From 9032dd5ff5a4f3ed8ef67aef06f388c4c31dae57 Mon Sep 17 00:00:00 2001 From: falkTX Date: Fri, 12 Nov 2021 19:08:45 +0000 Subject: [PATCH] Find LV2 plugins using LV2_PATH first Fixes #4 Signed-off-by: falkTX --- carla | 2 +- dpf | 2 +- plugins/Common/IldaeilPlugin.cpp | 3 +++ plugins/Common/IldaeilUI.cpp | 21 ++++++++++++++++----- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/carla b/carla index d691978..1edb1bb 160000 --- a/carla +++ b/carla @@ -1 +1 @@ -Subproject commit d6919785586228020e347bf24288b8317e0b24ef +Subproject commit 1edb1bb172fce8ae89cf666675ff531fc5dca628 diff --git a/dpf b/dpf index e030179..4c62f76 160000 --- a/dpf +++ b/dpf @@ -1 +1 @@ -Subproject commit e03017963d4e98cb898a6a1b435ad2ca5bccb537 +Subproject commit 4c62f76915478d7cf6ac89cbc1c9714d1fbeb044 diff --git a/plugins/Common/IldaeilPlugin.cpp b/plugins/Common/IldaeilPlugin.cpp index d5d9183..153b233 100644 --- a/plugins/Common/IldaeilPlugin.cpp +++ b/plugins/Common/IldaeilPlugin.cpp @@ -126,6 +126,9 @@ public: carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PATH_RESOURCES, 0, "/usr/share/carla/resources"); #endif + if (const char* const path = std::getenv("LV2_PATH")) + carla_set_engine_option(fCarlaHostHandle, ENGINE_OPTION_PLUGIN_PATH, PLUGIN_LV2, path); + fCarlaPluginDescriptor->dispatcher(fCarlaPluginHandle, NATIVE_PLUGIN_OPCODE_HOST_USES_EMBED, 0, 0, nullptr, 0.0f); diff --git a/plugins/Common/IldaeilUI.cpp b/plugins/Common/IldaeilUI.cpp index 3d177fe..2583801 100644 --- a/plugins/Common/IldaeilUI.cpp +++ b/plugins/Common/IldaeilUI.cpp @@ -488,14 +488,25 @@ protected: void run() override { - /* - // TESTING - const char* const path = "/home/falktx/bin/reaper_linux_x86_64/REAPER/InstallData/Effects"; + const char* path; - carla_set_engine_option(fPlugin->fCarlaHostHandle, ENGINE_OPTION_PLUGIN_PATH, fPluginType, path); + switch (fPluginType) + { + case PLUGIN_LV2: + path = std::getenv("LV2_PATH"); + break; + default: + path = nullptr; + break; + } + /* TESTING + const char* const path = "/home/falktx/bin/reaper_linux_x86_64/REAPER/InstallData/Effects"; */ - if (const uint count = carla_get_cached_plugin_count(fPluginType, nullptr)) + if (path != nullptr) + carla_set_engine_option(fPlugin->fCarlaHostHandle, ENGINE_OPTION_PLUGIN_PATH, fPluginType, path); + + if (const uint count = carla_get_cached_plugin_count(fPluginType, path)) { fPluginCount = 0; fPlugins = new PluginInfoCache[count];