Audacity 3.2.0
|
This specialization of Setting for bool adds a Toggle method to negate the saved value. More...
#include <Prefs.h>
Public Member Functions | |
bool | Toggle () |
Write the negation of the previous value, and return true if successful. More... | |
Setting (const SettingBase &path, const T &defaultValue) | |
Usual overload supplies a default value. More... | |
Setting (const SettingBase &path, DefaultValueFunction function) | |
This overload causes recomputation of the default each time it is needed. More... | |
Public Member Functions inherited from Setting< bool > | |
Setting (const SettingBase &path, const bool &defaultValue) | |
Usual overload supplies a default value. More... | |
Setting (const SettingBase &path, DefaultValueFunction function) | |
This overload causes recomputation of the default each time it is needed. More... | |
const bool & | GetDefault () const |
bool | Read (bool *pVar) const |
overload of Read returning a boolean that is true if the value was previously defined */ More... | |
bool | Read () const |
overload of Read, always returning a value More... | |
bool | ReadWithDefault (bool *pVar, const bool &defaultValue) const |
overload of ReadWithDefault returning a boolean that is true if the value was previously defined */ More... | |
bool | ReadWithDefault (const bool &defaultValue) const |
new direct use is discouraged but it may be needed in legacy code More... | |
bool | Write (const bool &value) |
Write value to config and return true if successful. More... | |
bool | Reset () |
Reset to the default value. More... | |
void | Invalidate () override |
Public Member Functions inherited from CachingSettingBase< bool > | |
CachingSettingBase (const SettingBase &path) | |
Public Member Functions inherited from TransactionalSettingBase | |
virtual void | Invalidate ()=0 |
SettingBase (const char *path) | |
SettingBase (const wxChar *path) | |
SettingBase (const wxString &path) | |
SettingBase (const SettingBase &)=default | |
Public Member Functions inherited from SettingBase | |
SettingBase (const char *path) | |
SettingBase (const wxChar *path) | |
SettingBase (const wxString &path) | |
audacity::BasicSettings * | GetConfig () const |
const SettingPath & | GetPath () const |
bool | Delete () |
Delete the key if present, and return true iff it was. More... | |
Additional Inherited Members | |
Public Types inherited from Setting< bool > | |
using | ValueType = bool |
using | DefaultValueFunction = std::function< bool() > |
Protected Member Functions inherited from Setting< bool > | |
bool | DoWrite () |
Write cached value to config and return true if successful. More... | |
Protected Member Functions inherited from CachingSettingBase< bool > | |
CachingSettingBase (const CachingSettingBase &)=default | |
virtual void | EnterTransaction (size_t depth)=0 |
virtual bool | Commit ()=0 |
virtual void | Rollback () noexcept=0 |
Protected Member Functions inherited from SettingBase | |
SettingBase (const SettingBase &)=default | |
Protected Attributes inherited from Setting< bool > | |
const DefaultValueFunction | mFunction |
bool | mDefaultValue |
std::vector< bool > | mPreviousValues |
Protected Attributes inherited from CachingSettingBase< bool > | |
bool | mCurrentValue |
bool | mValid |
Protected Attributes inherited from SettingBase | |
const SettingPath | mPath |
This specialization of Setting for bool adds a Toggle method to negate the saved value.
|
inline |
Usual overload supplies a default value.
Definition at line 187 of file Prefs.h.
|
inline |
This overload causes recomputation of the default each time it is needed.
bool BoolSetting::Toggle | ( | ) |
Write the negation of the previous value, and return true if successful.
Definition at line 555 of file Prefs.cpp.
References Setting< bool >::Read(), and Setting< bool >::Write().
Referenced by anonymous_namespace{ViewMenus.cpp}::OnShowClipping(), anonymous_namespace{ViewMenus.cpp}::OnShowRMS(), anonymous_namespace{TrackMenus.cpp}::OnSyncLock(), and anonymous_namespace{TransportMenus.cpp}::OnToggleSoundActivated().