Audacity  3.0.3
WaveformSettings.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 WaveformSettings.h
6 
7 Paul Licameli
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_WAVEFORM_SETTINGS__
12 #define __AUDACITY_WAVEFORM_SETTINGS__
13 
14 #include "Prefs.h"
15 
16 class EnumValueSymbols;
17 
18 class AUDACITY_DLL_API WaveformSettings : public PrefsListener
19 {
20 public:
21 
22  // Singleton for settings that are not per-track
23  class AUDACITY_DLL_API Globals
24  {
25  public:
26  static Globals &Get();
27  void SavePrefs();
28 
29  private:
30  Globals();
31  void LoadPrefs();
32  };
33 
34  static WaveformSettings &defaults();
36  WaveformSettings(const WaveformSettings &other);
37  WaveformSettings& operator= (const WaveformSettings &other);
39 
40  bool IsDefault() const
41  {
42  return this == &defaults();
43  }
44 
45  bool Validate(bool quiet);
46  void LoadPrefs();
47  void SavePrefs();
48  void Update();
49 
50  void UpdatePrefs() override;
51 
52  void ConvertToEnumeratedDBRange();
53  void ConvertToActualDBRange();
54  void NextLowerDBRange();
55  void NextHigherDBRange();
56 
57  typedef int ScaleType;
58  enum ScaleTypeValues : int {
61 
63  };
64 
65  static const EnumValueSymbols &GetScaleNames();
66 
68  int dBRange;
69 
70  // Convenience
71  bool isLinear() const { return stLinear == scaleType; }
72 };
73 #endif
WaveformSettings::isLinear
bool isLinear() const
Definition: WaveformSettings.h:71
WaveformSettings::scaleType
ScaleType scaleType
Definition: WaveformSettings.h:67
WaveformSettings::ScaleTypeValues
ScaleTypeValues
Definition: WaveformSettings.h:58
WaveformSettings::ScaleType
int ScaleType
Definition: WaveformSettings.h:57
TrackInfo::UpdatePrefs
AUDACITY_DLL_API void UpdatePrefs(wxWindow *pParent)
WaveformSettings::Globals
Definition: WaveformSettings.h:24
PrefsListener
A listener notified of changes in preferences.
Definition: Prefs.h:389
WaveformSettings::stLogarithmic
@ stLogarithmic
Definition: WaveformSettings.h:60
EnumValueSymbols
Definition: Prefs.h:239
BasicUI::Get
Services * Get()
Fetch the global instance, or nullptr if none is yet installed.
Definition: BasicUI.cpp:26
WaveformSettings::stNumScaleTypes
@ stNumScaleTypes
Definition: WaveformSettings.h:62
WaveformSettings::dBRange
int dBRange
Definition: WaveformSettings.h:68
WaveformSettings
Waveform settings, either for one track or as defaults.
Definition: WaveformSettings.h:19
Prefs.h
WaveformSettings::IsDefault
bool IsDefault() const
Definition: WaveformSettings.h:40
WaveformSettings::stLinear
@ stLinear
Definition: WaveformSettings.h:59