[Rhythmbox-devel] New plugin help

I am attempting to create a plugin for rhythmbox that will save/load the search filter text as well as the last playing song. I have not written much in python but it seems simple enough. I was looking through the rhythmbox source and noticed that rb-source.c has a signal that is emitted when the filter entry box contents are changed. I believe that i just need to connect to this signal for starters. How would I go about doing so? Most of the examples I have found use shell and shell.get_player so I am unsure how to access the signals in rb.Source. Any suggestions or sources of documentation? Here is what I have so far:

import rhythmdb, rb
import gtk, gobject
from warnings import warn

class SaveFilterPlugin (rb.Plugin):
   def __init__ (self):
       rb.Plugin.__init__ (self)
def activate (self, shell):
       self.shell = shell
              self.string = "Hello World"
           print self.string
           sp = shell.get_player ()
self.pec_id = sp.connect ('playing-song-changed', self.playing_entry_changed)
               self.source = rb.Source
self.ent_id = self.source.connect ('filter_changed', self.filter_changed) def deactivate (self, shell):
       del self.shell
del self.string
   def playing_entry_changed (self, sp, entry):
       print "bob"
def filter_changed (self, source, entry):
           print "yo"


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