Re: [Rhythmbox-devel] Python Plugin-LED Cube Visualizations



I under stand this a bit more. I read up on the spectrum element, but I can't
figure out how to get the messages it sends out. This is what I have now, it
does not work. 

import rhythmdb, rb
> import serial
> import gst
> 
> class LEDcube(rb.Plugin):
> 
> 	def __init__(self):
> 		rb.Plugin.__init__(self)
> 			
> 	def activate(self, shell):
> 		print "activating LED cube python plugin"
> 		self.b = gst.element_factory_make ("spectrum")
> 		shell.get_player().props.player.add_tee(self.b)
> 		self.ser = serial.Serial('/dev/ttyS0', 115200, timeout=1)
> 		self.ser.write("hello")
> 
> 		bus = gst.element_get_bus(self.b)
> 		bus.add_signal_watch()
> 		bus.connect("message", self.on_message)
> 		
> 	def deactivate(self, shell):
> 		print "deactivating LED cube python plugin"
> 		shell.get_player().props.player.remove_tee(self.b)
> 		self.ser.close()
> 
> 	def on_message(self, bus, message):
> 		print "Spectrum!"

Is the bus stuff even remotely correct? 

Thanks,
Justin
-- 
View this message in context: http://www.nabble.com/Python-Plugin-LED-Cube-Visualizations-tp23117783p23247634.html
Sent from the Gnome - Rhythmbox - Dev mailing list archive at Nabble.com.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]