MCGClient: method next() added

This commit is contained in:
coderkun 2012-06-24 01:15:07 +02:00
commit 1fe9ce31a2
2 changed files with 18 additions and 17 deletions

17
mcg.py
View file

@ -97,6 +97,12 @@ class MCGClient:
self._add_action(self._playpause)
def next(self):
"""Plays the next album in the current order
"""
self._add_action(self._next)
def connect_signal(self, signal, callback):
"""Connects a callback function to a signal (event).
"""
@ -169,7 +175,7 @@ class MCGClient:
self._connected = True
self._callback(self.SIGNAL_CONNECT, self._connected, None)
self.update()
self._add_action(self._get_status)
self.get_status()
except IOError as e:
self._connected = False
self._callback(self.SIGNAL_CONNECT, self._connected, e)
@ -245,6 +251,15 @@ class MCGClient:
self._client.play()
def _next(self):
"""Action: Performs the real next command.
"""
song = self._client.currentsong()
if song:
current_album = MCGAlbum(song['artist'], song['album'], song['date'], os.path.dirname(song['file']))
# TODO _next()
def _idle(self, modules):
"""Reacts to idle events from MPD.
"""