Audacity  3.0.3
Public Member Functions | List of all members
EnumSetting< Enum > Class Template Reference

Adapts EnumSettingBase to a particular enumeration type. More...

#include <Prefs.h>

Inheritance diagram for EnumSetting< Enum >:
[legend]

Public Member Functions

 EnumSetting (const SettingBase &key, EnumValueSymbols symbols, long defaultSymbol, std::vector< Enum > values, const wxString &oldKey={})
 
Enum ReadEnum () const
 
Enum ReadEnumWithDefault (Enum defaultValue) const
 
bool WriteEnum (Enum value)
 

Detailed Description

template<typename Enum>
class EnumSetting< Enum >

Adapts EnumSettingBase to a particular enumeration type.

Definition at line 353 of file Prefs.h.

Constructor & Destructor Documentation

◆ EnumSetting()

template<typename Enum >
EnumSetting< Enum >::EnumSetting ( const SettingBase key,
EnumValueSymbols  symbols,
long  defaultSymbol,
std::vector< Enum >  values,
const wxString &  oldKey = {} 
)
inline

Definition at line 357 of file Prefs.h.

363  {}
364  )
365  : EnumSettingBase{
366  key, symbols, defaultSymbol,
367  { values.begin(), values.end() },
368  oldKey
369  }
370  {}

Member Function Documentation

◆ ReadEnum()

template<typename Enum >
Enum EnumSetting< Enum >::ReadEnum ( ) const
inline

Definition at line 373 of file Prefs.h.

374  { return static_cast<Enum>( ReadInt() ); }

Referenced by Dither::BestDitherChoice(), Exporter::CheckMix(), NoteTrack::ExportAllegro(), Dither::FastDitherChoice(), SpectrogramSettings::LoadPrefs(), Resample::SetMethod(), SpectrogramSettings::UpdatePrefs(), and TracksPrefs::ViewModeChoice().

Here is the caller graph for this function:

◆ ReadEnumWithDefault()

template<typename Enum >
Enum EnumSetting< Enum >::ReadEnumWithDefault ( Enum  defaultValue) const
inline

Definition at line 379 of file Prefs.h.

380  {
381  auto integer = static_cast<int>(defaultValue);
382  return static_cast<Enum>( ReadIntWithDefault( integer ) );
383  }

◆ WriteEnum()

template<typename Enum >
bool EnumSetting< Enum >::WriteEnum ( Enum  value)
inline

Definition at line 385 of file Prefs.h.

386  { return WriteInt( static_cast<int>( value ) ); }

Referenced by SpectrogramSettings::SavePrefs().

Here is the caller graph for this function:

The documentation for this class was generated from the following files:
EnumSettingBase
Definition: Prefs.h:320
anonymous_namespace{ProjectSerializer.cpp}::ReadInt
static const auto ReadInt
Definition: ProjectSerializer.cpp:179
key
static const AudacityProject::AttachedObjects::RegisteredFactory key
Definition: CommandManager.cpp:201
anonymous_namespace{ProjectSerializer.cpp}::WriteInt
static const auto WriteInt
Definition: ProjectSerializer.cpp:168
values
const wxChar * values
Definition: Equalization.cpp:472