1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-08-01 08:29:27 +02:00

Fix HighPass and LowPass effects based on Peter's feedback

This commit is contained in:
Leland Lucius 2015-04-23 07:23:24 -05:00
parent 9aa8885d9b
commit 71cb68b798

View File

@ -260,7 +260,12 @@ bool NyquistEffect::GetAutomationParameters(EffectAutomationParameters & parms)
} }
else if (ctrl.type == NYQ_CTRL_CHOICE) else if (ctrl.type == NYQ_CTRL_CHOICE)
{ {
parms.WriteEnum(ctrl.var, (int) d, wxStringTokenize(ctrl.label, wxT(","))); wxArrayString choices = wxStringTokenize(ctrl.label, wxT(","));
for (size_t i = 0, cnt = choices.GetCount();i < cnt; i++)
{
choices[i] = choices[i].Trim(true).Trim(false);
}
parms.WriteEnum(ctrl.var, (int) d, choices);
} }
else if (ctrl.type == NYQ_CTRL_STRING) else if (ctrl.type == NYQ_CTRL_STRING)
{ {
@ -309,7 +314,12 @@ bool NyquistEffect::SetAutomationParameters(EffectAutomationParameters & parms)
else if (ctrl.type == NYQ_CTRL_CHOICE) else if (ctrl.type == NYQ_CTRL_CHOICE)
{ {
int val; int val;
good = parms.ReadEnum(ctrl.var, &val, wxStringTokenize(ctrl.label, wxT(","))) && wxArrayString choices = wxStringTokenize(ctrl.label, wxT(","));
for (size_t i = 0, cnt = choices.GetCount();i < cnt; i++)
{
choices[i] = choices[i].Trim(true).Trim(false);
}
good = parms.ReadEnum(ctrl.var, &val, choices) &&
val != wxNOT_FOUND; val != wxNOT_FOUND;
} }
else if (ctrl.type == NYQ_CTRL_STRING) else if (ctrl.type == NYQ_CTRL_STRING)
@ -348,7 +358,12 @@ bool NyquistEffect::SetAutomationParameters(EffectAutomationParameters & parms)
else if (ctrl.type == NYQ_CTRL_CHOICE) else if (ctrl.type == NYQ_CTRL_CHOICE)
{ {
int val; int val;
parms.ReadEnum(ctrl.var, &val, wxStringTokenize(ctrl.label, wxT(","))); wxArrayString choices = wxStringTokenize(ctrl.label, wxT(","));
for (size_t i = 0, cnt = choices.GetCount();i < cnt; i++)
{
choices[i] = choices[i].Trim(true).Trim(false);
}
parms.ReadEnum(ctrl.var, &val, choices);
ctrl.val = (double) val; ctrl.val = (double) val;
} }
else if (ctrl.type == NYQ_CTRL_STRING) else if (ctrl.type == NYQ_CTRL_STRING)