Update play code and next test

This commit is contained in:
Thomas Adamcik 2010-02-07 06:03:57 +01:00
parent 8b6a5184d8
commit e57709b0b4
2 changed files with 12 additions and 1 deletions

View File

@ -43,10 +43,19 @@ class GStreamerPlaybackController(BasePlaybackController):
self.bin = bin
def play(self, id=None, position=None):
if not self.current_track:
playlist = self.backend.current_playlist.playlist
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.bin.set_property("uri", self.current_track.uri)
self.bin.set_state(self.PLAYING)
self.state = self.PLAYING
return True
def next(self):
pass

View File

@ -62,6 +62,8 @@ class BasePlaybackControllerTest(object):
def test_next(self):
playback = self.backend.playback
playback.play()
old_position = playback.playlist_position
old_uri = playback.current_track.uri