summaryrefslogtreecommitdiffstats
path: root/jukeboxactivity.py
diff options
context:
space:
mode:
authorKushal Das <kushal@fedoraproject.org>2008-10-03 14:57:33 +0530
committerKushal Das <kushal@fedoraproject.org>2008-10-03 14:57:33 +0530
commit6d3428ca9e901b0fa633f219ff2da3ca804fbff6 (patch)
treec2d799ccee23a28fcd2c6763d1c8d2d67d05c69e /jukeboxactivity.py
parent05aa6f4ff4ae4b366f0a1d9617c67d7243f7157d (diff)
downloadjukebox-activity.git-6d3428ca9e901b0fa633f219ff2da3ca804fbff6.tar.gz
jukebox-activity.git-6d3428ca9e901b0fa633f219ff2da3ca804fbff6.tar.xz
jukebox-activity.git-6d3428ca9e901b0fa633f219ff2da3ca804fbff6.zip
Now next and previous buttons are working , only problem is to set default play/pause button
Diffstat (limited to 'jukeboxactivity.py')
-rwxr-xr-xjukeboxactivity.py22
1 files changed, 17 insertions, 5 deletions
diff --git a/jukeboxactivity.py b/jukeboxactivity.py
index 565aa2e..fbb4e60 100755
--- a/jukeboxactivity.py
+++ b/jukeboxactivity.py
@@ -114,11 +114,23 @@ class JukeboxActivity(activity.Activity):
pass
def songchange(self,direction):
- if self.playflag:
- self.playflag = False
- return
+ #if self.playflag:
+ # self.playflag = False
+ # return
self.player.seek(0L)
- if direction == "next" and self.currentplaying < len(self.playlist) - 1:
+ if direction == "prev" and self.currentplaying > 0:
+ 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("prev: " + self.playlist[self.currentplaying])
+ #self.playflag = True
+ self.play_toggled()
+ self.player.connect("eos", self._player_eos_cb)
+ elif direction == "next" and self.currentplaying < len(self.playlist) - 1:
self.currentplaying += 1
self.player.stop()
self.player = GstPlayer(self.videowidget)
@@ -127,7 +139,7 @@ class JukeboxActivity(activity.Activity):
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.playflag = True
self.play_toggled()
self.player.connect("eos", self._player_eos_cb)
else: