[gnome-music/wip/jfelder/fix-gstplayer-loading-state] gstplayer: Fix loading state partial handling



commit 9a0ea3c61701f35268ce8a2e226f8a5f7cd35c76
Author: Jean Felder <jfelder src gnome org>
Date:   Thu Oct 11 22:24:35 2018 +0200

    gstplayer: Fix loading state partial handling
    
    Commit a7c0180c introduced a LOADING state when a new song is
    loaded. However, the change was only defined in state setter and not
    the getter.
    
    Add LOADING state support to _get_playback_status method.
    Resset SmoothScale value to zero when a new song is loaded.

 gnomemusic/gstplayer.py           | 2 ++
 gnomemusic/widgets/smoothscale.py | 3 ++-
 2 files changed, 4 insertions(+), 1 deletion(-)
---
diff --git a/gnomemusic/gstplayer.py b/gnomemusic/gstplayer.py
index 13dcb920..ec67891c 100644
--- a/gnomemusic/gstplayer.py
+++ b/gnomemusic/gstplayer.py
@@ -203,6 +203,8 @@ class GstPlayer(GObject.GObject):
             return Playback.PLAYING
         elif state == Gst.State.PAUSED:
             return Playback.PAUSED
+        elif state == Gst.State.READY:
+            return Playback.LOADING
 
         return Playback.STOPPED
 
diff --git a/gnomemusic/widgets/smoothscale.py b/gnomemusic/widgets/smoothscale.py
index b9d6cb30..e995540b 100644
--- a/gnomemusic/widgets/smoothscale.py
+++ b/gnomemusic/widgets/smoothscale.py
@@ -100,7 +100,8 @@ class SmoothScale(Gtk.Scale):
 
         self._previous_state = state
 
-        if state == Playback.STOPPED:
+        if (state == Playback.STOPPED
+                or state == Playback.LOADING):
             self.set_value(0)
             self.set_sensitive(False)
         else:


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