[gnome-music/wip/jfelder/mpris-cleanup: 107/117] mpris: Do not expose a TrackListReplaced method
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/mpris-cleanup: 107/117] mpris: Do not expose a TrackListReplaced method
- Date: Wed, 29 May 2019 12:55:24 +0000 (UTC)
commit 834ca09c940630b4f0a40a56772bac9367451ef4
Author: Jean Felder <jfelder src gnome org>
Date: Thu Apr 4 15:47:07 2019 +0200
mpris: Do not expose a TrackListReplaced method
TrackListReplaced is used to send a signal from MediaPlayer2.TrackList
interface when the playlist (tracklist in MPRIS terminology) is
changed. It is only used by the _update_songs_list method. So it does
not need to be in its own function.
gnomemusic/mpris.py | 17 +++++++----------
1 file changed, 7 insertions(+), 10 deletions(-)
---
diff --git a/gnomemusic/mpris.py b/gnomemusic/mpris.py
index 210f8b14..03e8eb85 100644
--- a/gnomemusic/mpris.py
+++ b/gnomemusic/mpris.py
@@ -384,8 +384,13 @@ class MPRIS(DBusInterface):
if (not previous_path_list
or previous_path_list[0] != self._path_list[0]
or previous_path_list[-1] != self._path_list[-1]):
- current_song_path = self._get_song_dbus_path()
- self.TrackListReplaced(self._path_list, current_song_path)
+ self.con.emit_signal(
+ None, '/org/mpris/MediaPlayer2',
+ MPRIS.MEDIA_PLAYER2_TRACKLIST_IFACE, 'TrackListReplaced',
+ GLib.Variant.new_tuple(
+ GLib.Variant('ao', self._path_list),
+ GLib.Variant('o', self._get_song_dbus_path())))
+
self.PropertiesChanged(
MPRIS.MEDIA_PLAYER2_TRACKLIST_IFACE,
{'Tracks': GLib.Variant('ao', self._path_list), }, [])
@@ -668,14 +673,6 @@ class MPRIS(DBusInterface):
song_offset = goto_index - current_song_index
self.player.play(song_offset=song_offset)
- def TrackListReplaced(self, tracks, current_song):
- self.con.emit_signal(None,
- '/org/mpris/MediaPlayer2',
- MPRIS.MEDIA_PLAYER2_TRACKLIST_IFACE,
- 'TrackListReplaced',
- GLib.Variant.new_tuple(GLib.Variant('ao', tracks),
- GLib.Variant('o', current_song)))
-
def ActivatePlaylist(self, playlist_path):
playlist_id = self._get_playlist_from_dbus_path(playlist_path).get_id()
self._playlists.activate_playlist(playlist_id)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]