Audacity 3.2.0
Public Member Functions | List of all members
TimeDisplayModeSetting Class Reference

#include <TimeDisplayMode.h>

Inheritance diagram for TimeDisplayModeSetting:
[legend]
Collaboration diagram for TimeDisplayModeSetting:
[legend]

Public Member Functions

bool WriteEnum (TimeDisplayMode value)
 
template<typename Callback >
Observer::Subscription Subscribe (Callback callback)
 
template<typename Key >
 EnumSetting (Key &&key, EnumValueSymbols symbols, long defaultSymbol, std::vector< Enum > values, const wxString &oldKey={})
 
- Public Member Functions inherited from EnumSetting< TimeDisplayMode >
 EnumSetting (Key &&key, EnumValueSymbols symbols, long defaultSymbol, std::vector< TimeDisplayMode > values, const wxString &oldKey={})
 
TimeDisplayMode ReadEnum () const
 
TimeDisplayMode ReadEnumWithDefault (TimeDisplayMode defaultValue) const
 
bool WriteEnum (TimeDisplayMode 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)
 

Additional Inherited Members

- 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
 
- Private Types inherited from Observer::Publisher< TimeDisplayMode >
using message_type = TimeDisplayMode
 
using CallbackReturn = std::conditional_t< true, void, bool >
 
using Callback = std::function< CallbackReturn(const TimeDisplayMode &) >
 Type of functions that can be connected to the Publisher. More...
 
- Private Member Functions inherited from Observer::Publisher< TimeDisplayMode >
 Publisher (ExceptionPolicy *pPolicy=nullptr, Alloc a={})
 Constructor supporting type-erased custom allocation/deletion. More...
 
 Publisher (Publisher &&)=default
 
Publisheroperator= (Publisher &&)=default
 
Subscription Subscribe (Callback callback)
 Connect a callback to the Publisher; later-connected are called earlier. More...
 
Subscription Subscribe (Object &obj, Return(Object::*callback)(Args...))
 Overload of Subscribe takes an object and pointer-to-member-function. More...
 
CallbackReturn Publish (const TimeDisplayMode &message)
 Send a message to connected callbacks. More...
 
- Static Private Attributes inherited from Observer::Publisher< TimeDisplayMode >
static constexpr bool notifies_all
 

Detailed Description

Definition at line 24 of file TimeDisplayMode.h.

Member Function Documentation

◆ EnumSetting()

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

Definition at line 519 of file Prefs.h.

525 {}
526 )
528 std::forward<Key>(key), move(symbols), defaultSymbol,
529 ConvertValues(values), oldKey
530 }
531 {}
const wxChar * values
static const AudacityProject::AttachedObjects::RegisteredFactory key
std::vector< int > ConvertValues(const std::vector< TimeDisplayMode > &values)
Definition: Prefs.h:550

◆ Subscribe()

template<typename Callback >
Observer::Subscription TimeDisplayModeSetting::Subscribe ( Callback  callback)
inline

Definition at line 34 of file TimeDisplayMode.h.

35 {
37 std::move(callback));
38 }
Subscription Subscribe(Callback callback)
Connect a callback to the Publisher; later-connected are called earlier.
Definition: Observer.h:199

References Observer::Publisher< Message, NotifyAll >::Subscribe().

Here is the call graph for this function:

◆ WriteEnum()

bool TimeDisplayModeSetting::WriteEnum ( TimeDisplayMode  value)

Definition at line 28 of file TimeDisplayMode.cpp.

29{
30 if (!EnumSetting::WriteEnum(value))
31 return false;
32
33 Publish(value);
34
35 return true;
36}
bool WriteEnum(Enum value)
Definition: Prefs.h:546
CallbackReturn Publish(const TimeDisplayMode &message)
Send a message to connected callbacks.
Definition: Observer.h:207

References Observer::Publisher< TimeDisplayMode >::Publish(), and EnumSetting< Enum >::WriteEnum().

Referenced by AdornedRulerPanel::OnTimelineFormatChange(), and AdornedRulerPanel::SetTimeDisplayMode().

Here is the call graph for this function:
Here is the caller graph for this function:

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