11#ifndef __AUDACITY_WAVECLIP_SPECTRUM_CACHE__
12#define __AUDACITY_WAVECLIP_SPECTRUM_CACHE__
45 int dirty_,
double samplesPerPixel,
56 int copyBegin,
int copyEnd,
size_t numPixels,
double pixelsPerSecond);
61 double leftTrim{ .0 };
62 double rightTrim{ .0 };
65 size_t windowSize { 0 };
66 unsigned zeroPaddingFactor { 0 };
75 bool CalculateOneSpectrum(
77 const int xx,
double pixelsPerSecond,
int lowerBoundX,
int upperBoundX,
78 const std::vector<float>& gainFactors,
float* __restrict scratch,
79 float* __restrict out)
const;
110 std::unique_ptr<WaveClipListener>
Clone()
const override;
128 const
float *&spectrogram,
131 double t0 ,
double pixelsPerSecond);
135 void Erase(
size_t index) override;
static Settings & settings()
std::vector< float > freq
std::vector< sampleCount > where
std::optional< AudioSegmentSampleView > mSampleCacheHolder
SpecPxCache(size_t cacheLen)
Spectrogram settings, either for one track or as defaults.
WaveClipChannel(WaveClip &clip, size_t iChannel)
Positions or offsets within audio files need a wide type.
void MakeStereo(WaveClipListener &&other, bool aligned) override
std::vector< std::unique_ptr< SpecPxCache > > mSpecPxCaches
void SwapChannels() override
Default implementation does nothing.
bool GetSpectrogram(const WaveChannelInterval &clip, const float *&spectrogram, SpectrogramSettings &spectrogramSettings, const sampleCount *&where, size_t numPixels, double t0, double pixelsPerSecond)
static WaveClipSpectrumCache & Get(const WaveChannelInterval &clip)
~WaveClipSpectrumCache() override
std::unique_ptr< WaveClipListener > Clone() const override
void MarkChanged() noexcept override
void Erase(size_t index) override
WaveClipSpectrumCache(size_t nChannels)
void Invalidate() override
std::vector< std::unique_ptr< SpecCache > > mSpecCaches