Audacity  3.2.0
Public Member Functions | Private Attributes | List of all members
EffectFade Class Reference

An Effect that reduces the volume to zero over achosen interval. More...

#include <Fade.h>

Inheritance diagram for EffectFade:
[legend]
Collaboration diagram for EffectFade:
[legend]

Public Member Functions

 EffectFade (bool fadeIn=false)
 
virtual ~EffectFade ()
 
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
 
bool ProcessInitialize (sampleCount totalLen, ChannelNames chanMap=NULL) override
 Called for destructive, non-realtime effect computation. More...
 
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 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 ()
 

Private Attributes

bool mFadeIn
 
sampleCount mSample
 

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...
 
- 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>")
 
- 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
 
WaveTrackFactorymFactory
 
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 reduces the volume to zero over achosen interval.

Definition at line 16 of file Fade.h.

Constructor & Destructor Documentation

◆ EffectFade()

EffectFade::EffectFade ( bool  fadeIn = false)

Definition at line 33 of file Fade.cpp.

34 {
35  mFadeIn = fadeIn;
36 }

References mFadeIn.

◆ ~EffectFade()

EffectFade::~EffectFade ( )
virtual

Definition at line 38 of file Fade.cpp.

39 {
40 }

Member Function Documentation

◆ GetAudioInCount()

unsigned EffectFade::GetAudioInCount ( )
overridevirtual

Reimplemented from Effect.

Definition at line 72 of file Fade.cpp.

73 {
74  return 1;
75 }

◆ GetAudioOutCount()

unsigned EffectFade::GetAudioOutCount ( )
overridevirtual

Reimplemented from Effect.

Definition at line 77 of file Fade.cpp.

78 {
79  return 1;
80 }

◆ GetDescription()

TranslatableString EffectFade::GetDescription ( )
overridevirtual

Reimplemented from Effect.

Definition at line 51 of file Fade.cpp.

52 {
53  return mFadeIn
54  ? XO("Applies a linear fade-in to the selected audio")
55  : XO("Applies a linear fade-out to the selected audio");
56 }

References mFadeIn, and XO.

◆ GetSymbol()

ComponentInterfaceSymbol EffectFade::GetSymbol ( )
overridevirtual

Reimplemented from Effect.

Definition at line 44 of file Fade.cpp.

45 {
46  return mFadeIn
49 }

References mFadeIn, EffectFadeIn::Symbol, and EffectFadeOut::Symbol.

◆ GetType()

EffectType EffectFade::GetType ( )
overridevirtual

Type determines how it behaves.

Reimplemented from Effect.

Definition at line 60 of file Fade.cpp.

61 {
62  return EffectTypeProcess;
63 }

References EffectTypeProcess.

◆ IsInteractive()

bool EffectFade::IsInteractive ( )
overridevirtual

Whether the effect needs a dialog for entry of settings.

Reimplemented from Effect.

Definition at line 65 of file Fade.cpp.

66 {
67  return false;
68 }

◆ ProcessBlock()

size_t EffectFade::ProcessBlock ( float **  inBlock,
float **  outBlock,
size_t  blockLen 
)
overridevirtual

Called for destructive, non-realtime effect computation.

Reimplemented from Effect.

Definition at line 89 of file Fade.cpp.

90 {
91  float *ibuf = inBlock[0];
92  float *obuf = outBlock[0];
93 
94  if (mFadeIn)
95  {
96  for (decltype(blockLen) i = 0; i < blockLen; i++)
97  {
98  obuf[i] =
99  (ibuf[i] * ( mSample++ ).as_float()) /
101  }
102  }
103  else
104  {
105  for (decltype(blockLen) i = 0; i < blockLen; i++)
106  {
107  obuf[i] = (ibuf[i] *
108  ( mSampleCnt - 1 - mSample++ ).as_float()) /
110  }
111  }
112 
113  return blockLen;
114 }

References sampleCount::as_float(), mFadeIn, mSample, and Effect::mSampleCnt.

Here is the call graph for this function:

◆ ProcessInitialize()

bool EffectFade::ProcessInitialize ( sampleCount  totalLen,
ChannelNames  chanMap = NULL 
)
overridevirtual

Called for destructive, non-realtime effect computation.

Reimplemented from Effect.

Definition at line 82 of file Fade.cpp.

83 {
84  mSample = 0;
85 
86  return true;
87 }

References mSample.

Member Data Documentation

◆ mFadeIn

bool EffectFade::mFadeIn
private

Definition at line 42 of file Fade.h.

Referenced by EffectFade(), GetDescription(), GetSymbol(), and ProcessBlock().

◆ mSample

sampleCount EffectFade::mSample
private

Definition at line 43 of file Fade.h.

Referenced by ProcessBlock(), and ProcessInitialize().


The documentation for this class was generated from the following files:
Effect::mSampleCnt
sampleCount mSampleCnt
Definition: Effect.h:441
EffectFadeIn::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Fade.h:49
EffectFade::mSample
sampleCount mSample
Definition: Fade.h:43
EffectTypeProcess
@ EffectTypeProcess
Definition: EffectInterface.h:56
XO
#define XO(s)
Definition: Internat.h:31
EffectFadeOut::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Fade.h:58
sampleCount::as_float
float as_float() const
Definition: SampleCount.h:44
EffectFade::mFadeIn
bool mFadeIn
Definition: Fade.h:42