Audacity  3.0.3
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 
61 // EffectClientInterface implementation
62 
64 {
65  return 1;
66 }
67 
69 {
70  return 1;
71 }
72 
73 size_t EffectInvert::ProcessBlock(float **inBlock, float **outBlock, size_t blockLen)
74 {
75  float *ibuf = inBlock[0];
76  float *obuf = outBlock[0];
77 
78  for (decltype(blockLen) i = 0; i < blockLen; i++)
79  {
80  obuf[i] = -ibuf[i];
81  }
82 
83  return blockLen;
84 }
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
EffectInvert::ProcessBlock
size_t ProcessBlock(float **inBlock, float **outBlock, size_t blockLen) override
Definition: Invert.cpp:73
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:59
Invert.h
XO
#define XO(s)
Definition: Internat.h:31
EffectInvert::GetAudioInCount
unsigned GetAudioInCount() override
Definition: Invert.cpp:63
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
EffectInvert::GetType
EffectType GetType() override
Definition: Invert.cpp:51
anonymous_namespace{Invert.cpp}::reg
BuiltinEffectsModule::Registration< EffectInvert > reg
Definition: Invert.cpp:27
EffectInvert::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: Invert.cpp:39
LoadEffects.h
EffectInvert::~EffectInvert
virtual ~EffectInvert()
Definition: Invert.cpp:33
EffectInvert::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Invert.h:21
EffectInvert::GetDescription
TranslatableString GetDescription() override
Definition: Invert.cpp:44
BuiltinEffectsModule::Registration
Definition: LoadEffects.h:40
EffectInvert::EffectInvert
EffectInvert()
Definition: Invert.cpp:29
EffectType
EffectType
Definition: EffectInterface.h:55
EffectInvert::IsInteractive
bool IsInteractive() override
Definition: Invert.cpp:56
EffectInvert::GetAudioOutCount
unsigned GetAudioOutCount() override
Definition: Invert.cpp:68