From 05aa6f4ff4ae4b366f0a1d9617c67d7243f7157d Mon Sep 17 00:00:00 2001 From: Kushal Das Date: Fri, 3 Oct 2008 14:37:47 +0530 Subject: Now we have a method called songchange, which we can use for next and previous buttons --- jukeboxactivity.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/jukeboxactivity.py b/jukeboxactivity.py index 1127bc5..565aa2e 100755 --- a/jukeboxactivity.py +++ b/jukeboxactivity.py @@ -113,12 +113,12 @@ class JukeboxActivity(activity.Activity): except: pass - def _player_eos_cb(self, widget): + def songchange(self,direction): if self.playflag: self.playflag = False return self.player.seek(0L) - if self.currentplaying < len(self.playlist) - 1: + if direction == "next" and self.currentplaying < len(self.playlist) - 1: self.currentplaying += 1 self.player.stop() self.player = GstPlayer(self.videowidget) @@ -135,6 +135,10 @@ class JukeboxActivity(activity.Activity): self.player.stop() self.player.set_uri(None) + + def _player_eos_cb(self, widget): + self.songchange('next') + def _player_error_cb(self, widget, message, detail): self.player.stop() self.player.set_uri(None) -- cgit