From 4ef6ba0039fa3d7b76323d40906a259c30ce40ac Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Wed, 9 Dec 2020 17:17:19 +0100 Subject: [PATCH] VST3: allow filename mismatch inside the bundle This amends 5950df2b74. The VST3 SDK does not recursively search directories that are bundles IFF the file inside the bundle's architecture folder matches the bundle's name. In case there's a file with a different name resides inside the bundle it is treated as standalone, unbundled plugin. Since Ardour, PBD::Searchpath always does a recursive search, the bundled plugins need to be weeded after the fact. This now follows the VST3 SDK by not just checking the arch name, but also Contents and bundle.vst3 parent dirnames. --- libs/ardour/vst3_scan.cc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/libs/ardour/vst3_scan.cc b/libs/ardour/vst3_scan.cc index 05acd5d98e..cc70a223b4 100644 --- a/libs/ardour/vst3_scan.cc +++ b/libs/ardour/vst3_scan.cc @@ -279,8 +279,16 @@ ARDOUR::module_path_vst3 (string const& path) * ...\plugin.vst3 * ...\plugin.vst3\Contents\x64_64-win\plugin.vst3 */ - if (Glib::path_get_basename (Glib::path_get_dirname (path)) == vst3_bindir ()) { - /* ignore *.vst3 files if they're part of a bundle, use the bundle instead. */ + std::string p1 = Glib::path_get_dirname (path); + std::string p2 = Glib::path_get_dirname (p1); + std::string p3 = Glib::path_get_dirname (p2); + if ( Glib::path_get_basename (p1) == vst3_bindir () + && Glib::path_get_basename (p2) == "Contents" + && Glib::path_get_basename (p3) == Glib::path_get_basename (path) + ) { + /* Ignore *.vst3 dll if it resides inside a bundle with the same name. + * Ardour will instead use the bundle. + */ return ""; } #endif