Audacity 3.2.0
StatefulEffect.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 StatefulEffect.cpp
6
7 Dominic Mazzoni
8 Vaughan Johnson
9 Martyn Shaw
10
11 Paul Licameli split from Effect.cpp
12
13**********************************************************************/
14#include "StatefulEffect.h"
15#include "SampleCount.h"
16
18{
19 return GetEffect().Process(*this, settings);
20}
21
24{
25 return GetEffect().GetLatency().as_long_long();
26}
27
29 const float *const *, float *const *, size_t)
30{
31 return 0;
32}
33
35
36std::shared_ptr<EffectInstance> StatefulEffect::MakeInstance() const
37{
38 // Cheat with const-cast to return an object that calls through to
39 // non-const methods of a stateful effect.
40 // Stateless effects should override this function and be really const
41 // correct.
42 return std::make_shared<Instance>(const_cast<StatefulEffect&>(*this));
43}
static Settings & settings()
Definition: TrackInfo.cpp:51
uint64_t SampleCount
size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override
Default implementation fails (returns 0 always)
SampleCount GetLatency(const EffectSettings &settings, double sampleRate) const override
bool Process(EffectSettings &settings) override
Actually do the effect here.
StatefulEffectBase & GetEffect() const
virtual bool Process(EffectInstance &instance, EffectSettings &settings)=0
~StatefulEffect() override
std::shared_ptr< EffectInstance > MakeInstance() const override
Make an object maintaining short-term state of an Effect.
Externalized state of a plug-in.