Audacity  2.2.2
Silence.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  Silence.cpp
6 
7  Dominic Mazzoni
8 
9 *******************************************************************//*******************************************************************/
15 
16 #include "../Audacity.h"
17 #include "Silence.h"
18 
19 #include <wx/intl.h>
20 
21 #include "../ShuttleGui.h"
22 #include "../WaveTrack.h"
23 
25 {
26  SetLinearEffectFlag(true);
27 }
28 
30 {
31 }
32 
33 // IdentInterface implementation
34 
36 {
37  return SILENCE_PLUGIN_SYMBOL;
38 }
39 
41 {
42  return _("Creates audio of zero amplitude");
43 }
44 
46 {
47  return wxT("Silence");
48 }
49 
50 
51 // EffectDefinitionInterface implementation
52 
54 {
55  return EffectTypeGenerate;
56 }
57 
58 // Effect implementation
59 
61 {
62  S.StartVerticalLay();
63  {
65  {
66  S.AddPrompt(_("Duration:"));
68  NumericTextCtrl(S.GetParent(), wxID_ANY,
71  GetDuration(),
74  .AutoPos(true));
75  mDurationT->SetName(_("Duration"));
76  S.AddWindow(mDurationT, wxALIGN_CENTER | wxALL);
77  }
78  S.EndHorizontalLay();
79  }
80  S.EndVerticalLay();
81 
82  return;
83 }
84 
86 {
88 
89  return true;
90 }
91 
93 {
95 
96  return true;
97 }
98 
100  const WaveTrack & WXUNUSED(track),
101  int WXUNUSED(ntrack))
102 {
103  tmp->InsertSilence(0.0, GetDuration());
104  return true;
105 }
bool TransferDataToWindow() override
Definition: Silence.cpp:85
IdentInterfaceSymbol GetSymbol() override
Definition: Silence.cpp:35
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI...
Definition: ShuttleGui.h:409
double GetDuration() override
Definition: Effect.cpp:722
wxWindow * AddWindow(wxWindow *pWindow, int Flags=wxALIGN_CENTRE|wxALL)
Definition: ShuttleGui.cpp:288
void SetLinearEffectFlag(bool linearEffectFlag)
Definition: Effect.cpp:1961
virtual ~EffectSilence()
Definition: Silence.cpp:29
bool GenerateTrack(WaveTrack *tmp, const WaveTrack &track, int ntrack) override
Definition: Silence.cpp:99
wxString GetDescription() override
Definition: Silence.cpp:40
NumericFormatId GetDurationFormat() override
Definition: Effect.cpp:732
#define safenew
Definition: Audacity.h:230
void InsertSilence(double t, double len) override
Definition: WaveTrack.cpp:1385
void EndHorizontalLay()
void AddPrompt(const wxString &Prompt)
Right aligned text string.
Definition: ShuttleGui.cpp:239
void EndVerticalLay()
wxWindow * GetParent()
Definition: ShuttleGui.h:294
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
EffectType GetType() override
Definition: Silence.cpp:53
void PopulateOrExchange(ShuttleGui &S) override
Definition: Silence.cpp:60
A Track that contains audio waveform data.
Definition: WaveTrack.h:60
NumericTextCtrl * mDurationT
Definition: Silence.h:52
void SetDuration(double duration) override
Definition: Effect.cpp:742
IdentInterfaceSymbol pairs a persistent string identifier used internally with an optional...
void SetValue(double newValue)
bool TransferDataFromWindow() override
Definition: Silence.cpp:92
double mProjectRate
Definition: Effect.h:453
_("Move Track &Down")+wxT("\t")+(GetActiveProject() -> GetCommandManager() ->GetKeyFromName(wxT("TrackMoveDown")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveTopID, _("Move Track to &Top")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveTop")).Raw()), OnMoveTrack) POPUP_MENU_ITEM(OnMoveBottomID, _("Move Track to &Bottom")+wxT("\t")+(GetActiveProject() ->GetCommandManager() ->GetKeyFromName(wxT("TrackMoveBottom")).Raw()), OnMoveTrack)#define SET_TRACK_NAME_PLUGIN_SYMBOLclass SetTrackNameCommand:public AudacityCommand
EffectType
#define SILENCE_PLUGIN_SYMBOL
Definition: Silence.h:22
Options & AutoPos(bool value)
wxString ManualPage() override
Definition: Silence.cpp:45
void StartVerticalLay(int iProp=1)