1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-05-04 09:39:42 +02:00

Ladspa, VST: As before eb3bc7e: keep registering even if some errors

This commit is contained in:
Paul Licameli 2017-12-31 15:17:48 -05:00
parent 86b9c5c5fe
commit 0c97918bb9
2 changed files with 7 additions and 6 deletions

View File

@ -469,6 +469,7 @@ wxArrayString VSTEffectsModule::FindPlugins(PluginManagerInterface & pm)
bool VSTEffectsModule::RegisterPlugin(PluginManagerInterface & pm, bool VSTEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
const wxString & path, wxString &errMsg) const wxString & path, wxString &errMsg)
{ {
bool error = false;
errMsg.clear(); errMsg.clear();
// TODO: Fix this for external usage // TODO: Fix this for external usage
const wxString &cmdpath = PlatformCompatibility::GetExecutablePath(); const wxString &cmdpath = PlatformCompatibility::GetExecutablePath();
@ -502,8 +503,8 @@ bool VSTEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
catch (...) catch (...)
{ {
wxLogMessage(_("VST plugin registration failed for %s\n"), path.c_str()); wxLogMessage(_("VST plugin registration failed for %s\n"), path.c_str());
error = true;
valid = false; valid = false;
break;
} }
wxString output; wxString output;
@ -632,7 +633,7 @@ bool VSTEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
} }
} }
if (!valid) if (error)
errMsg = _("Could not load the library"); errMsg = _("Could not load the library");
return valid; return valid;

View File

@ -226,7 +226,8 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
wxSetEnv(wxT("PATH"), ff.GetPath() + wxFILE_SEP_PATH + envpath); wxSetEnv(wxT("PATH"), ff.GetPath() + wxFILE_SEP_PATH + envpath);
wxString saveOldCWD = ff.GetCwd(); wxString saveOldCWD = ff.GetCwd();
ff.SetCwd(); ff.SetCwd();
bool error = false;
int index = 0; int index = 0;
LADSPA_Descriptor_Function mainFn = NULL; LADSPA_Descriptor_Function mainFn = NULL;
wxDynamicLibrary lib; wxDynamicLibrary lib;
@ -244,8 +245,7 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
} }
else { else {
// If pm.RegisterPlugin is skipped, be sure to report error // If pm.RegisterPlugin is skipped, be sure to report error
index = 0; error = true;
break;
} }
} }
} }
@ -263,7 +263,7 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
wxSetWorkingDirectory(saveOldCWD); wxSetWorkingDirectory(saveOldCWD);
hadpath ? wxSetEnv(wxT("PATH"), envpath) : wxUnsetEnv(wxT("PATH")); hadpath ? wxSetEnv(wxT("PATH"), envpath) : wxUnsetEnv(wxT("PATH"));
if (index == 0) if (error)
errMsg = _("Could not load the library"); errMsg = _("Could not load the library");
return index > 0; return index > 0;