Audacity 3.2.0
TrackSpectrumTransformer.h
Go to the documentation of this file.
1/*!********************************************************************
2
3Audacity: A Digital Audio Editor
4
5TrackSpectrumTransformer.h
6
7Paul Licameli
8
9**********************************************************************/
10#pragma once
11
12#include "SpectrumTransformer.h"
13
14class WaveChannel;
15class WaveTrack;
16
18class WAVE_TRACK_FFT_API TrackSpectrumTransformer /* not final */ :
20{
21public:
28 WaveChannel* pOutputTrack, bool needsOutput,
29 eWindowFunctions inWindowType, eWindowFunctions outWindowType,
30 size_t windowSize, unsigned stepsPerWindow, bool leadingPadding,
31 bool trailingPadding)
32 : SpectrumTransformer { needsOutput, inWindowType, outWindowType,
33 windowSize, stepsPerWindow, leadingPadding,
34 trailingPadding }
35 , mOutputTrack { pOutputTrack }
36 {
37 assert(!needsOutput || pOutputTrack != nullptr);
38 }
40
42 bool Process(
43 const WindowProcessor& processor, const WaveChannel& channel,
44 size_t queueLength, sampleCount start, sampleCount len);
45
47 static bool PostProcess(WaveTrack& outputTrack, sampleCount len);
48
49protected:
50 bool DoStart() override;
51 void DoOutput(const float* outBuffer, size_t mStepSize) override;
52 bool DoFinish() override;
53
54private:
56};
eWindowFunctions
Definition: FFT.h:110
A class that transforms a portion of a wave track (preserving duration) by applying Fourier transform...
std::function< bool(SpectrumTransformer &) > WindowProcessor
Type of function that transforms windows in the queue.
virtual bool DoStart()
Called before any calls to ProcessWindow.
virtual void DoOutput(const float *outBuffer, size_t mStepSize)=0
Called within ProcessSamples if output was requested.
virtual bool DoFinish()
Called after the last call to ProcessWindow().
Subclass of SpectrumTransformer that rewrites a track.
~TrackSpectrumTransformer() override
TrackSpectrumTransformer(WaveChannel *pOutputTrack, bool needsOutput, eWindowFunctions inWindowType, eWindowFunctions outWindowType, size_t windowSize, unsigned stepsPerWindow, bool leadingPadding, bool trailingPadding)
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19