mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-03 09:29:30 +02:00
Fix crash when certain effects are open and a new project window is created
This affected VST, LADSPA, LV2, and Audio Unit effects.
This commit is contained in:
parent
0d89483df7
commit
a7203c5d3f
@ -2190,6 +2190,8 @@ const PluginDescriptor *PluginManager::GetNextPlugin(PluginType type)
|
|||||||
|
|
||||||
const PluginDescriptor *PluginManager::GetFirstPluginForEffectType(EffectType type)
|
const PluginDescriptor *PluginManager::GetFirstPluginForEffectType(EffectType type)
|
||||||
{
|
{
|
||||||
|
EffectManager & em = EffectManager::Get();
|
||||||
|
|
||||||
for (mPluginsIter = mPlugins.begin(); mPluginsIter != mPlugins.end(); ++mPluginsIter)
|
for (mPluginsIter = mPlugins.begin(); mPluginsIter != mPlugins.end(); ++mPluginsIter)
|
||||||
{
|
{
|
||||||
PluginDescriptor & plug = mPluginsIter->second;
|
PluginDescriptor & plug = mPluginsIter->second;
|
||||||
@ -2198,7 +2200,7 @@ const PluginDescriptor *PluginManager::GetFirstPluginForEffectType(EffectType ty
|
|||||||
gPrefs->Read(plug.GetEffectFamily() + wxT("/Enable"), &familyEnabled, true);
|
gPrefs->Read(plug.GetEffectFamily() + wxT("/Enable"), &familyEnabled, true);
|
||||||
if (plug.IsValid() && plug.IsEnabled() && plug.GetEffectType() == type && familyEnabled)
|
if (plug.IsValid() && plug.IsEnabled() && plug.GetEffectType() == type && familyEnabled)
|
||||||
{
|
{
|
||||||
if (plug.IsInstantiated() && ((Effect *)plug.GetInstance())->IsHidden())
|
if (plug.IsInstantiated() && em.IsHidden(plug.GetID()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -2212,6 +2214,8 @@ const PluginDescriptor *PluginManager::GetFirstPluginForEffectType(EffectType ty
|
|||||||
|
|
||||||
const PluginDescriptor *PluginManager::GetNextPluginForEffectType(EffectType type)
|
const PluginDescriptor *PluginManager::GetNextPluginForEffectType(EffectType type)
|
||||||
{
|
{
|
||||||
|
EffectManager & em = EffectManager::Get();
|
||||||
|
|
||||||
while (++mPluginsIter != mPlugins.end())
|
while (++mPluginsIter != mPlugins.end())
|
||||||
{
|
{
|
||||||
PluginDescriptor & plug = mPluginsIter->second;
|
PluginDescriptor & plug = mPluginsIter->second;
|
||||||
@ -2219,7 +2223,7 @@ const PluginDescriptor *PluginManager::GetNextPluginForEffectType(EffectType typ
|
|||||||
gPrefs->Read(plug.GetEffectFamily() + wxT("/Enable"), &familyEnabled, true);
|
gPrefs->Read(plug.GetEffectFamily() + wxT("/Enable"), &familyEnabled, true);
|
||||||
if (plug.IsValid() && plug.IsEnabled() && plug.GetEffectType() == type && familyEnabled)
|
if (plug.IsValid() && plug.IsEnabled() && plug.GetEffectType() == type && familyEnabled)
|
||||||
{
|
{
|
||||||
if (plug.IsInstantiated() && ((Effect *)plug.GetInstance())->IsHidden())
|
if (plug.IsInstantiated() && em.IsHidden(plug.GetID()))
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -147,6 +147,18 @@ wxString EffectManager::GetEffectDescription(const PluginID & ID)
|
|||||||
return wxEmptyString;
|
return wxEmptyString;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool EffectManager::IsHidden(const PluginID & ID)
|
||||||
|
{
|
||||||
|
Effect *effect = GetEffect(ID);
|
||||||
|
|
||||||
|
if (effect)
|
||||||
|
{
|
||||||
|
return effect->IsHidden();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
bool EffectManager::SupportsAutomation(const PluginID & ID)
|
bool EffectManager::SupportsAutomation(const PluginID & ID)
|
||||||
{
|
{
|
||||||
const PluginDescriptor *plug = PluginManager::Get().GetPlugin(ID);
|
const PluginDescriptor *plug = PluginManager::Get().GetPlugin(ID);
|
||||||
|
@ -76,6 +76,7 @@ public:
|
|||||||
wxString GetEffectName(const PluginID & ID);
|
wxString GetEffectName(const PluginID & ID);
|
||||||
wxString GetEffectIdentifier(const PluginID & ID);
|
wxString GetEffectIdentifier(const PluginID & ID);
|
||||||
wxString GetEffectDescription(const PluginID & ID);
|
wxString GetEffectDescription(const PluginID & ID);
|
||||||
|
bool IsHidden(const PluginID & ID);
|
||||||
|
|
||||||
/** Support for batch commands */
|
/** Support for batch commands */
|
||||||
bool SupportsAutomation(const PluginID & ID);
|
bool SupportsAutomation(const PluginID & ID);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user