[gnome-music/wip/jfelder/mpris-cleanup: 27/41] mpris: Do not expose a Seeked method



commit 46a945b6afed8c4d6c34b63963275f4f56fc7511
Author: Jean Felder <jfelder src gnome org>
Date:   Fri Apr 5 23:37:12 2019 +0200

    mpris: Do not expose a Seeked method
    
    Seeked is used to send a signal from MediaPlayer2.Player interface
    when the song position has changed. It is only used by the
    _on_seek_finished method. So it does not need to be in its own
    function.

 gnomemusic/mpris.py | 16 +++++-----------
 1 file changed, 5 insertions(+), 11 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 98093682..74a9d601 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -505,7 +505,11 @@ class MPRIS(DBusInterface):
 
     @log
     def _on_seek_finished(self, player, position_second):
-        self.Seeked(int(position_second * 1e6))
+        position_msecond = int(position_second * 1e6)
+        variant = GLib.Variant.new_tuple(GLib.Variant('x', position_msecond))
+        self.con.emit_signal(
+            None, '/org/mpris/MediaPlayer2',
+            MPRIS.MEDIA_PLAYER2_PLAYER_IFACE, 'Seeked', variant)
 
     @log
     def _on_player_playlist_changed(self, klass):
@@ -609,16 +613,6 @@ class MPRIS(DBusInterface):
     def OpenUri(self, uri):
         pass
 
-    def Seeked(self, position_msecond):
-        """Indicate that the track position has changed.
-
-        :param int position_msecond: new position in microseconds.
-        """
-        variant = GLib.Variant.new_tuple(GLib.Variant('x', position_msecond))
-        self.con.emit_signal(
-            None, '/org/mpris/MediaPlayer2',
-            MPRIS.MEDIA_PLAYER2_PLAYER_IFACE, 'Seeked', variant)
-
     def GetTracksMetadata(self, track_paths):
         metadata = []
         for path in track_paths:


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