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,
94 #ifdef EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS
95  ID_WINDOW_TYPE,
96  ID_PADDING_SIZE,
97  ID_SCALE,
98  ID_ALGORITHM,
99  ID_MINIMUM,
100  ID_MAXIMUM,
101  ID_GAIN,
102  ID_RANGE,
103  ID_FREQUENCY_GAIN,
104  ID_COLOR_SCHEME,
105  ID_SPECTRAL_SELECTION,
106 #endif
108 };
109 
110 void SpectrumPrefs::Populate(size_t windowSize)
111 {
112  PopulatePaddingChoices(windowSize);
113 
114  for (int i = 0; i < NumWindowFuncs(); i++) {
115  mTypeChoices.push_back( WindowFuncName(i) );
116  }
117 
118  //------------------------- Main section --------------------
119  // Now construct the GUI itself.
122  // ----------------------- End of main section --------------
123 }
124 
126 {
127 #ifdef EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS
128  mZeroPaddingChoice = 1;
129 
130  // The choice of window size restricts the choice of padding.
131  // So the padding menu might grow or shrink.
132 
133  // If pPaddingSizeControl is NULL, we have not yet tied the choice control.
134  // If it is not NULL, we rebuild the control by hand.
135  // I don't yet know an easier way to do this with ShuttleGUI functions.
136  // PRL
137  wxChoice *const pPaddingSizeControl =
138  static_cast<wxChoice*>(wxWindow::FindWindowById(ID_PADDING_SIZE, this));
139 
140  if (pPaddingSizeControl) {
141  mZeroPaddingChoice = pPaddingSizeControl->GetSelection();
142  pPaddingSizeControl->Clear();
143  }
144 
145  unsigned padding = 1;
146  int numChoices = 0;
147  const size_t maxWindowSize = 1 << (SpectrogramSettings::LogMaxWindowSize);
148  while (windowSize <= maxWindowSize) {
149  const auto numeral = wxString::Format(wxT("%d"), padding);
150  mZeroPaddingChoices.push_back( Verbatim( numeral ) );
151  if (pPaddingSizeControl)
152  pPaddingSizeControl->Append(numeral);
153  windowSize <<= 1;
154  padding <<= 1;
155  ++numChoices;
156  }
157 
158  mZeroPaddingChoice = std::min(mZeroPaddingChoice, numChoices - 1);
159 
160  if (pPaddingSizeControl)
161  pPaddingSizeControl->SetSelection(mZeroPaddingChoice);
162 #endif
163 }
164 
166 {
167  mPopulating = true;
168  S.SetBorder(2);
169  S.StartScroller(); {
170 
171  // S.StartStatic(XO("Track Settings"));
172  // {
173 
174 
175  mDefaultsCheckbox = 0;
176  if (mWt) {
177  /* i18n-hint: use is a verb */
178  mDefaultsCheckbox = S.Id(ID_DEFAULTS).TieCheckBox(XXO("&Use Preferences"), mDefaulted);
179  }
180 
181  S.StartMultiColumn(2,wxEXPAND);
182  {
183  S.SetStretchyCol( 0 );
184  S.SetStretchyCol( 1 );
185  S.StartStatic(XO("Scale"),1);
186  {
187  S.StartMultiColumn(2,wxEXPAND);
188  {
189  S.SetStretchyCol( 0 );
190  S.SetStretchyCol( 1 );
191  S.Id(ID_SCALE).TieChoice(XXO("S&cale:"),
194  mMinFreq =
195  S.Id(ID_MINIMUM).TieNumericTextBox(XXO("Mi&n Frequency (Hz):"),
197  12);
198  mMaxFreq =
199  S.Id(ID_MAXIMUM).TieNumericTextBox(XXO("Ma&x Frequency (Hz):"),
201  12);
202  }
203  S.EndMultiColumn();
204  }
205  S.EndStatic();
206 
207  S.StartStatic(XO("Colors"),1);
208  {
209  S.StartMultiColumn(2,wxEXPAND);
210  {
211  S.SetStretchyCol( 0 );
212  S.SetStretchyCol( 1 );
213  mGain =
214  S.Id(ID_GAIN).TieNumericTextBox(XXO("&Gain (dB):"),
216  8);
217  mRange =
218  S.Id(ID_RANGE).TieNumericTextBox(XXO("&Range (dB):"),
220  8);
221 
223  S.Id(ID_FREQUENCY_GAIN).TieNumericTextBox(XXO("High &boost (dB/dec):"),
225  8);
226 
227  // i18n-hint Scheme refers to a color scheme for spectrogram colors
228  S.Id(ID_COLOR_SCHEME).TieChoice(XC("Sche&me", "spectrum prefs"),
231  }
232  S.EndMultiColumn();
233  }
234  S.EndStatic();
235  }
236  S.EndMultiColumn();
237 
238  S.StartStatic(XO("Algorithm"));
239  {
240  S.StartMultiColumn(2);
241  {
243  S.Id(ID_ALGORITHM).TieChoice(XXO("A&lgorithm:"),
246 
247  S.Id(ID_WINDOW_SIZE).TieChoice(XXO("Window &size:"),
249  {
250  XO("8 - most wideband"),
251  XO("16"),
252  XO("32"),
253  XO("64"),
254  XO("128"),
255  XO("256"),
256  XO("512"),
257  XO("1024 - default"),
258  XO("2048"),
259  XO("4096"),
260  XO("8192"),
261  XO("16384"),
262  XO("32768 - most narrowband"),
263  }
264  );
265 
266  S.Id(ID_WINDOW_TYPE).TieChoice(XXO("Window &type:"),
268  mTypeChoices);
269 
270 #ifdef EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS
271  mZeroPaddingChoiceCtrl =
272  S.Id(ID_PADDING_SIZE).TieChoice(XXO("&Zero padding factor:"),
273  mTempSettings.zeroPaddingFactor,
274  mZeroPaddingChoices);
275 #endif
276  }
277  S.EndMultiColumn();
278  }
279  S.EndStatic();
280 
281 #ifndef SPECTRAL_SELECTION_GLOBAL_SWITCH
282  S.Id(ID_SPECTRAL_SELECTION).TieCheckBox(XXO("Ena&ble Spectral Selection"),
284 #endif
285 
286 #ifdef EXPERIMENTAL_FFT_Y_GRID
287  S.TieCheckBox(XO("Show a grid along the &Y-axis"),
288  mTempSettings.fftYGrid);
289 #endif //EXPERIMENTAL_FFT_Y_GRID
290 
291 #ifdef EXPERIMENTAL_FIND_NOTES
292  /* i18n-hint: FFT stands for Fast Fourier Transform and probably shouldn't be translated*/
293  S.StartStatic(XO("FFT Find Notes"));
294  {
295  S.StartTwoColumn();
296  {
297  mFindNotesMinA =
298  S.TieNumericTextBox(XXO("Minimum Amplitude (dB):"),
299  mTempSettings.findNotesMinA,
300  8);
301 
302  mFindNotesN =
303  S.TieNumericTextBox(XXO("Max. Number of Notes (1..128):"),
304  mTempSettings.numberOfMaxima,
305  8);
306  }
307  S.EndTwoColumn();
308 
309  S.TieCheckBox(XXO("&Find Notes"),
310  mTempSettings.fftFindNotes);
311 
312  S.TieCheckBox(XXO("&Quantize Notes"),
313  mTempSettings.findNotesQuantize);
314  }
315  S.EndStatic();
316 #endif //EXPERIMENTAL_FIND_NOTES
317  // S.EndStatic();
318 
319 #ifdef SPECTRAL_SELECTION_GLOBAL_SWITCH
320  S.StartStatic(XO("Global settings"));
321  {
322  S.TieCheckBox(XXO("Ena&ble spectral selection"),
323  SpectrogramSettings::Globals::Get().spectralSelection);
324  }
325  S.EndStatic();
326 #endif
327 
328  } S.EndScroller();
329 
330  // Enabling and disabling belongs outside this function.
331  if( S.GetMode() != eIsGettingMetadata )
333 
334  mPopulating = false;
335 }
336 
338 {
339  // Do checking for whole numbers
340 
341  // ToDo: use wxIntegerValidator<unsigned> when available
342 
343  long maxFreq;
344  if (!mMaxFreq->GetValue().ToLong(&maxFreq)) {
345  AudacityMessageBox( XO("The maximum frequency must be an integer") );
346  return false;
347  }
348 
349  long minFreq;
350  if (!mMinFreq->GetValue().ToLong(&minFreq)) {
351  AudacityMessageBox( XO("The minimum frequency must be an integer") );
352  return false;
353  }
354 
355  long gain;
356  if (!mGain->GetValue().ToLong(&gain)) {
357  AudacityMessageBox( XO("The gain must be an integer") );
358  return false;
359  }
360 
361  long range;
362  if (!mRange->GetValue().ToLong(&range)) {
363  AudacityMessageBox( XO("The range must be a positive integer") );
364  return false;
365  }
366 
367  long frequencygain;
368  if (!mFrequencyGain->GetValue().ToLong(&frequencygain)) {
369  AudacityMessageBox( XO("The frequency gain must be an integer") );
370  return false;
371  }
372 
373 #ifdef EXPERIMENTAL_FIND_NOTES
374  long findNotesMinA;
375  if (!mFindNotesMinA->GetValue().ToLong(&findNotesMinA)) {
376  AudacityMessageBox( XO("The minimum amplitude (dB) must be an integer") );
377  return false;
378  }
379 
380  long findNotesN;
381  if (!mFindNotesN->GetValue().ToLong(&findNotesN)) {
382  AudacityMessageBox( XO("The maximum number of notes must be an integer") );
383  return false;
384  }
385  if (findNotesN < 1 || findNotesN > 128) {
387 "The maximum number of notes must be in the range 1..128") );
388  return false;
389  }
390 #endif //EXPERIMENTAL_FIND_NOTES
391 
392  ShuttleGui S(this, eIsSavingToPrefs);
394 
395  // Delegate range checking to SpectrogramSettings class
397  const bool result = mTempSettings.Validate(false);
399  return result;
400 }
401 
403 {
404  if (mWt) {
405  auto channels = TrackList::Channels(mWt);
406 
407  for (auto channel : channels) {
408  if (mOrigDefaulted) {
409  channel->SetSpectrogramSettings({});
410  channel->SetSpectrumBounds(-1, -1);
411  }
412  else {
413  auto &settings =
414  channel->GetIndependentSpectrogramSettings();
415  channel->SetSpectrumBounds(mOrigMin, mOrigMax);
417  }
418  }
419  }
420 
421  if (!mWt || mOrigDefaulted) {
423  *pSettings = mOrigSettings;
424  }
425 
426  const bool isOpenPage = this->IsShown();
427  if (mWt && isOpenPage) {
428  auto channels = TrackList::Channels(mWt);
429  for (auto channel : channels)
431  }
432 
433  if (isOpenPage) {
434  if ( mProject ) {
435  auto &tp = TrackPanel::Get ( *mProject );
436  tp.UpdateVRulers();
437  tp.Refresh(false);
438  }
439  }
440 }
441 
443 {
444  if (!Validate())
445  return;
446 
447  const bool isOpenPage = this->IsShown();
448 
449  ShuttleGui S(this, eIsSavingToPrefs);
451 
452 
454 
455  if (mWt) {
456  for (auto channel : TrackList::Channels(mWt)) {
457  if (mDefaulted) {
458  channel->SetSpectrogramSettings({});
459  // ... and so that the vertical scale also defaults:
460  channel->SetSpectrumBounds(-1, -1);
461  }
462  else {
464  channel->GetIndependentSpectrogramSettings();
465  channel->SetSpectrumBounds(mTempSettings.minFreq, mTempSettings.maxFreq);
467  }
468  }
469  }
470 
471  if (!mWt || mDefaulted) {
473  *pSettings = mTempSettings;
474  }
476 
477  // Bug 2278
478  // This code destroys any Multi-view we had.
479  // Commenting it out as it seems not to be needed.
480  /*
481  if (mWt && isOpenPage) {
482  for (auto channel : TrackList::Channels(mWt))
483  WaveTrackView::Get( *channel )
484  .SetDisplay( WaveTrackViewConstants::Spectrum );
485  }
486  */
487 
488  if (isOpenPage) {
489  if ( mProject ) {
490  auto &tp = TrackPanel::Get( *mProject );
491  tp.UpdateVRulers();
492  tp.Refresh(false);
493  }
494  }
495 }
496 
498 {
499  if (!Validate())
500  return false;
501 
502  mCommitted = true;
505  if (!mWt || mDefaulted) {
506  pSettings->SavePrefs();
507  }
508  pSettings->LoadPrefs(); // always; in case Globals changed
509 
510  return true;
511 }
512 
514 {
515  return mProject != nullptr;
516 }
517 
518 void SpectrumPrefs::OnControl(wxCommandEvent&)
519 {
520  // Common routine for most controls
521  // If any per-track setting is changed, break the association with defaults
522  // Skip this, and View Settings... will be able to change defaults instead
523  // when the checkbox is on, as in the original design.
524 
525  if (mDefaultsCheckbox && !mPopulating) {
526  mDefaulted = false;
527  mDefaultsCheckbox->SetValue(false);
528  }
529 }
530 
531 void SpectrumPrefs::OnWindowSize(wxCommandEvent &evt)
532 {
533  // Restrict choice of zero padding, so that product of window
534  // size and padding may not exceed the largest window size.
535  wxChoice *const pWindowSizeControl =
536  static_cast<wxChoice*>(wxWindow::FindWindowById(ID_WINDOW_SIZE, this));
537  size_t windowSize = 1 <<
538  (pWindowSizeControl->GetSelection() + SpectrogramSettings::LogMinWindowSize);
539  PopulatePaddingChoices(windowSize);
540 
541  // Do the common part
542  OnControl(evt);
543 }
544 
545 void SpectrumPrefs::OnDefaults(wxCommandEvent &)
546 {
547  if (mDefaultsCheckbox->IsChecked()) {
550  mDefaulted = true;
553  }
554 }
555 
556 void SpectrumPrefs::OnAlgorithm(wxCommandEvent &evt)
557 {
559  OnControl(evt);
560 }
561 
563 {
564  // Enable or disable other controls that are applicable only to STFT.
565  const bool STFT =
567  mGain->Enable(STFT);
568  mRange->Enable(STFT);
569  mFrequencyGain->Enable(STFT);
570 #ifdef EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS
571  mZeroPaddingChoiceCtrl->Enable(STFT);
572 #endif
573 }
574 
575 BEGIN_EVENT_TABLE(SpectrumPrefs, PrefsPanel)
578  EVT_CHOICE(ID_ALGORITHM, SpectrumPrefs::OnAlgorithm)
579 
580  // Several controls with common routine that unchecks the default box
581  EVT_CHOICE(ID_WINDOW_TYPE, SpectrumPrefs::OnControl)
582  EVT_CHOICE(ID_PADDING_SIZE, SpectrumPrefs::OnControl)
584  EVT_TEXT(ID_MINIMUM, SpectrumPrefs::OnControl)
585  EVT_TEXT(ID_MAXIMUM, SpectrumPrefs::OnControl)
586  EVT_TEXT(ID_GAIN, SpectrumPrefs::OnControl)
588  EVT_TEXT(ID_FREQUENCY_GAIN, SpectrumPrefs::OnControl)
589  EVT_CHOICE(ID_COLOR_SCHEME, SpectrumPrefs::OnControl)
590  EVT_CHECKBOX(ID_SPECTRAL_SELECTION, SpectrumPrefs::OnControl)
591 
593 
594 PrefsPanel::Factory
596 {
597  return [=](wxWindow *parent, wxWindowID winid, AudacityProject *pProject)
598  {
599  wxASSERT(parent); // to justify safenew
600  return safenew SpectrumPrefs(parent, winid, pProject, wt);
601  };
602 }
603 
604 namespace{
606  SpectrumPrefsFactory( nullptr ),
607  false,
608  // Place it at a lower tree level
609  { "Tracks" }
610 };
611 }
SpectrumPrefs::mOrigSettings
SpectrogramSettings mOrigSettings
Definition: SpectrumPrefs.h:99
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
SpectrogramSettings::maxFreq
int maxFreq
Definition: SpectrogramSettings.h:104
SpectrogramSettings::GetAlgorithmNames
static const TranslatableStrings & GetAlgorithmNames()
Definition: SpectrogramSettings.cpp:200
SpectrogramSettings
Spectrogram settings, either for one track or as defaults.
Definition: SpectrogramSettings.h:27
SpectrumPrefs::EnableDisableSTFTOnlyControls
void EnableDisableSTFTOnlyControls()
Definition: SpectrumPrefs.cpp:562
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:69
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption=XO("Message"), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: AudacityMessageBox.h:20
SpectrogramSettings::windowType
int windowType
Definition: SpectrogramSettings.h:113
SpectrumPrefs::mDefaultsCheckbox
wxCheckBox * mDefaultsCheckbox
Definition: SpectrumPrefs.h:97
anonymous_namespace{SpectrumPrefs.cpp}::sAttachment
PrefsPanel::Registration sAttachment
Definition: SpectrumPrefs.cpp:605
SpectrogramSettings::gain
int gain
Definition: SpectrogramSettings.h:110
SpectrumPrefs::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: SpectrumPrefs.cpp:165
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:1468
SpectrogramSettings::Validate
bool Validate(bool quiet)
Definition: SpectrogramSettings.cpp:213
ID_RANGE
@ ID_RANGE
Definition: WaveformPrefs.cpp:78
SpectrumPrefs::ShowsPreviewButton
bool ShowsPreviewButton() override
Definition: SpectrumPrefs.cpp:513
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:221
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:113
SpectrogramSettings::GetScaleNames
static const EnumValueSymbols & GetScaleNames()
Definition: SpectrogramSettings.cpp:140
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
SpectrumPrefs::mOrigMax
float mOrigMax
Definition: SpectrumPrefs.h:102
SpectrumPrefs.h
SpectrogramSettings::GetColorSchemeNames
static const EnumValueSymbols & GetColorSchemeNames()
Definition: SpectrogramSettings.cpp:159
SpectrogramSettings::range
int range
Definition: SpectrogramSettings.h:109
eIsSettingToDialog
@ eIsSettingToDialog
Definition: ShuttleGui.h:40
SpectrumPrefs::OnControl
void OnControl(wxCommandEvent &event)
Definition: SpectrumPrefs.cpp:518
SpectrogramSettings::algorithm
Algorithm algorithm
Definition: SpectrogramSettings.h:163
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:101
SpectrumPrefs::mOrigMin
float mOrigMin
Definition: SpectrumPrefs.h:102
SpectrogramSettings::windowSize
int windowSize
Definition: SpectrogramSettings.h:116
ShuttleGuiBase::EndScroller
void EndScroller()
Definition: ShuttleGui.cpp:971
SpectrumPrefs::mTypeChoices
TranslatableStrings mTypeChoices
Definition: SpectrumPrefs.h:87
FFT.h
ID_SCALE
@ ID_SCALE
Definition: WaveformPrefs.cpp:77
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:152
SpectrumPrefs::mCommitted
bool mCommitted
Definition: SpectrumPrefs.h:105
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
SpectrumPrefs::mAlgorithmChoice
wxChoice * mAlgorithmChoice
Definition: SpectrumPrefs.h:89
SpectrumPrefs::Rollback
void Rollback()
Definition: SpectrumPrefs.cpp:402
SpectrumPrefs::PopulatePaddingChoices
void PopulatePaddingChoices(size_t windowSize)
Definition: SpectrumPrefs.cpp:125
SpectrogramSettings::Globals::Get
static Globals & Get()
Definition: SpectrogramSettings.cpp:52
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:99
WaveTrackView::SavePlacements
const WaveTrackSubViewPlacements & SavePlacements() const
Definition: WaveTrackView.h:111
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:329
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:149
Msgids
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Convenience function often useful when adding choice controls.
Definition: ShuttleGui.cpp:2510
WindowFuncName
const TranslatableString WindowFuncName(int whichFunction)
Definition: FFT.cpp:334
SpectrumPrefs::mDefaulted
bool mDefaulted
Definition: SpectrumPrefs.h:73
SpectrumPrefsFactory
PrefsPanel::Factory SpectrumPrefsFactory(WaveTrack *wt)
Definition: SpectrumPrefs.cpp:595
SpectrogramSettings::LoadPrefs
void LoadPrefs()
Definition: SpectrogramSettings.cpp:284
SpectrumPrefs::OnWindowSize
void OnWindowSize(wxCommandEvent &event)
Definition: SpectrumPrefs.cpp:531
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:104
eIsGettingMetadata
@ eIsGettingMetadata
Definition: ShuttleGui.h:41
SpectrogramSettings::colorScheme
ColorScheme colorScheme
Definition: SpectrogramSettings.h:141
SpectrumPrefs::Preview
void Preview() override
Definition: SpectrumPrefs.cpp:442
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:113
SpectrogramSettings::algPitchEAC
@ algPitchEAC
Definition: SpectrogramSettings.h:159
SpectrumPrefs::Commit
bool Commit() override
Definition: SpectrumPrefs.cpp:497
WaveTrackView::Get
static WaveTrackView & Get(WaveTrack &track)
Definition: WaveTrackView.cpp:771
SpectrumPrefs::Validate
bool Validate() override
Definition: SpectrumPrefs.cpp:337
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:584
ShuttleGui::GetMode
teShuttleMode GetMode()
Definition: ShuttleGui.h:752
SpectrumPrefs::Populate
void Populate(size_t windowSize)
Definition: SpectrumPrefs.cpp:110
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
SpectrogramSettings::ConvertToEnumeratedWindowSizes
void ConvertToEnumeratedWindowSizes()
Definition: SpectrogramSettings.cpp:560
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:922
SpectrumPrefs::OnAlgorithm
void OnAlgorithm(wxCommandEvent &)
Definition: SpectrumPrefs.cpp:556
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:545
ID_DEFAULTS
@ ID_DEFAULTS
Definition: SpectrumPrefs.cpp:107
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:133
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:36
SpectrumPrefs::mProject
AudacityProject * mProject
Definition: SpectrumPrefs.h:70