mirror of
https://github.com/cookiengineer/audacity
synced 2026-03-05 06:01:04 +01:00
Redo type HFFT as a smart pointer, remove malloc and free
This commit is contained in:
@@ -348,10 +348,7 @@ SpectrogramSettings::~SpectrogramSettings()
|
||||
|
||||
void SpectrogramSettings::DestroyWindows()
|
||||
{
|
||||
if (hFFT != NULL) {
|
||||
EndFFT(hFFT);
|
||||
hFFT = NULL;
|
||||
}
|
||||
hFFT.reset();
|
||||
window.reset();
|
||||
dWindow.reset();
|
||||
tWindow.reset();
|
||||
@@ -420,9 +417,7 @@ void SpectrogramSettings::CacheWindows() const
|
||||
const auto fftLen = WindowSize() * ZeroPaddingFactor();
|
||||
const auto padding = (WindowSize() * (zeroPaddingFactor - 1)) / 2;
|
||||
|
||||
if (hFFT != NULL)
|
||||
EndFFT(hFFT);
|
||||
hFFT = InitializeFFT(fftLen);
|
||||
hFFT = GetFFT(fftLen);
|
||||
RecreateWindow(window, WINDOW, fftLen, padding, windowType, windowSize, scale);
|
||||
if (algorithm == algReassignment) {
|
||||
RecreateWindow(tWindow, TWINDOW, fftLen, padding, windowType, windowSize, scale);
|
||||
|
||||
@@ -13,6 +13,7 @@ Paul Licameli
|
||||
|
||||
#include "../Experimental.h"
|
||||
#include "../SampleFormat.h"
|
||||
#include "../RealFFTf.h"
|
||||
|
||||
#undef SPECTRAL_SELECTION_GLOBAL_SWITCH
|
||||
|
||||
@@ -153,7 +154,7 @@ public:
|
||||
// Following fields are derived from preferences.
|
||||
|
||||
// Variables used for computing the spectrum
|
||||
mutable FFTParam *hFFT{};
|
||||
mutable HFFT hFFT;
|
||||
mutable Floats window;
|
||||
|
||||
// Two other windows for computing reassigned spectrogram
|
||||
|
||||
Reference in New Issue
Block a user