From 0c0b0348b48dd8b3430ecb9b97b07a49d84c4fed Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 29 Aug 2014 06:27:37 +0100 Subject: [PATCH] Use ENGINE_OPTION_PLUGIN_PATH instead of modifying environment --- source/backend/CarlaStandalone.cpp | 12 ++++----- source/carla_host.py | 41 ++++++++++++++++-------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/source/backend/CarlaStandalone.cpp b/source/backend/CarlaStandalone.cpp index b0d34a0e6..7e656de79 100644 --- a/source/backend/CarlaStandalone.cpp +++ b/source/backend/CarlaStandalone.cpp @@ -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',); diff --git a/source/carla_host.py b/source/carla_host.py index 67070048b..dac1fe711 100644 --- a/source/carla_host.py +++ b/source/carla_host.py @@ -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