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 This class inverts the selected audio.
10
11**********************************************************************/
12#include "Invert.h"
13#include "LoadEffects.h"
14
16{
17}
18
20{
21}
22
24
25// ComponentInterface implementation
26
28{
29 return Symbol;
30}
31
33{
34 return XO("Flips the audio samples upside-down, reversing their polarity");
35}
36
37// EffectDefinitionInterface implementation
38
40{
41 return EffectTypeProcess;
42}
43
45{
46 return false;
47}
48
50{
51 return 1;
52}
53
55{
56 return 1;
57}
58
60 EffectSettings&, const float* const* inBlock, float* const* outBlock,
61 size_t blockLen)
62{
63 const float* ibuf = inBlock[0];
64 float* obuf = outBlock[0];
65
66 for (decltype(blockLen) i = 0; i < blockLen; i++)
67 {
68 obuf[i] = -ibuf[i];
69 }
70
71 return blockLen;
72}
73
75{
76 return false;
77}
EffectType
@ EffectTypeProcess
XO("Cut/Copy/Paste")
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:49
size_t ProcessBlock(EffectSettings &settings, const float *const *inBlock, float *const *outBlock, size_t blockLen) override
Called for destructive effect computation.
Definition: Invert.cpp:59
Invert()
Definition: Invert.cpp:15
bool IsInteractive() const override
Whether the effect needs a dialog for entry of settings.
Definition: Invert.cpp:44
static const ComponentInterfaceSymbol Symbol
Definition: Invert.h:22
bool NeedsDither() const override
Definition: Invert.cpp:74
unsigned GetAudioOutCount() const override
How many output buffers to allocate at once.
Definition: Invert.cpp:54
TranslatableString GetDescription() const override
Definition: Invert.cpp:32
ComponentInterfaceSymbol GetSymbol() const override
Definition: Invert.cpp:27
EffectType GetType() const override
Type determines how it behaves.
Definition: Invert.cpp:39
virtual ~Invert()
Definition: Invert.cpp:19
Holds a msgid for the translation catalog; may also bind format arguments.
Externalized state of a plug-in.