Audacity  3.2.0
Public Member Functions | Static Public Attributes | List of all members
EffectInvert Class Referencefinal

An Effect that inverts the selected audio. More...

#include <Invert.h>

Inheritance diagram for EffectInvert:
Collaboration diagram for EffectInvert:

Public Member Functions

 EffectInvert ()
virtual ~EffectInvert ()
ComponentInterfaceSymbol GetSymbol () override
TranslatableString GetDescription () override
EffectType GetType () override
 Type determines how it behaves. More...
bool IsInteractive () override
 Whether the effect needs a dialog for entry of settings. More...
unsigned GetAudioInCount () override
unsigned GetAudioOutCount () override
size_t ProcessBlock (float **inBlock, float **outBlock, size_t blockLen) override
 Called for destructive, non-realtime effect computation. More...
- Public Member Functions inherited from Effect
 Effect ()
virtual ~Effect ()
PluginPath GetPath () override
VendorSymbol GetVendor () override
wxString GetVersion () override
EffectFamilySymbol GetFamily () override
 Report identifier and user-visible name of the effect protocol. More...
bool IsDefault () override
 Whether the effect sorts "above the line" in the menus. More...
bool IsLegacy () override
bool SupportsRealtime () override
 Whether the effect supports realtime previewing (while audio is playing). More...
bool SupportsAutomation () override
 Whether the effect can be used without the UI, in a macro. More...
bool GetAutomationParameters (CommandParameters &parms) override
 Save current settings into parms. More...
bool SetAutomationParameters (CommandParameters &parms) override
 Change settings to those stored in parms. More...
bool LoadUserPreset (const RegistryPath &name) override
 Change settings to a user-named preset. More...
bool SaveUserPreset (const RegistryPath &name) override
 Save current settings as a user-named preset. More...
RegistryPaths GetFactoryPresets () override
 Report names of factory presets. More...
bool LoadFactoryPreset (int id) override
 Change settings to the preset whose name is GetFactoryPresets()[id] More...
bool LoadFactoryDefaults () override
 Change settings back to "factory default". More...
bool SetHost (EffectHostInterface *host) override
int GetMidiInCount () override
int GetMidiOutCount () override
sampleCount GetLatency () override
 Called for destructive, non-realtime effect computation. More...
size_t GetTailSize () override
void SetSampleRate (double rate) override
size_t SetBlockSize (size_t maxBlockSize) override
size_t GetBlockSize () const override
bool ProcessInitialize (sampleCount totalLen, ChannelNames chanMap=NULL) override
 Called for destructive, non-realtime effect computation. More...
bool ProcessFinalize () override
 Called for destructive, non-realtime effect computation. More...
bool RealtimeInitialize () override
bool RealtimeAddProcessor (unsigned numChannels, float sampleRate) override
bool RealtimeFinalize () override
bool RealtimeSuspend () override
bool RealtimeResume () noexcept override
bool RealtimeProcessStart () override
size_t RealtimeProcess (int group, float **inbuf, float **outbuf, size_t numSamples) override
bool RealtimeProcessEnd () noexcept override
int ShowClientInterface (wxWindow &parent, wxDialog &dialog, bool forceModal=false) override
bool PopulateUI (ShuttleGui &S) final
 Adds controls to a panel that is given as the parent window of S More...
bool IsGraphicalUI () override
bool ValidateUI () override
bool HideUI () override
bool CloseUI () override
bool CanExportPresets () override
void ExportPresets () override
void ImportPresets () override
bool HasOptions () override
void ShowOptions () override
EffectDefinitionInterfaceGetDefinition () override
double GetDuration () override
NumericFormatSymbol GetDurationFormat () override
virtual NumericFormatSymbol GetSelectionFormat ()
void SetDuration (double duration) override
RegistryPath GetUserPresetsGroup (const RegistryPath &name) override
RegistryPath GetCurrentSettingsGroup () override
RegistryPath GetFactoryDefaultsGroup () override
virtual wxString GetSavedStateGroup ()
int ShowHostInterface (wxWindow &parent, const EffectDialogFactory &factory, bool forceModal=false) override
unsigned TestUIFlags (unsigned mask)
void SetPresetParameters (const wxArrayString *Names, const wxArrayString *Values)
virtual bool Startup (EffectUIClientInterface *client)
virtual bool GetAutomationParametersAsString (wxString &parms)
virtual bool SetAutomationParametersFromString (const wxString &parms)
virtual bool IsBatchProcessing ()
virtual void SetBatchProcessing (bool start)
bool DoEffect (double projectRate, TrackList *list, WaveTrackFactory *factory, NotifyingSelectedRegion &selectedRegion, unsigned flags, wxWindow *pParent=nullptr, const EffectDialogFactory &dialogFactory={})
bool Delegate (Effect &delegate, wxWindow &parent, const EffectDialogFactory &factory)
int MessageBox (const TranslatableString &message, long style=DefaultMessageBoxStyle, const TranslatableString &titleStr={})
virtual bool Startup ()
- Public Member Functions inherited from EffectUIClientInterface
virtual ~EffectUIClientInterface ()
- Public Member Functions inherited from EffectProcessor
virtual ~EffectProcessor ()
- Public Member Functions inherited from EffectDefinitionInterface
virtual ~EffectDefinitionInterface ()
virtual EffectType GetClassification ()
 Determines which menu it appears in; default same as GetType(). More...
virtual bool EnablesDebug ()
 Whether the effect dialog should have a Debug button; default, always false. More...
virtual ManualPageID ManualPage ()
 Name of a page in the Audacity alpha manual, default is empty. More...
virtual FilePath HelpPage ()
 Fully qualified local help file name, default is empty. More...
virtual bool IsHiddenFromMenus ()
 Default is false. More...
- Public Member Functions inherited from ComponentInterface
virtual ~ComponentInterface ()
TranslatableString GetName ()
virtual bool DefineParams (ShuttleParams &WXUNUSED(S))
- Public Member Functions inherited from EffectUIHostInterface
virtual ~EffectUIHostInterface ()
- Public Member Functions inherited from EffectHostInterface
virtual ~EffectHostInterface ()

Static Public Attributes

static const ComponentInterfaceSymbol Symbol { XO("Invert") }
- Static Public Attributes inherited from Effect
static const wxString kUserPresetIdent = wxT("User Preset:")
static const wxString kFactoryPresetIdent = wxT("Factory Preset:")
static const wxString kCurrentSettingsIdent = wxT("<Current Settings>")
static const wxString kFactoryDefaultsIdent = wxT("<Factory Defaults>")

Additional Inherited Members

- Public Types inherited from Effect
enum  : long { DefaultMessageBoxStyle = wxOK | wxCENTRE }
- Static Public Member Functions inherited from Effect
static void IncEffectCounter ()
- Static Public Member Functions inherited from EffectDefinitionInterface
static Identifier GetSquashedName (const Identifier &ident)
 A utility that strips spaces and CamelCases a name. More...
- Protected Member Functions inherited from Effect
bool EnableApply (bool enable=true)
bool EnablePreview (bool enable=true)
virtual bool Init ()
virtual bool CheckWhetherSkipEffect ()
virtual bool Process ()
virtual bool ProcessPass ()
virtual bool InitPass1 ()
virtual bool InitPass2 ()
virtual void End ()
virtual double CalcPreviewInputLength (double previewLength)
virtual void Preview (bool dryOnly)
virtual void PopulateOrExchange (ShuttleGui &S)
virtual bool TransferDataToWindow ()
virtual bool TransferDataFromWindow ()
bool TotalProgress (double frac, const TranslatableString &={})
bool TrackProgress (int whichTrack, double frac, const TranslatableString &={})
bool TrackGroupProgress (int whichGroup, double frac, const TranslatableString &={})
int GetNumWaveTracks ()
int GetNumWaveGroups ()
void GetBounds (const WaveTrack &track, const WaveTrack *pRight, sampleCount *start, sampleCount *len)
void SetLinearEffectFlag (bool linearEffectFlag)
void SetPreviewFullSelectionFlag (bool previewDurationFlag)
bool IsPreviewing ()
void IncludeNotSelectedPreviewTracks (bool includeNotSelected)
void CopyInputTracks (bool allSyncLockSelected=false)
std::shared_ptr< AddedAnalysisTrackAddAnalysisTrack (const wxString &name=wxString())
ModifiedAnalysisTrack ModifyAnalysisTrack (const LabelTrack *pOrigTrack, const wxString &name=wxString())
void ReplaceProcessedTracks (const bool bGoodResult)
TrackAddToOutputTracks (const std::shared_ptr< Track > &t)
const TrackListinputTracks () const
const AudacityProjectFindProject () const
- Protected Attributes inherited from Effect
BasicUI::ProgressDialogmProgress = nullptr
double mProjectRate
double mSampleRate
std::shared_ptr< TrackListmOutputTracks
double mT0
double mT1
wxArrayString mPresetNames
wxArrayString mPresetValues
int mPass
wxWeakRef< wxDialog > mHostUIDialog
 This smart pointer tracks the lifetime of the dialog. More...
wxWeakRef< wxDialog > mUIDialog
 This weak pointer may be the same as the above, or null. More...
wxWindow * mUIParent
unsigned mUIFlags { 0 }
sampleCount mSampleCnt
- Static Protected Attributes inherited from Effect
static int nEffectsDone =0

Detailed Description

An Effect that inverts the selected audio.

Definition at line 18 of file Invert.h.

Constructor & Destructor Documentation

◆ EffectInvert()

EffectInvert::EffectInvert ( )

Definition at line 29 of file Invert.cpp.

30 {
31 }

◆ ~EffectInvert()

EffectInvert::~EffectInvert ( )

Definition at line 33 of file Invert.cpp.

34 {
35 }

Member Function Documentation

◆ GetAudioInCount()

unsigned EffectInvert::GetAudioInCount ( )

Reimplemented from Effect.

Definition at line 63 of file Invert.cpp.

64 {
65  return 1;
66 }

◆ GetAudioOutCount()

unsigned EffectInvert::GetAudioOutCount ( )

Reimplemented from Effect.

Definition at line 68 of file Invert.cpp.

69 {
70  return 1;
71 }

◆ GetDescription()

TranslatableString EffectInvert::GetDescription ( )

Reimplemented from Effect.

Definition at line 44 of file Invert.cpp.

45 {
46  return XO("Flips the audio samples upside-down, reversing their polarity");
47 }

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol EffectInvert::GetSymbol ( )

Reimplemented from Effect.

Definition at line 39 of file Invert.cpp.

40 {
41  return Symbol;
42 }

References Symbol.

◆ GetType()

EffectType EffectInvert::GetType ( )

Type determines how it behaves.

Reimplemented from Effect.

Definition at line 51 of file Invert.cpp.

52 {
53  return EffectTypeProcess;
54 }

References EffectTypeProcess.

◆ IsInteractive()

bool EffectInvert::IsInteractive ( )

Whether the effect needs a dialog for entry of settings.

Reimplemented from Effect.

Definition at line 56 of file Invert.cpp.

57 {
58  return false;
59 }

◆ ProcessBlock()

size_t EffectInvert::ProcessBlock ( float **  inBlock,
float **  outBlock,
size_t  blockLen 

Called for destructive, non-realtime effect computation.

Reimplemented from Effect.

Definition at line 73 of file Invert.cpp.

74 {
75  float *ibuf = inBlock[0];
76  float *obuf = outBlock[0];
78  for (decltype(blockLen) i = 0; i < blockLen; i++)
79  {
80  obuf[i] = -ibuf[i];
81  }
83  return blockLen;
84 }

Member Data Documentation

◆ Symbol

const ComponentInterfaceSymbol EffectInvert::Symbol { XO("Invert") }

Definition at line 21 of file Invert.h.

Referenced by GetSymbol().

The documentation for this class was generated from the following files:
@ EffectTypeProcess
Definition: EffectInterface.h:56
#define XO(s)
Definition: Internat.h:31
static const ComponentInterfaceSymbol Symbol
Definition: Invert.h:21