[gnome-music/wip/jfelder/player-seeked-finished-signal: 1/2] player: Do not send the position with seek-finished signal
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/player-seeked-finished-signal: 1/2] player: Do not send the position with seek-finished signal
- Date: Fri, 7 Jun 2019 09:49:14 +0000 (UTC)
commit 4804e73f08a2e526c5c416e48f2909df2c2f941a
Author: Jean Felder <jfelder src gnome org>
Date: Thu Jun 6 11:59:26 2019 +0200
player: Do not send the position with seek-finished signal
It's not necessary to send the position because it can be retrieved
from the get_position method.
gnomemusic/mpris.py | 3 ++-
gnomemusic/player.py | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 5999e5d1..af60ce57 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -515,7 +515,8 @@ class MediaPlayer2Service(Server):
MediaPlayer2Service.MEDIA_PLAYER2_PLAYER_IFACE, properties, [])
@log
- def _on_seek_finished(self, player, position_second):
+ def _on_seek_finished(self, player):
+ position_second = self.player.get_position()
self.Seeked(int(position_second * 1e6))
@log
diff --git a/gnomemusic/player.py b/gnomemusic/player.py
index 25ce9b66..f23ed5e1 100644
--- a/gnomemusic/player.py
+++ b/gnomemusic/player.py
@@ -543,7 +543,7 @@ class Player(GObject.GObject):
__gsignals__ = {
'playlist-changed': (GObject.SignalFlags.RUN_FIRST, None, ()),
- 'seek-finished': (GObject.SignalFlags.RUN_FIRST, None, (float,)),
+ 'seek-finished': (GObject.SignalFlags.RUN_FIRST, None, ()),
'song-changed': (GObject.SignalFlags.RUN_FIRST, None, ()),
'song-validated': (GObject.SignalFlags.RUN_FIRST, None, (int, int)),
}
@@ -878,7 +878,7 @@ class Player(GObject.GObject):
duration_second = self._gst_player.props.duration
if position_second <= duration_second:
self._gst_player.seek(position_second)
- self.emit('seek-finished', position_second)
+ self.emit('seek-finished')
@log
def get_mpris_playlist(self):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]