Update banshee current track when necessary. Defective by design but working. Fixes #2229

This commit is contained in:
Stephan Erb 2008-10-27 22:06:58 +00:00
parent bd7bac578f
commit 24f8305b81
2 changed files with 21 additions and 4 deletions

View File

@ -220,6 +220,23 @@ class MusicTrackListener(gobject.GObject):
self._last_playing_music = info self._last_playing_music = info
return info return info
## Check Banshee playing track
test = False
if hasattr(bus, 'name_has_owner'):
if bus.name_has_owner('org.bansheeproject.Banshee'):
test = True
elif dbus.dbus_bindings.bus_name_has_owner(bus.get_connection(),
'org.bansheeproject.Banshee'):
test = True
if test:
banshee = bus.get_object('org.bansheeproject.Banshee',
'/org/bansheeproject/Banshee/PlayerEngine')
currentTrack = banshee.GetCurrentTrack()
if currentTrack:
song = self._banshee_properties_extract(currentTrack)
self._last_playing_music = song
return song
return None return None
# here we test :) # here we test :)

View File

@ -3285,8 +3285,8 @@ class RosterWindow:
act = widget.get_active() act = widget.get_active()
gajim.config.set_per('accounts', account, 'publish_tune', act) gajim.config.set_per('accounts', account, 'publish_tune', act)
if act: if act:
if not self.music_track_changed_signal:
listener = MusicTrackListener.get() listener = MusicTrackListener.get()
if not self.music_track_changed_signal:
self.music_track_changed_signal = listener.connect( self.music_track_changed_signal = listener.connect(
'music-track-changed', self.music_track_changed) 'music-track-changed', self.music_track_changed)
track = listener.get_playing_track() track = listener.get_playing_track()