13
0

VST2: more verbose scan logs

This commit is contained in:
Robin Gareus 2021-07-06 21:24:23 +02:00
parent d01d261f0e
commit e5de39c861
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
4 changed files with 15 additions and 11 deletions

View File

@ -1,6 +1,6 @@
/*
* Copyright (C) 2012-2016 Paul Davis <paul@linuxaudiosystems.com>
* Copyright (C) 2013-2017 Robin Gareus <robin@gareus.org>
* Copyright (C) 2013-2021 Robin Gareus <robin@gareus.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -108,7 +108,7 @@ static void* vstfx_load_vst_library(const char* path)
}
if (Glib::file_test (path, Glib::FILE_TEST_EXISTS)) {
PBD::error << string_compose (_("Could not open existing LXVST plugin: %1"), dlerror()) << endmsg;
PBD::error << string_compose (_("Could not load VST2 plugin '%1': %2"), path, dlerror ()) << endmsg;
return 0;
}
@ -149,11 +149,11 @@ static void* vstfx_load_vst_library(const char* path)
/*Try and load the library*/
if ((dll = dlopen(full_path, RTLD_LOCAL | RTLD_LAZY)) != 0)
{
if ((dll = dlopen(full_path, RTLD_LOCAL | RTLD_LAZY)) != 0) {
/*Succeeded */
break;
}
PBD::error << string_compose (_("Could not load VST2 plugin '%1': %2"), full_path, dlerror ()) << endmsg;
/*Try again*/
@ -227,6 +227,7 @@ vstfx_load (const char *path)
if (fhandle->main_entry == 0)
{
PBD::error << string_compose (_("Missing entry method in VST2 plugin '%1'"), path) << endmsg;
/*If it can't be found, unload the plugin and return a 0 handle*/
vstfx_unload (fhandle);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2016-2017 Robin Gareus <robin@gareus.org>
* Copyright (C) 2016-2021 Robin Gareus <robin@gareus.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -125,6 +125,7 @@ mac_vst_load (const char *path)
}
if (fhandle->main_entry == 0) {
PBD::error << string_compose (_("Missing entry method in VST2 plugin '%1'"), path) << endmsg;
mac_vst_unload (fhandle);
return 0;
}

View File

@ -296,7 +296,7 @@ vst2_unload (VSTHandle* h, ARDOUR::PluginType type)
}
static VSTHandle*
vstfx_load (const char* dllpath, ARDOUR::PluginType type)
vst2_load (const char* dllpath, ARDOUR::PluginType type)
{
VSTHandle* h = NULL;
switch (type) {
@ -523,10 +523,10 @@ vstfx_info_from_plugin (VSTHandle* h, VSTState* vstfx, vector<ARDOUR::VST2Info>&
static bool
discover_vst2 (std::string const& path, ARDOUR::PluginType type, std::vector<ARDOUR::VST2Info>& rv, bool verbose)
{
VSTHandle* h = vstfx_load (path.c_str (), type);
VSTHandle* h = vst2_load (path.c_str (), type);
if (!h) {
PBD::warning << string_compose (_("Cannot get load VST plugin from '%1'"), path) << endmsg;
PBD::warning << string_compose (_("Cannot open VST2 module '%1'"), path) << endmsg;
return false;
}
@ -678,7 +678,7 @@ ARDOUR::vst2_scan_and_cache (std::string const& path, ARDOUR::PluginType type, b
return false;
}
if (nfo.empty ()) {
cerr << "No plugins in VST2 plugin: '" << path << "'\n";
PBD::warning << string_compose (_("No plugins in VST2 module '%1'"), path) << endmsg;
delete root;
return false;
}
@ -687,7 +687,7 @@ ARDOUR::vst2_scan_and_cache (std::string const& path, ARDOUR::PluginType type, b
root->add_child_nocopy (i->state ());
}
} catch (...) {
cerr << "Cannot load VST2 plugin: '" << path << "'\n";
PBD::warning << string_compose (_("Cannot load VST plugin '%1'"), path) << endmsg;
delete root;
return false;
}

View File

@ -2,7 +2,7 @@
* Copyright (C) 2006-2010 Paul Davis <paul@linuxaudiosystems.com>
* Copyright (C) 2010-2011 Carl Hetherington <carl@carlh.net>
* Copyright (C) 2014-2016 John Emmas <john@creativepost.co.uk>
* Copyright (C) 2014-2017 Robin Gareus <robin@gareus.org>
* Copyright (C) 2014-2021 Robin Gareus <robin@gareus.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -410,6 +410,7 @@ fst_load (const char *path)
// See if we can load the plugin DLL
if ((fhandle->dll = (HMODULE)fst_load_vst_library (path)) == NULL) {
fst_error ("fst_load(): Cannot open plugin dll\n");
fst_unload (&fhandle);
return NULL;
}
@ -421,6 +422,7 @@ fst_load (const char *path)
}
if (fhandle->main_entry == 0) {
fst_error ("fst_load(): Missing entry method in VST2 plugin\n");
fst_unload (&fhandle);
return NULL;
}