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

Thanks a lot for the tip! I have been looking for a while without
finding much about this.

So now I have 
import rhythmdb, rb
import gobject, gtk
import serial
import gst

class SamplePython(rb.Plugin):

        def __init__(self):
        def activate(self, shell):
                print "activating sample python plugin"
                level = gst.element_factory_make ("level")
                spectrum = gst.element_factory_make ("spectrum")
                b = gst.Bin()
                b.add (level, spectrum)
                self.ser = serial.Serial('/dev/ttyS0', 115200, timeout=1)
        def deactivate(self, shell):
                print "deactivating sample python plugin"

I got most of that from

There is a problem though. When I try to run it I get 

AttributeError: '__main__.RBPlayerGst' object has no attribute

Is the guide wrong? How do I add the elements?

Also what's a GStreamer sink plugin? 

Thanks a lot,
Justin Rajewski

Jonathan Matthew-4 wrote:
> On Sat, Apr 18, 2009 at 03:06:25PM -0700, EmbeddedMicro wrote:
>> I build and sell RGB LED cubes. The newest version has a serial interface
>> that I would like to utilise using Rhythmbox. I know C, but I am using
>> Python (for the first time) as it is easier.
>> So far I have the plugin set up so it sends "Hello" over the serial port
>> when it is started and that works fine. What I need to do now is make it
>> get
>> information on the sound being played, ie intensity, frequency, etc. Does
>> anyone know how to do that with Python?
> Rhythmbox plugins have the ability to insert elements into the GStreamer
> playback pipeline.  You can probably get enough information using the
> standard GStreamer 'level' and 'spectrum' elements.  Your plugin would
> then handle messages emitted by these elements and use the information
> from those to update the device.  I don't think we have any examples of
> plugins that do this currently.
> Alternatively, I think you could write a GStreamer sink plugin that took
> care of the whole process, which would make it easier to use this in
> other applications.
> _______________________________________________
> rhythmbox-devel mailing list
> rhythmbox-devel gnome org

View this message in context:
Sent from the Gnome - Rhythmbox - Dev mailing list archive at

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