Ejemplo n.º 1
0
    def plumb(self):
        if monitor_debug:
            print '-       Monitor: plumb - unplumbing first...'
        self.unplumb()
        if monitor_debug:
            print '-       Monitor: plumbing...'

        if self.is_fast():
            if monitor_debug:
                print '-       Monitor: plumbed fast'
            self.set_sink(self.__recv)
            self.__fast = True
        else:
            if monitor_debug:
                print '-       Monitor: not plumbed fast'
            self.__aux = piw.fastdata(const.fastdata_sender)
            piw.tsd_fastdata(self.__aux)
            self.__recv.set_upstream(self.__aux)
            self.__auxq = piw.tsd_dataqueue(16)
            self.__aux.send_slow(piw.pathnull(piw.tsd_time()), self.__auxq)
            self.set_change_handler(self.__auxq.sender_slow())
            data = self.get_data()
            if not data.is_null():
                if monitor_debug:
                    print 'target=', self.target_id, 'data="', self.get_data(
                    ), '" ready=', self.is_ready(), 'type=', type(data)
                self.__auxq.sender_slow()(data)
            self.__fast = False

        # called when a connection can successfully be made
        if self.__widget.send_channel is not None:
            if monitor_debug:
                print '-       Monitor: set_connected true', self.__widget.send_channel
            self.__osc.set_connected(self.__widget.send_channel, True)
        else:
            if monitor_debug:
                print '-       Monitor: **** not set_connected ****'
        # try sending change in status
        osc_path = self.__widget.get_property_string('target-name')
        if osc_path != '':
            if monitor_debug:
                print '-       Monitor: sent osc connected 1'
            self.__osc.send(osc_path + '/connected', 1)
Ejemplo n.º 2
0
 def __init__(self,size=2):
     piw.fastdata.__init__(self,const.fastdata_sender)
     piw.tsd_fastdata(self)
     self.__queue = piw.tsd_dataqueue(size)
     piw.fastdata.send_slow(self,piw.pathnull(piw.tsd_time()),self.__queue)