Author: steve-e
Date: 2008-10-27 23:06:58 +0100 (Mon, 27 Oct 2008)
New Revision: 10579
Modified:
trunk/src/music_track_listener.py
trunk/src/roster_window.py
Log:
Update banshee current track when necessary. Defective by design but working. Fixes #2229
Modified: trunk/src/music_track_listener.py
===================================================================
--- trunk/src/music_track_listener.py 2008-10-25 19:48:01 UTC (rev 10578)
+++ trunk/src/music_track_listener.py 2008-10-27 22:06:58 UTC (rev 10579)
@@ -220,6 +220,23 @@
self._last_playing_music = 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
# here we test :)
Modified: trunk/src/roster_window.py
===================================================================
--- trunk/src/roster_window.py 2008-10-25 19:48:01 UTC (rev 10578)
+++ trunk/src/roster_window.py 2008-10-27 22:06:58 UTC (rev 10579)
@@ -1004,7 +1004,7 @@
gajim.connections[account].activity['activity'].strip(),
gajim.connections[account].activity['subactivity'].strip()). \
get_pixbuf()
- else:
+ else:
self.model[child_iter][C_ACTIVITY_PIXBUF] = \
gtkgui_helpers.load_activity_icon(
gajim.connections[account].activity['activity'].strip()). \
@@ -3285,12 +3285,12 @@
act = widget.get_active()
gajim.config.set_per('accounts', account, 'publish_tune', act)
if act:
+ listener = MusicTrackListener.get()
if not self.music_track_changed_signal:
- listener = MusicTrackListener.get()
self.music_track_changed_signal = listener.connect(
'music-track-changed', self.music_track_changed)
- track = listener.get_playing_track()
- self.music_track_changed(listener, track)
+ track = listener.get_playing_track()
+ self.music_track_changed(listener, track)
else:
# disable it only if no other account use it
for acct in gajim.connections: