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_GRAYSCALE,
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  S.EndMultiColumn();
228 
229  S.Id(ID_GRAYSCALE).TieCheckBox(XXO("Gra&yscale"),
231  }
232  S.EndStatic();
233  }
234  S.EndMultiColumn();
235 
236  S.StartStatic(XO("Algorithm"));
237  {
238  S.StartMultiColumn(2);
239  {
241  S.Id(ID_ALGORITHM).TieChoice(XXO("A&lgorithm:"),
244 
245  S.Id(ID_WINDOW_SIZE).TieChoice(XXO("Window &size:"),
247  {
248  XO("8 - most wideband"),
249  XO("16"),
250  XO("32"),
251  XO("64"),
252  XO("128"),
253  XO("256"),
254  XO("512"),
255  XO("1024 - default"),
256  XO("2048"),
257  XO("4096"),
258  XO("8192"),
259  XO("16384"),
260  XO("32768 - most narrowband"),
261  }
262  );
263 
264  S.Id(ID_WINDOW_TYPE).TieChoice(XXO("Window &type:"),
266  mTypeChoices);
267 
268 #ifdef EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS
269  mZeroPaddingChoiceCtrl =
270  S.Id(ID_PADDING_SIZE).TieChoice(XXO("&Zero padding factor:"),
271  mTempSettings.zeroPaddingFactor,
272  mZeroPaddingChoices);
273 #endif
274  }
275  S.EndMultiColumn();
276  }
277  S.EndStatic();
278 
279 #ifndef SPECTRAL_SELECTION_GLOBAL_SWITCH
280  S.Id(ID_SPECTRAL_SELECTION).TieCheckBox(XXO("Ena&ble Spectral Selection"),
282 #endif
283 
284 #ifdef EXPERIMENTAL_FFT_Y_GRID
285  S.TieCheckBox(XO("Show a grid along the &Y-axis"),
286  mTempSettings.fftYGrid);
287 #endif //EXPERIMENTAL_FFT_Y_GRID
288 
289 #ifdef EXPERIMENTAL_FIND_NOTES
290  /* i18n-hint: FFT stands for Fast Fourier Transform and probably shouldn't be translated*/
291  S.StartStatic(XO("FFT Find Notes"));
292  {
293  S.StartTwoColumn();
294  {
295  mFindNotesMinA =
296  S.TieNumericTextBox(XXO("Minimum Amplitude (dB):"),
297  mTempSettings.findNotesMinA,
298  8);
299 
300  mFindNotesN =
301  S.TieNumericTextBox(XXO("Max. Number of Notes (1..128):"),
302  mTempSettings.numberOfMaxima,
303  8);
304  }
305  S.EndTwoColumn();
306 
307  S.TieCheckBox(XXO("&Find Notes"),
308  mTempSettings.fftFindNotes);
309 
310  S.TieCheckBox(XXO("&Quantize Notes"),
311  mTempSettings.findNotesQuantize);
312  }
313  S.EndStatic();
314 #endif //EXPERIMENTAL_FIND_NOTES
315  // S.EndStatic();
316 
317 #ifdef SPECTRAL_SELECTION_GLOBAL_SWITCH
318  S.StartStatic(XO("Global settings"));
319  {
320  S.TieCheckBox(XXO("Ena&ble spectral selection"),
321  SpectrogramSettings::Globals::Get().spectralSelection);
322  }
323  S.EndStatic();
324 #endif
325 
326  } S.EndScroller();
327 
328  // Enabling and disabling belongs outside this function.
329  if( S.GetMode() != eIsGettingMetadata )
331 
332  mPopulating = false;
333 }
334 
336 {
337  // Do checking for whole numbers
338 
339  // ToDo: use wxIntegerValidator<unsigned> when available
340 
341  long maxFreq;
342  if (!mMaxFreq->GetValue().ToLong(&maxFreq)) {
343  AudacityMessageBox( XO("The maximum frequency must be an integer") );
344  return false;
345  }
346 
347  long minFreq;
348  if (!mMinFreq->GetValue().ToLong(&minFreq)) {
349  AudacityMessageBox( XO("The minimum frequency must be an integer") );
350  return false;
351  }
352 
353  long gain;
354  if (!mGain->GetValue().ToLong(&gain)) {
355  AudacityMessageBox( XO("The gain must be an integer") );
356  return false;
357  }
358 
359  long range;
360  if (!mRange->GetValue().ToLong(&range)) {
361  AudacityMessageBox( XO("The range must be a positive integer") );
362  return false;
363  }
364 
365  long frequencygain;
366  if (!mFrequencyGain->GetValue().ToLong(&frequencygain)) {
367  AudacityMessageBox( XO("The frequency gain must be an integer") );
368  return false;
369  }
370 
371 #ifdef EXPERIMENTAL_FIND_NOTES
372  long findNotesMinA;
373  if (!mFindNotesMinA->GetValue().ToLong(&findNotesMinA)) {
374  AudacityMessageBox( XO("The minimum amplitude (dB) must be an integer") );
375  return false;
376  }
377 
378  long findNotesN;
379  if (!mFindNotesN->GetValue().ToLong(&findNotesN)) {
380  AudacityMessageBox( XO("The maximum number of notes must be an integer") );
381  return false;
382  }
383  if (findNotesN < 1 || findNotesN > 128) {
385 "The maximum number of notes must be in the range 1..128") );
386  return false;
387  }
388 #endif //EXPERIMENTAL_FIND_NOTES
389 
390  ShuttleGui S(this, eIsSavingToPrefs);
392 
393  // Delegate range checking to SpectrogramSettings class
395  const bool result = mTempSettings.Validate(false);
397  return result;
398 }
399 
401 {
402  if (mWt) {
403  auto channels = TrackList::Channels(mWt);
404 
405  for (auto channel : channels) {
406  if (mOrigDefaulted) {
407  channel->SetSpectrogramSettings({});
408  channel->SetSpectrumBounds(-1, -1);
409  }
410  else {
411  auto &settings =
412  channel->GetIndependentSpectrogramSettings();
413  channel->SetSpectrumBounds(mOrigMin, mOrigMax);
415  }
416  }
417  }
418 
419  if (!mWt || mOrigDefaulted) {
421  *pSettings = mOrigSettings;
422  }
423 
424  const bool isOpenPage = this->IsShown();
425  if (mWt && isOpenPage) {
426  auto channels = TrackList::Channels(mWt);
427  for (auto channel : channels)
429  }
430 
431  if (isOpenPage) {
432  if ( mProject ) {
433  auto &tp = TrackPanel::Get ( *mProject );
434  tp.UpdateVRulers();
435  tp.Refresh(false);
436  }
437  }
438 }
439 
441 {
442  if (!Validate())
443  return;
444 
445  const bool isOpenPage = this->IsShown();
446 
447  ShuttleGui S(this, eIsSavingToPrefs);
449 
450 
452 
453  if (mWt) {
454  for (auto channel : TrackList::Channels(mWt)) {
455  if (mDefaulted) {
456  channel->SetSpectrogramSettings({});
457  // ... and so that the vertical scale also defaults:
458  channel->SetSpectrumBounds(-1, -1);
459  }
460  else {
462  channel->GetIndependentSpectrogramSettings();
463  channel->SetSpectrumBounds(mTempSettings.minFreq, mTempSettings.maxFreq);
465  }
466  }
467  }
468 
469  if (!mWt || mDefaulted) {
471  *pSettings = mTempSettings;
472  }
474 
475  // Bug 2278
476  // This code destroys any Multi-view we had.
477  // Commenting it out as it seems not to be needed.
478  /*
479  if (mWt && isOpenPage) {
480  for (auto channel : TrackList::Channels(mWt))
481  WaveTrackView::Get( *channel )
482  .SetDisplay( WaveTrackViewConstants::Spectrum );
483  }
484  */
485 
486  if (isOpenPage) {
487  if ( mProject ) {
488  auto &tp = TrackPanel::Get( *mProject );
489  tp.UpdateVRulers();
490  tp.Refresh(false);
491  }
492  }
493 }
494 
496 {
497  if (!Validate())
498  return false;
499 
500  mCommitted = true;
503  if (!mWt || mDefaulted) {
504  pSettings->SavePrefs();
505  }
506  pSettings->LoadPrefs(); // always; in case Globals changed
507 
508  return true;
509 }
510 
512 {
513  return mProject != nullptr;
514 }
515 
516 void SpectrumPrefs::OnControl(wxCommandEvent&)
517 {
518  // Common routine for most controls
519  // If any per-track setting is changed, break the association with defaults
520  // Skip this, and View Settings... will be able to change defaults instead
521  // when the checkbox is on, as in the original design.
522 
523  if (mDefaultsCheckbox && !mPopulating) {
524  mDefaulted = false;
525  mDefaultsCheckbox->SetValue(false);
526  }
527 }
528 
529 void SpectrumPrefs::OnWindowSize(wxCommandEvent &evt)
530 {
531  // Restrict choice of zero padding, so that product of window
532  // size and padding may not exceed the largest window size.
533  wxChoice *const pWindowSizeControl =
534  static_cast<wxChoice*>(wxWindow::FindWindowById(ID_WINDOW_SIZE, this));
535  size_t windowSize = 1 <<
536  (pWindowSizeControl->GetSelection() + SpectrogramSettings::LogMinWindowSize);
537  PopulatePaddingChoices(windowSize);
538 
539  // Do the common part
540  OnControl(evt);
541 }
542 
543 void SpectrumPrefs::OnDefaults(wxCommandEvent &)
544 {
545  if (mDefaultsCheckbox->IsChecked()) {
548  mDefaulted = true;
551  }
552 }
553 
554 void SpectrumPrefs::OnAlgorithm(wxCommandEvent &evt)
555 {
557  OnControl(evt);
558 }
559 
561 {
562  // Enable or disable other controls that are applicable only to STFT.
563  const bool STFT =
565  mGain->Enable(STFT);
566  mRange->Enable(STFT);
567  mFrequencyGain->Enable(STFT);
568 #ifdef EXPERIMENTAL_ZERO_PADDED_SPECTROGRAMS
569  mZeroPaddingChoiceCtrl->Enable(STFT);
570 #endif
571 }
572 
573 BEGIN_EVENT_TABLE(SpectrumPrefs, PrefsPanel)
576  EVT_CHOICE(ID_ALGORITHM, SpectrumPrefs::OnAlgorithm)
577 
578  // Several controls with common routine that unchecks the default box
579  EVT_CHOICE(ID_WINDOW_TYPE, SpectrumPrefs::OnControl)
580  EVT_CHOICE(ID_PADDING_SIZE, SpectrumPrefs::OnControl)
582  EVT_TEXT(ID_MINIMUM, SpectrumPrefs::OnControl)
583  EVT_TEXT(ID_MAXIMUM, SpectrumPrefs::OnControl)
584  EVT_TEXT(ID_GAIN, SpectrumPrefs::OnControl)
586  EVT_TEXT(ID_FREQUENCY_GAIN, SpectrumPrefs::OnControl)
587  EVT_CHECKBOX(ID_GRAYSCALE, SpectrumPrefs::OnControl)
588  EVT_CHECKBOX(ID_SPECTRAL_SELECTION, SpectrumPrefs::OnControl)
589 
591 
592 PrefsPanel::Factory
594 {
595  return [=](wxWindow *parent, wxWindowID winid, AudacityProject *pProject)
596  {
597  wxASSERT(parent); // to justify safenew
598  return safenew SpectrumPrefs(parent, winid, pProject, wt);
599  };
600 }
601 
602 namespace{
604  SpectrumPrefsFactory( nullptr ),
605  false,
606  // Place it at a lower tree level
607  { "Tracks" }
608 };
609 }
SpectrumPrefs::mOrigSettings
SpectrogramSettings mOrigSettings
Definition: SpectrumPrefs.h:99
TranslatableString
Definition: Types.h:290
SpectrumPrefs::mOrigDefaulted
bool mOrigDefaulted
Definition: SpectrumPrefs.h:73
SpectrogramSettings::maxFreq
int maxFreq
Definition: SpectrogramSettings.h:103
ID_RANGE
@ ID_RANGE
Definition: WaveformPrefs.cpp:78
SpectrogramSettings::GetAlgorithmNames
static const TranslatableStrings & GetAlgorithmNames()
Definition: SpectrogramSettings.cpp:159
SpectrogramSettings
Spectrogram settings, either for one track or as defaults.
Definition: SpectrogramSettings.h:27
SpectrumPrefs::EnableDisableSTFTOnlyControls
void EnableDisableSTFTOnlyControls()
Definition: SpectrumPrefs.cpp:560
WaveTrack
A Track that contains audio waveform data.
Definition: WaveTrack.h:68
SpectrumPrefs::HelpPageName
wxString HelpPageName() override
Definition: SpectrumPrefs.cpp:80
SpectrogramSettings::windowType
int windowType
Definition: SpectrogramSettings.h:112
SpectrumPrefs::mDefaultsCheckbox
wxCheckBox * mDefaultsCheckbox
Definition: SpectrumPrefs.h:97
anonymous_namespace{SpectrumPrefs.cpp}::sAttachment
PrefsPanel::Registration sAttachment
Definition: SpectrumPrefs.cpp:603
SpectrogramSettings::gain
int gain
Definition: SpectrogramSettings.h:109
SpectrumPrefs::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S) override
Definition: SpectrumPrefs.cpp:165
ID_DEFAULTS
@ ID_DEFAULTS
Definition: SpectrumPrefs.cpp:107
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: AudacityMessageBox.h:20
SpectrumPrefs::mGain
wxTextCtrl * mGain
Definition: SpectrumPrefs.h:77
SpectrogramSettings::LogMinWindowSize
@ LogMinWindowSize
Definition: SpectrogramSettings.h:48
SpectrumPrefs::mFrequencyGain
wxTextCtrl * mFrequencyGain
Definition: SpectrumPrefs.h:79
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1603
TrackList::Channels
static auto Channels(TrackType *pTrack) -> TrackIterRange< TrackType >
Definition: Track.h:1467
SpectrogramSettings::Validate
bool Validate(bool quiet)
Definition: SpectrogramSettings.cpp:172
SpectrumPrefs::ShowsPreviewButton
bool ShowsPreviewButton() override
Definition: SpectrumPrefs.cpp:511
NumWindowFuncs
int NumWindowFuncs()
Definition: FFT.cpp:330
SpectrumPrefs::~SpectrumPrefs
virtual ~SpectrumPrefs()
Definition: SpectrumPrefs.cpp:64
PrefsPanel::Registration
Definition: PrefsPanel.h:84
TrackPanel::Get
static TrackPanel & Get(AudacityProject &project)
Definition: TrackPanel.cpp:222
XO
#define XO(s)
Definition: Internat.h:32
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:107
SpectrogramSettings::GetScaleNames
static const EnumValueSymbols & GetScaleNames()
Definition: SpectrogramSettings.cpp:140
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1212
SpectrumPrefs::mOrigMax
float mOrigMax
Definition: SpectrumPrefs.h:102
SpectrumPrefs.h
SpectrogramSettings::range
int range
Definition: SpectrogramSettings.h:108
eIsSettingToDialog
@ eIsSettingToDialog
Definition: ShuttleGui.h:38
SpectrumPrefs::OnControl
void OnControl(wxCommandEvent &event)
Definition: SpectrumPrefs.cpp:516
SpectrogramSettings::algorithm
Algorithm algorithm
Definition: SpectrogramSettings.h:147
ComponentInterfaceSymbol
ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional,...
Definition: ComponentInterface.h:60
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2248
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:115
ShuttleGuiBase::EndScroller
void EndScroller()
Definition: ShuttleGui.cpp:964
SpectrumPrefs::mTypeChoices
TranslatableStrings mTypeChoices
Definition: SpectrumPrefs.h:87
XXO
#define XXO(s)
Definition: Internat.h:45
ShuttleGuiBase::StartScroller
wxScrolledWindow * StartScroller(int iStyle=0)
Definition: ShuttleGui.cpp:931
SpectrogramSettings::spectralSelection
bool spectralSelection
Definition: SpectrogramSettings.h:136
ID_WINDOW_SIZE
@ ID_WINDOW_SIZE
Definition: SpectrumPrefs.cpp:93
SpectrumPrefs::mCommitted
bool mCommitted
Definition: SpectrumPrefs.h:105
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1203
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:400
Msgids
TranslatableStrings Msgids(const EnumValueSymbol strings[], size_t nStrings)
Definition: Internat.cpp:267
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:374
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:105
ShuttleGuiBase::TieNumericTextBox
wxTextCtrl * TieNumericTextBox(const TranslatableString &Prompt, int &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1647
SpectrumPrefs::GetDescription
TranslatableString GetDescription() override
Definition: SpectrumPrefs.cpp:75
SpectrogramSettings::SavePrefs
void SavePrefs()
Definition: SpectrogramSettings.cpp:285
SpectrogramSettings::scaleType
ScaleType scaleType
Definition: SpectrogramSettings.h:133
WindowFuncName
const TranslatableString WindowFuncName(int whichFunction)
Definition: FFT.cpp:335
SpectrumPrefs::mDefaulted
bool mDefaulted
Definition: SpectrumPrefs.h:73
SpectrogramSettings::isGrayscale
bool isGrayscale
Definition: SpectrogramSettings.h:131
SpectrumPrefsFactory
PrefsPanel::Factory SpectrumPrefsFactory(WaveTrack *wt)
Definition: SpectrumPrefs.cpp:593
SpectrogramSettings::LoadPrefs
void LoadPrefs()
Definition: SpectrogramSettings.cpp:240
ID_SCALE
@ ID_SCALE
Definition: WaveformPrefs.cpp:77
SpectrumPrefs::OnWindowSize
void OnWindowSize(wxCommandEvent &event)
Definition: SpectrumPrefs.cpp:529
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:886
eIsSavingToPrefs
@ eIsSavingToPrefs
Definition: ShuttleGui.h:46
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
SpectrumPrefs::mPopulating
bool mPopulating
Definition: SpectrumPrefs.h:104
eIsGettingMetadata
@ eIsGettingMetadata
Definition: ShuttleGui.h:39
SpectrumPrefs::Preview
void Preview() override
Definition: SpectrumPrefs.cpp:440
SpectrogramSettings::LogMaxWindowSize
@ LogMaxWindowSize
Definition: SpectrogramSettings.h:49
SpectrumPrefs::mRange
wxTextCtrl * mRange
Definition: SpectrumPrefs.h:78
AudacityProject
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:112
SpectrogramSettings::algPitchEAC
@ algPitchEAC
Definition: SpectrogramSettings.h:143
SpectrumPrefs::Commit
bool Commit() override
Definition: SpectrumPrefs.cpp:495
Verbatim
TranslatableString Verbatim(wxString str)
Definition: Types.h:581
WaveTrackView::Get
static WaveTrackView & Get(WaveTrack &track)
Definition: WaveTrackView.cpp:763
SpectrumPrefs::Validate
bool Validate() override
Definition: SpectrumPrefs.cpp:335
SpectrogramSettings::ConvertToActualWindowSizes
void ConvertToActualWindowSizes()
Definition: SpectrogramSettings.cpp:542
ShuttleGui::GetMode
teShuttleMode GetMode()
Definition: ShuttleGui.h:759
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:497
ShuttleGuiBase::EndTwoColumn
void EndTwoColumn()
Definition: ShuttleGui.h:375
eIsCreatingFromPrefs
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:45
SpectrogramSettings::ConvertToEnumeratedWindowSizes
void ConvertToEnumeratedWindowSizes()
Definition: SpectrogramSettings.cpp:518
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:915
SpectrumPrefs::OnAlgorithm
void OnAlgorithm(wxCommandEvent &)
Definition: SpectrumPrefs.cpp:554
safenew
#define safenew
Definition: MemoryX.h:8
settings
static Settings & settings()
Definition: TrackInfo.cpp:87
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:195
SpectrogramSettings::frequencyGain
int frequencyGain
Definition: SpectrogramSettings.h:110
SpectrumPrefs::OnDefaults
void OnDefaults(wxCommandEvent &)
Definition: SpectrumPrefs.cpp:543
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:1701
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:102
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:638
SpectrogramSettings::Globals::SavePrefs
void SavePrefs()
Definition: SpectrogramSettings.cpp:36
SpectrumPrefs::mProject
AudacityProject * mProject
Definition: SpectrumPrefs.h:70