Fix next method so that test passes
This commit is contained in:
parent
b510d8fdae
commit
a724d8f0ff
@ -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
|
||||
|
||||
@ -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()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user