[gnome-music/wip/merge: 198/343] player: switch to next song at the end of the track



commit b97c6a6e913a2e3d5fd397f200c26698d9fd11f7
Author: Vadim Rutkovsky <vrutkovs redhat com>
Date:   Tue Jul 16 19:10:45 2013 +0200

    player: switch to next song at the end of the track

 gnomemusic/player.py |   33 +++++++++++++++++----------------
 1 files changed, 17 insertions(+), 16 deletions(-)
---
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 9fd9c2c..43c0992 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -93,22 +93,6 @@ class Player(GObject.GObject):
         self.bus.connect("message::error", self._onBusError)
         self.bus.connect("message::eos", self._onBusEos)
         self._setupView()
-        if self.nextTrack:
-            GLib.idle_add(self._onGLibIdle)
-        elif (self.repeat == RepeatType.NONE):
-            self.stop()
-            self.playBtn.set_image(self._playImage)
-            self.progressScale.set_value(0)
-            self.progressScale.set_sensitive(False)
-            if self.playlist is not None:
-                self.currentTrack = self.playlist.get_iter_first()[1]
-                self.load(self.playlist.get_value(self.currentTrack, self.playlistField))
-        else:
-            #Stop playback
-            self.stop()
-            self.playBtn.set_image(self._playImage)
-            self.progressScale.set_value(0)
-            self.progressScale.set_sensitive(False)
 
     def _onSettingsChanged(self, settings, value):
         self.repeat = settings.get_enum('repeat')
@@ -137,6 +121,23 @@ class Player(GObject.GObject):
     def _onBusEos(self, bus, message):
         self.nextTrack = self._getNextTrack()
 
+        if self.nextTrack:
+            GLib.idle_add(self._onGLibIdle)
+        elif (self.repeat == RepeatType.NONE):
+            self.stop()
+            self.playBtn.set_image(self._playImage)
+            self.progressScale.set_value(0)
+            self.progressScale.set_sensitive(False)
+            if self.playlist is not None:
+                self.currentTrack = self.playlist.get_iter_first()[1]
+                self.load(self.playlist.get_value(self.currentTrack, self.playlistField))
+        else:
+            #Stop playback
+            self.stop()
+            self.playBtn.set_image(self._playImage)
+            self.progressScale.set_value(0)
+            self.progressScale.set_sensitive(False)
+
     def _onGLibIdle(self):
         self.currentTrack = self.nextTrack
         self.play()


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]