예제 #1
0
    def __init__(self, main_object):
        Server.__init__(self)
        self.add_method('/ray/patchbay/add_gui', 's',
                        self._ray_patchbay_add_gui)
        self.add_method('/ray/patchbay/gui_disannounce', '',
                        self._ray_patchbay_gui_disannounce)
        self.add_method('ray/patchbay/port/set_alias', 'sis',
                        self._ray_patchbay_port_set_alias)
        self.add_method('/ray/patchbay/connect', 'ss',
                        self._ray_patchbay_connect)
        self.add_method('/ray/patchbay/disconnect', 'ss',
                        self._ray_patchbay_disconnect)
        self.add_method('/ray/patchbay/set_buffer_size', 'i',
                        self._ray_patchbay_set_buffersize)
        self.add_method('/ray/patchbay/refresh', '',
                        self._ray_patchbay_refresh)
        self.add_method('/ray/patchbay/set_metadata', 'hss',
                        self._ray_patchbay_set_metadata)

        self.main_object = main_object
        self.jack_client = main_object.jack_client
        self.port_list = main_object.port_list
        self.connection_list = main_object.connection_list
        self.metadata_list = main_object.metadata_list
        self.client_list = main_object.client_list
        self.gui_list = []
        self._tmp_gui_url = ''
        self._terminate = False
예제 #2
0
    def __init__(self, host):
        Server.__init__(self, proto=LO_UDP)

        if False:
            host = CarlaHostOSC()

        self.host = host
예제 #3
0
    def __init__(self, host, rhost):
        Server.__init__(self, proto=LO_TCP)

        if False:
            host = CarlaHostOSC()

        self.host = host
        self.rhost = rhost
 def __init__(self, port, pymol_handler=None, flask_server=None):
     """
     Initialize an OSC server to listen to specific port
     :param port: OSC port
     :param pymol_handler: PyMol associated app
     :param flask_server: Flask web server
     """
     logging.info("***************")
     logging.info("1) Free the desired port")
     try:
         server = Server(port)
         server.free()
     except ServerError, err:
         logging.info(str(err))
         sys.exit()
예제 #5
0
def isOscPortFree(port):
    try:
        testport = Server(port)
    except BaseException:
        return False

    del testport
    return True
예제 #6
0
def is_osc_port_free(port: int):
    try:
        testport = Server(port)
    except BaseException:
        return False

    del testport
    return True
예제 #7
0
    def setupOscServer(
            self                , 
            serverListenPort    ,
            ):
        #setup OSC Server
        try:
            oscListenServer = Server( serverListenPort )
            
            #register OSC Listen method
            oscListenServer.add_method(
                    None                , 
                    None                , 
                    self.forwardMessage ,
                    )

        except ServerError as error:
            exit( error )
        return oscListenServer
예제 #8
0
def getFreeOscPort(default=16187):
    # get a free OSC port for daemon, start from default

    if default >= 65536:
        default = 16187

    daemon_port = default
    UsedPort = True
    testport = None

    while UsedPort:
        try:
            testport = Server(daemon_port)
            UsedPort = False
        except BaseException:
            daemon_port += 1
            UsedPort = True

    del testport
    return daemon_port
예제 #9
0
def get_free_osc_port(default=16187):
    ''' get a free OSC port for daemon, start from default '''

    if default >= 65536:
        default = 16187

    daemon_port = default
    used_port = True
    testport = None

    while used_port:
        try:
            testport = Server(daemon_port)
            used_port = False
        except BaseException:
            daemon_port += 1
            used_port = True

    del testport
    return daemon_port
예제 #10
0
def main():
    global led, presets

    parser = argparse.ArgumentParser(description='AllPixel OSC controller',
                                     formatter_class=argparse.ArgumentDefaultsHelpFormatter)
    parser.add_argument('--port', dest='port', default=7676,
                        help='Port to listen on')
    parser.add_argument('--num-leds', dest='num_leds', default=194,
                        help='Number of LEDs on strip')
    args = parser.parse_args()

    signal(SIGINT, sig_exit)
    signal(SIGTERM, sig_exit)

    osc = Server(args.port, UDP)
    osc.add_method("/off", None, set_off)
    osc.add_method("/presets", None, set_preset)

    driver = DriverSerial(type=LEDTYPE.WS2801, num=int(args.num_leds), c_order=ChannelOrder.GRB)
    led = LEDStrip(driver)

    presets += [
        LarsonScanners.LarsonScanner(led, color=colors.Cyan, tail=60),
        LarsonScanners.LarsonRainbow(led, tail=60),
        Rainbows.Rainbow(led),
        PartyMode.PartyMode(led, [colors.White, colors.Blue]),
        FireFlies.FireFlies(led, [colors.Gold, colors.Red], width=12, count=4),
        WhiteTwinkle.WhiteTwinkle(led),
        Wave.Wave(led, color=colors.Cyan, cycles=4),
        ColorChase.ColorChase(led, color=colors.Cyan, width=20)
    ]

    set_preset('', [0, 50], '', '')

    while True:
        osc.recv(100)
예제 #11
0
    def __init__(self, host, mode):
        Server.__init__(self, 8998 + int(random()*9000), mode)

        self.host = host
예제 #12
0
    def __init__(self, host, mode):
        Server.__init__(self, 8998 + int(random() * 9000), mode)

        self.host = host