X-Git-Url: http://git.kaliko.me/?a=blobdiff_plain;f=sima%2Fclient.py;h=9d6100535f93e880d1792ce4aa6c74847ecdfd69;hb=c1bda032095902bdcd183c530a9c4de28f3c828a;hp=641fa22166f106ff2adfa32611223e783b091c71;hpb=5fe20b6caffe162afe5be18e77fe40004d00c95e;p=mpd-sima.git diff --git a/sima/client.py b/sima/client.py index 641fa22..9d61005 100644 --- a/sima/client.py +++ b/sima/client.py @@ -130,6 +130,11 @@ class PlayerClient(Player): def remove(self, position=0): self._client.delete(position) + def add(self, track): + """Overriding MPD's add method to accept add signature with a Track + object""" + self._client.add(track.file) + @property def state(self): return str(self._client.status().get('state')) @@ -138,6 +143,12 @@ class PlayerClient(Player): def current(self): return self.currentsong() + @property + def queue(self): + plst = self.playlist + plst.reverse() + return [ trk for trk in plst if int(trk.pos) > int(self.current.pos)] + @property def playlist(self): """ @@ -178,7 +189,7 @@ class PlayerClient(Player): raise PlayerError("Could not connect to '%s': " "error with password command: %s" % (self._host, err)) - # Controls we have sufficient rights for MPD_sima + # Controls we have sufficient rights needed_cmds = ['status', 'stats', 'add', 'find', \ 'search', 'currentsong', 'ping']