mcg: Method _play() added

This commit is contained in:
coderkun 2012-06-22 15:45:16 +02:00
parent cd711efa4a
commit c87b3def1c

51
mcg.py
View file

@ -86,10 +86,8 @@ class MCGClient:
def play(self, album): def play(self, album):
"""Plays the given album. """Plays the given album.
""" """
# TODO play() # TODO Pass parameters
# mpd-Befehle: add, play self._add_action(self._play)
# https://github.com/Mic92/python-mpd2/blob/master/mpd.py
print("play: ", self._albums[album].get_title())
def connect_signal(self, signal, callback): def connect_signal(self, signal, callback):
@ -150,25 +148,6 @@ class MCGClient:
self._idle(modules) self._idle(modules)
def _idle(self, modules):
"""Reacts to idle events from MPD.
"""
if not modules:
return
if 'player' in modules:
self._idle_player()
if 'database' in modules:
# TODO update DB
pass
if 'update' in modules:
# TODO update
pass
if 'mixer' in modules:
# TODO mixer
pass
def _connect(self): def _connect(self):
"""Action: Performs the real connect to MPD. """Action: Performs the real connect to MPD.
""" """
@ -219,6 +198,32 @@ class MCGClient:
self._callback(self.SIGNAL_UPDATE, self._albums) self._callback(self.SIGNAL_UPDATE, self._albums)
def _play(self):
"""Action: Performs the real play command.
"""
# TODO _play()
pass
def _idle(self, modules):
"""Reacts to idle events from MPD.
"""
if not modules:
return
if 'player' in modules:
self._idle_player()
if 'database' in modules:
# TODO update DB
pass
if 'update' in modules:
# TODO update
pass
if 'mixer' in modules:
# TODO mixer
pass
def _idle_player(self): def _idle_player(self):
"""Reacts on the player idle event. """Reacts on the player idle event.
""" """