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 267 of file RecordingPrefs.cpp.

268{
271
273
276
277 #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
278 double targetpeak, deltapeak;
279 gPrefs->Read(wxT("/AudioIO/TargetPeak"), &targetpeak);
280 gPrefs->Read(wxT("/AudioIO/DeltaPeakVolume"), &deltapeak);
281 if (targetpeak + deltapeak > 100.0 || targetpeak - deltapeak < 0.0)
282 {
283 gPrefs->Write(wxT("/AudioIO/DeltaPeakVolume"), min(100.0 - targetpeak, targetpeak));
284 }
285
286 int value;
287 gPrefs->Read(wxT("/AudioIO/AnalysisTime"), &value);
288 if (value <= 0)
289 gPrefs->Write(wxT("/AudioIO/AnalysisTime"), AILA_DEF_ANALYSIS_TIME);
290
291 gPrefs->Read(wxT("/AudioIO/NumberAnalysis"), &value);
292 if (value < 0)
293 gPrefs->Write(wxT("/AudioIO/NumberAnalysis"), AILA_DEF_NUMBER_ANALYSIS);
294 #endif
295 return true;
296}
BoolSetting SoundActivatedRecord
Definition: AudioIO.cpp:3356
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:287
bool Reset()
Reset to the default value.
Definition: Prefs.h:282
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:205
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:630
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 298 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#ifdef EXPERIMENTAL_DA
93 false
94#else
95 true
96#endif
97 });
98
99//#if defined(__WXMAC__)
100// Bug 388. Feature not supported on any Mac Hardware.
101#if 0
102 S.TieCheckBox(XO("Use &hardware to play other tracks"),
103 {wxT("/AudioIO/Playthrough"),
104 false});
105#endif
106 S.TieCheckBox(XXO("Audible input &monitoring"),
107 {wxT("/AudioIO/SWPlaythrough"),
108 false});
109#if !defined(__WXMAC__)
110 //S.AddUnits(XO(" (uncheck when recording computer playback)"));
111#endif
112
113 S.TieCheckBox(XXO("Record on a new track"),
114 {wxT("/GUI/PreferNewTrackRecord"),
115 false});
116
117/* i18n-hint: Dropout is a loss of a short sequence audio sample data from the recording */
118 S.TieCheckBox(XXO("Detect dropouts"),
119 {WarningDialogKey(wxT("DropoutDetected")),
120 true});
121
122
123 }
124 S.EndStatic();
125
126 S.StartStatic(XO("Sound Activated Recording"));
127 {
128 S.TieCheckBox(XXO("&Enable"), SoundActivatedRecord);
129
130 S.StartMultiColumn(2, wxEXPAND);
131 {
132 S.SetStretchyCol(1);
133
134 S.TieSlider(XXO("Le&vel (dB):"),
135 {wxT("/AudioIO/SilenceLevel"),
136 -50},
137 0,
139 }
140 S.EndMultiColumn();
141 }
142 S.EndStatic();
143
144 /* i18n-hint: start of two-part phrase, "Name newly recorded tracks with:" */
145 S.StartStatic(XO("Name newly recorded tracks"));
146 {
147 // Nested multicolumns to indent by 'With:' width, in a way that works if
148 // translated.
149 // This extra step is worth doing to get the check boxes lined up nicely.
150 S.StartMultiColumn( 2 );
151 {
152 /* i18n-hint: end of two-part phrase, "Name newly recorded tracks with:" */
153 S.AddFixedText(XO("With:")) ;
154 S.StartMultiColumn(3);
155 {
156 S.Id(UseCustomTrackNameID).TieCheckBox(XXO("Custom Track &Name"),
157 {wxT("/GUI/TrackNames/RecordingNameCustom"),
159
161 .Name(XO("Custom name text"))
162 .Disable(!mUseCustomTrackName)
163 .TieTextBox( {},
164 {wxT("/GUI/TrackNames/RecodingTrackName"),
165 _("Recorded_Audio")},
166 30);
167 }
168
169 S.EndMultiColumn();
170
171 S.AddFixedText( {} );
172 S.StartMultiColumn(3);
173 {
174 S.TieCheckBox(XXO("&Track Number"),
175 {wxT("/GUI/TrackNames/TrackNumber"),
176 false});
177
178 S.TieCheckBox(XXO("System &Date"),
179 {wxT("/GUI/TrackNames/DateStamp"),
180 false});
181
182 S.TieCheckBox(XXO("System T&ime"),
183 {wxT("/GUI/TrackNames/TimeStamp"),
184 false});
185 }
186 S.EndMultiColumn();
187 }
188 S.EndMultiColumn();
189 }
190 S.EndStatic();
191
192 #ifdef EXPERIMENTAL_AUTOMATED_INPUT_LEVEL_ADJUSTMENT
193 S.StartStatic(XO("Automated Recording Level Adjustment"));
194 {
195 S.TieCheckBox(XXO("Enable Automated Recording Level Adjustment."),
196 {wxT("/AudioIO/AutomatedInputLevelAdjustment"),
197 false});
198
199 S.StartMultiColumn(2, wxEXPAND);
200 {
201 S.SetStretchyCol(1);
202
203 /* i18n-hint: Desired maximum (peak) volume for sound */
204 S.TieSlider(XXO("Target Peak:"),
205 {wxT("/AudioIO/TargetPeak"),
206 AILA_DEF_TARGET_PEAK},
207 100,
208 0);
209
210 S.TieSlider(XXO("Within:"),
211 {wxT("/AudioIO/DeltaPeakVolume"),
212 AILA_DEF_DELTA_PEAK},
213 100,
214 0);
215 }
216 S.EndMultiColumn();
217
218 S.StartThreeColumn();
219 {
220 S.TieIntegerTextBox(XXO("Analysis Time:"),
221 {wxT("/AudioIO/AnalysisTime"),
222 AILA_DEF_ANALYSIS_TIME},
223 9);
224 S.AddUnits(XO("milliseconds (time of one analysis)"));
225
226 S.TieIntegerTextBox(XXO("Number of consecutive analysis:"),
227 {wxT("/AudioIO/NumberAnalysis"),
228 AILA_DEF_NUMBER_ANALYSIS},
229 2);
230 S.AddUnits(XO("0 means endless"));
231 }
232 S.EndThreeColumn();
233 }
234 S.EndStatic();
235 #endif
236
237#ifdef EXPERIMENTAL_PUNCH_AND_ROLL
238 S.StartStatic(XO("Punch and Roll Recording"));
239 {
240 S.StartThreeColumn();
241 {
242 auto w = S
243 .NameSuffix(XO("seconds"))
244 .TieNumericTextBox(XXO("Pre-ro&ll:"),
247 9);
248 S.AddUnits(XO("seconds"));
249 }
250 {
251 auto w = S
252 .NameSuffix(XO("milliseconds"))
253 .TieNumericTextBox(XXO("Cross&fade:"),
256 9);
257 S.AddUnits(XO("milliseconds"));
258 }
259 S.EndThreeColumn();
260 }
261 S.EndStatic();
262#endif
263
264 S.EndScroller();
265}
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:484
@ 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: