Audacity 3.2.0
StatefulPerTrackEffect.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 StatefulPerTrackEffect.cpp
6
7 Dominic Mazzoni
8 Vaughan Johnson
9 Martyn Shaw
10
11 Paul Licameli split from PerTrackEffect.cpp
12
13*******************************************************************//*******************************************************************/
20
22
25{
26 return GetEffect()
28}
29
31{
32 return GetEffect().ProcessFinalize();
33}
34
36 const float *const *inBlock, float *const *outBlock, size_t blockLen)
37{
38 return GetEffect().ProcessBlock(settings, inBlock, outBlock, blockLen);
39}
40
42
43std::shared_ptr<EffectInstance> StatefulPerTrackEffect::MakeInstance() const
44{
45 // Cheat with const_cast to return an object that calls through to
46 // non-const methods of a stateful effect.
47 // Stateless effects should override this function and be really const
48 // correct.
49 return std::make_shared<Instance>(
50 const_cast<StatefulPerTrackEffect&>(*this));
51}
52
55{
56 // Call through to a non-virtual function
57 return PerTrackEffect::Process(instance, settings);
58}
59
61{
63 return mBlockSize;
64}
65
67{
68 return mBlockSize;
69}
70
73{
74 return true;
75}
76
78{
79 return true;
80}
ChannelName
static Settings & settings()
Definition: TrackInfo.cpp:51
Performs effect computation.
bool Process(EffectInstance &instance, EffectSettings &settings) const
bool ProcessInitialize(EffectSettings &settings, double sampleRate, ChannelNames chanMap) override
StatefulPerTrackEffect & GetEffect() const
size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override
Called for destructive effect computation.
bool ProcessFinalize() noexcept override
Base class for many of the effects in Audacity.
bool ProcessInitialize(EffectSettings &settings, double sampleRate, ChannelNames chanMap=nullptr) override
~StatefulPerTrackEffect() override
bool ProcessFinalize() noexcept override
size_t GetBlockSize() const override
size_t SetBlockSize(size_t maxBlockSize) override
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
bool Process(EffectInstance &instance, EffectSettings &settings) final
Externalized state of a plug-in.