Pass plugin path around instead of redetecting

This is now set only once at the top level. This is needed for the
chainloading to work because we'll need to set the path when we create
the bridge.
This commit is contained in:
Robbert van der Helm
2022-04-16 14:21:24 +02:00
parent 1fec4c8860
commit fde90d7bc3
11 changed files with 78 additions and 36 deletions
+9 -2
View File
@@ -29,6 +29,10 @@ using namespace std::literals::string_literals;
// NOLINTNEXTLINE(bugprone-suspicious-include)
#include <public.sdk/source/main/linuxmain.cpp>
using namespace std::literals::string_literals;
namespace fs = ghc::filesystem;
// Because VST3 plugins consist of completely independent components that have
// to be initialized and connected by the host, hosting a VST3 plugin through
// yabridge works very differently from hosting VST2 plugin. Even with
@@ -48,8 +52,11 @@ std::unique_ptr<Vst3PluginBridge> bridge;
bool InitModule() {
assert(!bridge);
// FIXME: Update this for the chainloading
const fs::path plugin_path = get_this_file_location();
try {
bridge = std::make_unique<Vst3PluginBridge>();
bridge = std::make_unique<Vst3PluginBridge>(plugin_path);
return true;
} catch (const std::exception& error) {
@@ -67,7 +74,7 @@ bool InitModule() {
error.what() +
"\nIf you just updated yabridge, then you may need to rerun "
"'yabridgectl sync' first to update your plugins."s,
true);
plugin_path);
return false;
}