Audacity  3.2.0
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
EffectSilence Class Referencefinal

An effect to add silence. More...

#include <Silence.h>

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

Public Member Functions

 EffectSilence ()
 
virtual ~EffectSilence ()
 
ComponentInterfaceSymbol GetSymbol () override
 
TranslatableString GetDescription () override
 
ManualPageID ManualPage () override
 Name of a page in the Audacity alpha manual, default is empty. More...
 
EffectType GetType () override
 Type determines how it behaves. More...
 
void PopulateOrExchange (ShuttleGui &S) override
 
bool TransferDataToWindow () override
 
bool TransferDataFromWindow () override
 
- Public Member Functions inherited from Generator
 Generator ()
 
- 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 IsInteractive () override
 Whether the effect needs a dialog for entry of settings. 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
 
unsigned GetAudioInCount () override
 
unsigned GetAudioOutCount () 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...
 
size_t ProcessBlock (float **inBlock, float **outBlock, size_t blockLen) 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 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 { XC("Silence", "generator") }
 
- 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

bool GenerateTrack (WaveTrack *tmp, const WaveTrack &track, int ntrack) override
 
- Protected Member Functions inherited from Generator
bool Init () override
 
virtual void BeforeGenerate ()
 
virtual void BeforeTrack (const WaveTrack &WXUNUSED(track))
 
virtual void Success ()
 
virtual void Failure ()
 
AUDACITY_DLL_API bool Process () override
 
- Protected Member Functions inherited from Effect
bool EnableApply (bool enable=true)
 
bool EnablePreview (bool enable=true)
 
virtual bool CheckWhetherSkipEffect ()
 
virtual bool ProcessPass ()
 
virtual bool InitPass1 ()
 
virtual bool InitPass2 ()
 
virtual void End ()
 
virtual double CalcPreviewInputLength (double previewLength)
 
virtual void Preview (bool dryOnly)
 
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
 

Private Attributes

NumericTextCtrlmDurationT
 

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 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 to add silence.

Definition at line 20 of file Silence.h.

Constructor & Destructor Documentation

◆ EffectSilence()

EffectSilence::EffectSilence ( )

Definition at line 32 of file Silence.cpp.

33 {
34  SetLinearEffectFlag(true);
35 }

References Effect::SetLinearEffectFlag().

Here is the call graph for this function:

◆ ~EffectSilence()

EffectSilence::~EffectSilence ( )
virtual

Definition at line 37 of file Silence.cpp.

38 {
39 }

Member Function Documentation

◆ GenerateTrack()

bool EffectSilence::GenerateTrack ( WaveTrack tmp,
const WaveTrack track,
int  ntrack 
)
overrideprotectedvirtual

Implements Generator.

Definition at line 108 of file Silence.cpp.

111 {
112  tmp->InsertSilence(0.0, GetDuration());
113  return true;
114 }

References Effect::GetDuration(), and WaveTrack::InsertSilence().

Here is the call graph for this function:

◆ GetDescription()

TranslatableString EffectSilence::GetDescription ( )
overridevirtual

Reimplemented from Effect.

Definition at line 48 of file Silence.cpp.

49 {
50  return XO("Creates audio of zero amplitude");
51 }

References XO.

◆ GetSymbol()

ComponentInterfaceSymbol EffectSilence::GetSymbol ( )
overridevirtual

Reimplemented from Effect.

Definition at line 43 of file Silence.cpp.

44 {
45  return Symbol;
46 }

References Symbol.

◆ GetType()

EffectType EffectSilence::GetType ( )
overridevirtual

Type determines how it behaves.

Reimplemented from Effect.

Definition at line 61 of file Silence.cpp.

62 {
63  return EffectTypeGenerate;
64 }

References EffectTypeGenerate.

◆ ManualPage()

ManualPageID EffectSilence::ManualPage ( )
overridevirtual

Name of a page in the Audacity alpha manual, default is empty.

Reimplemented from EffectDefinitionInterface.

Definition at line 53 of file Silence.cpp.

54 {
55  return L"Silence";
56 }

◆ PopulateOrExchange()

void EffectSilence::PopulateOrExchange ( ShuttleGui S)
overridevirtual

Reimplemented from Effect.

Definition at line 68 of file Silence.cpp.

69 {
70  S.StartVerticalLay();
71  {
72  S.StartHorizontalLay();
73  {
74  S.AddPrompt(XXO("&Duration:"));
76  NumericTextCtrl(S.GetParent(), wxID_ANY,
79  GetDuration(),
82  .AutoPos(true));
83  S.Name(XO("Duration"))
84  .Position(wxALIGN_CENTER | wxALL)
85  .AddWindow(mDurationT);
86  }
87  S.EndHorizontalLay();
88  }
89  S.EndVerticalLay();
90 
91  return;
92 }

References NumericTextCtrl::Options::AutoPos(), Effect::GetDuration(), Effect::GetDurationFormat(), mDurationT, Effect::mProjectRate, S, safenew, NumericConverter::TIME, XO, and XXO.

Here is the call graph for this function:

◆ TransferDataFromWindow()

bool EffectSilence::TransferDataFromWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 101 of file Silence.cpp.

102 {
104 
105  return true;
106 }

References NumericConverter::GetValue(), mDurationT, and Effect::SetDuration().

Here is the call graph for this function:

◆ TransferDataToWindow()

bool EffectSilence::TransferDataToWindow ( )
overridevirtual

Reimplemented from Effect.

Definition at line 94 of file Silence.cpp.

95 {
97 
98  return true;
99 }

References Effect::GetDuration(), mDurationT, and NumericTextCtrl::SetValue().

Here is the call graph for this function:

Member Data Documentation

◆ mDurationT

NumericTextCtrl* EffectSilence::mDurationT
private

Definition at line 50 of file Silence.h.

Referenced by PopulateOrExchange(), TransferDataFromWindow(), and TransferDataToWindow().

◆ Symbol

const ComponentInterfaceSymbol EffectSilence::Symbol { XC("Silence", "generator") }
static

Definition at line 23 of file Silence.h.

Referenced by GetSymbol().


The documentation for this class was generated from the following files:
Effect::GetDuration
double GetDuration() override
Definition: Effect.cpp:769
Effect::SetLinearEffectFlag
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: Effect.cpp:1764
S
#define S(N)
Definition: ToChars.cpp:64
NumericTextCtrl::Options::AutoPos
Options & AutoPos(bool enable)
Definition: NumericTextCtrl.h:190
EffectTypeGenerate
@ EffectTypeGenerate
Definition: EffectInterface.h:55
XO
#define XO(s)
Definition: Internat.h:31
EffectSilence::mDurationT
NumericTextCtrl * mDurationT
Definition: Silence.h:50
NumericTextCtrl
Definition: NumericTextCtrl.h:172
NumericTextCtrl::SetValue
void SetValue(double newValue)
Definition: NumericTextCtrl.cpp:1474
NumericTextCtrl::Options
Definition: NumericTextCtrl.h:178
Effect::mProjectRate
double mProjectRate
Definition: Effect.h:416
XXO
#define XXO(s)
Definition: Internat.h:44
WaveTrack::InsertSilence
void InsertSilence(double t, double len) override
Definition: WaveTrack.cpp:1602
NumericConverter::TIME
@ TIME
Definition: NumericTextCtrl.h:52
EffectSilence::Symbol
static const ComponentInterfaceSymbol Symbol
Definition: Silence.h:23
Effect::SetDuration
void SetDuration(double duration) override
Definition: Effect.cpp:791
Effect::GetDurationFormat
NumericFormatSymbol GetDurationFormat() override
Definition: Effect.cpp:779
safenew
#define safenew
Definition: MemoryX.h:10
NumericConverter::GetValue
double GetValue()
Definition: NumericTextCtrl.cpp:1174