示例#1
0
    def __init__(self):
        
        self.iq=Queue()  #normal queue
        self.ipq=Queue() #high priority queue

        mswitch.subscribe(self.NAME, self.iq, self.ipq)        
        Bus.subscribe(self.NAME, "*", self.h_msg)
示例#2
0
 def __init__ (self):
     self.spcb=None
     self.activated=False
     self.volume=0
     self.playing=False
     self.current_pos=0
     self.this_dir=os.path.dirname(__file__)
     
     self.last_seek=None
     
     ## the last captured SB state
     self.last_sb_state=None
     
     self.scc=SqueezeCenterControl()
     self.skip_time_adjust=False
     
     Bus.subscribe(self, "__tick__", self.h_tick)
示例#3
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)
示例#4
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()