Audacity 3.2.0
Public Member Functions | Private Member Functions | Private Attributes | List of all members
RecordingPrefs Class Referencefinal

A PrefsPanel used to select recording options. More...

#include <RecordingPrefs.h>

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

Public Member Functions

 RecordingPrefs (wxWindow *parent, wxWindowID winid)
 
virtual ~RecordingPrefs ()
 
ComponentInterfaceSymbol GetSymbol () const override
 
TranslatableString GetDescription () const override
 
bool Commit () override
 
ManualPageID HelpPageName () override
 If not empty string, the Help button is added below the panel. More...
 
void PopulateOrExchange (ShuttleGui &S) override
 
- Public Member Functions inherited from PrefsPanel
 PrefsPanel (wxWindow *parent, wxWindowID winid, const TranslatableString &title)
 
virtual ~PrefsPanel ()
 
virtual void Preview ()
 
virtual bool Commit ()=0
 
virtual PluginPath GetPath () const override
 
virtual VendorSymbol GetVendor () const override
 
virtual wxString GetVersion () const override
 
virtual bool ShowsPreviewButton ()
 
virtual void PopulateOrExchange (ShuttleGui &WXUNUSED(S))
 
virtual ManualPageID HelpPageName ()
 If not empty string, the Help button is added below the panel. More...
 
virtual void Cancel ()
 
- Public Member Functions inherited from wxPanelWrapper
 wxPanelWrapper ()
 
 wxPanelWrapper (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
bool Create (wxWindow *parent, wxWindowID winid=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL|wxNO_BORDER, const TranslatableString &name=XO("Panel"))
 
void SetLabel (const TranslatableString &label)
 
void SetName (const TranslatableString &name)
 
void SetToolTip (const TranslatableString &toolTip)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxPanel >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Private Member Functions

void Populate ()
 
void OnToggleCustomName (wxCommandEvent &)
 

Private Attributes

wxTextCtrl * mToggleCustomName
 
bool mUseCustomTrackName
 
bool mOldNameChoice
 

Additional Inherited Members

- Public Types inherited from PrefsPanel
using Factories = std::vector< PrefsPanel::PrefsNode >
 
using Factory = std::function< PrefsPanel *(wxWindow *parent, wxWindowID winid, AudacityProject *) >
 
- Static Public Member Functions inherited from PrefsPanel
static FactoriesDefaultFactories ()
 

Detailed Description

A PrefsPanel used to select recording options.

Presents interface for user to update the various recording options like playthrough, latency correction, and others.

Definition at line 43 of file RecordingPrefs.h.

Constructor & Destructor Documentation

◆ RecordingPrefs()

RecordingPrefs::RecordingPrefs ( wxWindow *  parent,
wxWindowID  winid 
)

Definition at line 43 of file RecordingPrefs.cpp.

45: PrefsPanel(parent, winid, XC("Recording", "preference"))
46{
47 gPrefs->Read(wxT("/GUI/TrackNames/RecordingNameCustom"), &mUseCustomTrackName, false);
49 Populate();
50}
wxT("CloseDown"))
#define XC(s, c)
Definition: Internat.h:37
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
PrefsPanel(wxWindow *parent, wxWindowID winid, const TranslatableString &title)
Definition: PrefsPanel.h:94
bool mUseCustomTrackName
virtual bool Read(const wxString &key, bool *value) const =0

References gPrefs, audacity::BasicSettings::Read(), and wxT().

Here is the call graph for this function:

◆ ~RecordingPrefs()

RecordingPrefs::~RecordingPrefs ( )
virtual

Definition at line 52 of file RecordingPrefs.cpp.

53{
54}

Member Function Documentation

◆ Commit()

bool RecordingPrefs::Commit ( )
overridevirtual

Implements PrefsPanel.

Definition at line 260 of file RecordingPrefs.cpp.

261{
264
266
269
270 #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
271 double targetpeak, deltapeak;
272 gPrefs->Read(wxT("/AudioIO/TargetPeak"), &targetpeak);
273 gPrefs->Read(wxT("/AudioIO/DeltaPeakVolume"), &deltapeak);
274 if (targetpeak + deltapeak > 100.0 || targetpeak - deltapeak < 0.0)
275 {
276 gPrefs->Write(wxT("/AudioIO/DeltaPeakVolume"), min(100.0 - targetpeak, targetpeak));
277 }
278
279 int value;
280 gPrefs->Read(wxT("/AudioIO/AnalysisTime"), &value);
281 if (value <= 0)
282 gPrefs->Write(wxT("/AudioIO/AnalysisTime"), AILA_DEF_ANALYSIS_TIME);
283
284 gPrefs->Read(wxT("/AudioIO/NumberAnalysis"), &value);
285 if (value < 0)
286 gPrefs->Write(wxT("/AudioIO/NumberAnalysis"), AILA_DEF_NUMBER_ANALYSIS);
287 #endif
288 return true;
289}
BoolSetting SoundActivatedRecord
Definition: AudioIO.cpp:3370
DoubleSetting AudioIOLatencyDuration
int min(int a, int b)
@ eIsSavingToPrefs
Definition: ShuttleGui.h:47
#define S(N)
Definition: ToChars.cpp:64
void PopulateOrExchange(ShuttleGui &S) override
void Invalidate() override
Definition: Prefs.h:289
bool Reset()
Reset to the default value.
Definition: Prefs.h:284
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:207
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
virtual bool Write(const wxString &key, bool value)=0

References AudioIOLatencyDuration, eIsSavingToPrefs, gPrefs, Setting< T >::Invalidate(), min(), PopulateOrExchange(), audacity::BasicSettings::Read(), Setting< T >::Read(), Setting< T >::Reset(), S, SoundActivatedRecord, audacity::BasicSettings::Write(), and wxT().

Here is the call graph for this function:

◆ GetDescription()

TranslatableString RecordingPrefs::GetDescription ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 61 of file RecordingPrefs.cpp.

62{
63 return XO("Preferences for Recording");
64}
XO("Cut/Copy/Paste")

References XO().

Here is the call graph for this function:

◆ GetSymbol()

ComponentInterfaceSymbol RecordingPrefs::GetSymbol ( ) const
overridevirtual

Implements ComponentInterface.

Definition at line 56 of file RecordingPrefs.cpp.

57{
59}
#define RECORDING_PREFS_PLUGIN_SYMBOL

References RECORDING_PREFS_PLUGIN_SYMBOL.

◆ HelpPageName()

ManualPageID RecordingPrefs::HelpPageName ( )
overridevirtual

If not empty string, the Help button is added below the panel.

Default returns empty string.

Reimplemented from PrefsPanel.

Definition at line 66 of file RecordingPrefs.cpp.

67{
68 return "Recording_Preferences";
69}

◆ OnToggleCustomName()

void RecordingPrefs::OnToggleCustomName ( wxCommandEvent &  )
private

Definition at line 291 of file RecordingPrefs.cpp.

References mToggleCustomName, and mUseCustomTrackName.

◆ Populate()

void RecordingPrefs::Populate ( )
private

Definition at line 71 of file RecordingPrefs.cpp.

72{
73 //------------------------- Main section --------------------
74 // Now construct the GUI itself.
75 // Use 'eIsCreatingFromPrefs' so that the GUI is
76 // initialised with values from gPrefs.
79 // ----------------------- End of main section --------------
80}
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:46

References eIsCreatingFromPrefs, PopulateOrExchange(), and S.

Here is the call graph for this function:

◆ PopulateOrExchange()

void RecordingPrefs::PopulateOrExchange ( ShuttleGui S)
override

Definition at line 82 of file RecordingPrefs.cpp.

83{
84 S.SetBorder(2);
85 S.StartScroller();
86
87 S.StartStatic(XO("Options"));
88 {
89 // Start wording of options with a verb, if possible.
90 S.TieCheckBox(XXO("Hear &other tracks while recording (overdub)"),
91 {wxT("/AudioIO/Duplex"),
92 true});
93
94//#if defined(__WXMAC__)
95// Bug 388. Feature not supported on any Mac Hardware.
96#if 0
97 S.TieCheckBox(XO("Use &hardware to play other tracks"),
98 {wxT("/AudioIO/Playthrough"),
99 false});
100#endif
101 S.TieCheckBox(XXO("Audible input &monitoring"),
102 {wxT("/AudioIO/SWPlaythrough"),
103 false});
104#if !defined(__WXMAC__)
105 //S.AddUnits(XO(" (uncheck when recording computer playback)"));
106#endif
107
108 S.TieCheckBox(XXO("Record on a new track"),
109 {wxT("/GUI/PreferNewTrackRecord"),
110 false});
111
112/* i18n-hint: Dropout is a loss of a short sequence audio sample data from the recording */
113 S.TieCheckBox(XXO("Detect dropouts"),
114 {WarningDialogKey(wxT("DropoutDetected")),
115 true});
116
117
118 }
119 S.EndStatic();
120
121 S.StartStatic(XO("Sound Activated Recording"));
122 {
123 S.TieCheckBox(XXO("&Enable"), SoundActivatedRecord);
124
125 S.StartMultiColumn(2, wxEXPAND);
126 {
127 S.SetStretchyCol(1);
128
129 S.TieSlider(XXO("Le&vel (dB):"),
130 {wxT("/AudioIO/SilenceLevel"),
131 -50},
132 0,
134 }
135 S.EndMultiColumn();
136 }
137 S.EndStatic();
138
139 /* i18n-hint: start of two-part phrase, "Name newly recorded tracks with:" */
140 S.StartStatic(XO("Name newly recorded tracks"));
141 {
142 // Nested multicolumns to indent by 'With:' width, in a way that works if
143 // translated.
144 // This extra step is worth doing to get the check boxes lined up nicely.
145 S.StartMultiColumn( 2 );
146 {
147 /* i18n-hint: end of two-part phrase, "Name newly recorded tracks with:" */
148 S.AddFixedText(XO("With:")) ;
149 S.StartMultiColumn(3);
150 {
151 S.Id(UseCustomTrackNameID).TieCheckBox(XXO("Custom Track &Name"),
152 {wxT("/GUI/TrackNames/RecordingNameCustom"),
154
156 .Name(XO("Custom name text"))
157 .Disable(!mUseCustomTrackName)
158 .TieTextBox( {},
159 {wxT("/GUI/TrackNames/RecodingTrackName"),
160 _("Recorded_Audio")},
161 30);
162 }
163
164 S.EndMultiColumn();
165
166 S.AddFixedText( {} );
167 S.StartMultiColumn(3);
168 {
169 S.TieCheckBox(XXO("&Track Number"),
170 {wxT("/GUI/TrackNames/TrackNumber"),
171 false});
172
173 S.TieCheckBox(XXO("System &Date"),
174 {wxT("/GUI/TrackNames/DateStamp"),
175 false});
176
177 S.TieCheckBox(XXO("System T&ime"),
178 {wxT("/GUI/TrackNames/TimeStamp"),
179 false});
180 }
181 S.EndMultiColumn();
182 }
183 S.EndMultiColumn();
184 }
185 S.EndStatic();
186
187 #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
188 S.StartStatic(XO("Automated Recording Level Adjustment"));
189 {
190 S.TieCheckBox(XXO("Enable Automated Recording Level Adjustment."),
191 {wxT("/AudioIO/AutomatedInputLevelAdjustment"),
192 false});
193
194 S.StartMultiColumn(2, wxEXPAND);
195 {
196 S.SetStretchyCol(1);
197
198 /* i18n-hint: Desired maximum (peak) volume for sound */
199 S.TieSlider(XXO("Target Peak:"),
200 {wxT("/AudioIO/TargetPeak"),
201 AILA_DEF_TARGET_PEAK},
202 100,
203 0);
204
205 S.TieSlider(XXO("Within:"),
206 {wxT("/AudioIO/DeltaPeakVolume"),
207 AILA_DEF_DELTA_PEAK},
208 100,
209 0);
210 }
211 S.EndMultiColumn();
212
213 S.StartThreeColumn();
214 {
215 S.TieIntegerTextBox(XXO("Analysis Time:"),
216 {wxT("/AudioIO/AnalysisTime"),
217 AILA_DEF_ANALYSIS_TIME},
218 9);
219 S.AddUnits(XO("milliseconds (time of one analysis)"));
220
221 S.TieIntegerTextBox(XXO("Number of consecutive analysis:"),
222 {wxT("/AudioIO/NumberAnalysis"),
223 AILA_DEF_NUMBER_ANALYSIS},
224 2);
225 S.AddUnits(XO("0 means endless"));
226 }
227 S.EndThreeColumn();
228 }
229 S.EndStatic();
230 #endif
231
232 S.StartStatic(XO("Punch and Roll Recording"));
233 {
234 S.StartThreeColumn();
235 {
236 auto w = S
237 .NameSuffix(XO("seconds"))
238 .TieNumericTextBox(XXO("Pre-ro&ll:"),
241 9);
242 S.AddUnits(XO("seconds"));
243 }
244 {
245 auto w = S
246 .NameSuffix(XO("milliseconds"))
247 .TieNumericTextBox(XXO("Cross&fade:"),
250 9);
251 S.AddUnits(XO("milliseconds"));
252 }
253 S.EndThreeColumn();
254 }
255 S.EndStatic();
256
257 S.EndScroller();
258}
IntSetting DecibelScaleCutoff
Negation of this value is the lowest dB level that should be shown in dB scales.
Definition: Decibels.cpp:12
XXO("&Cut/Copy/Paste Toolbar")
#define _(s)
Definition: Internat.h:73
wxString WarningDialogKey(const wxString &internalDialogName)
Definition: Prefs.cpp:510
@ UseCustomTrackNameID
#define AUDIO_PRE_ROLL_KEY
#define DEFAULT_PRE_ROLL_SECONDS
#define DEFAULT_ROLL_CROSSFADE_MS
#define AUDIO_ROLL_CROSSFADE_KEY

References _, AUDIO_PRE_ROLL_KEY, AUDIO_ROLL_CROSSFADE_KEY, DecibelScaleCutoff, DEFAULT_PRE_ROLL_SECONDS, DEFAULT_ROLL_CROSSFADE_MS, mToggleCustomName, mUseCustomTrackName, Setting< T >::Read(), S, SoundActivatedRecord, UseCustomTrackNameID, WarningDialogKey(), wxT(), XO(), and XXO().

Referenced by Commit(), and Populate().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ mOldNameChoice

bool RecordingPrefs::mOldNameChoice
private

Definition at line 61 of file RecordingPrefs.h.

◆ mToggleCustomName

wxTextCtrl* RecordingPrefs::mToggleCustomName
private

Definition at line 59 of file RecordingPrefs.h.

Referenced by OnToggleCustomName(), and PopulateOrExchange().

◆ mUseCustomTrackName

bool RecordingPrefs::mUseCustomTrackName
private

Definition at line 60 of file RecordingPrefs.h.

Referenced by OnToggleCustomName(), and PopulateOrExchange().


The documentation for this class was generated from the following files: