From 76c86ee96dc91a4eb595c0e145314244fc4d8407 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 16 Oct 2020 22:25:56 +0200 Subject: [PATCH] VST3 path customization Allow to add custom VST3 search to default. the VST3_PATH environment variable is use to pre-seed this path at first start. --- libs/ardour/ardour/rc_configuration_vars.h | 1 + libs/ardour/plugin_manager.cc | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/libs/ardour/ardour/rc_configuration_vars.h b/libs/ardour/ardour/rc_configuration_vars.h index 7b9f46703e..9321c13c76 100644 --- a/libs/ardour/ardour/rc_configuration_vars.h +++ b/libs/ardour/ardour/rc_configuration_vars.h @@ -237,6 +237,7 @@ CONFIG_VARIABLE (uint32_t, limit_n_automatables, "limit-n-automatables", 512) /* custom user plugin paths */ CONFIG_VARIABLE (std::string, plugin_path_vst, "plugin-path-vst", "@default@") CONFIG_VARIABLE (std::string, plugin_path_lxvst, "plugin-path-lxvst", "@default@") +CONFIG_VARIABLE (std::string, plugin_path_vst3, "plugin-path-vst3", "@default@") /* denormal management */ diff --git a/libs/ardour/plugin_manager.cc b/libs/ardour/plugin_manager.cc index b886a14a70..edc9d9f2a7 100644 --- a/libs/ardour/plugin_manager.cc +++ b/libs/ardour/plugin_manager.cc @@ -288,6 +288,14 @@ PluginManager::PluginManager () if (Config->get_plugin_path_vst() == X_("@default@")) { Config->set_plugin_path_vst(get_default_windows_vst_path()); } + if (Config->get_plugin_path_vst3() == X_("@default@")) { + /* This path is currently only added to the existing path */ + if ((s = getenv ("VST3_PATH"))) { + Config->set_plugin_path_vst3 (s); + } else { + Config->set_plugin_path_vst3 (""); + } + } if (_instance == 0) { _instance = this; @@ -1632,9 +1640,14 @@ PluginManager::vst3_discover_from_path (string const& path, bool cache_only) return -1; } - DEBUG_TRACE (DEBUG::PluginManager, string_compose ("VST3: search along: [%1]\n", path)); - Searchpath paths (path); + if (!Config->get_plugin_path_vst3().empty ()) { + Searchpath custom (Config->get_plugin_path_vst3 ()); + paths += custom; + } + + DEBUG_TRACE (DEBUG::PluginManager, string_compose ("VST3: search along: [%1]\n", paths.to_string ())); + vector plugin_objects; find_paths_matching_filter (plugin_objects, paths, vst3_filter, 0, false, true, true);