diff --git a/src/music_track_listener.py b/src/music_track_listener.py index 23805fd0e..181cdc3d2 100644 --- a/src/music_track_listener.py +++ b/src/music_track_listener.py @@ -68,11 +68,9 @@ class MusicTrackListener(gobject.GObject): 'org.gnome.Muine.Player') ## Rhythmbox - bus.add_signal_receiver(self._rhythmbox_music_track_change_cb, - 'playingUriChanged', 'org.gnome.Rhythmbox.Player') bus.add_signal_receiver(self._player_name_owner_changed, 'NameOwnerChanged', 'org.freedesktop.DBus', arg0='org.gnome.Rhythmbox') - bus.add_signal_receiver(self._player_playing_changed_cb, + bus.add_signal_receiver(self._rhythmbox_playing_changed_cb, 'playingChanged', 'org.gnome.Rhythmbox.Player') bus.add_signal_receiver(self._player_playing_song_property_changed_cb, 'playingSongPropertyChanged', 'org.gnome.Rhythmbox.Player') @@ -159,6 +157,13 @@ class MusicTrackListener(gobject.GObject): info = self._muine_properties_extract(arg) self.emit('music-track-changed', info) + def _rhythmbox_playing_changed_cb(self, playing): + if playing: + info = self.get_playing_track() + self.emit('music-track-changed', info) + else: + self.emit('music-track-changed', None) + def _rhythmbox_properties_extract(self, props): info = MusicTrackInfo() info.title = props['title'] @@ -167,17 +172,6 @@ class MusicTrackListener(gobject.GObject): info.duration = int(props['duration']) info.track_number = int(props['track-number']) return info - - def _rhythmbox_music_track_change_cb(self, uri): - if not uri: - return - bus = dbus.SessionBus() - rbshellobj = bus.get_object('org.gnome.Rhythmbox', - '/org/gnome/Rhythmbox/Shell') - rbshell = dbus.Interface(rbshellobj, 'org.gnome.Rhythmbox.Shell') - props = rbshell.getSongProperties(uri) - info = self._rhythmbox_properties_extract(props) - self.emit('music-track-changed', info) def _banshee_check_track_status(self): if self.dubus_methods.NameHasOwner('org.gnome.Banshee') and \ diff --git a/src/roster_window.py b/src/roster_window.py index f0cd4dfc7..5118b312e 100644 --- a/src/roster_window.py +++ b/src/roster_window.py @@ -3796,7 +3796,6 @@ class RosterWindow: title = music_track_info.title source = music_track_info.album if account == '': - print "Multi accounts" for account in accounts: if not gajim.account_is_connected(account): continue @@ -3807,7 +3806,6 @@ class RosterWindow: continue pep.user_send_tune(account, artist, title, source) else: - print "Single account" pep.user_send_tune(account, artist, title, source) return # No PEP