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




EmbeddedMicro wrote:
> 
> shell.get_player().props.player.add_tee_element(b)
> AttributeError: '__main__.RBPlayerGst' object has no attribute
> 'add_tee_element'
> 
> Is the guide wrong? How do I add the elements?
> 

It looks like it should be 
shell.get_player().props.player.add_tee(b)

So here it is again.

import rhythmdb, rb
> import gobject, gtk
> import serial
> import gst
> 
> class SamplePython(rb.Plugin):
> 
> 	def __init__(self):
> 		rb.Plugin.__init__(self)
> 			
> 	def activate(self, shell):
> 		print "activating sample 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_tee(self.b)
> 		self.ser = serial.Serial('/dev/ttyS0', 115200, timeout=1)
> 		self.ser.write("hello")
> 		
> 	def deactivate(self, shell):
> 		print "deactivating sample python plugin"
> 		shell.get_player().props.player.remove_tee(self.b)
> 		self.ser.close()

To get it from complaining about b and ser not being defined in deactivate I
added self.*. Is there a more correct way to do that?

Also what exactly does adding the elements do? How do I get the information
from them. Keep in mind this is my first time using Python.
-- 
View this message in context: http://www.nabble.com/Python-Plugin-LED-Cube-Visualizations-tp23117783p23129334.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]