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



commit 4f416f5f08d10d5496bacb30a2710ec7d6834261
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 7a679ba8..eb32c085 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -533,7 +533,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):
@@ -636,16 +640,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]