From e1e533a58133d2a6e7de829bb5eaaf9d1217468e Mon Sep 17 00:00:00 2001 From: falkTX Date: Tue, 7 Mar 2017 11:01:27 +0100 Subject: [PATCH] Search for plugin binaries using env var paths as fallback --- source/backend/engine/CarlaEngine.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/source/backend/engine/CarlaEngine.cpp b/source/backend/engine/CarlaEngine.cpp index ab16b6666..90cfb2e99 100644 --- a/source/backend/engine/CarlaEngine.cpp +++ b/source/backend/engine/CarlaEngine.cpp @@ -2141,7 +2141,25 @@ bool CarlaEngine::loadProjectInternal(juce::XmlDocument& xmlDoc) carla_stderr("Plugin binary '%s' doesn't exist on this filesystem, let's look for it...", stateSave.binary); - const String result(findBinaryInCustomPath(searchPath, stateSave.binary)); + String result = findBinaryInCustomPath(searchPath, stateSave.binary); + + if (result.isEmpty()) + { + switch (ptype) + { + case PLUGIN_LADSPA: searchPath = std::getenv("LADSPA_PATH"); break; + case PLUGIN_DSSI: searchPath = std::getenv("DSSI_PATH"); break; + case PLUGIN_VST2: searchPath = std::getenv("VST_PATH"); break; + case PLUGIN_VST3: searchPath = std::getenv("VST3_PATH"); break; + case PLUGIN_GIG: searchPath = std::getenv("GIG_PATH"); break; + case PLUGIN_SF2: searchPath = std::getenv("SF2_PATH"); break; + case PLUGIN_SFZ: searchPath = std::getenv("SFZ_PATH"); break; + default: searchPath = nullptr; break; + } + + if (searchPath != nullptr && searchPath[0] != '\0') + result = findBinaryInCustomPath(searchPath, stateSave.binary); + } if (result.isNotEmpty()) {