Beispiel #1
0
    def __init__(self):
        QObject.__init__(self)

        self.sl_process = QProcess()
        self.sl_process.setProcessChannelMode(QProcess.ForwardedChannels)
        self.sl_process.finished.connect(self.slProcessFinished)

        self.sl_port = ray.getFreeOscPort(9951)
        self.sl_url = Address(self.sl_port)

        self.sl_process.start('sooperlooper', ['-p', str(self.sl_port)])

        self.gui_process = QProcess()
        self.gui_process.setProcessChannelMode(QProcess.ForwardedChannels)
        self.gui_process.started.connect(self.guiProcessStarted)
        self.gui_process.finished.connect(self.guiProcessFinished)

        self.project_path = ''
        self.session_path = ''
        self.session_name = ''
        self.full_client_id = ''
        self.session_file = ''
        self.session_bak = ''
        self.midi_bindings_file = ''

        self.file_timer = QTimer()
        self.file_timer.setInterval(100)
        self.file_timer.timeout.connect(self.checkFile)
        self.n_file_timer = 0

        signaler.server_sends_open.connect(self.initialize)
        signaler.server_sends_save.connect(self.saveSlSession)
        signaler.show_optional_gui.connect(self.showOptionalGui)
        signaler.hide_optional_gui.connect(self.hideOptionalGui)

        self.sl_ready.connect(self.loadSession)

        self.leaving = False
        self.wait_for_load = False

        self.showOptionalGui()

        self.ping_timer = QTimer()
        self.ping_timer.setInterval(100)
        self.ping_timer.timeout.connect(self.pingSL)
        self.ping_timer.start()

        self.transport_timer = QTimer()
        self.transport_timer.setInterval(2)
        self.transport_timer.timeout.connect(self.checkTransport)

        self.transport_playing = False
        self.will_trig = False
Beispiel #2
0
 def setNewOscAddress(self):
     if not (self.address or self.port):
         self.port = ray.getFreeOscPort()
         self.address = Address(self.port)
Beispiel #3
0
            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: