Fix: Effects that aren't in menus now addable.

Previous code changes meant that they never got added in.
This commit is contained in:
James Crook 2015-05-15 22:20:06 +01:00
parent b9dd3e64c6
commit 1e6e251ea9
2 changed files with 10 additions and 3 deletions

View File

@ -861,8 +861,9 @@ void PluginRegistrationDialog::OnOK(wxCommandEvent & WXUNUSED(evt))
PluginManager & pm = PluginManager::Get();
ModuleManager & mm = ModuleManager::Get();
// From here on, if we register an effect we want to enable it.
pm.mbRegisterAndEnable = true;
// JKC: The following loop disables all the effects, which
// will in turn make them disappear from menus.
PluginMap::iterator iter = pm.mPlugins.begin();
@ -911,6 +912,8 @@ void PluginRegistrationDialog::OnOK(wxCommandEvent & WXUNUSED(evt))
{
if (mm.RegisterPlugin(providers[j], path))
{
plug = pm.mPlugins[path];
plug.SetEnabled( true );
break;
}
}
@ -1288,7 +1291,7 @@ const PluginID & PluginManager::RegisterPlugin(ModuleInterface *provider, Effect
plug.SetEffectRealtime(effect->SupportsRealtime());
plug.SetEffectAutomatable(effect->SupportsAutomation());
plug.SetEnabled(effect->EnableFromGetGo());
plug.SetEnabled(mbRegisterAndEnable | effect->EnableFromGetGo());
plug.SetValid(true);
return plug.GetID();
@ -1561,6 +1564,7 @@ PluginManager *PluginManager::mInstance = NULL;
PluginManager::PluginManager()
{
mSettings = NULL;
mbRegisterAndEnable = false;
}
PluginManager::~PluginManager()

View File

@ -262,6 +262,9 @@ public:
// a better solution is devised.
const PluginID & RegisterPlugin(EffectIdentInterface *effect);
public:
bool mbRegisterAndEnable;
private:
void Load();
void LoadGroup(PluginType type);