Audacity 3.2.0
|
Subclass of SpectrumTransformer that rewrites a track. More...
#include <TrackSpectrumTransformer.h>
Public Member Functions | |
TrackSpectrumTransformer (WaveChannel *pOutputTrack, bool needsOutput, eWindowFunctions inWindowType, eWindowFunctions outWindowType, size_t windowSize, unsigned stepsPerWindow, bool leadingPadding, bool trailingPadding) | |
~TrackSpectrumTransformer () override | |
bool | Process (const WindowProcessor &processor, const WaveChannel &channel, size_t queueLength, sampleCount start, sampleCount len) |
Invokes Start(), ProcessSamples(), and Finish() More... | |
Public Member Functions inherited from SpectrumTransformer | |
SpectrumTransformer (bool needsOutput, eWindowFunctions inWindowType, eWindowFunctions outWindowType, size_t windowSize, unsigned stepsPerWindow, bool leadingPadding, bool trailingPadding) | |
virtual | ~SpectrumTransformer () |
bool | NeedsOutput () const |
bool | Start (size_t queueLength) |
Call once before a sequence of calls to ProcessSamples; Invokes DoStart. More... | |
bool | ProcessSamples (const WindowProcessor &processor, const float *buffer, size_t len) |
Call multiple times. More... | |
bool | Finish (const WindowProcessor &processor) |
virtual std::unique_ptr< Window > | NewWindow (size_t windowSize) |
Allocates a window to place in the queue. More... | |
virtual bool | DoStart () |
Called before any calls to ProcessWindow. More... | |
virtual void | DoOutput (const float *outBuffer, size_t mStepSize)=0 |
Called within ProcessSamples if output was requested. More... | |
virtual bool | DoFinish () |
Called after the last call to ProcessWindow(). More... | |
size_t | TotalQueueSize () const |
Useful functions to implement WindowProcesser: More... | |
size_t | CurrentQueueSize () const |
How many windows in the queue have been filled? More... | |
bool | QueueIsFull () const |
Window & | Nth (int n) |
Access the queue, so you can inspect and modify any window in it. More... | |
Window & | Newest () |
Window & | Latest () |
Static Public Member Functions | |
static bool | PostProcess (WaveTrack &outputTrack, sampleCount len) |
Final flush and trimming of tail samples. More... | |
Protected Member Functions | |
bool | DoStart () override |
Called before any calls to ProcessWindow. More... | |
void | DoOutput (const float *outBuffer, size_t mStepSize) override |
bool | DoFinish () override |
Called after the last call to ProcessWindow(). More... | |
Private Attributes | |
WaveChannel *const | mOutputTrack |
Additional Inherited Members | |
Public Types inherited from SpectrumTransformer | |
using | FloatVector = std::vector< float > |
using | WindowProcessor = std::function< bool(SpectrumTransformer &) > |
Type of function that transforms windows in the queue. More... | |
Protected Attributes inherited from SpectrumTransformer | |
const size_t | mWindowSize |
const size_t | mSpectrumSize |
const unsigned | mStepsPerWindow |
const size_t | mStepSize |
const bool | mLeadingPadding |
const bool | mTrailingPadding |
Subclass of SpectrumTransformer that rewrites a track.
Definition at line 18 of file TrackSpectrumTransformer.h.
|
inline |
!(inWindowType == eWinFuncRectangular && outWindowType eWinFuncRectangular)
windowSize % stepsPerWindow == 0
windowSize
is a power of 2 !needsOutput || pOutputTrack != nullptr
Definition at line 27 of file TrackSpectrumTransformer.h.
|
overridedefault |
|
overrideprotectedvirtual |
Called after the last call to ProcessWindow().
Reimplemented from SpectrumTransformer.
Definition at line 51 of file TrackSpectrumTransformer.cpp.
References SpectrumTransformer::DoFinish().
Referenced by MyTransformer::DoFinish(), and SpectralDataManager::Worker::DoFinish().
|
overrideprotectedvirtual |
Audacity: A Digital Audio Editor
Paul Licameli
Implements SpectrumTransformer.
Definition at line 14 of file TrackSpectrumTransformer.cpp.
References WaveChannel::Append(), floatSample, mOutputTrack, and SpectrumTransformer::mStepSize.
|
overrideprotectedvirtual |
Called before any calls to ProcessWindow.
More queue initializations can be done here.
Reimplemented from SpectrumTransformer.
Definition at line 69 of file TrackSpectrumTransformer.cpp.
References SpectrumTransformer::DoStart().
Referenced by MyTransformer::DoStart(), and SpectralDataManager::Worker::DoStart().
|
static |
Final flush and trimming of tail samples.
Definition at line 56 of file TrackSpectrumTransformer.cpp.
References WaveTrack::Clear(), WaveTrack::Flush(), WaveTrack::GetEndTime(), and WideSampleSequence::LongSamplesToTime().
Referenced by NoiseReductionBase::Worker::Process(), and SpectralDataManager::ProcessTracks().
bool TrackSpectrumTransformer::Process | ( | const WindowProcessor & | processor, |
const WaveChannel & | channel, | ||
size_t | queueLength, | ||
sampleCount | start, | ||
sampleCount | len | ||
) |
Invokes Start(), ProcessSamples(), and Finish()
Definition at line 20 of file TrackSpectrumTransformer.cpp.
References SpectrumTransformer::Finish(), WaveChannel::GetBestBlockSize(), WaveChannel::GetFloats(), WaveChannel::GetMaxBlockSize(), limitSampleBufferSize(), min(), SpectrumTransformer::ProcessSamples(), and SpectrumTransformer::Start().
Referenced by SpectralDataManager::Worker::Process(), SpectralDataManager::Worker::ProcessOvertones(), and SpectralDataManager::Worker::ProcessSnapping().
|
private |
Definition at line 55 of file TrackSpectrumTransformer.h.
Referenced by DoOutput().