Fewer calls to Effect::FindProject when only rate is needed

This commit is contained in:
Paul Licameli 2020-01-07 14:28:48 -05:00
parent 314ede2137
commit 4385326e9d
3 changed files with 5 additions and 7 deletions

View File

@ -98,7 +98,6 @@
#include "../FFT.h"
#include "../Prefs.h"
#include "../Project.h"
#include "../ProjectSettings.h"
#include "../TrackArtist.h"
#include "../WaveClip.h"
#include "../ViewInfo.h"
@ -739,7 +738,7 @@ void EffectEqualization::PopulateOrExchange(ShuttleGui & S)
mHiFreq =
(t
? t->GetRate()
: ProjectSettings::Get( *FindProject() ).GetRate())
: mProjectRate)
/ 2.0;
mLoFreq = loFreqI;

View File

@ -56,7 +56,6 @@ a graph for EffectScienFilter.
#include "../PlatformCompatibility.h"
#include "../Prefs.h"
#include "../Project.h"
#include "../ProjectSettings.h"
#include "../Shuttle.h"
#include "../ShuttleGui.h"
#include "../WaveTrack.h"
@ -334,7 +333,7 @@ bool EffectScienFilter::Init()
mNyquist =
(t
? t->GetRate()
: ProjectSettings::Get( *FindProject() ).GetRate())
: mProjectRate)
/ 2.0;
}

View File

@ -373,7 +373,7 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S)
6, &mFrequency[0],
NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_StartFreq,
ProjectSettings::Get( *FindProject() ).GetRate() / 2.0
mProjectRate / 2.0
)
.AddTextBox( {}, wxT(""), 12);
}
@ -386,7 +386,7 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S)
6, &mFrequency[1],
NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_EndFreq,
ProjectSettings::Get( *FindProject() ).GetRate() / 2.0
mProjectRate / 2.0
)
.AddTextBox( {}, wxT(""), 12);
}
@ -430,7 +430,7 @@ void EffectToneGen::PopulateOrExchange(ShuttleGui & S)
t = S.Validator<FloatingPointValidator<double>>(
6, &mFrequency[0], NumValidatorStyle::NO_TRAILING_ZEROES,
MIN_Frequency,
ProjectSettings::Get( *FindProject() ).GetRate() / 2.0
mProjectRate / 2.0
)
.AddTextBox(XO("Frequency (Hz):"), wxT(""), 12);