mirror of
https://github.com/cookiengineer/audacity
synced 2025-09-17 08:40:27 +02:00
Bug 1587 - Mac: Ghost duplicate Nyquist effects after upgrade
Fix removes ghost Nyquist effects from the effects menu and generators from generate menu.
This commit is contained in:
parent
31df61f537
commit
e4260e9581
@ -91,7 +91,7 @@ public:
|
|||||||
|
|
||||||
// For modules providing an interface to other dynamically loaded plugins,
|
// For modules providing an interface to other dynamically loaded plugins,
|
||||||
// the module returns true if the plugin is still valid, otherwise false.
|
// the module returns true if the plugin is still valid, otherwise false.
|
||||||
virtual bool IsPluginValid(const wxString & path) = 0;
|
virtual bool IsPluginValid(const wxString & path, bool bFast) = 0;
|
||||||
|
|
||||||
// When appropriate, CreateInstance() will be called to instantiate the plugin.
|
// When appropriate, CreateInstance() will be called to instantiate the plugin.
|
||||||
virtual IdentInterface *CreateInstance(const wxString & path) = 0;
|
virtual IdentInterface *CreateInstance(const wxString & path) = 0;
|
||||||
|
@ -601,13 +601,14 @@ bool ModuleManager::IsProviderValid(const PluginID & WXUNUSED(providerID),
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ModuleManager::IsPluginValid(const PluginID & providerID,
|
bool ModuleManager::IsPluginValid(const PluginID & providerID,
|
||||||
const wxString & path)
|
const wxString & path,
|
||||||
|
bool bFast)
|
||||||
{
|
{
|
||||||
if (mDynModules.find(providerID) == mDynModules.end())
|
if (mDynModules.find(providerID) == mDynModules.end())
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return mDynModules[providerID]->IsPluginValid(path);
|
return mDynModules[providerID]->IsPluginValid(path, bFast);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -104,7 +104,7 @@ public:
|
|||||||
void DeleteInstance(const PluginID & provider, IdentInterface *instance);
|
void DeleteInstance(const PluginID & provider, IdentInterface *instance);
|
||||||
|
|
||||||
bool IsProviderValid(const PluginID & provider, const wxString & path);
|
bool IsProviderValid(const PluginID & provider, const wxString & path);
|
||||||
bool IsPluginValid(const PluginID & provider, const wxString & path);
|
bool IsPluginValid(const PluginID & provider, const wxString & path, bool bFast);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// I'm a singleton class
|
// I'm a singleton class
|
||||||
|
@ -1697,6 +1697,9 @@ void PluginManager::Initialize()
|
|||||||
// And finally check for updates
|
// And finally check for updates
|
||||||
#ifndef EXPERIMENTAL_EFFECT_MANAGEMENT
|
#ifndef EXPERIMENTAL_EFFECT_MANAGEMENT
|
||||||
CheckForUpdates();
|
CheckForUpdates();
|
||||||
|
#else
|
||||||
|
const bool kFast = true;
|
||||||
|
CheckForUpdates( kFast );
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2105,7 +2108,10 @@ void PluginManager::SaveGroup(wxFileConfig *pRegistry, PluginType type)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PluginManager::CheckForUpdates()
|
// If bFast is true, do not do a full check. Just check the ones
|
||||||
|
// that are quick to check. Currently (Feb 2017) just Nyquist
|
||||||
|
// and built-ins.
|
||||||
|
void PluginManager::CheckForUpdates(bool bFast)
|
||||||
{
|
{
|
||||||
// Get ModuleManager reference
|
// Get ModuleManager reference
|
||||||
ModuleManager & mm = ModuleManager::Get();
|
ModuleManager & mm = ModuleManager::Get();
|
||||||
@ -2148,9 +2154,13 @@ void PluginManager::CheckForUpdates()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugType == PluginTypeModule)
|
if ( (plugType == PluginTypeModule) )
|
||||||
{
|
{
|
||||||
if (!mm.IsProviderValid(plugID, plugPath))
|
if( bFast )
|
||||||
|
{
|
||||||
|
// Skip modules, when doing a fast refresh/check.
|
||||||
|
}
|
||||||
|
else if (!mm.IsProviderValid(plugID, plugPath))
|
||||||
{
|
{
|
||||||
plug.SetEnabled(false);
|
plug.SetEnabled(false);
|
||||||
plug.SetValid(false);
|
plug.SetValid(false);
|
||||||
@ -2178,7 +2188,7 @@ void PluginManager::CheckForUpdates()
|
|||||||
}
|
}
|
||||||
else if (plugType != PluginTypeNone && plugType != PluginTypeStub)
|
else if (plugType != PluginTypeNone && plugType != PluginTypeStub)
|
||||||
{
|
{
|
||||||
plug.SetValid(mm.IsPluginValid(plug.GetProviderID(), plugPath));
|
plug.SetValid(mm.IsPluginValid(plug.GetProviderID(), plugPath, bFast));
|
||||||
if (!plug.IsValid())
|
if (!plug.IsValid())
|
||||||
{
|
{
|
||||||
plug.SetEnabled(false);
|
plug.SetEnabled(false);
|
||||||
|
@ -254,7 +254,7 @@ public:
|
|||||||
wxString GetName(const PluginID & ID);
|
wxString GetName(const PluginID & ID);
|
||||||
IdentInterface *GetInstance(const PluginID & ID);
|
IdentInterface *GetInstance(const PluginID & ID);
|
||||||
|
|
||||||
void CheckForUpdates();
|
void CheckForUpdates(bool bFast = false);
|
||||||
|
|
||||||
bool ShowManager(wxWindow *parent, EffectType type = EffectTypeNone);
|
bool ShowManager(wxWindow *parent, EffectType type = EffectTypeNone);
|
||||||
|
|
||||||
|
@ -321,8 +321,10 @@ bool BuiltinEffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxS
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BuiltinEffectsModule::IsPluginValid(const wxString & path)
|
bool BuiltinEffectsModule::IsPluginValid(const wxString & path, bool bFast)
|
||||||
{
|
{
|
||||||
|
// bFast is unused as checking in the list is fast.
|
||||||
|
bFast;
|
||||||
return mNames.Index(path) != wxNOT_FOUND;
|
return mNames.Index(path) != wxNOT_FOUND;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ public:
|
|||||||
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
||||||
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
||||||
|
|
||||||
bool IsPluginValid(const wxString & path) override;
|
bool IsPluginValid(const wxString & path, bool bFast) override;
|
||||||
|
|
||||||
IdentInterface *CreateInstance(const wxString & path) override;
|
IdentInterface *CreateInstance(const wxString & path) override;
|
||||||
void DeleteInstance(IdentInterface *instance) override;
|
void DeleteInstance(IdentInterface *instance) override;
|
||||||
|
@ -616,8 +616,10 @@ bool VSTEffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxStrin
|
|||||||
return valid;
|
return valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VSTEffectsModule::IsPluginValid(const wxString & path)
|
bool VSTEffectsModule::IsPluginValid(const wxString & path, bool bFast)
|
||||||
{
|
{
|
||||||
|
if( bFast )
|
||||||
|
return true;
|
||||||
wxString realPath = path.BeforeFirst(wxT(';'));
|
wxString realPath = path.BeforeFirst(wxT(';'));
|
||||||
return wxFileName::FileExists(realPath) || wxFileName::DirExists(realPath);
|
return wxFileName::FileExists(realPath) || wxFileName::DirExists(realPath);
|
||||||
}
|
}
|
||||||
|
@ -389,7 +389,7 @@ public:
|
|||||||
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
||||||
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
||||||
|
|
||||||
bool IsPluginValid(const wxString & path) override;
|
bool IsPluginValid(const wxString & path, bool bFast) override;
|
||||||
|
|
||||||
IdentInterface *CreateInstance(const wxString & path) override;
|
IdentInterface *CreateInstance(const wxString & path) override;
|
||||||
void DeleteInstance(IdentInterface *instance) override;
|
void DeleteInstance(IdentInterface *instance) override;
|
||||||
|
@ -255,8 +255,10 @@ bool LadspaEffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxSt
|
|||||||
return index > 0;
|
return index > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LadspaEffectsModule::IsPluginValid(const wxString & path)
|
bool LadspaEffectsModule::IsPluginValid(const wxString & path, bool bFast)
|
||||||
{
|
{
|
||||||
|
if( bFast )
|
||||||
|
return true;
|
||||||
wxString realPath = path.BeforeFirst(wxT(';'));
|
wxString realPath = path.BeforeFirst(wxT(';'));
|
||||||
return wxFileName::FileExists(realPath);
|
return wxFileName::FileExists(realPath);
|
||||||
}
|
}
|
||||||
|
@ -226,7 +226,7 @@ public:
|
|||||||
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
||||||
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
||||||
|
|
||||||
bool IsPluginValid(const wxString & path) override;
|
bool IsPluginValid(const wxString & path, bool bFast) override;
|
||||||
|
|
||||||
IdentInterface *CreateInstance(const wxString & path) override;
|
IdentInterface *CreateInstance(const wxString & path) override;
|
||||||
void DeleteInstance(IdentInterface *instance) override;
|
void DeleteInstance(IdentInterface *instance) override;
|
||||||
|
@ -260,8 +260,10 @@ bool LV2EffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxStrin
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LV2EffectsModule::IsPluginValid(const wxString & path)
|
bool LV2EffectsModule::IsPluginValid(const wxString & path, bool bFast)
|
||||||
{
|
{
|
||||||
|
if( bFast )
|
||||||
|
return true;
|
||||||
return GetPlugin(path) != NULL;
|
return GetPlugin(path) != NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,7 +92,7 @@ public:
|
|||||||
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
||||||
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
||||||
|
|
||||||
bool IsPluginValid(const wxString & path) override;
|
bool IsPluginValid(const wxString & path, bool bFast) override;
|
||||||
|
|
||||||
IdentInterface *CreateInstance(const wxString & path) override;
|
IdentInterface *CreateInstance(const wxString & path) override;
|
||||||
void DeleteInstance(IdentInterface *instance) override;
|
void DeleteInstance(IdentInterface *instance) override;
|
||||||
|
@ -216,8 +216,11 @@ bool NyquistEffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxS
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool NyquistEffectsModule::IsPluginValid(const wxString & path)
|
bool NyquistEffectsModule::IsPluginValid(const wxString & path, bool bFast)
|
||||||
{
|
{
|
||||||
|
// Ignores bFast parameter, since checking file exists is fast enough for
|
||||||
|
// the small number of Nyquist plug-ins that we have.
|
||||||
|
bFast;
|
||||||
if (path == NYQUIST_PROMPT_ID)
|
if (path == NYQUIST_PROMPT_ID)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
|
@ -42,7 +42,7 @@ public:
|
|||||||
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
||||||
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
||||||
|
|
||||||
bool IsPluginValid(const wxString & path) override;
|
bool IsPluginValid(const wxString & path, bool bFast) override;
|
||||||
|
|
||||||
IdentInterface *CreateInstance(const wxString & path) override;
|
IdentInterface *CreateInstance(const wxString & path) override;
|
||||||
void DeleteInstance(IdentInterface *instance) override;
|
void DeleteInstance(IdentInterface *instance) override;
|
||||||
|
@ -216,10 +216,12 @@ bool VampEffectsModule::RegisterPlugin(PluginManagerInterface & pm, const wxStri
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VampEffectsModule::IsPluginValid(const wxString & path)
|
bool VampEffectsModule::IsPluginValid(const wxString & path, bool bFast)
|
||||||
{
|
{
|
||||||
int output;
|
int output;
|
||||||
bool hasParameters;
|
bool hasParameters;
|
||||||
|
if( bFast )
|
||||||
|
return true;
|
||||||
|
|
||||||
auto vp = FindPlugin(path, output, hasParameters);
|
auto vp = FindPlugin(path, output, hasParameters);
|
||||||
return bool(vp);
|
return bool(vp);
|
||||||
|
@ -46,7 +46,7 @@ public:
|
|||||||
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
wxArrayString FindPlugins(PluginManagerInterface & pm) override;
|
||||||
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
bool RegisterPlugin(PluginManagerInterface & pm, const wxString & path) override;
|
||||||
|
|
||||||
bool IsPluginValid(const wxString & path) override;
|
bool IsPluginValid(const wxString & path, bool bFast) override;
|
||||||
|
|
||||||
IdentInterface *CreateInstance(const wxString & path) override;
|
IdentInterface *CreateInstance(const wxString & path) override;
|
||||||
void DeleteInstance(IdentInterface *instance) override;
|
void DeleteInstance(IdentInterface *instance) override;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user