Fix a few things with chain/effect parameters as reported by Gale

This commit is contained in:
Leland Lucius 2015-04-29 09:54:48 -05:00
parent 7950d4fd5a
commit 20fbb163d2
3 changed files with 30 additions and 2 deletions

View File

@ -349,7 +349,16 @@ wxString BatchCommands::PromptForPresetFor(const wxString & command, const wxStr
return wxEmptyString; // effect not found.
}
return EffectManager::Get().GetPreset(ID, params, parent);
wxString preset = EffectManager::Get().GetPreset(ID, params, parent);
// Preset will be empty if the user cancelled the dialog, so return the original
// parameter value.
if (preset.IsEmpty())
{
return params;
}
return preset;
}
double BatchCommands::GetEndTime()

View File

@ -2289,7 +2289,19 @@ wxFileConfig *PluginManager::GetSettings()
bool PluginManager::HasGroup(const wxString & group)
{
return GetSettings()->HasGroup(group);
wxFileConfig *settings = GetSettings();
bool res = settings->HasGroup(group);
if (res)
{
// The group exists, but empty groups aren't considered valid
wxString oldPath = settings->GetPath();
settings->SetPath(group);
res = settings->GetNumberOfEntries() || settings->GetNumberOfGroups();
settings->SetPath(oldPath);
}
return res;
}
bool PluginManager::GetSubgroups(const wxString & group, wxArrayString & subgroups)

View File

@ -168,6 +168,13 @@ wxString EffectManager::GetEffectParameters(const PluginID & ID)
effect->GetAutomationParameters(parms);
// Some effects don't have automatable parameters and will not return
// anything, so try to get the active preset (current or factory).
if (parms.IsEmpty())
{
parms = GetDefaultPreset(ID);
}
return parms;
}