13
0

Better version of previous commit (fa3ae33a1f)

Since the file-modification timestamp of the module-path is used
if the cache is up-to-date, the file must exist.
For macOS/X bundles the mandatory file as per VST3 spec is Info.plist
This commit is contained in:
Robin Gareus 2020-10-08 00:08:52 +02:00
parent fa3ae33a1f
commit fa3051fb24
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 16 additions and 12 deletions

View File

@ -49,8 +49,7 @@ class VST3MacModule : public VST3PluginModule
public:
VST3MacModule (std::string const& module_path)
{
std::string path = Glib::path_get_dirname (module_path); // MacOS
path = Glib::path_get_dirname (path); // Contents
std::string path = Glib::path_get_dirname (module_path); // Contents
path = Glib::path_get_dirname (path); // theVST.vst3
CFURLRef url = CFURLCreateFromFileSystemRepresentation (0, (const UInt8*)path.c_str (), (CFIndex)path.length (), true);
if (url) {

View File

@ -244,18 +244,23 @@ ARDOUR::module_path_vst3 (string const& path)
module_path = Glib::build_filename (path, "Contents",
vst3_bindir (), PBD::basename_nosuffix (path) + vst3_suffix ());
}
if (!Glib::file_test (module_path, Glib::FILE_TEST_IS_REGULAR)) {
#ifdef __APPLE__
if (Glib::file_test (Glib::path_get_dirname (module_path), Glib::FILE_TEST_IS_DIR) &&
Glib::file_test (Glib::build_filename (path, "Contents", "Info.plist"), Glib::FILE_TEST_IS_REGULAR)) {
/* Alternatively check for "Contents/MacOS" and an Info.plist file.
* VST3MacModule calls CFBundleCreate() which handles Info.plist files.
* (this is for plugins that use PACE, the MacOS folder usually
* contains a file <basename> + "Protect").
*/
return module_path;
}
/* Check for "Contents/MacOS/" and "Context/Info.plist".
* VST3MacModule calls CFBundleCreate() which handles Info.plist files.
* (on macOS/X the binrary name may differ from the bundle name)
*/
string plist = Glib::build_filename (path, "Contents", "Info.plist");
if (Glib::file_test (Glib::path_get_dirname (module_path), Glib::FILE_TEST_IS_DIR) &&
Glib::file_test (Glib::build_filename (path, "Contents", "Info.plist"), Glib::FILE_TEST_IS_REGULAR)) {
return plist;
} else {
cerr << "VST3 not a valid bundle: '" << path << "'\n";
return "";
}
#endif
if (!Glib::file_test (module_path, Glib::FILE_TEST_IS_REGULAR)) {
cerr << "VST3 not a valid bundle: '" << module_path << "'\n";
return "";
}