1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-09-18 17:10:55 +02:00

Minimal error messages for failing to load non-Nyquist effects

This commit is contained in:
Paul Licameli 2017-12-27 15:09:24 -05:00
parent 0f8bd45a7c
commit eb3bc7e642
6 changed files with 29 additions and 10 deletions

View File

@ -322,6 +322,7 @@ bool BuiltinEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
return true;
}
errMsg = _("Unknown built-in effect name");
return false;
}

View File

@ -502,7 +502,8 @@ bool VSTEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
catch (...)
{
wxLogMessage(_("VST plugin registration failed for %s\n"), path.c_str());
return false;
valid = false;
break;
}
wxString output;
@ -631,6 +632,9 @@ bool VSTEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
}
}
if (!valid)
errMsg = _("Could not load the library");
return valid;
}

View File

@ -180,12 +180,16 @@ bool AudioUnitEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
AudioComponent component = FindAudioUnit(path, name);
if (component == NULL)
{
errMsg = _("Could not find component");
return false;
}
AudioUnitEffect effect(path, name, component);
if (!effect.SetHost(NULL))
{
// TODO: Is it worth it to discriminate all the ways SetHost might
// return false?
errMsg = _("Could not initialize component");
return false;
}

View File

@ -214,6 +214,7 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
// causes duplicate menu entries to appear.
wxFileName ff(path);
if (ff.GetName().CmpNoCase(wxT("vst-bridge")) == 0) {
errMsg = _("Audacity no longer uses vst-bridge");
return false;
}
@ -241,6 +242,11 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
if (effect.SetHost(NULL)) {
pm.RegisterPlugin(this, &effect);
}
else {
// If pm.RegisterPlugin is skipped, be sure to report error
index = 0;
break;
}
}
}
}
@ -257,6 +263,9 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
wxSetWorkingDirectory(saveOldCWD);
hadpath ? wxSetEnv(wxT("PATH"), envpath) : wxUnsetEnv(wxT("PATH"));
if (index == 0)
errMsg = _("Could not load the library");
return index > 0;
}

View File

@ -247,18 +247,18 @@ bool LV2EffectsModule::RegisterPlugin(PluginManagerInterface & pm,
{
errMsg.clear();
const LilvPlugin *plug = GetPlugin(path);
if (!plug)
if (plug)
{
return false;
LV2Effect effect(plug);
if (effect.SetHost(NULL))
{
pm.RegisterPlugin(this, &effect);
return true;
}
}
LV2Effect effect(plug);
if (effect.SetHost(NULL))
{
pm.RegisterPlugin(this, &effect);
}
return true;
errMsg = _("Could not load the library");
return false;
}
bool LV2EffectsModule::IsPluginValid(const wxString & path, bool bFast)

View File

@ -215,6 +215,7 @@ bool VampEffectsModule::RegisterPlugin(PluginManagerInterface & pm,
return true;
}
errMsg = _("Could not load the library");
return false;
}