Audacity 3.2.0
StatefulEffectBase.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 StatefulEffectBase.cpp
6
7 Dominic Mazzoni
8 Vaughan Johnson
9 Martyn Shaw
10
11 Paul Licameli split from Effect.cpp
12
13**********************************************************************/
14#include "StatefulEffectBase.h"
15#include "SampleCount.h"
16
18 : mEffect{ effect }
19{
20}
21
23
25{
26 return GetEffect().Init();
27}
28
31{
32 return GetEffect().RealtimeInitialize(settings, sampleRate);
33}
34
37 EffectOutputs *pOutputs, unsigned numChannels, float sampleRate)
38{
39 return GetEffect()
40 .RealtimeAddProcessor(settings, pOutputs, numChannels, sampleRate);
41}
42
44{
45 return GetEffect().RealtimeSuspend();
46}
47
49{
50 return GetEffect().RealtimeResume();
51}
52
54 MessagePackage &package)
55{
56 return GetEffect().RealtimeProcessStart(package);
57}
58
61 const float *const *inBuf, float *const *outBuf, size_t numSamples)
62{
63 return GetEffect()
64 .RealtimeProcess(group, settings, inBuf, outBuf, numSamples);
65}
66
68{
69 return GetEffect().RealtimeProcessEnd(settings);
70}
71
73{
74 return GetEffect().RealtimeFinalize(settings);
75}
76
78{
79 return GetEffect().GetBlockSize();
80}
81
83{
84 return GetEffect().SetBlockSize(maxBlockSize);
85}
86
88{
89 return GetEffect().GetAudioInCount();
90}
91
93{
94 return GetEffect().GetAudioOutCount();
95}
96
98{
99 return GetEffect().NeedsDither();
100}
101
104{
105 return GetEffect()
106 .ProcessInitialize(settings, sampleRate, chanMap);
107}
108
110{
111 return GetEffect().ProcessFinalize();
112}
113
115{
117 return mEffectBlockSize;
118}
119
121{
122 return mEffectBlockSize;
123}
124
126{
127 return 0;
128}
129
131{
132 return 0;
133}
134
136{
137 return false;
138}
139
141 EffectOutputs *, unsigned numChannels, float sampleRate)
142{
143 return true;
144}
145
147{
148 return true;
149}
150
152{
153 return true;
154}
155
157{
158 return true;
159}
160
163 const float *const *inbuf, float *const *outbuf, size_t numSamples)
164{
165 return 0;
166}
167
169{
170 return true;
171}
172
174{
175 return false;
176}
177
179{
180 return true;
181}
182
184{
185 return 0;
186}
187
189{
190 return true;
191}
192
194 EffectSettings &, double, ChannelNames)
195{
196 return true;
197}
198
200{
201 return true;
202}
ChannelName
static Settings & settings()
Definition: TrackInfo.cpp:51
Hold values to send to effect output meters.
bool NeedsDither() const override
bool RealtimeFinalize(EffectSettings &settings) noexcept override
bool ProcessInitialize(EffectSettings &settings, double sampleRate, ChannelNames chanMap) override
bool RealtimeAddProcessor(EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate) override
bool ProcessFinalize() noexcept override
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
size_t RealtimeProcess(size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples) override
bool RealtimeProcessStart(MessagePackage &package) override
settings are possibly changed, since last call, by an asynchronous dialog
bool RealtimeInitialize(EffectSettings &settings, double sampleRate) override
unsigned GetAudioInCount() const override
How many input buffers to allocate at once.
bool Init() override
Call once to set up state for whole list of tracks to be processed.
bool RealtimeProcessEnd(EffectSettings &settings) noexcept override
settings can be updated to let a dialog change appearance at idle
size_t SetBlockSize(size_t maxBlockSize) override
size_t GetBlockSize() const override
Instance(StatefulEffectBase &effect)
virtual bool RealtimeInitialize(EffectSettings &settings, double sampleRate)
virtual bool NeedsDither() const
virtual bool ProcessFinalize() noexcept
virtual unsigned GetAudioOutCount() const
How many output buffers to allocate at once.
virtual unsigned GetAudioInCount() const
How many input buffers to allocate at once.
virtual size_t RealtimeProcess(size_t group, EffectSettings &settings, const float *const *inBuf, float *const *outBuf, size_t numSamples)
virtual bool RealtimeProcessStart(MessagePackage &package)
settings are possibly changed, since last call, by an asynchronous dialog
virtual size_t GetBlockSize() const
virtual bool RealtimeResume()
virtual size_t SetBlockSize(size_t maxBlockSize)
virtual bool RealtimeProcessEnd(EffectSettings &settings) noexcept
settings can be updated to let a dialog change appearance at idle
virtual bool RealtimeAddProcessor(EffectSettings &settings, EffectOutputs *pOutputs, unsigned numChannels, float sampleRate)
virtual bool RealtimeSuspend()
virtual sampleCount GetLatency() const
virtual bool RealtimeFinalize(EffectSettings &settings) noexcept
virtual bool ProcessInitialize(EffectSettings &settings, double sampleRate, ChannelNames chanMap=nullptr)
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:19
Externalized state of a plug-in.