fix rhythmbox track change. no need to liste to playingUriChanged event
This commit is contained in:
parent
aa41133f63
commit
228f7597c0
|
@ -68,11 +68,9 @@ class MusicTrackListener(gobject.GObject):
|
||||||
'org.gnome.Muine.Player')
|
'org.gnome.Muine.Player')
|
||||||
|
|
||||||
## Rhythmbox
|
## 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,
|
bus.add_signal_receiver(self._player_name_owner_changed,
|
||||||
'NameOwnerChanged', 'org.freedesktop.DBus', arg0='org.gnome.Rhythmbox')
|
'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')
|
'playingChanged', 'org.gnome.Rhythmbox.Player')
|
||||||
bus.add_signal_receiver(self._player_playing_song_property_changed_cb,
|
bus.add_signal_receiver(self._player_playing_song_property_changed_cb,
|
||||||
'playingSongPropertyChanged', 'org.gnome.Rhythmbox.Player')
|
'playingSongPropertyChanged', 'org.gnome.Rhythmbox.Player')
|
||||||
|
@ -159,6 +157,13 @@ class MusicTrackListener(gobject.GObject):
|
||||||
info = self._muine_properties_extract(arg)
|
info = self._muine_properties_extract(arg)
|
||||||
self.emit('music-track-changed', info)
|
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):
|
def _rhythmbox_properties_extract(self, props):
|
||||||
info = MusicTrackInfo()
|
info = MusicTrackInfo()
|
||||||
info.title = props['title']
|
info.title = props['title']
|
||||||
|
@ -168,17 +173,6 @@ class MusicTrackListener(gobject.GObject):
|
||||||
info.track_number = int(props['track-number'])
|
info.track_number = int(props['track-number'])
|
||||||
return info
|
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):
|
def _banshee_check_track_status(self):
|
||||||
if self.dubus_methods.NameHasOwner('org.gnome.Banshee') and \
|
if self.dubus_methods.NameHasOwner('org.gnome.Banshee') and \
|
||||||
not hasattr(self, 'banshee_methods'):
|
not hasattr(self, 'banshee_methods'):
|
||||||
|
|
|
@ -3796,7 +3796,6 @@ class RosterWindow:
|
||||||
title = music_track_info.title
|
title = music_track_info.title
|
||||||
source = music_track_info.album
|
source = music_track_info.album
|
||||||
if account == '':
|
if account == '':
|
||||||
print "Multi accounts"
|
|
||||||
for account in accounts:
|
for account in accounts:
|
||||||
if not gajim.account_is_connected(account):
|
if not gajim.account_is_connected(account):
|
||||||
continue
|
continue
|
||||||
|
@ -3807,7 +3806,6 @@ class RosterWindow:
|
||||||
continue
|
continue
|
||||||
pep.user_send_tune(account, artist, title, source)
|
pep.user_send_tune(account, artist, title, source)
|
||||||
else:
|
else:
|
||||||
print "Single account"
|
|
||||||
pep.user_send_tune(account, artist, title, source)
|
pep.user_send_tune(account, artist, title, source)
|
||||||
return
|
return
|
||||||
# No PEP
|
# No PEP
|
||||||
|
|
Loading…
Reference in New Issue