]> kaliko git repositories - mpd-sima.git/blob - sima/plugins/mpd.py
Huge commit… Running last.fm track mode
[mpd-sima.git] / sima / plugins / mpd.py
1 # -*- coding: utf-8 -*-
2 """
3 """
4
5 # standard library import
6
7 # third parties components
8
9 # local import
10 from ..lib.plugin import Plugin
11
12
13 class MpdOptions(Plugin):
14     """
15     Deal with MPD options ‑ idle and repeat mode
16     """
17
18     def __init__(self, daemon):
19         Plugin.__init__(self, daemon)
20         self.daemon = daemon
21
22     def callback_player(self):
23         """
24         Called on player changes
25         """
26         player = self.daemon.player
27         if player.status().get('single') == str(1):
28             self.log.info('MPD "single" mode activated.')
29             self.daemon.enabled = False
30         elif player.status().get('repeat') == str(1):
31             self.log.info('MPD "repeat" mode activated.')
32             self.daemon.enabled = False
33         else:
34             self.daemon.enabled = True
35
36     def shutdown(self):
37         pass
38
39
40 # VIM MODLINE
41 # vim: ai ts=4 sw=4 sts=4 expandtab