Browse Source

Use ENGINE_OPTION_PLUGIN_PATH instead of modifying environment

tags/1.9.5
falkTX 10 years ago
parent
commit
0c0b0348b4
2 changed files with 28 additions and 25 deletions
  1. +6
    -6
      source/backend/CarlaStandalone.cpp
  2. +22
    -19
      source/carla_host.py

+ 6
- 6
source/backend/CarlaStandalone.cpp View File

@@ -986,6 +986,12 @@ void carla_set_engine_option(EngineOption option, int value, const char* valueSt
gStandalone.engineOptions.audioDevice = carla_strdup_safe(valueStr);
break;

case CB:: ENGINE_OPTION_NSM_INIT:
CARLA_SAFE_ASSERT_RETURN(value != 0,);
CARLA_SAFE_ASSERT_RETURN(valueStr != nullptr && valueStr[0] != '\0',);
gNSM.announce(value, valueStr);
break;

case CB::ENGINE_OPTION_PLUGIN_PATH:
CARLA_SAFE_ASSERT_RETURN(value > CB::PLUGIN_NONE,);
CARLA_SAFE_ASSERT_RETURN(value <= CB::PLUGIN_SFZ,);
@@ -993,12 +999,6 @@ void carla_set_engine_option(EngineOption option, int value, const char* valueSt
// TODO
break;

case CB:: ENGINE_OPTION_NSM_INIT:
CARLA_SAFE_ASSERT_RETURN(value != 0,);
CARLA_SAFE_ASSERT_RETURN(valueStr != nullptr && valueStr[0] != '\0',);
gNSM.announce(value, valueStr);
break;

case CB::ENGINE_OPTION_PATH_BINARIES:
CARLA_SAFE_ASSERT_RETURN(valueStr != nullptr && valueStr[0] != '\0',);



+ 22
- 19
source/carla_host.py View File

@@ -525,6 +525,28 @@ class HostWindow(QMainWindow):
if gCarla.host is None:
return audioDriver

# -------------------------------------------------------------
# plugin paths

LADSPA_PATH = toList(settings.value(CARLA_KEY_PATHS_LADSPA, gCarla.DEFAULT_LADSPA_PATH))
DSSI_PATH = toList(settings.value(CARLA_KEY_PATHS_DSSI, gCarla.DEFAULT_DSSI_PATH))
LV2_PATH = toList(settings.value(CARLA_KEY_PATHS_LV2, gCarla.DEFAULT_LV2_PATH))
VST_PATH = toList(settings.value(CARLA_KEY_PATHS_VST, gCarla.DEFAULT_VST_PATH))
VST3_PATH = toList(settings.value(CARLA_KEY_PATHS_VST3, gCarla.DEFAULT_VST3_PATH))
AU_PATH = toList(settings.value(CARLA_KEY_PATHS_AU, gCarla.DEFAULT_AU_PATH))
GIG_PATH = toList(settings.value(CARLA_KEY_PATHS_GIG, gCarla.DEFAULT_GIG_PATH))
SF2_PATH = toList(settings.value(CARLA_KEY_PATHS_SF2, gCarla.DEFAULT_SF2_PATH))
SFZ_PATH = toList(settings.value(CARLA_KEY_PATHS_SFZ, gCarla.DEFAULT_SFZ_PATH))

gCarla.host.set_engine_option(ENGINE_OPTION_PLUGIN_PATH, PLUGIN_LADSPA, splitter.join(LADSPA_PATH))
gCarla.host.set_engine_option(ENGINE_OPTION_PLUGIN_PATH, PLUGIN_DSSI, splitter.join(DSSI_PATH))
gCarla.host.set_engine_option(ENGINE_OPTION_PLUGIN_PATH, PLUGIN_LV2, splitter.join(LV2_PATH))
gCarla.host.set_engine_option(ENGINE_OPTION_PLUGIN_PATH, PLUGIN_VST, splitter.join(VST_PATH))
gCarla.host.set_engine_option(ENGINE_OPTION_PLUGIN_PATH, PLUGIN_AU, splitter.join(AU_PATH))
gCarla.host.set_engine_option(ENGINE_OPTION_PLUGIN_PATH, PLUGIN_GIG, splitter.join(GIG_PATH))
gCarla.host.set_engine_option(ENGINE_OPTION_PLUGIN_PATH, PLUGIN_SF2, splitter.join(SF2_PATH))
gCarla.host.set_engine_option(ENGINE_OPTION_PLUGIN_PATH, PLUGIN_SFZ, splitter.join(SFZ_PATH))

# -------------------------------------------------------------
# apply to engine

@@ -708,25 +730,6 @@ class HostWindow(QMainWindow):
# engine
self.setEngineSettings(settings)

# plugin paths
LADSPA_PATH = toList(settings.value("Paths/LADSPA", gCarla.DEFAULT_LADSPA_PATH))
DSSI_PATH = toList(settings.value("Paths/DSSI", gCarla.DEFAULT_DSSI_PATH))
LV2_PATH = toList(settings.value("Paths/LV2", gCarla.DEFAULT_LV2_PATH))
VST_PATH = toList(settings.value("Paths/VST", gCarla.DEFAULT_VST_PATH))
AU_PATH = toList(settings.value("Paths/AU", gCarla.DEFAULT_AU_PATH))
GIG_PATH = toList(settings.value("Paths/GIG", gCarla.DEFAULT_GIG_PATH))
SF2_PATH = toList(settings.value("Paths/SF2", gCarla.DEFAULT_SF2_PATH))
SFZ_PATH = toList(settings.value("Paths/SFZ", gCarla.DEFAULT_SFZ_PATH))

gCarla.host.setenv("LADSPA_PATH", splitter.join(LADSPA_PATH))
gCarla.host.setenv("DSSI_PATH", splitter.join(DSSI_PATH))
gCarla.host.setenv("LV2_PATH", splitter.join(LV2_PATH))
gCarla.host.setenv("VST_PATH", splitter.join(VST_PATH))
gCarla.host.setenv("AU_PATH", splitter.join(AU_PATH))
gCarla.host.setenv("GIG_PATH", splitter.join(GIG_PATH))
gCarla.host.setenv("SF2_PATH", splitter.join(SF2_PATH))
gCarla.host.setenv("SFZ_PATH", splitter.join(SFZ_PATH))

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

# TODO


Loading…
Cancel
Save