summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKushal Das <kushal@fedoraproject.org>2008-10-03 02:20:08 +0530
committerKushal Das <kushal@fedoraproject.org>2008-10-03 02:20:08 +0530
commit7d0f9b5db12528e06980bd92d05c763987d0e622 (patch)
tree67e6c1f8649294b137e9654d564f9f7ade06462e
parent19f37084653d08d8c471f974db9818bd4cbb81a7 (diff)
downloadjukebox-activity.git-7d0f9b5db12528e06980bd92d05c763987d0e622.zip
jukebox-activity.git-7d0f9b5db12528e06980bd92d05c763987d0e622.tar.gz
jukebox-activity.git-7d0f9b5db12528e06980bd92d05c763987d0e622.tar.xz
currently it is playing songs one by one from the playlist
-rwxr-xr-xjukeboxactivity.py23
1 files changed, 22 insertions, 1 deletions
diff --git a/jukeboxactivity.py b/jukeboxactivity.py
index e6ddb30..1127bc5 100755
--- a/jukeboxactivity.py
+++ b/jukeboxactivity.py
@@ -82,6 +82,8 @@ class JukeboxActivity(activity.Activity):
self.uri = None
self.playlist = []
self.playpath = None
+ self.currentplaying = None
+ self.playflag = False
self.tags = {}
self.only_audio = False
self.got_stream_info = False
@@ -112,8 +114,26 @@ class JukeboxActivity(activity.Activity):
pass
def _player_eos_cb(self, widget):
+ if self.playflag:
+ self.playflag = False
+ return
self.player.seek(0L)
- self.play_toggled()
+ if self.currentplaying < len(self.playlist) - 1:
+ self.currentplaying += 1
+ self.player.stop()
+ self.player = GstPlayer(self.videowidget)
+ self.player.connect("error", self._player_error_cb)
+ self.player.connect("tag", self._player_new_tag_cb)
+ self.player.connect("stream-info", self._player_stream_info_cb)
+ self.player.set_uri(self.playlist[self.currentplaying])
+ logging.info("NExt: " + self.playlist[self.currentplaying])
+ self.playflag = True
+ self.play_toggled()
+ self.player.connect("eos", self._player_eos_cb)
+ else:
+ self.play_toggled()
+ self.player.stop()
+ self.player.set_uri(None)
def _player_error_cb(self, widget, message, detail):
self.player.stop()
@@ -202,6 +222,7 @@ class JukeboxActivity(activity.Activity):
try:
logging.info("Playing: " + self.playlist[0])
self.player.set_uri(self.playlist[0])
+ self.currentplaying = 0
except:
pass
self.play_toggled()