Audacity  3.0.3
SpectrumPrefs.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  SpectrumPrefs.cpp
6 
7  Dominic Mazzoni
8  James Crook
9 
10 *******************************************************************//*******************************************************************/
16 
17 
18 #include "SpectrumPrefs.h"
19 
20 #include <wx/choice.h>
21 #include <wx/defs.h>
22 #include <wx/intl.h>
23 #include <wx/checkbox.h>
24 #include <wx/textctrl.h>
25 
26 #include "FFT.h"
27 #include "Project.h"
28 #include "../ShuttleGui.h"
29 
30 #include "../TrackPanel.h"
31 #include "../WaveTrack.h"
32 #include "../tracks/playabletrack/wavetrack/ui/WaveTrackView.h"
33 
34 #include <algorithm>
35 
36 #include "../widgets/AudacityMessageBox.h"
37 
38 SpectrumPrefs::SpectrumPrefs(wxWindow * parent, wxWindowID winid,
39  AudacityProject *pProject, WaveTrack *wt)
40 : PrefsPanel(parent, winid, wt ? XO("Spectrogram Settings") : XO("Spectrograms"))
41 , mProject{ pProject }
42 , mWt(wt)
43 , mPopulating(false)
44 {
45  if (mWt) {
46  SpectrogramSettings &settings = wt->GetSpectrogramSettings();
47  mOrigDefaulted = mDefaulted = (&SpectrogramSettings::defaults() == &settings);
48  mTempSettings = mOrigSettings = settings;
49  wt->GetSpectrumBounds(&mOrigMin, &mOrigMax);
50  mTempSettings.maxFreq = mOrigMax;
51  mTempSettings.minFreq = mOrigMin;
52  mOrigPlacements = WaveTrackView::Get( *mWt ).SavePlacements();
53  }
54  else {
55  mTempSettings = mOrigSettings = SpectrogramSettings::defaults();
56  mOrigDefaulted = mDefaulted = false;
57  }
58 
59  const auto windowSize = mTempSettings.WindowSize();
60  mTempSettings.ConvertToEnumeratedWindowSizes();
61  Populate(windowSize);
62 }
63 
65 {
66  if (!mCommitted)
67  Rollback();
68 }
69 
71 {
73 }
74 
76 {
77  return XO("Preferences for Spectrum");
78 }
79 
81 {
82  // Currently (May2017) Spectrum Settings is the only preferences
83  // we ever display in a dialog on its own without others.
84  // We do so when it is configuring spectrums for a track.
85  // Because this happens, we want to visit a different help page.
86  // So we change the page name in the case of a page on its own.
87  return mWt
88  ? "Spectrogram_Settings"
89  : "Spectrograms_Preferences";
90 }
91 
92 enum {
93  ID_WINDOW_SIZE = 10001,
106 };
107 
108 void SpectrumPrefs::Populate(size_t windowSize)
109 {
110  PopulatePaddingChoices(windowSize);
111 
112  for (int i = 0; i < NumWindowFuncs(); i++) {
113  mTypeChoices.push_back( WindowFuncName(i) );
114  }
115 
116  //------------------------- Main section --------------------
117  // Now construct the GUI itself.
120  // ----------------------- End of main section --------------
121 }
122 
124 {
125  mZeroPaddingChoice = 1;
126 
127  // The choice of window size restricts the choice of padding.
128  // So the padding menu might grow or shrink.
129 
130  // If pPaddingSizeControl is NULL, we have not yet tied the choice control.
131  // If it is not NULL, we rebuild the control by hand.
132  // I don't yet know an easier way to do this with ShuttleGUI functions.
133  // PRL
134  wxChoice *const pPaddingSizeControl =
135  static_cast<wxChoice*>(wxWindow::FindWindowById(ID_PADDING_SIZE, this));
136 
137  if (pPaddingSizeControl) {
138  mZeroPaddingChoice = pPaddingSizeControl->GetSelection();
139  pPaddingSizeControl->Clear();
140  }
141 
142  unsigned padding = 1;
143  int numChoices = 0;
144  const size_t maxWindowSize = 1 << (SpectrogramSettings::LogMaxWindowSize);
145  while (windowSize <= maxWindowSize) {
146  const auto numeral = wxString::Format(wxT("%d"), padding);
147  mZeroPaddingChoices.push_back( Verbatim( numeral ) );
148  if (pPaddingSizeControl)
149  pPaddingSizeControl->Append(numeral);
150  windowSize <<= 1;
151  padding <<= 1;
152  ++numChoices;
153  }
154 
156 
157  if (pPaddingSizeControl)
158  pPaddingSizeControl->SetSelection(mZeroPaddingChoice);
159 }
160 
162 {
163  mPopulating = true;
164  S.SetBorder(2);
165  S.StartScroller(); {
166 
167  // S.StartStatic(XO("Track Settings"));
168  // {
169 
170 
171  mDefaultsCheckbox = 0;
172  if (mWt) {
173  /* i18n-hint: use is a verb */
174  mDefaultsCheckbox = S.Id(ID_DEFAULTS).TieCheckBox(XXO("&Use Preferences"), mDefaulted);
175  }
176 
177  S.StartMultiColumn(2,wxEXPAND);
178  {
179  S.SetStretchyCol( 0 );
180  S.SetStretchyCol( 1 );
181  S.StartStatic(XO("Scale"),1);
182  {
183  S.StartMultiColumn(2,wxEXPAND);
184  {
185  S.SetStretchyCol( 0 );
186  S.SetStretchyCol( 1 );
187  S.Id(ID_SCALE).TieChoice(XXO("S&cale:"),
190  mMinFreq =
191  S.Id(ID_MINIMUM).TieNumericTextBox(XXO("Mi&n Frequency (Hz):"),
193  12);
194  mMaxFreq =
195  S.Id(ID_MAXIMUM).TieNumericTextBox(XXO("Ma&x Frequency (Hz):"),
197  12);
198  }
199  S.EndMultiColumn();
200  }
201  S.EndStatic();
202 
203  S.StartStatic(XO("Colors"),1);
204  {
205  S.StartMultiColumn(2,wxEXPAND);
206  {
207  S.SetStretchyCol( 0 );
208  S.SetStretchyCol( 1 );
209  mGain =
210  S.Id(ID_GAIN).TieNumericTextBox(XXO("&Gain (dB):"),
212  8);
213  mRange =
214  S.Id(ID_RANGE).TieNumericTextBox(XXO("&Range (dB):"),
216  8);
217 
219  S.Id(ID_FREQUENCY_GAIN).TieNumericTextBox(XXO("High &boost (dB/dec):"),
221  8);
222 
223  // i18n-hint Scheme refers to a color scheme for spectrogram colors
224  S.Id(ID_COLOR_SCHEME).TieChoice(XC("Sche&me", "spectrum prefs"),
227  }
228  S.EndMultiColumn();
229  }
230  S.EndStatic();
231  }
232  S.EndMultiColumn();
233 
234  S.StartStatic(XO("Algorithm"));
235  {
236  S.StartMultiColumn(2);
237  {
239  S.Id(ID_ALGORITHM).TieChoice(XXO("A&lgorithm:"),
242 
243  S.Id(ID_WINDOW_SIZE).TieChoice(XXO("Window &size:"),
245  {
246  XO("8 - most wideband"),
247  XO("16"),
248  XO("32"),
249  XO("64"),
250  XO("128"),
251  XO("256"),
252  XO("512"),
253  XO("1024 - default"),
254  XO("2048"),
255  XO("4096"),
256  XO("8192"),
257  XO("16384"),
258  XO("32768 - most narrowband"),
259  }
260  );
261 
262  S.Id(ID_WINDOW_TYPE).TieChoice(XXO("Window &type:"),
264  mTypeChoices);
265 
267  S.Id(ID_PADDING_SIZE).TieChoice(XXO("&Zero padding factor:"),
270  }
271  S.EndMultiColumn();
272  }
273  S.EndStatic();
274 
275 #ifndef SPECTRAL_SELECTION_GLOBAL_SWITCH
276  S.Id(ID_SPECTRAL_SELECTION).TieCheckBox(XXO("Ena&ble Spectral Selection"),
278 #endif
279 
280 #ifdef EXPERIMENTAL_FFT_Y_GRID
281  S.TieCheckBox(XO("Show a grid along the &Y-axis"),
282  mTempSettings.fftYGrid);
283 #endif //EXPERIMENTAL_FFT_Y_GRID
284 
285 #ifdef EXPERIMENTAL_FIND_NOTES
286  /* i18n-hint: FFT stands for Fast Fourier Transform and probably shouldn't be translated*/
287  S.StartStatic(XO("FFT Find Notes"));
288  {
289  S.StartTwoColumn();
290  {
291  mFindNotesMinA =
292  S.TieNumericTextBox(XXO("Minimum Amplitude (dB):"),
293  mTempSettings.findNotesMinA,
294  8);
295 
296  mFindNotesN =
297  S.TieNumericTextBox(XXO("Max. Number of Notes (1..128):"),
298  mTempSettings.numberOfMaxima,
299  8);
300  }
301  S.EndTwoColumn();
302 
303  S.TieCheckBox(XXO("&Find Notes"),
304  mTempSettings.fftFindNotes);
305 
306  S.TieCheckBox(XXO("&Quantize Notes"),
307  mTempSettings.findNotesQuantize);
308  }
309  S.EndStatic();
310 #endif //EXPERIMENTAL_FIND_NOTES
311  // S.EndStatic();
312 
313 #ifdef SPECTRAL_SELECTION_GLOBAL_SWITCH
314  S.StartStatic(XO("Global settings"));
315  {
316  S.TieCheckBox(XXO("Ena&ble spectral selection"),
317  SpectrogramSettings::Globals::Get().spectralSelection);
318  }
319  S.EndStatic();
320 #endif
321 
322  } S.EndScroller();
323 
324  // Enabling and disabling belongs outside this function.
325  if( S.GetMode() != eIsGettingMetadata )
327 
328  mPopulating = false;
329 }
330 
332 {
333  // Do checking for whole numbers
334 
335  // ToDo: use wxIntegerValidator<unsigned> when available
336 
337  long maxFreq;
338  if (!mMaxFreq->GetValue().ToLong(&maxFreq)) {
339  AudacityMessageBox( XO("The maximum frequency must be an integer") );
340  return false;
341  }
342 
343  long minFreq;
344  if (!mMinFreq->GetValue().ToLong(&minFreq)) {
345  AudacityMessageBox( XO("The minimum frequency must be an integer") );
346  return false;
347  }
348 
349  long gain;
350  if (!mGain->GetValue().ToLong(&gain)) {
351  AudacityMessageBox( XO("The gain must be an integer") );
352  return false;
353  }
354 
355  long range;
356  if (!mRange->GetValue().ToLong(&range)) {
357  AudacityMessageBox( XO("The range must be a positive integer") );
358  return false;
359  }
360 
361  long frequencygain;
362  if (!mFrequencyGain->GetValue().ToLong(&frequencygain)) {
363  AudacityMessageBox( XO("The frequency gain must be an integer") );
364  return false;
365  }
366 
367 #ifdef EXPERIMENTAL_FIND_NOTES
368  long findNotesMinA;
369  if (!mFindNotesMinA->GetValue().ToLong(&findNotesMinA)) {
370  AudacityMessageBox( XO("The minimum amplitude (dB) must be an integer") );
371  return false;
372  }
373 
374  long findNotesN;
375  if (!mFindNotesN->GetValue().ToLong(&findNotesN)) {
376  AudacityMessageBox( XO("The maximum number of notes must be an integer") );
377  return false;
378  }
379  if (findNotesN < 1 || findNotesN > 128) {
381 "The maximum number of notes must be in the range 1..128") );
382  return false;
383  }
384 #endif //EXPERIMENTAL_FIND_NOTES
385 
386  ShuttleGui S(this, eIsSavingToPrefs);
388 
389  // Delegate range checking to SpectrogramSettings class
391  const bool result = mTempSettings.Validate(false);
393  return result;
394 }
395 
397 {
398  if (mWt) {
399  auto channels = TrackList::Channels(mWt);
400 
401  for (auto channel : channels) {
402  if (mOrigDefaulted) {
403  channel->SetSpectrogramSettings({});
404  channel->SetSpectrumBounds(-1, -1);
405  }
406  else {
407  auto &settings =
408  channel->GetIndependentSpectrogramSettings();
409  channel->SetSpectrumBounds(mOrigMin, mOrigMax);
411  }
412  }
413  }
414 
415  if (!mWt || mOrigDefaulted) {
417  *pSettings = mOrigSettings;
418  }
419 
420  const bool isOpenPage = this->IsShown();
421  if (mWt && isOpenPage) {
422  auto channels = TrackList::Channels(mWt);
423  for (auto channel : channels)
425  }
426 
427  if (isOpenPage) {
428  if ( mProject ) {
429  auto &tp = TrackPanel::Get ( *mProject );
430  tp.UpdateVRulers();
431  tp.Refresh(false);
432  }
433  }
434 }
435 
437 {
438  if (!Validate())
439  return;
440 
441  const bool isOpenPage = this->IsShown();
442 
443  ShuttleGui S(this, eIsSavingToPrefs);
445 
446 
448 
449  if (mWt) {
450  for (auto channel : TrackList::Channels(mWt)) {
451  if (mDefaulted) {
452  channel->SetSpectrogramSettings({});
453  // ... and so that the vertical scale also defaults:
454  channel->SetSpectrumBounds(-1, -1);
455  }
456  else {
458  channel->GetIndependentSpectrogramSettings();
459  channel->SetSpectrumBounds(mTempSettings.minFreq, mTempSettings.maxFreq);
461  }
462  }
463  }
464 
465  if (!mWt || mDefaulted) {
467  *pSettings = mTempSettings;
468  }
470 
471  // Bug 2278
472  // This code destroys any Multi-view we had.
473  // Commenting it out as it seems not to be needed.
474  /*
475  if (mWt && isOpenPage) {
476  for (auto channel : TrackList::Channels(mWt))
477  WaveTrackView::Get( *channel )
478  .SetDisplay( WaveTrackViewConstants::Spectrum );
479  }
480  */
481 
482  if (isOpenPage) {
483  if ( mProject ) {
484  auto &tp = TrackPanel::Get( *mProject );
485  tp.UpdateVRulers();
486  tp.Refresh(false);
487  }
488  }
489 }
490 
492 {
493  if (!Validate())
494  return false;
495 
496  mCommitted = true;
499  if (!mWt || mDefaulted) {
500  pSettings->SavePrefs();
501  }
502  pSettings->LoadPrefs(); // always; in case Globals changed
503 
504  return true;
505 }
506 
508 {
509  return mProject != nullptr;
510 }
511 
512 void SpectrumPrefs::OnControl(wxCommandEvent&)
513 {
514  // Common routine for most controls
515  // If any per-track setting is changed, break the association with defaults
516  // Skip this, and View Settings... will be able to change defaults instead
517  // when the checkbox is on, as in the original design.
518 
519  if (mDefaultsCheckbox && !mPopulating) {
520  mDefaulted = false;
521  mDefaultsCheckbox->SetValue(false);
522  }
523 }
524 
525 void SpectrumPrefs::OnWindowSize(wxCommandEvent &evt)
526 {
527  // Restrict choice of zero padding, so that product of window
528  // size and padding may not exceed the largest window size.
529  wxChoice *const pWindowSizeControl =
530  static_cast<wxChoice*>(wxWindow::FindWindowById(ID_WINDOW_SIZE, this));
531  size_t windowSize = 1 <<
532  (pWindowSizeControl->GetSelection() + SpectrogramSettings::LogMinWindowSize);
533  PopulatePaddingChoices(windowSize);
534 
535  // Do the common part
536  OnControl(evt);
537 }
538 
539 void SpectrumPrefs::OnDefaults(wxCommandEvent &)
540 {
541  if (mDefaultsCheckbox->IsChecked()) {
544  mDefaulted = true;
547  }
548 }
549 
550 void SpectrumPrefs::OnAlgorithm(wxCommandEvent &evt)
551 {
553  OnControl(evt);
554 }
555 
557 {
558  // Enable or disable other controls that are applicable only to STFT.
559  const bool STFT =
561  mGain->Enable(STFT);
562  mRange->Enable(STFT);
563  mFrequencyGain->Enable(STFT);
564  mZeroPaddingChoiceCtrl->Enable(STFT);
565 }
566 
567 BEGIN_EVENT_TABLE(SpectrumPrefs, PrefsPanel)
571 
572  // Several controls with common routine that unchecks the default box
583 
585 
586 PrefsPanel::Factory
588 {
589  return [=](wxWindow *parent, wxWindowID winid, AudacityProject *pProject)
590  {
591  wxASSERT(parent); // to justify safenew
592  return safenew SpectrumPrefs(parent, winid, pProject, wt);
593  };
594 }
595 
596 namespace{
598  SpectrumPrefsFactory( nullptr ),
599  false,
600  // Place it at a lower tree level
601  { "Tracks" }
602 };
603 }
SpectrumPrefs::mOrigSettings
SpectrogramSettings mOrigSettings
Definition: SpectrumPrefs.h:100
TranslatableString
Holds a msgid for the translation catalog; may also bind format arguments.
Definition: TranslatableString.h:32
SpectrumPrefs::mOrigDefaulted
bool mOrigDefaulted
Definition: SpectrumPrefs.h:73
ID_MINIMUM
@ ID_MINIMUM
Definition: SpectrumPrefs.cpp:98
SpectrogramSettings::maxFreq
int maxFreq
Definition: SpectrogramSettings.h:104
SpectrogramSettings::GetAlgorithmNames
static const TranslatableStrings & GetAlgorithmNames()
Definition: SpectrogramSettings.cpp:244
SpectrogramSettings
Spectrogram settings, either for one track or as defaults.
Definition: SpectrogramSettings.h:27
SpectrumPrefs::EnableDisableSTFTOnlyControls
void EnableDisableSTFTOnlyControls()
Definition: SpectrumPrefs.cpp:556
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
SpectrogramSettings::windowType
int windowType
Definition: SpectrogramSettings.h:113
SpectrumPrefs::mDefaultsCheckbox
wxCheckBox * mDefaultsCheckbox
Definition: SpectrumPrefs.h:98
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Definition: AudacityMessageBox.cpp:17
anonymous_namespace{SpectrumPrefs.cpp}::sAttachment
PrefsPanel::Registration sAttachment
Definition: SpectrumPrefs.cpp:597
SpectrogramSettings::gain
int gain
Definition: SpectrogramSettings.h:110
SpectrumPrefs::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: SpectrumPrefs.cpp:161
Project.h
SpectrumPrefs::mGain
wxTextCtrl * mGain
Definition: SpectrumPrefs.h:77
SpectrogramSettings::LogMinWindowSize
@ LogMinWindowSize
Definition: SpectrogramSettings.h:48
ID_WINDOW_SIZE
@ ID_WINDOW_SIZE
Definition: SpectrumPrefs.cpp:93
SpectrumPrefs::mFrequencyGain
wxTextCtrl * mFrequencyGain
Definition: SpectrumPrefs.h:79
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1629
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1484
SpectrogramSettings::Validate
bool Validate(bool quiet)
Definition: SpectrogramSettings.cpp:257
ID_ALGORITHM
@ ID_ALGORITHM
Definition: SpectrumPrefs.cpp:97
SpectrumPrefs::ShowsPreviewButton
bool ShowsPreviewButton() override
Definition: SpectrumPrefs.cpp:507
NumWindowFuncs
int NumWindowFuncs()
Definition: FFT.cpp:329
SpectrumPrefs::~SpectrumPrefs
virtual ~SpectrumPrefs()
Definition: SpectrumPrefs.cpp:64
PrefsPanel::Registration
Definition: PrefsPanel.h:84
TrackPanel::Get
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:227
XO
#define XO(s)
Definition: Internat.h:31
XC
#define XC(s, c)
Definition: Internat.h:37
SpectrumPrefs::mMaxFreq
wxTextCtrl * mMaxFreq
Definition: SpectrumPrefs.h:76
SPECTRUM_PREFS_PLUGIN_SYMBOL
#define SPECTRUM_PREFS_PLUGIN_SYMBOL
Definition: SpectrumPrefs.h:39
WaveTrackView::RestorePlacements
void RestorePlacements(const WaveTrackSubViewPlacements &placements)
Definition: WaveTrackView.h:135
SpectrogramSettings::GetScaleNames
static const EnumValueSymbols & GetScaleNames()
Definition: SpectrogramSettings.cpp:184
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
SpectrumPrefs::mOrigMax
float mOrigMax
Definition: SpectrumPrefs.h:103
SpectrumPrefs.h
SpectrogramSettings::GetColorSchemeNames
static const EnumValueSymbols & GetColorSchemeNames()
Definition: SpectrogramSettings.cpp:203
ID_FREQUENCY_GAIN
@ ID_FREQUENCY_GAIN
Definition: SpectrumPrefs.cpp:102
SpectrogramSettings::range
int range
Definition: SpectrogramSettings.h:109
SpectrumPrefs::mZeroPaddingChoice
int mZeroPaddingChoice
Definition: SpectrumPrefs.h:84
eIsSettingToDialog
@ eIsSettingToDialog
Definition: ShuttleGui.h:40
SpectrumPrefs::mZeroPaddingChoices
TranslatableStrings mZeroPaddingChoices
Definition: SpectrumPrefs.h:86
SpectrumPrefs::OnControl
void OnControl(wxCommandEvent &event)
Definition: SpectrumPrefs.cpp:512
SpectrogramSettings::algorithm
Algorithm algorithm
Definition: SpectrogramSettings.h:161
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterfaceSymbol.h:27
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2274
SpectrumPrefs::GetSymbol
ComponentInterfaceSymbol GetSymbol() override
Definition: SpectrumPrefs.cpp:70
SpectrumPrefs::mOrigPlacements
std::vector< WaveTrackSubViewPlacement > mOrigPlacements
Definition: SpectrumPrefs.h:102
SpectrumPrefs::mOrigMin
float mOrigMin
Definition: SpectrumPrefs.h:103
ID_COLOR_SCHEME
@ ID_COLOR_SCHEME
Definition: SpectrumPrefs.cpp:103
SpectrogramSettings::windowSize
int windowSize
Definition: SpectrogramSettings.h:116
ShuttleGuiBase::EndScroller
void EndScroller()
Definition: ShuttleGui.cpp:971
SpectrumPrefs::mTypeChoices
TranslatableStrings mTypeChoices
Definition: SpectrumPrefs.h:88
FFT.h
XXO
#define XXO(s)
Definition: Internat.h:44
ShuttleGuiBase::StartScroller
wxScrolledWindow * StartScroller(int iStyle=0)
Definition: ShuttleGui.cpp:938
SpectrogramSettings::spectralSelection
bool spectralSelection
Definition: SpectrogramSettings.h:150
ID_PADDING_SIZE
@ ID_PADDING_SIZE
Definition: SpectrumPrefs.cpp:95
SpectrumPrefs::mCommitted
bool mCommitted
Definition: SpectrumPrefs.h:106
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
SpectrumPrefs::SpectrumPrefs
SpectrumPrefs(wxWindow *parent, wxWindowID winid, AudacityProject *pProject, WaveTrack *wt)
Definition: SpectrumPrefs.cpp:38
ID_MAXIMUM
@ ID_MAXIMUM
Definition: SpectrumPrefs.cpp:99
SpectrumPrefs::mAlgorithmChoice
wxChoice * mAlgorithmChoice
Definition: SpectrumPrefs.h:90
SpectrumPrefs::Rollback
void Rollback()
Definition: SpectrumPrefs.cpp:396
SpectrumPrefs::PopulatePaddingChoices
void PopulatePaddingChoices(size_t windowSize)
Definition: SpectrumPrefs.cpp:123
SpectrogramSettings::Globals::Get
static Globals & Get()
Definition: SpectrogramSettings.cpp:100
ShuttleGuiBase::StartTwoColumn
void StartTwoColumn()
Definition: ShuttleGui.h:366
SpectrumPrefs
A PrefsPanel for spectrum settings.
Definition: SpectrumPrefs.h:42
SpectrumPrefs::mTempSettings
SpectrogramSettings mTempSettings
Definition: SpectrumPrefs.h:100
WaveTrackView::SavePlacements
const WaveTrackSubViewPlacements & SavePlacements() const
Definition: WaveTrackView.h:133
ShuttleGuiBase::TieNumericTextBox
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, int &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1673
SpectrumPrefs::GetDescription
TranslatableString GetDescription() override
Definition: SpectrumPrefs.cpp:75
SpectrogramSettings::SavePrefs
void SavePrefs()
Definition: SpectrogramSettings.cpp:371
SpectrumPrefs::HelpPageName
ManualPageID HelpPageName() override
If not empty string, the Help button is added below the panel.
Definition: SpectrumPrefs.cpp:80
SpectrogramSettings::scaleType
ScaleType scaleType
Definition: SpectrogramSettings.h:147
SpectrumPrefs::mZeroPaddingChoiceCtrl
wxChoice * mZeroPaddingChoiceCtrl
Definition: SpectrumPrefs.h:85
Msgids
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
Definition: ShuttleGui.cpp:2522
WindowFuncName
const TranslatableString WindowFuncName(int whichFunction)
Definition: FFT.cpp:334
ID_WINDOW_TYPE
@ ID_WINDOW_TYPE
Definition: SpectrumPrefs.cpp:94
SpectrumPrefs::mDefaulted
bool mDefaulted
Definition: SpectrumPrefs.h:73
SpectrumPrefsFactory
PrefsPanel::Factory SpectrumPrefsFactory(WaveTrack *wt)
Definition: SpectrumPrefs.cpp:587
SpectrogramSettings::LoadPrefs
void LoadPrefs()
Definition: SpectrogramSettings.cpp:328
SpectrumPrefs::OnWindowSize
void OnWindowSize(wxCommandEvent &event)
Definition: SpectrumPrefs.cpp:525
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:893
eIsSavingToPrefs
@ eIsSavingToPrefs
Definition: ShuttleGui.h:48
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
SpectrumPrefs::mPopulating
bool mPopulating
Definition: SpectrumPrefs.h:105
eIsGettingMetadata
@ eIsGettingMetadata
Definition: ShuttleGui.h:41
SpectrogramSettings::colorScheme
ColorScheme colorScheme
Definition: SpectrogramSettings.h:139
SpectrumPrefs::Preview
void Preview() override
Definition: SpectrumPrefs.cpp:436
SpectrogramSettings::LogMaxWindowSize
@ LogMaxWindowSize
Definition: SpectrogramSettings.h:49
SpectrumPrefs::mRange
wxTextCtrl * mRange
Definition: SpectrumPrefs.h:78
TaggedIdentifier< ManualPageIDTag >
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:92
SpectrogramSettings::algPitchEAC
@ algPitchEAC
Definition: SpectrogramSettings.h:157
SpectrumPrefs::Commit
bool Commit() override
Definition: SpectrumPrefs.cpp:491
ID_SCALE
@ ID_SCALE
Definition: SpectrumPrefs.cpp:96
WaveTrackView::Get
static WaveTrackView & Get(WaveTrack &track)
Definition: WaveTrackView.cpp:851
ID_RANGE
@ ID_RANGE
Definition: SpectrumPrefs.cpp:101
SpectrogramSettings::zeroPaddingFactor
int zeroPaddingFactor
Definition: SpectrogramSettings.h:121
SpectrumPrefs::Validate
bool Validate() override
Definition: SpectrumPrefs.cpp:331
Verbatim
TranslatableString Verbatim(wxString str)
Require calls to the one-argument constructor to go through this distinct global function name.
Definition: TranslatableString.h:321
SpectrogramSettings::ConvertToActualWindowSizes
void ConvertToActualWindowSizes()
Definition: SpectrogramSettings.cpp:592
ShuttleGui::GetMode
teShuttleMode GetMode()
Definition: ShuttleGui.h:752
SpectrumPrefs::Populate
void Populate(size_t windowSize)
Definition: SpectrumPrefs.cpp:108
PrefsPanel
Base class for a panel in the PrefsDialog. Classes derived from this class include BatchPrefs,...
Definition: PrefsPanel.h:51
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
ShuttleGuiBase::EndTwoColumn
void EndTwoColumn()
Definition: ShuttleGui.h:367
eIsCreatingFromPrefs
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:47
ID_SPECTRAL_SELECTION
@ ID_SPECTRAL_SELECTION
Definition: SpectrumPrefs.cpp:104
SpectrogramSettings::ConvertToEnumeratedWindowSizes
void ConvertToEnumeratedWindowSizes()
Definition: SpectrogramSettings.cpp:570
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:922
ID_GAIN
@ ID_GAIN
Definition: SpectrumPrefs.cpp:100
SpectrumPrefs::OnAlgorithm
void OnAlgorithm(wxCommandEvent &)
Definition: SpectrumPrefs.cpp:550
safenew
#define safenew
Definition: MemoryX.h:10
settings
static Settings & settings()
Definition: TrackInfo.cpp:86
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
SpectrogramSettings::frequencyGain
int frequencyGain
Definition: SpectrogramSettings.h:111
SpectrumPrefs::OnDefaults
void OnDefaults(wxCommandEvent &)
Definition: SpectrumPrefs.cpp:539
ID_DEFAULTS
@ ID_DEFAULTS
Definition: SpectrumPrefs.cpp:105
SpectrumPrefs::mMinFreq
wxTextCtrl * mMinFreq
Definition: SpectrumPrefs.h:75
END_EVENT_TABLE
END_EVENT_TABLE()
ShuttleGuiBase::TieChoice
wxChoice * TieChoice(const TranslatableString &Prompt, TranslatableString &Selected, const TranslatableStrings &choices)
Definition: ShuttleGui.cpp:1727
SpectrogramSettings::defaults
static SpectrogramSettings & defaults()
Definition: SpectrogramSettings.cpp:177
SpectrumPrefs::mWt
WaveTrack *const mWt
Definition: SpectrumPrefs.h:72
SpectrogramSettings::minFreq
int minFreq
Definition: SpectrogramSettings.h:103
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:631
SpectrogramSettings::Globals::SavePrefs
void SavePrefs()
Definition: SpectrogramSettings.cpp:85
SpectrumPrefs::mProject
AudacityProject * mProject
Definition: SpectrumPrefs.h:70