remove unused EXPERIMENTAL_FFT_Y_GRID code

Signed-off-by: Hailey Somerville <hailey@hails.org>
This commit is contained in:
Hailey Somerville
2025-06-29 20:58:02 +10:00
committed by Avery King
parent b340835d4f
commit be1fd954c1
6 changed files with 0 additions and 75 deletions

View File

@@ -59,11 +59,6 @@ IntSetting SpectrumRange{
L"/Spectrum/Range", 80 };
IntSetting SpectrumZeroPaddingFactor{
L"/Spectrum/ZeroPaddingFactor", 2 };
#ifdef EXPERIMENTAL_FFT_Y_GRID
BoolSetting SpectrumYGrid{
L"/Spectrum/FFTYGrid", false};
#endif
}
SpectrogramSettings::Globals::Globals()
@@ -147,9 +142,6 @@ SpectrogramSettings::SpectrogramSettings(const SpectrogramSettings &other)
, spectralSelection(other.spectralSelection)
#endif
, algorithm(other.algorithm)
#ifdef EXPERIMENTAL_FFT_Y_GRID
, fftYGrid(other.fftYGrid)
#endif
// Do not copy these!
, hFFT{}
@@ -176,9 +168,6 @@ SpectrogramSettings &SpectrogramSettings::operator= (const SpectrogramSettings &
spectralSelection = other.spectralSelection;
#endif
algorithm = other.algorithm;
#ifdef EXPERIMENTAL_FFT_Y_GRID
fftYGrid = other.fftYGrid;
#endif
// Invalidate the caches
DestroyWindows();
@@ -362,10 +351,6 @@ void SpectrogramSettings::LoadPrefs()
algorithm = static_cast<Algorithm>(SpectrumAlgorithm.Read());
#ifdef EXPERIMENTAL_FFT_Y_GRID
fftYGrid = SpectrumYGrid.Read();
#endif //EXPERIMENTAL_FFT_Y_GRID
// Enforce legal values
Validate(true);
@@ -400,10 +385,6 @@ void SpectrogramSettings::SavePrefs()
#endif
SpectrumAlgorithm.Write(static_cast<int>(algorithm));
#ifdef EXPERIMENTAL_FFT_Y_GRID
SpectrumYGrid.Write(fftYGrid);
#endif //EXPERIMENTAL_FFT_Y_GRID
}
// This is a temporary hack until SpectrogramSettings gets fully integrated
@@ -448,11 +429,6 @@ void SpectrogramSettings::UpdatePrefs()
if (algorithm == defaults().algorithm)
algorithm = static_cast<Algorithm>(SpectrumAlgorithm.Read());
#ifdef EXPERIMENTAL_FFT_Y_GRID
if (fftYGrid == defaults().fftYGrid)
fftYGrid = SpectrumYGrid.Read();
#endif //EXPERIMENTAL_FFT_Y_GRID
// Enforce legal values
Validate(true);
}

View File

@@ -182,10 +182,6 @@ public:
};
Algorithm algorithm;
#ifdef EXPERIMENTAL_FFT_Y_GRID
bool fftYGrid;
#endif //EXPERIMENTAL_FFT_Y_GRID
// Following fields are derived from preferences.
// Variables used for computing the spectrum

View File

@@ -49,10 +49,6 @@ set( EXPERIMENTAL_OPTIONS_LIST
#RIGHT_ALIGNED_TEXTBOXES
#VOICE_DETECTION
# AM, 22.Nov 2007:
# A Frequency Grid for the Spectrum Log(f) & Find Notes modes
#FFT_Y_GRID
# Andy Coder, 03.Mar 2009:
# Allow keyboard seeking before initial playback position
#SEEK_BEHIND_CURSOR

View File

@@ -100,10 +100,6 @@ public:
wxBrush beatStrongSelBrush[2];
wxBrush beatWeakSelBrush[2];
#ifdef EXPERIMENTAL_FFT_Y_GRID
bool fftYGridOld;
#endif //EXPERIMENTAL_FFT_Y_GRID
const SelectedRegion *pSelectedRegion{};
ZoomInfo *pZoomInfo{};
const PendingTracks *pPendingTracks{};

View File

@@ -276,10 +276,6 @@ void SpectrumPrefs::PopulateOrExchange(ShuttleGui & S)
mTempSettings.spectralSelection);
#endif
#ifdef EXPERIMENTAL_FFT_Y_GRID
S.TieCheckBox(XO("Show a grid along the &Y-axis"),
mTempSettings.fftYGrid);
#endif //EXPERIMENTAL_FFT_Y_GRID
#ifdef SPECTRAL_SELECTION_GLOBAL_SWITCH
S.StartStatic(XO("Global settings"));

View File

@@ -399,10 +399,6 @@ void DrawClipSpectrum(TrackPanelDrawingContext &context,
const int &range = settings.range;
const int &gain = settings.gain;
#ifdef EXPERIMENTAL_FFT_Y_GRID
const bool &fftYGrid = settings.fftYGrid;
#endif
dc.SetPen(*wxTRANSPARENT_PEN);
// We draw directly to a bit image in memory,
@@ -451,27 +447,6 @@ void DrawClipSpectrum(TrackPanelDrawingContext &context,
bins[yy] = nextBin;
}
#ifdef EXPERIMENTAL_FFT_Y_GRID
const float
log2 = logf(2.0f),
scale2 = (lmax - lmin) / log2,
lmin2 = lmin / log2;
ArrayOf<bool> yGrid{size_t(mid.height)};
for (int yy = 0; yy < mid.height; ++yy) {
float n = (float(yy) / mid.height*scale2 - lmin2) * 12;
float n2 = (float(yy + 1) / mid.height*scale2 - lmin2) * 12;
float f = float(minFreq) / (fftSkipPoints + 1)*powf(2.0f, n / 12.0f + lmin2);
float f2 = float(minFreq) / (fftSkipPoints + 1)*powf(2.0f, n2 / 12.0f + lmin2);
n = logf(f / 440) / log2 * 12;
n2 = logf(f2 / 440) / log2 * 12;
if (floor(n) < floor(n2))
yGrid[yy] = true;
else
yGrid[yy] = false;
}
#endif //EXPERIMENTAL_FFT_Y_GRID
auto &clipCache = WaveClipSpectrumCache::Get(clip);
auto &specPxCache = clipCache.mSpecPxCaches[clip.GetChannelIndex()];
if (!updated && specPxCache &&
@@ -481,9 +456,6 @@ void DrawClipSpectrum(TrackPanelDrawingContext &context,
&& range == specPxCache->range
&& minFreq == specPxCache->minFreq
&& maxFreq == specPxCache->maxFreq
#ifdef EXPERIMENTAL_FFT_Y_GRID
&& fftYGrid==fftYGridOld
#endif //EXPERIMENTAL_FFT_Y_GRID
) {
// Wave clip's spectrum cache is up to date,
// and so is the spectrum pixel cache
@@ -636,13 +608,6 @@ void DrawClipSpectrum(TrackPanelDrawingContext &context,
unsigned char rv, gv, bv;
GetColorGradient(value, selected, colorScheme, &rv, &gv, &bv);
#ifdef EXPERIMENTAL_FFT_Y_GRID
if (fftYGrid && yGrid[yy]) {
rv /= 1.1f;
gv /= 1.1f;
bv /= 1.1f;
}
#endif //EXPERIMENTAL_FFT_Y_GRID
int px = ((mid.height - 1 - yy) * mid.width + xx);
#ifdef EXPERIMENTAL_SPECTROGRAM_OVERLAY
// More transparent the closer to zero intensity.