Audacity 3.2.0
Invert.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 Invert.cpp
6
7 Mark Phillips
8
9
10*******************************************************************//*******************************************************************/
16
17
18#include "Invert.h"
19
20#include <wx/intl.h>
21
22#include "LoadEffects.h"
23
25{ XO("Invert") };
26
28
30{
31}
32
34{
35}
36
37// ComponentInterface implementation
38
40{
41 return Symbol;
42}
43
45{
46 return XO("Flips the audio samples upside-down, reversing their polarity");
47}
48
49// EffectDefinitionInterface implementation
50
52{
53 return EffectTypeProcess;
54}
55
57{
58 return false;
59}
60
62{
63 return 1;
64}
65
67{
68 return 1;
69}
70
72 const float *const *inBlock, float *const *outBlock, size_t blockLen)
73{
74 const float *ibuf = inBlock[0];
75 float *obuf = outBlock[0];
76
77 for (decltype(blockLen) i = 0; i < blockLen; i++)
78 {
79 obuf[i] = -ibuf[i];
80 }
81
82 return blockLen;
83}
EffectType
@ EffectTypeProcess
#define XO(s)
Definition: Internat.h:31
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
unsigned GetAudioInCount() const override
How many input buffers to allocate at once.
Definition: Invert.cpp:61
ComponentInterfaceSymbol GetSymbol() const override
Definition: Invert.cpp:39
static const ComponentInterfaceSymbol Symbol
Definition: Invert.h:21
EffectInvert()
Definition: Invert.cpp:29
EffectType GetType() const override
Type determines how it behaves.
Definition: Invert.cpp:51
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
Definition: Invert.cpp:66
TranslatableString GetDescription() const override
Definition: Invert.cpp:44
size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override
Called for destructive effect computation.
Definition: Invert.cpp:71
bool IsInteractive() const override
Whether the effect needs a dialog for entry of settings.
Definition: Invert.cpp:56
virtual ~EffectInvert()
Definition: Invert.cpp:33
Holds a msgid for the translation catalog; may also bind format arguments.
BuiltinEffectsModule::Registration< EffectInvert > reg
Definition: Invert.cpp:27
Externalized state of a plug-in.