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#include "ShuttleGui.h"
17#include <wx/sizer.h>
18
20{
21 return GetEffect().Process(*this, settings);
22}
23
26{
27 return GetEffect().GetLatency().as_long_long();
28}
29
31 const float *const *, float *const *, size_t)
32{
33 return 0;
34}
35
37
38std::shared_ptr<EffectInstance> StatefulEffect::MakeInstance() const
39{
40 // Cheat with const-cast to return an object that calls through to
41 // non-const methods of a stateful effect.
42 // Stateless effects should override this function and be really const
43 // correct.
44 return std::make_shared<Instance>(const_cast<StatefulEffect&>(*this));
45}
static Settings & settings()
Definition: TrackInfo.cpp:69
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.