示例#1
0
 def _dispatcher(self, mtype, *pargs):
     
     ## let's not repeart ourselves...
     if mtype=="__tick__":
         return
     
     try:
         handled=Bus.publish(self.NAME, mtype, *pargs)
         return (handled, False)
     except Exception,e:
         print "BridgeAgent._dispatcher: pargs: %s ---- exception: %s" % (str(pargs), e)
         return (False, False)
示例#2
0
 def activate (self, shell):
     """
     Called by Rhythmbox when the plugin is activated
     """
     print ">> Squeezebox activated"
     self.active=True
     self.shell = shell
     self.sp = shell.get_player()
     self.db=self.shell.props.db
     
     ##
     self.spcb = (
                  self.sp.connect("playing-changed",        self.on_playing_changed),
                  self.sp.connect("playing-song-changed",   self.on_playing_song_changed),
                  self.sp.connect("elapsed-changed",         self.on_elapsed_changed),
                  )
     
     ## Distribute the vital RB objects around
     Bus.publish("__pluging__", "rb_shell", self.shell, self.db, self.sp)
     
     #self._reconnect()
     self.init_toolbar()