commit ba252eacf4846da1c0a3f2cae5fef3a5cae5a3d9
parent c91b3520a5863af57ebf40159744afc82e4502db
Author: dsp56300 <dsp56300@users.noreply.github.com>
Date: Sat, 8 Feb 2025 03:14:56 +0100
load VST3 as .vst3 path also, doesn't work when loading embedded shared lib directly
Diffstat:
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/source/pluginTester/pluginTester.cpp b/source/pluginTester/pluginTester.cpp
@@ -45,12 +45,24 @@ int main(const int _argc, char* _argv[])
return error("No plugin specified");
}
- // juce wants the folder for a LV2 plugin instead of the actual file
- auto path = baseLib::filesystem::getPath(pluginPathName);
- if (baseLib::filesystem::hasExtension(path, ".lv2"))
- pluginPathName = path;
+ {
+ // juce wants the folder for a VST3/LV2 plugin instead of the actual file
+ const auto lowercase = baseLib::filesystem::lowercase(pluginPathName);
- JuceAppLifetimeObjects jalto;
+ auto start = lowercase.find(".vst3");
+ if (start == std::string::npos)
+ start = lowercase.find(".lv2");
+
+ if (start != std::string::npos)
+ {
+ auto slash = pluginPathName.find_first_of("\\/", start);
+
+ if (slash != std::string::npos)
+ pluginPathName = pluginPathName.substr(0, slash);
+ }
+ }
+
+ JuceAppLifetimeObjects jalto;
CommandLinePluginHost pluginHost;
@@ -65,6 +77,8 @@ int main(const int _argc, char* _argv[])
if (!format)
continue;
+ Logger::writeToLog("Attempt to load plugin as type " + format->getName());
+
KnownPluginList plugins;
OwnedArray<PluginDescription> typesFound;