Browse Source

Allow to force audio driver

tags/1.9.7
falkTX 7 years ago
parent
commit
2c71884953
3 changed files with 22 additions and 10 deletions
  1. +1
    -0
      source/carla_backend.py
  2. +12
    -8
      source/carla_host.py
  3. +9
    -2
      source/carla_settings.py

+ 1
- 0
source/carla_backend.py View File

@@ -1212,6 +1212,7 @@ class CarlaHostMeta(object):
self.transportMode = ENGINE_TRANSPORT_MODE_INTERNAL
self.nextProcessMode = ENGINE_PROCESS_MODE_PATCHBAY
self.processModeForced = False
self.audioDriverForced = None

# settings
self.forceStereo = False


+ 12
- 8
source/carla_host.py View File

@@ -2327,10 +2327,11 @@ def loadHostSettings(host):
return

# enums
try:
host.transportMode = settings.value(CARLA_KEY_ENGINE_TRANSPORT_MODE, CARLA_DEFAULT_TRANSPORT_MODE, type=int)
except:
host.transportMode = CARLA_DEFAULT_TRANSPORT_MODE
if host.audioDriverForced is None:
try:
host.transportMode = settings.value(CARLA_KEY_ENGINE_TRANSPORT_MODE, CARLA_DEFAULT_TRANSPORT_MODE, type=int)
except:
host.transportMode = CARLA_DEFAULT_TRANSPORT_MODE

if not host.processModeForced:
try:
@@ -2430,10 +2431,13 @@ def setEngineSettings(host):
# driver and device settings

# driver name
try:
audioDriver = settings.value(CARLA_KEY_ENGINE_AUDIO_DRIVER, CARLA_DEFAULT_AUDIO_DRIVER, type=str)
except:
audioDriver = CARLA_DEFAULT_AUDIO_DRIVER
if host.audioDriverForced is not None:
audioDriver = host.audioDriverForced
else:
try:
audioDriver = settings.value(CARLA_KEY_ENGINE_AUDIO_DRIVER, CARLA_DEFAULT_AUDIO_DRIVER, type=str)
except:
audioDriver = CARLA_DEFAULT_AUDIO_DRIVER

# driver options
try:


+ 9
- 2
source/carla_settings.py View File

@@ -261,6 +261,10 @@ class CarlaSettingsW(QDialog):
if host.isPlugin:
self.ui.cb_engine_audio_driver.setEnabled(False)

if host.audioDriverForced is not None:
self.ui.cb_engine_audio_driver.setEnabled(False)
self.ui.tb_engine_driver_config.setEnabled(False)

if host.processModeForced:
self.ui.cb_engine_process_mode_jack.setEnabled(False)
self.ui.cb_engine_process_mode_other.setEnabled(False)
@@ -361,6 +365,9 @@ class CarlaSettingsW(QDialog):
if self.host.isPlugin:
audioDriver = "Plugin"
self.ui.cb_engine_audio_driver.setCurrentIndex(0)
elif self.host.audioDriverForced:
audioDriver = self.host.audioDriverForced
self.ui.cb_engine_audio_driver.setCurrentIndex(0)
else:
audioDriver = settings.value(CARLA_KEY_ENGINE_AUDIO_DRIVER, CARLA_DEFAULT_AUDIO_DRIVER, type=str)

@@ -376,7 +383,7 @@ class CarlaSettingsW(QDialog):
self.ui.tb_engine_driver_config.setEnabled(False)
else:
self.ui.sw_engine_process_mode.setCurrentIndex(1)
self.ui.tb_engine_driver_config.setEnabled(not self.host.isPlugin)
self.ui.tb_engine_driver_config.setEnabled(self.host.audioDriverForced is None and not self.host.isPlugin)

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

@@ -489,7 +496,7 @@ class CarlaSettingsW(QDialog):

audioDriver = self.ui.cb_engine_audio_driver.currentText()

if audioDriver and not self.host.isPlugin:
if audioDriver and self.host.audioDriverForced is None and not self.host.isPlugin:
settings.setValue(CARLA_KEY_ENGINE_AUDIO_DRIVER, audioDriver)

if not self.host.processModeForced:


Loading…
Cancel
Save