Audacity 3.2.0
Private Member Functions | List of all members
SpectrogramSettings::ColorSchemeEnumSetting Class Reference

#include <SpectrogramSettings.h>

Inheritance diagram for SpectrogramSettings::ColorSchemeEnumSetting:
Collaboration diagram for SpectrogramSettings::ColorSchemeEnumSetting:

Private Member Functions

void Migrate (wxString &value) override

Additional Inherited Members

- Public Member Functions inherited from EnumSetting< ColorScheme >
 EnumSetting (Key &&key, EnumValueSymbols symbols, long defaultSymbol, std::vector< ColorScheme > values, const wxString &oldKey={})
ColorScheme ReadEnum () const
ColorScheme ReadEnumWithDefault (ColorScheme defaultValue) const
bool WriteEnum (ColorScheme value)
- Public Member Functions inherited from EnumSettingBase
template<typename Key >
 EnumSettingBase (Key &&key, EnumValueSymbols symbols, long defaultSymbol, std::vector< int > intValues, const wxString &oldKey={})
- Public Member Functions inherited from ChoiceSetting
 ChoiceSetting (const SettingPath &, EnumValueSymbols, long=-1)=delete
 ChoiceSetting (TransactionalSettingBase &key, EnumValueSymbols symbols, long defaultSymbol=-1)
 ChoiceSetting (const SettingBase &key, EnumValueSymbols symbols, long defaultSymbol=-1)
const wxString & Key () const
const EnumValueSymbolDefault () const
const EnumValueSymbolsGetSymbols () const
wxString Read () const
wxString ReadWithDefault (const wxString &) const
bool Write (const wxString &value)
void SetDefault (long value)
- Protected Member Functions inherited from EnumSettingBase
int ReadInt () const
int ReadIntWithDefault (int defaultValue) const
bool WriteInt (int code)
size_t FindInt (int code) const
void Migrate (wxString &) override
- Protected Member Functions inherited from ChoiceSetting
size_t Find (const wxString &value) const
virtual void Migrate (wxString &)
- Protected Attributes inherited from ChoiceSetting
const wxString mKey
const EnumValueSymbols mSymbols
TransactionalSettingBase *const mpOtherSettings {}
bool mMigrated { false }
long mDefaultSymbol

Detailed Description

Definition at line 157 of file SpectrogramSettings.h.

Member Function Documentation

◆ Migrate()

void SpectrogramSettings::ColorSchemeEnumSetting::Migrate ( wxString &  value)

Reimplemented from ChoiceSetting.

Definition at line 259 of file SpectrogramSettings.cpp.

261 // Migrate old grayscale option to Color scheme choice
262 bool isGrayscale = SpectrumGrayscale.Read();
263 if (isGrayscale && !gPrefs->Read(wxT("/Spectrum/ColorScheme"), &value)) {
264 value = GetColorSchemeNames().at(csGrayscale).Internal();
265 Write(value);
266 gPrefs->Flush();
267 }
FileConfig * gPrefs
Definition: Prefs.cpp:70
bool Write(const wxString &value)
Definition: Prefs.cpp:390
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:143
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:200
static const EnumValueSymbols & GetColorSchemeNames()

References SpectrogramSettings::csGrayscale, FileConfig::Flush(), SpectrogramSettings::GetColorSchemeNames(), gPrefs, Setting< T >::Read(), anonymous_namespace{SpectrogramSettings.cpp}::SpectrumGrayscale, ChoiceSetting::Write(), and wxT().

Here is the call graph for this function:

The documentation for this class was generated from the following files: