Fix next method so that test passes

This commit is contained in:
Thomas Adamcik 2010-02-07 19:25:08 +01:00
parent b510d8fdae
commit a724d8f0ff
2 changed files with 8 additions and 4 deletions

View File

@ -31,7 +31,7 @@ class BasePlaybackController(object):
def __init__(self, backend):
self.backend = backend
self.current_track = None
self.playlist_position = None
self.playlist_position = 0
def play(self, id=None, position=None):
raise NotImplementedError

View File

@ -60,8 +60,7 @@ class GStreamerPlaybackController(BasePlaybackController):
if not self.current_track and not playlist.tracks:
return False
elif playlist.tracks:
self.current_track = playlist.tracks[0]
self.playlist_position = 0
self.current_track = playlist.tracks[self.playlist_position]
self.bin.set_property("uri", self.current_track.uri)
self.bin.set_state(gst.STATE_PLAYING)
@ -69,4 +68,9 @@ class GStreamerPlaybackController(BasePlaybackController):
return True
def next(self):
pass
playlist = self.backend.current_playlist.playlist
self.playlist_position += 1
self.current_track = playlist.tracks[self.playlist_position]
self.play()