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

#include <SpectrogramSettings.h>

Inheritance diagram for SpectrogramSettings::ColorSchemeEnumSetting:
[legend]
Collaboration diagram for SpectrogramSettings::ColorSchemeEnumSetting:
[legend]

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)
overrideprivatevirtual

Reimplemented from ChoiceSetting.

Definition at line 258 of file SpectrogramSettings.cpp.

259{
260 // Migrate old grayscale option to Color scheme choice
261 bool isGrayscale = SpectrumGrayscale.Read();
262 if (isGrayscale && !gPrefs->Read(wxT("/Spectrum/ColorScheme"), &value)) {
263 value = GetColorSchemeNames().at(csGrayscale).Internal();
264 Write(value);
265 gPrefs->Flush();
266 }
267}
wxT("CloseDown"))
audacity::BasicSettings * gPrefs
Definition: Prefs.cpp:68
bool Write(const wxString &value)
Definition: Prefs.cpp:424
bool Read(T *pVar) const
overload of Read returning a boolean that is true if the value was previously defined *‍/
Definition: Prefs.h:207
static const EnumValueSymbols & GetColorSchemeNames()
virtual bool Flush() noexcept=0
virtual bool Read(const wxString &key, bool *value) const =0

References SpectrogramSettings::csGrayscale, audacity::BasicSettings::Flush(), SpectrogramSettings::GetColorSchemeNames(), gPrefs, audacity::BasicSettings::Read(), 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: