Exemplo n.º 1
0
    def isNsmLocked(self):
        if self.is_dummy:
            return False

        server = OscServerThread.getInstance()
        if not server:
            return False

        return server.is_nsm_locked
Exemplo n.º 2
0
    def set_server_status(self, server_status: int):
        if self.is_dummy:
            return

        server = OscServerThread.getInstance()
        if not server:
            return

        server.set_server_status(server_status)
Exemplo n.º 3
0
    def getServerStatus(self):
        if self.is_dummy:
            return -1

        server = OscServerThread.getInstance()
        if not server:
            return -1

        return server.server_status
Exemplo n.º 4
0
    def sendGui(self, *args):
        if self.is_dummy:
            return

        server = OscServerThread.getInstance()
        if not server:
            return

        server.sendGui(*args)
Exemplo n.º 5
0
    def getServerPort(self):
        server = OscServerThread.getInstance()
        if server:
            return server.port

        return 0
Exemplo n.º 6
0
    def getServerUrl(self):
        server = OscServerThread.getInstance()
        if server:
            return server.url

        return ''
Exemplo n.º 7
0
 def getServer(self):
     return OscServerThread.getInstance()
Exemplo n.º 8
0
    def sendGuiMessage(self, message):
        self.sendGui('/ray/gui/server/message', message)

        server = OscServerThread.getInstance()
        if server:
            server.sendControllerMessage(message)
Exemplo n.º 9
0
    def send_gui_message(self, message: str):
        self.send_gui('/ray/gui/server/message', message)

        server = OscServerThread.getInstance()
        if server:
            server.send_controller_message(message)
Exemplo n.º 10
0
    def sendEvenDummy(self, *args):
        server = OscServerThread.getInstance()
        if not server:
            return

        server.send(*args)
Exemplo n.º 11
0
    def hasServer(self):
        if not OscServerThread.getInstance():
            return False

        return not self.is_dummy
Exemplo n.º 12
0
                session_root)
            sys.exit(1)

        try:
            os.makedirs(session_root)
        except:
            sys.stderr.write("impossible to make dir %s , aborted !\n" %
                             session_root)
            sys.exit(1)

    #create session
    session = SignaledSession(session_root)

    #create and start server
    if CommandLineArgs.findfreeport:
        server = OscServerThread(
            session, ray.get_free_osc_port(CommandLineArgs.osc_port))
    else:
        if ray.is_osc_port_free(CommandLineArgs.osc_port):
            server = OscServerThread(session, CommandLineArgs.osc_port)
        else:
            sys.stderr.write(
                _translate('daemon', 'port %i is not free, try another one\n')
                % CommandLineArgs.osc_port)
            sys.exit()
    server.start()

    if CommandLineArgs.hidden:
        server.not_default = True

    #announce server to GUI
    if CommandLineArgs.gui_url:
Exemplo n.º 13
0
 def get_server_even_dummy(self):
     return OscServerThread.getInstance()
Exemplo n.º 14
0
    def get_server(self):
        if self.is_dummy:
            return None

        return OscServerThread.getInstance()
Exemplo n.º 15
0
    def informCopytoGui(self, copy_state):
        server = OscServerThread.getInstance()
        if not server:
            return

        server.informCopytoGui(copy_state)
Exemplo n.º 16
0
                session_root)
            sys.exit(1)

        try:
            os.makedirs(session_root)
        except:
            sys.stderr.write("impossible to make dir %s , aborted !\n" %
                             session_root)
            sys.exit(1)

    #create session
    session = SignaledSession(session_root)

    #create and start server
    if CommandLineArgs.findfreeport:
        server = OscServerThread(session,
                                 ray.getFreeOscPort(CommandLineArgs.osc_port))
    else:
        if ray.isOscPortFree(CommandLineArgs.osc_port):
            server = OscServerThread(session, CommandLineArgs.osc_port)
        else:
            sys.stderr.write(
                _translate('daemon', 'port %i is not free, try another one\n')
                % CommandLineArgs.osc_port)
            sys.exit()
    server.start()

    if CommandLineArgs.hidden:
        server.setAsNotDefault()

    #announce server to GUI
    if CommandLineArgs.gui_url:
Exemplo n.º 17
0
 def get_client_templates_database(self, base: str) -> list:
     server = OscServerThread.getInstance()
     if server:
         return server.client_templates_database[base]
     return []