Browse Source

Fix changing process mode without quitting carla

tags/1.9.5
falkTX 10 years ago
parent
commit
16d9083c0f
3 changed files with 13 additions and 10 deletions
  1. +3
    -2
      source/carla_backend.py
  2. +4
    -2
      source/carla_host.py
  3. +6
    -6
      source/carla_settings.py

+ 3
- 2
source/carla_backend.py View File

@@ -1311,8 +1311,9 @@ class CarlaHostMeta(QObject):
self.isPlugin = False

# settings
self.processMode = ENGINE_PROCESS_MODE_CONTINUOUS_RACK
self.transportMode = ENGINE_TRANSPORT_MODE_INTERNAL
self.processMode = ENGINE_PROCESS_MODE_CONTINUOUS_RACK
self.transportMode = ENGINE_TRANSPORT_MODE_INTERNAL
self.nextProcessMode = ENGINE_PROCESS_MODE_CONTINUOUS_RACK
self.processModeForced = False

# settings


+ 4
- 2
source/carla_host.py View File

@@ -2107,12 +2107,14 @@ def loadHostSettings(host):
except:
host.processMode = CARLA_DEFAULT_PROCESS_MODE

host.nextProcessMode = host.processMode

# --------------------------------------------------------------------------------------------------------
# fix things if needed

if host.processMode == ENGINE_PROCESS_MODE_MULTIPLE_CLIENTS and LADISH_APP_NAME:
print("LADISH detected but using multiple clients (not allowed), forcing single client now")
host.processMode = ENGINE_PROCESS_MODE_SINGLE_CLIENT
host.nextProcessMode = host.processMode = ENGINE_PROCESS_MODE_SINGLE_CLIENT

# ------------------------------------------------------------------------------------------------------------
# Set host settings
@@ -2135,7 +2137,7 @@ def setHostSettings(host):
if host.isPlugin:
return

host.set_engine_option(ENGINE_OPTION_PROCESS_MODE, host.processMode, "")
host.set_engine_option(ENGINE_OPTION_PROCESS_MODE, host.nextProcessMode, "")
host.set_engine_option(ENGINE_OPTION_TRANSPORT_MODE, host.transportMode, "")

# ------------------------------------------------------------------------------------------------------------

+ 6
- 6
source/carla_settings.py View File

@@ -348,10 +348,10 @@ class CarlaSettingsW(QDialog):
self.ui.sw_engine_process_mode.setCurrentIndex(1)
self.ui.tb_engine_driver_config.setEnabled(not self.host.isPlugin)

self.ui.cb_engine_process_mode_jack.setCurrentIndex(self.host.processMode)
self.ui.cb_engine_process_mode_jack.setCurrentIndex(self.host.nextProcessMode)

if self.host.processMode >= self.PROCESS_MODE_NON_JACK_PADDING:
self.ui.cb_engine_process_mode_other.setCurrentIndex(self.host.processMode-self.PROCESS_MODE_NON_JACK_PADDING)
if self.host.nextProcessMode >= self.PROCESS_MODE_NON_JACK_PADDING:
self.ui.cb_engine_process_mode_other.setCurrentIndex(self.host.nextProcessMode-self.PROCESS_MODE_NON_JACK_PADDING)
else:
self.ui.cb_engine_process_mode_other.setCurrentIndex(0)

@@ -458,11 +458,11 @@ class CarlaSettingsW(QDialog):

if not self.host.processModeForced:
# engine sends callback if processMode really changes
processMode = self.ui.cb_engine_process_mode_jack.currentIndex() if audioDriver == "JACK" else self.ui.cb_engine_process_mode_other.currentIndex()+self.PROCESS_MODE_NON_JACK_PADDING
self.host.nextProcessMode = self.ui.cb_engine_process_mode_jack.currentIndex() if audioDriver == "JACK" else self.ui.cb_engine_process_mode_other.currentIndex()+self.PROCESS_MODE_NON_JACK_PADDING

self.host.set_engine_option(ENGINE_OPTION_PROCESS_MODE, processMode, "")
self.host.set_engine_option(ENGINE_OPTION_PROCESS_MODE, self.host.nextProcessMode, "")

settings.setValue(CARLA_KEY_ENGINE_PROCESS_MODE, processMode)
settings.setValue(CARLA_KEY_ENGINE_PROCESS_MODE, self.host.nextProcessMode)

self.host.forceStereo = self.ui.ch_engine_force_stereo.isChecked()
self.host.preferPluginBridges = self.ui.ch_engine_prefer_plugin_bridges.isChecked()


Loading…
Cancel
Save