Audacity 3.2.0
|
#include <DistortionBase.h>
Public Member Functions | |
Instance (const PerTrackEffect &effect) | |
bool | ProcessInitialize (EffectSettings &settings, double sampleRate, ChannelNames chanMap) override |
size_t | ProcessBlock (EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override |
Called for destructive effect computation. More... | |
bool | RealtimeInitialize (EffectSettings &settings, double) override |
bool | RealtimeAddProcessor (EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate) override |
bool | RealtimeFinalize (EffectSettings &settings) noexcept override |
size_t | RealtimeProcess (size_t group, EffectSettings &settings, const float *const *inbuf, float *const *outbuf, size_t numSamples) override |
void | InstanceInit (EffectDistortionState &data, EffectSettings &settings, float sampleRate) |
size_t | InstanceProcess (EffectSettings &settings, EffectDistortionState &data, const float *const *inBlock, float *const *outBlock, size_t blockLen) |
void | MakeTable (EffectDistortionState &state, const EffectDistortionSettings &ms) |
void | HardClip (EffectDistortionState &, const EffectDistortionSettings &) |
void | SoftClip (EffectDistortionState &, const EffectDistortionSettings &) |
void | ExponentialTable (const EffectDistortionSettings &) |
void | LogarithmicTable (const EffectDistortionSettings &) |
void | HalfSinTable (const EffectDistortionSettings &) |
void | CubicTable (const EffectDistortionSettings &) |
void | EvenHarmonicTable (const EffectDistortionSettings &) |
void | SineTable (const EffectDistortionSettings &) |
void | Leveller (const EffectDistortionSettings &) |
void | Rectifier (const EffectDistortionSettings &) |
void | HardLimiter (EffectDistortionState &state, const EffectDistortionSettings &) |
void | CopyHalfTable () |
float | LogCurve (double threshold, float value, double ratio) |
double | Cubic (const EffectDistortionSettings &, double x) |
float | WaveShaper (float sample, EffectDistortionSettings &ms) |
float | DCFilter (EffectDistortionState &data, float sample) |
unsigned | GetAudioInCount () const override |
How many input buffers to allocate at once. More... | |
unsigned | GetAudioOutCount () const override |
How many output buffers to allocate at once. More... | |
Public Member Functions inherited from PerTrackEffect::Instance | |
Instance (const PerTrackEffect &processor) | |
~Instance () override | |
bool | Process (EffectSettings &settings) final |
Uses the other virtual functions of this class. More... | |
bool | ProcessInitialize (EffectSettings &settings, double sampleRate, ChannelNames chanMap) override |
bool | ProcessFinalize () noexcept override |
Public Member Functions inherited from EffectInstanceEx | |
virtual bool | Init () |
Call once to set up state for whole list of tracks to be processed. More... | |
virtual bool | Process (EffectSettings &settings)=0 |
Actually do the effect here. More... | |
~EffectInstanceEx () override | |
Public Member Functions inherited from EffectInstance | |
virtual | ~EffectInstance () |
virtual size_t | GetBlockSize () const =0 |
virtual size_t | SetBlockSize (size_t maxBlockSize)=0 |
virtual unsigned | GetAudioInCount () const =0 |
How many input buffers to allocate at once. More... | |
virtual unsigned | GetAudioOutCount () const =0 |
How many output buffers to allocate at once. More... | |
virtual bool | RealtimeInitialize (EffectSettings &settings, double sampleRate) |
virtual bool | RealtimeAddProcessor (EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate) |
virtual bool | RealtimeSuspend () |
virtual bool | RealtimeResume () |
virtual std::unique_ptr< Message > | MakeMessage () const |
Called on the main thread, in which the result may be cloned. More... | |
virtual bool | UsesMessages () const noexcept |
virtual bool | RealtimeProcessStart (MessagePackage &package) |
settings are possibly changed, since last call, by an asynchronous dialog More... | |
virtual size_t | RealtimeProcess (size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples) |
virtual void | RealtimePassThrough (size_t group, EffectSettings &settings, const float *const *inBuf, size_t numSamples) |
Called instead of RealtimeProcess when the effect is bypassed. Default implementation does nothing. More... | |
virtual bool | RealtimeProcessEnd (EffectSettings &settings) noexcept |
settings can be updated to let a dialog change appearance at idle More... | |
virtual bool | RealtimeFinalize (EffectSettings &settings) noexcept |
virtual size_t | GetTailSize () const |
virtual SampleCount | GetLatency (const EffectSettings &settings, double sampleRate) const |
virtual bool | NeedsDither () const |
virtual bool | ProcessInitialize (EffectSettings &settings, double sampleRate, ChannelNames chanMap)=0 |
virtual bool | ProcessFinalize () noexcept=0 |
virtual size_t | ProcessBlock (EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen)=0 |
Called for destructive effect computation. More... | |
Public Member Functions inherited from EffectInstanceWithBlockSize | |
~EffectInstanceWithBlockSize () override | |
size_t | GetBlockSize () const override |
size_t | SetBlockSize (size_t maxBlockSize) override |
Public Attributes | |
double | mTable [TABLESIZE] |
EffectDistortionState | mMaster |
std::vector< EffectDistortionState > | mSlaves |
Additional Inherited Members | |
Public Types inherited from EffectInstance | |
using | Message = EffectSettingsAccess::Message |
using | SampleCount = uint64_t |
Protected Attributes inherited from PerTrackEffect::Instance | |
const PerTrackEffect & | mProcessor |
Protected Attributes inherited from EffectInstanceWithBlockSize | |
size_t | mBlockSize { 0 } |
Definition at line 92 of file DistortionBase.h.
|
inlineexplicit |
Definition at line 96 of file DistortionBase.h.
void DistortionBase::Instance::CopyHalfTable | ( | ) |
Definition at line 669 of file DistortionBase.cpp.
|
inline |
Definition at line 519 of file DistortionBase.cpp.
References EffectDistortionSettings::mParam1.
void DistortionBase::Instance::CubicTable | ( | const EffectDistortionSettings & | ms | ) |
Definition at line 487 of file DistortionBase.cpp.
References min(), EffectDistortionSettings::mParam1, EffectDistortionSettings::mRepeats, staffpad::audio::simd::sqrt(), STEPS, and TABLESIZE.
float DistortionBase::Instance::DCFilter | ( | EffectDistortionState & | data, |
float | sample | ||
) |
Definition at line 711 of file DistortionBase.cpp.
References EffectDistortionState::queuesamples, EffectDistortionState::queuetotal, and EffectDistortionState::samplerate.
void DistortionBase::Instance::EvenHarmonicTable | ( | const EffectDistortionSettings & | ms | ) |
Definition at line 527 of file DistortionBase.cpp.
References anonymous_namespace{DynamicRangeProcessorEditor.cpp}::C, EffectDistortionSettings::mParam1, EffectDistortionSettings::mParam2, STEPS, and TABLESIZE.
void DistortionBase::Instance::ExponentialTable | ( | const EffectDistortionSettings & | ms | ) |
Definition at line 424 of file DistortionBase.cpp.
References DB_TO_LINEAR, min(), EffectDistortionSettings::mParam1, STEPS, and TABLESIZE.
|
overridevirtual |
How many input buffers to allocate at once.
If the instance processes channels independently, this can return 1 The result is not necessarily well defined before RealtimeInitialize
Implements EffectInstance.
Definition at line 127 of file DistortionBase.cpp.
|
overridevirtual |
How many output buffers to allocate at once.
The result is not necessarily well defined before RealtimeInitialize
Implements EffectInstance.
Definition at line 132 of file DistortionBase.cpp.
void DistortionBase::Instance::HalfSinTable | ( | const EffectDistortionSettings & | ms | ) |
Definition at line 466 of file DistortionBase.cpp.
References M_PI_2, EffectDistortionSettings::mParam1, STEPS, and TABLESIZE.
void DistortionBase::Instance::HardClip | ( | EffectDistortionState & | state, |
const EffectDistortionSettings & | ms | ||
) |
Definition at line 375 of file DistortionBase.cpp.
References DB_TO_LINEAR, EffectDistortionState::mMakeupGain, EffectDistortionSettings::mThreshold_dB, STEPS, and TABLESIZE.
void DistortionBase::Instance::HardLimiter | ( | EffectDistortionState & | state, |
const EffectDistortionSettings & | settings | ||
) |
Definition at line 658 of file DistortionBase.cpp.
References settings().
void DistortionBase::Instance::InstanceInit | ( | EffectDistortionState & | data, |
EffectSettings & | settings, | ||
float | sampleRate | ||
) |
Definition at line 218 of file DistortionBase.cpp.
References EffectDistortionState::dcblock, EffectWithSettings< EffectDistortionSettings, PerTrackEffect >::GetSettings(), EffectDistortionState::noisefloor, EffectDistortionState::param1, EffectDistortionState::param2, EffectDistortionState::queuesamples, EffectDistortionState::queuetotal, EffectDistortionState::repeats, EffectDistortionState::samplerate, anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, settings(), EffectDistortionState::skipcount, EffectDistortionState::tablechoiceindx, and EffectDistortionState::threshold.
size_t DistortionBase::Instance::InstanceProcess | ( | EffectSettings & | settings, |
EffectDistortionState & | data, | ||
const float *const * | inBlock, | ||
float *const * | outBlock, | ||
size_t | blockLen | ||
) |
Definition at line 245 of file DistortionBase.cpp.
References EffectWithSettings< EffectDistortionSettings, PerTrackEffect >::GetSettings(), DistortionBase::kCubic, DistortionBase::kEvenHarmonics, DistortionBase::kExpCurve, DistortionBase::kHalfSinCurve, DistortionBase::kHardClip, DistortionBase::kHardLimiter, DistortionBase::kLeveller, DistortionBase::kLogCurve, DistortionBase::kRectifier, DistortionBase::kSinCurve, DistortionBase::kSoftClip, EffectDistortionState::mMakeupGain, EffectDistortionState::noisefloor, EffectDistortionState::param1, EffectDistortionState::param2, EffectDistortionState::repeats, settings(), EffectDistortionState::skipcount, skipsamples, EffectDistortionState::tablechoiceindx, and EffectDistortionState::threshold.
void DistortionBase::Instance::Leveller | ( | const EffectDistortionSettings & | ms | ) |
Definition at line 567 of file DistortionBase.cpp.
References DB_TO_LINEAR, EffectDistortionSettings::mNoiseFloor, EffectDistortionSettings::mParam1, EffectDistortionSettings::mRepeats, STEPS, and TABLESIZE.
void DistortionBase::Instance::LogarithmicTable | ( | const EffectDistortionSettings & | ms | ) |
Definition at line 440 of file DistortionBase.cpp.
References EffectDistortionSettings::mParam1, STEPS, and TABLESIZE.
|
inline |
Definition at line 418 of file DistortionBase.cpp.
void DistortionBase::Instance::MakeTable | ( | EffectDistortionState & | state, |
const EffectDistortionSettings & | ms | ||
) |
Definition at line 330 of file DistortionBase.cpp.
References DistortionBase::kCubic, DistortionBase::kEvenHarmonics, DistortionBase::kExpCurve, DistortionBase::kHalfSinCurve, DistortionBase::kHardClip, DistortionBase::kHardLimiter, DistortionBase::kLeveller, DistortionBase::kLogCurve, DistortionBase::kRectifier, DistortionBase::kSinCurve, DistortionBase::kSoftClip, and EffectDistortionSettings::mTableChoiceIndx.
|
overridevirtual |
Called for destructive effect computation.
Implements EffectInstance.
Definition at line 144 of file DistortionBase.cpp.
References settings().
|
overridevirtual |
Called at start of destructive processing, for each (mono/stereo) track Default implementation does nothing, returns true
chanMap | null or array terminated with ChannelNameEOL. Do not retain the pointer |
GetAudioInCount()
and GetAudioOutCount()
are well defined Implements EffectInstance.
Definition at line 137 of file DistortionBase.cpp.
References anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, and settings().
|
overridevirtual |
Reimplemented from EffectInstance.
Definition at line 158 of file DistortionBase.cpp.
References anonymous_namespace{ClipSegmentTest.cpp}::sampleRate, and settings().
|
overridevirtualnoexcept |
Reimplemented from EffectInstance.
Definition at line 170 of file DistortionBase.cpp.
|
overridevirtual |
GetAudioInCount()
and GetAudioOutCount()
are well definedDefault implementation does nothing, returns false (so assume realtime is not supported). Other member functions related to realtime return true or zero, but will not be called, unless a derived class overrides RealtimeInitialize.
Reimplemented from EffectInstance.
Definition at line 151 of file DistortionBase.cpp.
|
overridevirtual |
Reimplemented from EffectInstance.
Definition at line 177 of file DistortionBase.cpp.
References settings().
void DistortionBase::Instance::Rectifier | ( | const EffectDistortionSettings & | ms | ) |
Definition at line 636 of file DistortionBase.cpp.
References EffectDistortionSettings::mParam1, and STEPS.
void DistortionBase::Instance::SineTable | ( | const EffectDistortionSettings & | ms | ) |
Definition at line 545 of file DistortionBase.cpp.
References M_PI, M_PI_2, EffectDistortionSettings::mParam1, STEPS, and TABLESIZE.
void DistortionBase::Instance::SoftClip | ( | EffectDistortionState & | state, |
const EffectDistortionSettings & | ms | ||
) |
Definition at line 396 of file DistortionBase.cpp.
References DB_TO_LINEAR, EffectDistortionState::mMakeupGain, EffectDistortionSettings::mParam1, EffectDistortionSettings::mThreshold_dB, STEPS, and TABLESIZE.
float DistortionBase::Instance::WaveShaper | ( | float | sample, |
EffectDistortionSettings & | ms | ||
) |
Definition at line 680 of file DistortionBase.cpp.
References DistortionBase::kHardClip, EffectDistortionSettings::mParam1, EffectDistortionSettings::mTableChoiceIndx, and STEPS.
EffectDistortionState DistortionBase::Instance::mMaster |
Definition at line 180 of file DistortionBase.h.
std::vector<EffectDistortionState> DistortionBase::Instance::mSlaves |
Definition at line 181 of file DistortionBase.h.
double DistortionBase::Instance::mTable[TABLESIZE] |
Definition at line 178 of file DistortionBase.h.