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



I'm having a hard time with this. I believe I have the level and spectrum
elements set up correctly, but I can't figure out how to use them. For
example say I have this.

import rhythmdb, rb
> import gobject, gtk
> 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"
> 		level = gst.element_factory_make ("level")
> 		spectrum = gst.element_factory_make ("spectrum")
> 		self.b = gst.Bin()
> 		self.b.add (level, spectrum)
> 		shell.get_player().props.player.add_filter(self.b)
> 		print level
> 		self.ser = serial.Serial('/dev/ttyS0', 115200, timeout=1)
> 		self.ser.write("hello")
> 		
> 	def deactivate(self, shell):
> 		print "deactivating LED cube python plugin"
> 		shell.get_player().props.player.remove_filter(self.b)
> 		self.ser.close()
I want the line "print level" to print the current level of audio. How do I
get that information?

Also how do I make my code be called every x ms to update the cube?

Thanks a lot,
Justin
-- 
View this message in context: http://www.nabble.com/Python-Plugin-LED-Cube-Visualizations-tp23117783p23177467.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]