Audacity 3.2.0
PerTrackEffect.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 PerTrackEffect.h
6
7 Dominic Mazzoni
8 Vaughan Johnson
9
10 Paul Licameli split from Effect.h
11
12**********************************************************************/
13
14#ifndef __AUDACITY_PER_TRACK_EFFECT__
15#define __AUDACITY_PER_TRACK_EFFECT__
16
17#include "Effect.h" // to inherit
18#include "MemoryX.h"
19
21
24
32 : public Effect
33{
34public:
35 ~PerTrackEffect() override;
36
37 class AUDACITY_DLL_API Instance : public virtual EffectInstance {
38 public:
39 explicit Instance(const PerTrackEffect &processor)
40 : mProcessor{ processor }
41 {}
42 ~Instance() override;
43
45 bool Process(EffectSettings &settings) final;
46
49 virtual bool ProcessInitialize(EffectSettings &settings,
50 sampleCount totalLen, ChannelNames chanMap);
51
55 virtual bool ProcessFinalize() /* noexcept */ ;
56
59 const float *const *inBlock, float *const *outBlock, size_t blockLen)
60 = 0;
61
64 virtual sampleCount GetLatency(const EffectSettings &settings);
65
66 protected:
68 };
69
70protected:
71 // These were overridables but the generality wasn't used yet
72 /* virtual */ bool DoPass1() const;
73 /* virtual */ bool DoPass2() const;
74
75 // non-virtual
76 bool Process(EffectInstance &instance, EffectSettings &settings) const;
77
79
80private:
81 bool ProcessPass(Instance &instance, EffectSettings &settings);
82 bool ProcessTrack(Instance &instance, EffectSettings &settings,
83 int count,
84 ChannelNames map,
85 WaveTrack *left,
86 WaveTrack *right,
87 sampleCount start,
88 sampleCount len,
89 FloatBuffers &inBuffer,
90 FloatBuffers &outBuffer,
91 ArrayOf< float * > &inBufPos,
92 ArrayOf< float *> &outBufPos, size_t bufferSize, size_t blockSize,
93 unsigned mNumChannels) const;
94};
95#endif
enum ChannelName * ChannelNames
static Settings & settings()
Definition: TrackInfo.cpp:87
Memory.h template class for making an array of float, bool, etc.
Definition: MemoryX.h:27
Base class for many of the effects in Audacity.
Definition: Effect.h:148
Performs effect computation.
virtual size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen)=0
Called for destructive effect computation.
Instance(const PerTrackEffect &processor)
const PerTrackEffect & mProcessor
Base class for many of the effects in Audacity.
bool DoPass2() const
bool ProcessTrack(Instance &instance, EffectSettings &settings, int count, ChannelNames map, WaveTrack *left, WaveTrack *right, sampleCount start, sampleCount len, FloatBuffers &inBuffer, FloatBuffers &outBuffer, ArrayOf< float * > &inBufPos, ArrayOf< float * > &outBufPos, size_t bufferSize, size_t blockSize, unsigned mNumChannels) const
bool ProcessPass(Instance &instance, EffectSettings &settings)
bool Process(EffectInstance &instance, EffectSettings &settings) const
~PerTrackEffect() override
bool DoPass1() const
sampleCount mSampleCnt
A Track that contains audio waveform data.
Definition: WaveTrack.h:57
Positions or offsets within audio files need a wide type.
Definition: SampleCount.h:18
Externalized state of a plug-in.