From 0c97918bb988939dfc05333647ba74aeddc4057a Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Sun, 31 Dec 2017 15:17:48 -0500 Subject: [PATCH] Ladspa, VST: As before eb3bc7e: keep registering even if some errors --- src/effects/VST/VSTEffect.cpp | 5 +++-- src/effects/ladspa/LadspaEffect.cpp | 8 ++++---- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/effects/VST/VSTEffect.cpp b/src/effects/VST/VSTEffect.cpp index 4eee34fcc..60330a359 100644 --- a/src/effects/VST/VSTEffect.cpp +++ b/src/effects/VST/VSTEffect.cpp @@ -469,6 +469,7 @@ wxArrayString VSTEffectsModule::FindPlugins(PluginManagerInterface & pm) bool VSTEffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxString & path, wxString &errMsg) { + bool error = false; errMsg.clear(); // TODO: Fix this for external usage const wxString &cmdpath = PlatformCompatibility::GetExecutablePath(); @@ -502,8 +503,8 @@ bool VSTEffectsModule::RegisterPlugin(PluginManagerInterface & pm, catch (...) { wxLogMessage(_("VST plugin registration failed for %s\n"), path.c_str()); + error = true; valid = false; - break; } wxString output; @@ -632,7 +633,7 @@ bool VSTEffectsModule::RegisterPlugin(PluginManagerInterface & pm, } } - if (!valid) + if (error) errMsg = _("Could not load the library"); return valid; diff --git a/src/effects/ladspa/LadspaEffect.cpp b/src/effects/ladspa/LadspaEffect.cpp index 05234f85c..2852c7bee 100644 --- a/src/effects/ladspa/LadspaEffect.cpp +++ b/src/effects/ladspa/LadspaEffect.cpp @@ -226,7 +226,8 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm, wxSetEnv(wxT("PATH"), ff.GetPath() + wxFILE_SEP_PATH + envpath); wxString saveOldCWD = ff.GetCwd(); ff.SetCwd(); - + + bool error = false; int index = 0; LADSPA_Descriptor_Function mainFn = NULL; wxDynamicLibrary lib; @@ -244,8 +245,7 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm, } else { // If pm.RegisterPlugin is skipped, be sure to report error - index = 0; - break; + error = true; } } } @@ -263,7 +263,7 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm, wxSetWorkingDirectory(saveOldCWD); hadpath ? wxSetEnv(wxT("PATH"), envpath) : wxUnsetEnv(wxT("PATH")); - if (index == 0) + if (error) errMsg = _("Could not load the library"); return index > 0;