mirror of
https://github.com/cookiengineer/audacity
synced 2025-06-16 16:10:06 +02:00
Improve input precision for some effects.
This addresses some minor regressions that occurred as a consequence of the improved validation in 2.1.1.
This commit is contained in:
parent
90d03f8351
commit
aa54699cf4
@ -211,10 +211,11 @@ void EffectAmplify::PopulateOrExchange(ShuttleGui & S)
|
|||||||
|
|
||||||
S.StartVerticalLay(0);
|
S.StartVerticalLay(0);
|
||||||
{
|
{
|
||||||
|
int precission = 3;
|
||||||
// Amplitude
|
// Amplitude
|
||||||
S.StartMultiColumn(2, wxCENTER);
|
S.StartMultiColumn(2, wxCENTER);
|
||||||
{
|
{
|
||||||
FloatingPointValidator<double> vldAmp(2, &mAmp);
|
FloatingPointValidator<double> vldAmp(precission, &mAmp, NUM_VAL_ONE_TRAILING_ZERO);
|
||||||
vldAmp.SetRange(MIN_Amp, MAX_Amp);
|
vldAmp.SetRange(MIN_Amp, MAX_Amp);
|
||||||
mAmpT = S.Id(ID_Amp).AddTextBox(_("Amplification (dB):"), wxT(""), 12);
|
mAmpT = S.Id(ID_Amp).AddTextBox(_("Amplification (dB):"), wxT(""), 12);
|
||||||
mAmpT->SetValidator(vldAmp);
|
mAmpT->SetValidator(vldAmp);
|
||||||
@ -233,8 +234,7 @@ void EffectAmplify::PopulateOrExchange(ShuttleGui & S)
|
|||||||
// Peak
|
// Peak
|
||||||
S.StartMultiColumn(2, wxCENTER);
|
S.StartMultiColumn(2, wxCENTER);
|
||||||
{
|
{
|
||||||
int precission = 2;
|
FloatingPointValidator<double> vldNewPeak(precission, &mNewPeak, NUM_VAL_ONE_TRAILING_ZERO);
|
||||||
FloatingPointValidator<double> vldNewPeak(precission, &mNewPeak);
|
|
||||||
double minAmp = MIN_Amp + (20.0 * log10(mPeak));
|
double minAmp = MIN_Amp + (20.0 * log10(mPeak));
|
||||||
double maxAmp = MAX_Amp + (20.0 * log10(mPeak));
|
double maxAmp = MAX_Amp + (20.0 * log10(mPeak));
|
||||||
|
|
||||||
|
@ -44,8 +44,8 @@ enum
|
|||||||
// Define keys, defaults, minimums, and maximums for the effect parameters
|
// Define keys, defaults, minimums, and maximums for the effect parameters
|
||||||
//
|
//
|
||||||
// Name Type Key Def Min Max Scale
|
// Name Type Key Def Min Max Scale
|
||||||
Param( Bass, double, XO("Bass"), 0.0, -15.0, 15.0, 1 );
|
Param( Bass, double, XO("Bass"), 0.0, -30.0, 30.0, 1 );
|
||||||
Param( Treble, double, XO("Treble"), 0.0, -15.0, 15.0, 1 );
|
Param( Treble, double, XO("Treble"), 0.0, -30.0, 30.0, 1 );
|
||||||
Param( Level, double, XO("Level"), -1.0, -30.0, 0.0, 1 );
|
Param( Level, double, XO("Level"), -1.0, -30.0, 0.0, 1 );
|
||||||
Param( Normalize, bool, XO("Normalize"), true, false, true, 1 );
|
Param( Normalize, bool, XO("Normalize"), true, false, true, 1 );
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@
|
|||||||
//
|
//
|
||||||
// Name Type Key Def Min Max Scale
|
// Name Type Key Def Min Max Scale
|
||||||
Param( Amount, float, XO("Stretch Factor"), 10.0, 1.0, FLT_MAX, 1 );
|
Param( Amount, float, XO("Stretch Factor"), 10.0, 1.0, FLT_MAX, 1 );
|
||||||
Param( Time, float, XO("Time Resolution"), 0.25f, 0.001f, FLT_MAX, 1 );
|
Param( Time, float, XO("Time Resolution"), 0.25f, 0.00099f, FLT_MAX, 1 );
|
||||||
|
|
||||||
class PaulStretch
|
class PaulStretch
|
||||||
{
|
{
|
||||||
@ -170,7 +170,7 @@ void EffectPaulstretch::PopulateOrExchange(ShuttleGui & S)
|
|||||||
*/
|
*/
|
||||||
S.AddTextBox(_("Stretch Factor:"), wxT(""), 10)->SetValidator(vldAmount);
|
S.AddTextBox(_("Stretch Factor:"), wxT(""), 10)->SetValidator(vldAmount);
|
||||||
|
|
||||||
FloatingPointValidator<float> vldTime(1, &time_resolution);
|
FloatingPointValidator<float> vldTime(3, &time_resolution, NUM_VAL_ONE_TRAILING_ZERO);
|
||||||
vldTime.SetMin(MIN_Time);
|
vldTime.SetMin(MIN_Time);
|
||||||
S.AddTextBox(_("Time Resolution (seconds):"), wxT(""), 10)->SetValidator(vldTime);
|
S.AddTextBox(_("Time Resolution (seconds):"), wxT(""), 10)->SetValidator(vldTime);
|
||||||
}
|
}
|
||||||
|
@ -45,8 +45,8 @@ enum
|
|||||||
// Name Type Key Def Min Max Scale
|
// Name Type Key Def Min Max Scale
|
||||||
Param( Stages, int, XO("Stages"), 2, 2, NUM_STAGES, 1 );
|
Param( Stages, int, XO("Stages"), 2, 2, NUM_STAGES, 1 );
|
||||||
Param( DryWet, int, XO("DryWet"), 128, 0, 255, 1 );
|
Param( DryWet, int, XO("DryWet"), 128, 0, 255, 1 );
|
||||||
Param( Freq, double, XO("Freq"), 0.4, 0.1, 4.0, 10 );
|
Param( Freq, double, XO("Freq"), 0.4, 0.001,4.0, 10.0 );
|
||||||
Param( Phase, double, XO("Phase"), 0.0, 0.0, 359.0, 1 );
|
Param( Phase, double, XO("Phase"), 0.0, 0.0, 360.0, 1 );
|
||||||
Param( Depth, int, XO("Depth"), 100, 0, 255, 1 );
|
Param( Depth, int, XO("Depth"), 100, 0, 255, 1 );
|
||||||
Param( Feedback, int, XO("Feedback"), 0, -100, 100, 1 );
|
Param( Feedback, int, XO("Feedback"), 0, -100, 100, 1 );
|
||||||
|
|
||||||
@ -152,7 +152,7 @@ sampleCount EffectPhaser::ProcessBlock(float **inBlock, float **outBlock, sample
|
|||||||
{
|
{
|
||||||
double in = ibuf[i];
|
double in = ibuf[i];
|
||||||
|
|
||||||
double m = in + fbout * mFeedback / 100;
|
double m = in + fbout * mFeedback / 101; // Feedback must be less than 100% to avoid infinite gain.
|
||||||
|
|
||||||
if (((skipcount++) % lfoskipsamples) == 0)
|
if (((skipcount++) % lfoskipsamples) == 0)
|
||||||
{
|
{
|
||||||
@ -222,6 +222,7 @@ bool EffectPhaser::SetAutomationParameters(EffectAutomationParameters & parms)
|
|||||||
void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
|
void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
|
||||||
{
|
{
|
||||||
S.SetBorder(5);
|
S.SetBorder(5);
|
||||||
|
S.AddSpace(0, 5);
|
||||||
|
|
||||||
S.StartMultiColumn(3, wxEXPAND);
|
S.StartMultiColumn(3, wxEXPAND);
|
||||||
{
|
{
|
||||||
@ -229,7 +230,7 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
|
|||||||
|
|
||||||
IntegerValidator<int> vldStages(&mStages);
|
IntegerValidator<int> vldStages(&mStages);
|
||||||
vldStages.SetRange(MIN_Stages, MAX_Stages);
|
vldStages.SetRange(MIN_Stages, MAX_Stages);
|
||||||
mStagesT = S.Id(ID_Stages).AddTextBox(_("Stages:"), wxT(""), 12);
|
mStagesT = S.Id(ID_Stages).AddTextBox(_("Stages:"), wxT(""), 15);
|
||||||
mStagesT->SetValidator(vldStages);
|
mStagesT->SetValidator(vldStages);
|
||||||
|
|
||||||
S.SetStyle(wxSL_HORIZONTAL);
|
S.SetStyle(wxSL_HORIZONTAL);
|
||||||
@ -240,7 +241,7 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
|
|||||||
|
|
||||||
IntegerValidator<int> vldDryWet(&mDryWet);
|
IntegerValidator<int> vldDryWet(&mDryWet);
|
||||||
vldDryWet.SetRange(MIN_DryWet, MAX_DryWet);
|
vldDryWet.SetRange(MIN_DryWet, MAX_DryWet);
|
||||||
mDryWetT = S.Id(ID_DryWet).AddTextBox(_("Dry/Wet:"), wxT(""), 12);
|
mDryWetT = S.Id(ID_DryWet).AddTextBox(_("Dry/Wet:"), wxT(""), 15);
|
||||||
mDryWetT->SetValidator(vldDryWet);
|
mDryWetT->SetValidator(vldDryWet);
|
||||||
|
|
||||||
S.SetStyle(wxSL_HORIZONTAL);
|
S.SetStyle(wxSL_HORIZONTAL);
|
||||||
@ -248,19 +249,19 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
|
|||||||
mDryWetS->SetName(_("Dry Wet"));
|
mDryWetS->SetName(_("Dry Wet"));
|
||||||
mDryWetS->SetMinSize(wxSize(100, -1));
|
mDryWetS->SetMinSize(wxSize(100, -1));
|
||||||
|
|
||||||
FloatingPointValidator<double> vldFreq(1, &mFreq);
|
FloatingPointValidator<double> vldFreq(5, &mFreq, NUM_VAL_ONE_TRAILING_ZERO);
|
||||||
vldFreq.SetRange(MIN_Freq, MAX_Freq);
|
vldFreq.SetRange(MIN_Freq, MAX_Freq);
|
||||||
mFreqT = S.Id(ID_Freq).AddTextBox(_("LFO Frequency (Hz):"), wxT(""), 12);
|
mFreqT = S.Id(ID_Freq).AddTextBox(_("LFO Frequency (Hz):"), wxT(""), 15);
|
||||||
mFreqT->SetValidator(vldFreq);
|
mFreqT->SetValidator(vldFreq);
|
||||||
|
|
||||||
S.SetStyle(wxSL_HORIZONTAL);
|
S.SetStyle(wxSL_HORIZONTAL);
|
||||||
mFreqS = S.Id(ID_Freq).AddSlider(wxT(""), DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, MIN_Freq * SCL_Freq);
|
mFreqS = S.Id(ID_Freq).AddSlider(wxT(""), DEF_Freq * SCL_Freq, MAX_Freq * SCL_Freq, 0.0);
|
||||||
mFreqS ->SetName(_("LFO frequency in hertz"));
|
mFreqS ->SetName(_("LFO frequency in hertz"));
|
||||||
mFreqS ->SetMinSize(wxSize(100, -1));
|
mFreqS ->SetMinSize(wxSize(100, -1));
|
||||||
|
|
||||||
FloatingPointValidator<double> vldPhase(1, &mPhase);
|
FloatingPointValidator<double> vldPhase(1, &mPhase);
|
||||||
vldPhase.SetRange(MIN_Phase, MAX_Phase);
|
vldPhase.SetRange(MIN_Phase, MAX_Phase);
|
||||||
mPhaseT = S.Id(ID_Phase).AddTextBox(_("LFO Start Phase (deg.):"), wxT(""), 12);
|
mPhaseT = S.Id(ID_Phase).AddTextBox(_("LFO Start Phase (deg.):"), wxT(""), 15);
|
||||||
mPhaseT->SetValidator(vldPhase);
|
mPhaseT->SetValidator(vldPhase);
|
||||||
|
|
||||||
S.SetStyle(wxSL_HORIZONTAL);
|
S.SetStyle(wxSL_HORIZONTAL);
|
||||||
@ -271,7 +272,7 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
|
|||||||
|
|
||||||
IntegerValidator<int> vldDepth(&mDepth);
|
IntegerValidator<int> vldDepth(&mDepth);
|
||||||
vldDepth.SetRange(MIN_Depth, MAX_Depth);
|
vldDepth.SetRange(MIN_Depth, MAX_Depth);
|
||||||
mDepthT = S.Id(ID_Depth).AddTextBox(_("Depth:"), wxT(""), 12);
|
mDepthT = S.Id(ID_Depth).AddTextBox(_("Depth:"), wxT(""), 15);
|
||||||
mDepthT->SetValidator(vldDepth);
|
mDepthT->SetValidator(vldDepth);
|
||||||
|
|
||||||
S.SetStyle(wxSL_HORIZONTAL);
|
S.SetStyle(wxSL_HORIZONTAL);
|
||||||
@ -281,7 +282,7 @@ void EffectPhaser::PopulateOrExchange(ShuttleGui & S)
|
|||||||
|
|
||||||
IntegerValidator<int> vldFeedback(&mFeedback);
|
IntegerValidator<int> vldFeedback(&mFeedback);
|
||||||
vldFeedback.SetRange(MIN_Feedback, MAX_Feedback);
|
vldFeedback.SetRange(MIN_Feedback, MAX_Feedback);
|
||||||
mFeedbackT = S.Id(ID_Feedback).AddTextBox(_("Feedback (%):"), wxT(""), 12);
|
mFeedbackT = S.Id(ID_Feedback).AddTextBox(_("Feedback (%):"), wxT(""), 15);
|
||||||
mFeedbackT->SetValidator(vldFeedback);
|
mFeedbackT->SetValidator(vldFeedback);
|
||||||
|
|
||||||
S.SetStyle(wxSL_HORIZONTAL);
|
S.SetStyle(wxSL_HORIZONTAL);
|
||||||
@ -331,7 +332,6 @@ bool EffectPhaser::TransferDataFromWindow()
|
|||||||
void EffectPhaser::OnStagesSlider(wxCommandEvent & evt)
|
void EffectPhaser::OnStagesSlider(wxCommandEvent & evt)
|
||||||
{
|
{
|
||||||
mStages = (evt.GetInt() / SCL_Stages) & ~1; // must be even;
|
mStages = (evt.GetInt() / SCL_Stages) & ~1; // must be even;
|
||||||
mPhaseS->SetValue(mStages * SCL_Stages);
|
|
||||||
mStagesT->GetValidator()->TransferToWindow();
|
mStagesT->GetValidator()->TransferToWindow();
|
||||||
EnableApply(mUIParent->Validate());
|
EnableApply(mUIParent->Validate());
|
||||||
}
|
}
|
||||||
@ -346,6 +346,7 @@ void EffectPhaser::OnDryWetSlider(wxCommandEvent & evt)
|
|||||||
void EffectPhaser::OnFreqSlider(wxCommandEvent & evt)
|
void EffectPhaser::OnFreqSlider(wxCommandEvent & evt)
|
||||||
{
|
{
|
||||||
mFreq = (double) evt.GetInt() / SCL_Freq;
|
mFreq = (double) evt.GetInt() / SCL_Freq;
|
||||||
|
if (mFreq < MIN_Freq) mFreq = MIN_Freq;
|
||||||
mFreqT->GetValidator()->TransferToWindow();
|
mFreqT->GetValidator()->TransferToWindow();
|
||||||
EnableApply(mUIParent->Validate());
|
EnableApply(mUIParent->Validate());
|
||||||
}
|
}
|
||||||
|
@ -217,7 +217,7 @@ void EffectWahwah::PopulateOrExchange(ShuttleGui & S)
|
|||||||
{
|
{
|
||||||
S.SetStretchyCol(2);
|
S.SetStretchyCol(2);
|
||||||
|
|
||||||
FloatingPointValidator<double> vldfreq(1, &mFreq);
|
FloatingPointValidator<double> vldfreq(5, &mFreq, NUM_VAL_ONE_TRAILING_ZERO);
|
||||||
vldfreq.SetRange(MIN_Freq, MAX_Freq);
|
vldfreq.SetRange(MIN_Freq, MAX_Freq);
|
||||||
mFreqT = S.Id(ID_Freq).AddTextBox(_("LFO Frequency (Hz):"), wxT(""), 12);
|
mFreqT = S.Id(ID_Freq).AddTextBox(_("LFO Frequency (Hz):"), wxT(""), 12);
|
||||||
mFreqT->SetValidator(vldfreq);
|
mFreqT->SetValidator(vldfreq);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user