listen to Rhythmbox's changing stream titles. fixes #3013
This commit is contained in:
		
							parent
							
								
									9a851c3b0d
								
							
						
					
					
						commit
						a0d6f20f24
					
				
					 1 changed files with 7 additions and 2 deletions
				
			
		| 
						 | 
					@ -61,6 +61,8 @@ class MusicTrackListener(gobject.GObject):
 | 
				
			||||||
			'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._player_playing_changed_cb,
 | 
				
			||||||
			'playingChanged', 'org.gnome.Rhythmbox.Player')
 | 
								'playingChanged', 'org.gnome.Rhythmbox.Player')
 | 
				
			||||||
 | 
							bus.add_signal_receiver(self._player_playing_song_property_changed_cb,
 | 
				
			||||||
 | 
								'playingSongPropertyChanged', 'org.gnome.Rhythmbox.Player')
 | 
				
			||||||
			
 | 
								
 | 
				
			||||||
		## Banshee
 | 
							## Banshee
 | 
				
			||||||
		banshee_bus = dbus.SessionBus()
 | 
							banshee_bus = dbus.SessionBus()
 | 
				
			||||||
| 
						 | 
					@ -86,7 +88,6 @@ class MusicTrackListener(gobject.GObject):
 | 
				
			||||||
			self.banshee_is_here = False
 | 
								self.banshee_is_here = False
 | 
				
			||||||
		return True
 | 
							return True
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		
 | 
					 | 
				
			||||||
	def _get_banshee_bus(self):
 | 
						def _get_banshee_bus(self):
 | 
				
			||||||
		bus = dbus.SessionBus()
 | 
							bus = dbus.SessionBus()
 | 
				
			||||||
		banshee = bus.get_object('org.gnome.Banshee', '/org/gnome/Banshee/Player')
 | 
							banshee = bus.get_object('org.gnome.Banshee', '/org/gnome/Banshee/Player')
 | 
				
			||||||
| 
						 | 
					@ -106,6 +107,10 @@ class MusicTrackListener(gobject.GObject):
 | 
				
			||||||
		else:
 | 
							else:
 | 
				
			||||||
			self.emit('music-track-changed', None)
 | 
								self.emit('music-track-changed', None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						def _player_playing_song_property_changed_cb(self, a, b, c, d):
 | 
				
			||||||
 | 
							if b == 'rb:stream-song-title':
 | 
				
			||||||
 | 
								self.emit('music-track-changed', self._last_playing_music)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	def _muine_properties_extract(self, song_string):
 | 
						def _muine_properties_extract(self, song_string):
 | 
				
			||||||
		d = dict((x.strip() for x in  s1.split(':', 1)) for s1 in \
 | 
							d = dict((x.strip() for x in  s1.split(':', 1)) for s1 in \
 | 
				
			||||||
			song_string.split('\n'))
 | 
								song_string.split('\n'))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue