Audacity 3.2.0
Classes | Public Member Functions | Protected Member Functions | List of all members
audacity::BasicSettings Class Referenceabstract

Base class for objects that provide facility to store data persistently, and access it with string keys that are formed similarly to how paths in tree are formed. More...

#include <BasicSettings.h>

Inheritance diagram for audacity::BasicSettings:
[legend]

Classes

class  GroupScope
 

Public Member Functions

 BasicSettings ()
 
virtual ~BasicSettings ()
 
 BasicSettings (const BasicSettings &)=delete
 
 BasicSettings (BasicSettings &&)=default
 
BasicSettingsoperator= (const BasicSettings &)=delete
 
BasicSettingsoperator= (BasicSettings &&)=default
 
virtual wxString GetGroup () const =0
 Returns current group prefix. More...
 
virtual wxArrayString GetChildGroups () const =0
 Returns all child groups within the current group. More...
 
virtual wxArrayString GetChildKeys () const =0
 Returns all child keys within the current group. More...
 
virtual bool HasEntry (const wxString &key) const =0
 Checks whether specified key exists within the current group. More...
 
virtual bool HasGroup (const wxString &key) const =0
 Checks whether specified group exists relative to the current group. More...
 
virtual bool Exists (const wxString &key) const
 Returns true if group or entry exists. More...
 
virtual bool Remove (const wxString &key)=0
 Removes group or entry within the current group, if exists. Pass empty string to remove each entry in the current group. More...
 
virtual void Clear ()=0
 Remove all groups and keys. More...
 
bool DeleteGroup (const wxString &key)
 Deletes specified group if exists. More...
 
bool DeleteEntry (const wxString &key)
 Deletes specified entry if exists. More...
 
GroupScope BeginGroup (const wxString &prefix)
 Appends a prefix to the current group or sets a new absolute path. Group that was set as current before BeginGroup is called, will be restored once GroupScope is destroyed. More...
 
virtual bool Read (const wxString &key, bool *value) const =0
 
virtual bool Read (const wxString &key, int *value) const =0
 
virtual bool Read (const wxString &key, long *value) const =0
 
virtual bool Read (const wxString &key, long long *value) const =0
 
virtual bool Read (const wxString &key, double *value) const =0
 
virtual bool Read (const wxString &key, wxString *value) const =0
 
virtual bool Read (const wxString &key, float *value) const
 
template<typename T >
bool Read (const wxString &key, T *value) const
 Uses wxFromString to read object. More...
 
template<typename T >
std::enable_if_t< std::is_scalar_v< T >, bool > Read (const wxString &key, T *value, T defaultValue) const
 
template<typename T >
std::enable_if_t<!std::is_scalar_v< T >, bool > Read (const wxString &key, T *value, const T &defaultValue)
 
wxString Read (const wxString &key, const wxString &defaultValue=wxEmptyString) const
 
wxString Read (const wxString &key, const char *defaultValue) const
 
wxString Read (const wxString &key, const wchar_t *defaultValue) const
 
template<typename T >
std::enable_if_t< std::is_scalar_v< T >, T > Read (const wxString &key, T defaultValue) const
 
template<typename T >
std::enable_if_t<!std::is_scalar_v< T >, T > Read (const wxString &key, const T &defaultValue) const
 
virtual bool Write (const wxString &key, bool value)=0
 
virtual bool Write (const wxString &key, int value)=0
 
virtual bool Write (const wxString &key, long value)=0
 
virtual bool Write (const wxString &key, long long value)=0
 
virtual bool Write (const wxString &key, double value)=0
 
virtual bool Write (const wxString &key, const wxString &value)=0
 
virtual bool Write (const wxString &key, float value)
 
virtual bool Write (const wxString &key, const char *value)
 
virtual bool Write (const wxString &key, const wchar_t *value)
 
template<typename T >
bool Write (const wxString &key, const T &value)
 Uses wxToString to convert object into string. More...
 
virtual bool Flush () noexcept=0
 
bool ReadBool (const wxString &key, bool defaultValue) const
 
long ReadLong (const wxString &key, long defaultValue) const
 
double ReadDouble (const wxString &key, double defaultValue) const
 
template<typename T >
ReadObject (const wxString &key, const T &defaultValue) const
 

Protected Member Functions

virtual void DoBeginGroup (const wxString &prefix)=0
 
virtual void DoEndGroup () noexcept=0
 

Detailed Description

Base class for objects that provide facility to store data persistently, and access it with string keys that are formed similarly to how paths in tree are formed.

Each group (node) in path separated using '/'(slash) symbol. Path could be empty, in that case value belongs to the root group. If path starts with slash then it's considered to be absolute, otherwise it's relative to the current group, which could be changed using BeginGroup method.

Definition at line 30 of file BasicSettings.h.

Constructor & Destructor Documentation

◆ BasicSettings() [1/3]

BasicSettings::BasicSettings ( )
default

◆ ~BasicSettings()

BasicSettings::~BasicSettings ( )
virtualdefault

◆ BasicSettings() [2/3]

audacity::BasicSettings::BasicSettings ( const BasicSettings )
delete

◆ BasicSettings() [3/3]

audacity::BasicSettings::BasicSettings ( BasicSettings &&  )
default

Member Function Documentation

◆ BeginGroup()

auto BasicSettings::BeginGroup ( const wxString &  prefix)

Appends a prefix to the current group or sets a new absolute path. Group that was set as current before BeginGroup is called, will be restored once GroupScope is destroyed.

Definition at line 39 of file BasicSettings.cpp.

40{
41 DoBeginGroup(prefix);
42 return { *this };
43}
virtual void DoBeginGroup(const wxString &prefix)=0

Referenced by ModulePrefs::GetAllModuleStatuses(), PluginManager::GetSubgroups(), Tags::LoadDefaults(), PluginManager::LoadGroup(), CommandManager::Populator::NewIdentifier(), ModuleSettingsResetHandler::OnSettingResetBegin(), anonymous_namespace{AudacityApp.cpp}::PopulatePreferences(), ToolManager::ReadConfig(), PluginManager::SaveGroup(), and ToolManager::WriteConfig().

Here is the caller graph for this function:

◆ Clear()

virtual void audacity::BasicSettings::Clear ( )
pure virtual

Remove all groups and keys.

Implemented in SettingsWX.

Referenced by ResetPreferences().

Here is the caller graph for this function:

◆ DeleteEntry()

bool BasicSettings::DeleteEntry ( const wxString &  key)

Deletes specified entry if exists.

Definition at line 32 of file BasicSettings.cpp.

33{
34 if(HasEntry(key))
35 return Remove(key);
36 return false;
37}
static const AudacityProject::AttachedObjects::RegisteredFactory key
virtual bool HasEntry(const wxString &key) const =0
Checks whether specified key exists within the current group.
virtual bool Remove(const wxString &key)=0
Removes group or entry within the current group, if exists. Pass empty string to remove each entry in...

References HasEntry(), key, and Remove().

Referenced by KeyConfigPrefs::Commit(), ModuleSettings::GetModuleStatus(), AudacityApp::OnExit(), KeyConfigPrefs::OnImportDefaults(), anonymous_namespace{AudacityApp.cpp}::PopulatePreferences(), PluginManager::RemoveConfig(), ToolBarConfiguration::Write(), and Importer::WriteImportItems().

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

◆ DeleteGroup()

bool BasicSettings::DeleteGroup ( const wxString &  key)

Deletes specified group if exists.

Definition at line 25 of file BasicSettings.cpp.

26{
27 if(HasGroup(key))
28 return Remove(key);
29 return false;
30}
virtual bool HasGroup(const wxString &key) const =0
Checks whether specified group exists relative to the current group.

References HasGroup(), key, and Remove().

Referenced by TagsEditorDialog::OnSaveDefaults(), anonymous_namespace{AudacityApp.cpp}::PopulatePreferences(), and PluginManager::RemoveConfigSubgroup().

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

◆ DoBeginGroup()

virtual void audacity::BasicSettings::DoBeginGroup ( const wxString &  prefix)
protectedpure virtual

Implemented in SettingsWX.

◆ DoEndGroup()

virtual void audacity::BasicSettings::DoEndGroup ( )
protectedpure virtualnoexcept

Implemented in SettingsWX.

◆ Exists()

bool BasicSettings::Exists ( const wxString &  key) const
virtual

Returns true if group or entry exists.

Definition at line 20 of file BasicSettings.cpp.

21{
22 return HasEntry(key) || HasGroup(key);
23}

References HasEntry(), HasGroup(), and key.

Referenced by PluginManager::HasConfigValue(), and anonymous_namespace{AudacityApp.cpp}::PopulatePreferences().

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

◆ Flush()

virtual bool audacity::BasicSettings::Flush ( )
pure virtualnoexcept

Implemented in SettingsWX.

Referenced by SetPreferenceCommand::Apply(), ApplyMacroDialog::ApplyMacroToProject(), AudacityApp::AssociateFileTypes(), audacity::cloud::audiocom::sync::AudioComDialogBase::AudioComDialogBase(), DeviceToolBar::ChangeHost(), AudioSetupToolBar::ChangeHost(), ExportMP3::CheckFileName(), audacity::cloud::audiocom::UserService::ClearUserData(), SettingTransaction::Commit(), DevicePrefs::Commit(), GUIPrefs::Commit(), KeyConfigPrefs::Commit(), MidiIOPrefs::Commit(), TracksPrefs::Commit(), audacity::cloud::audiocom::OAuthService::DoAuthorise(), ToolsToolBar::DoToolChanged(), audacity::cloud::audiocom::UserService::DownloadAvatar(), AudioSetupToolBar::FillHostDevices(), DeviceToolBar::FillHostDevices(), MP3Exporter::FindLibrary(), AudioIO::Init(), MP3ExportProcessor::Initialize(), UpdateManager::IsTimeForUpdatesChecking(), LoadFFmpeg(), EnumSettingBase::Migrate(), SpectrogramSettings::ColorSchemeEnumSetting::Migrate(), TracksViewModeEnumSetting::Migrate(), ApplyMacroDialog::OnApplyToFiles(), AdornedRulerPanel::OnAutoScroll(), PrefsDialog::OnCancel(), SpectralSelectionBar::OnChoice(), BrowserDialog::OnClose(), FrequencyPlotDialog::OnCloseButton(), AudioPasteDialog::OnContinue(), SplashDialog::OnDontShow(), AudacityApp::OnExit(), KeyConfigPrefs::OnImportDefaults(), anonymous_namespace{TrackMenus.cpp}::OnMoveSelectionWithTracks(), PrefsDialog::OnOK(), ExportFFmpegOptions::OnOK(), SoundActivatedRecordDialog::OnOK(), TagsEditorDialog::OnOk(), TimerRecordDialog::OnOK(), FFmpegNotFoundDialog::OnOk(), MeterPanel::OnPreferences(), anonymous_namespace{PluginMenus.cpp}::OnResetConfig(), TagsEditorDialog::OnSaveDefaults(), LabelTrackMenuTable::OnSetFont(), anonymous_namespace{ViewMenus.cpp}::OnShowClipping(), anonymous_namespace{ViewMenus.cpp}::OnShowExtraMenus(), anonymous_namespace{ViewMenus.cpp}::OnShowNameOverlay(), anonymous_namespace{TrackMenus.cpp}::OnSyncLock(), AdornedRulerPanel::OnSyncSelToQuickPlay(), anonymous_namespace{TransportMenus.cpp}::OnTogglePlayRecording(), Scrubber::OnToggleScrubRuler(), anonymous_namespace{TransportMenus.cpp}::OnToggleSoundActivated(), anonymous_namespace{TransportMenus.cpp}::OnToggleSWPlaythrough(), anonymous_namespace{LabelMenus.cpp}::OnToggleTypeToCreateLabel(), FFmpegImportPlugin::Open(), Registry::OrderingPreferenceInitializer::operator()(), anonymous_namespace{HelpMenus.cpp}::QuickFixDialog::PopulateOrExchange(), anonymous_namespace{AudacityApp.cpp}::PopulatePreferences(), EffectNoiseReduction::Settings::PrefsIO(), ProjectRate::ProjectRate(), ReadSnapTo(), PluginManager::RemoveConfig(), PluginManager::RemoveConfigSubgroup(), MenuCreator::RemoveDuplicateShortcuts(), MacrosWindow::SaveChanges(), DependencyDialog::SaveFutureActionChoice(), GlobalPrefsDialog::SavePreferredPage(), ProjectSelectionManager::SetAudioTimeFormat(), ProjectSelectionManager::SetBandwidthSelectionFormatName(), PluginManager::SetConfigValue(), Importer::SetDefaultOpenType(), AudioSetupToolBar::SetDevices(), DeviceToolBar::SetDevices(), ProjectSelectionManager::SetFrequencySelectionFormatName(), Importer::SetLastOpenType(), ProjectTimeSignature::SetLowerTimeSignature(), ModuleSettings::SetModuleStatus(), TracksPrefs::SetPinnedHeadPositionPreference(), TracksPrefs::SetPinnedHeadPreference(), Journal::SetRecordEnabled(), ProjectSelectionManager::SetSelectionFormat(), ProjectSnap::SetSnapMode(), ProjectSnap::SetSnapTo(), ProjectTimeSignature::SetTempo(), ProjectTimeSignature::SetUpperTimeSignature(), audacity::cloud::audiocom::sync::CloudLocationDialog::ShowDialog(), HelpSystem::ShowHelp(), ShowWarningDialog(), UpdateManager::Start(), audacity::cloud::audiocom::OAuthService::UnlinkAccount(), EQCurveReader::UpdateDefaultCurves(), anonymous_namespace{SelectionBar.cpp}::UpdateSelectionMode(), audacity::cloud::audiocom::UserService::UpdateUserData(), Registry::detail::Visit(), ToolManager::WriteConfig(), Importer::WriteImportItems(), and LabelDialog::WriteSize().

◆ GetChildGroups()

virtual wxArrayString audacity::BasicSettings::GetChildGroups ( ) const
pure virtual

Returns all child groups within the current group.

Implemented in SettingsWX.

Referenced by PluginManager::LoadGroup(), and anonymous_namespace{AudacityApp.cpp}::PopulatePreferences().

Here is the caller graph for this function:

◆ GetChildKeys()

virtual wxArrayString audacity::BasicSettings::GetChildKeys ( ) const
pure virtual

Returns all child keys within the current group.

Implemented in SettingsWX.

Referenced by ModulePrefs::GetAllModuleStatuses(), Tags::LoadDefaults(), and ModuleSettingsResetHandler::OnSettingResetBegin().

Here is the caller graph for this function:

◆ GetGroup()

virtual wxString audacity::BasicSettings::GetGroup ( ) const
pure virtual

Returns current group prefix.

Implemented in SettingsWX.

◆ HasEntry()

virtual bool audacity::BasicSettings::HasEntry ( const wxString &  key) const
pure virtual

Checks whether specified key exists within the current group.

Implemented in SettingsWX.

Referenced by KeyConfigPrefs::Commit(), DeduceSnapTo(), DeleteEntry(), Exists(), CommandManager::Populator::NewIdentifier(), ReadSnapMode(), and ReadSnapTo().

Here is the caller graph for this function:

◆ HasGroup()

virtual bool audacity::BasicSettings::HasGroup ( const wxString &  key) const
pure virtual

Checks whether specified group exists relative to the current group.

Implemented in SettingsWX.

Referenced by DeleteGroup(), Exists(), and ModuleSettingsResetHandler::OnSettingResetBegin().

Here is the caller graph for this function:

◆ operator=() [1/2]

BasicSettings & audacity::BasicSettings::operator= ( BasicSettings &&  )
default

◆ operator=() [2/2]

BasicSettings & audacity::BasicSettings::operator= ( const BasicSettings )
delete

◆ Read() [1/15]

virtual bool audacity::BasicSettings::Read ( const wxString &  key,
bool *  value 
) const
pure virtual

Implemented in SettingsWX.

Referenced by AdornedRulerPanel::AdornedRulerPanel(), PluginManager::Iterator::Advance(), EffectTruncSilence::Analyze(), GetPreferenceCommand::Apply(), MacroCommands::ApplyMacro(), AudacityApp::AssociateFileTypes(), ProgressDialog::Beep(), GUIPrefs::Commit(), RecordingPrefs::Commit(), ControlToolBar::ControlToolBar(), DeduceSnapTo(), anonymous_namespace{LabelMenus.cpp}::DoAddLabel(), LabelTrackView::DoCaptureKey(), LabelTrackView::DoChar(), ProjectAudioManager::DoRecord(), SpectrumView::DoSetMinimized(), WaveformView::DoSetMinimized(), EffectPreview(), ExportFFmpegOptions::ExportFFmpegOptions(), anonymous_namespace{Registry.cpp}::ItemOrdering::Get(), ModulePrefs::GetAllModuleStatuses(), PluginManager::GetConfigValue(), anonymous_namespace{TimeAndPitchExperimentalSettings.cpp}::GetFromFile(), ModuleSettings::GetModuleStatus(), GlobalPrefsDialog::GetPreferredPage(), Importer::Import(), AudioIO::Init(), AudacityApp::InitPart2(), UpdateManager::IsTimeForUpdatesChecking(), PlainExportOptionsEditor::Load(), ExportOptionsCLEditor::Load(), anonymous_namespace{ExportFFmpeg.cpp}::ExportOptionsFFmpegCustomEditor::Load(), MP2ExportOptionsEditor::Load(), MP3ExportOptionsEditor::Load(), anonymous_namespace{ExportOGG.cpp}::ExportOptionOGGEditor::Load(), anonymous_namespace{ExportWavPack.cpp}::ExportOptionsWavPackEditor::Load(), EQCurveReader::LoadCurves(), Tags::LoadDefaults(), anonymous_namespace{ExportPCM.cpp}::LoadEncoding(), PluginManager::LoadGroup(), anonymous_namespace{ExportPCM.cpp}::LoadOtherFormat(), ToolBar::MakeButtonBackgroundsLarge(), ToolBar::MakeButtonBackgroundsSmall(), EnumSettingBase::Migrate(), SpectrogramSettings::ColorSchemeEnumSetting::Migrate(), TracksViewModeEnumSetting::Migrate(), MP3Exporter::MP3Exporter(), CommandManager::Populator::NewIdentifier(), NyqBench::NyqBench(), anonymous_namespace{TrackMenus.cpp}::OnAlign(), anonymous_namespace{EditMenus.cpp}::OnCut(), AudacityApp::OnExit(), ExportFFmpegOptions::OnExportPresets(), NyqBench::OnFind(), ExportFFmpegOptions::OnImportPresets(), anonymous_namespace{TrackMenus.cpp}::OnMoveSelectionWithTracks(), anonymous_namespace{TransportMenus.cpp}::OnPlayAfterSelectionEnd(), anonymous_namespace{TransportMenus.cpp}::OnPlayAfterSelectionStart(), anonymous_namespace{TransportMenus.cpp}::OnPlayBeforeAndAfterSelectionEnd(), anonymous_namespace{TransportMenus.cpp}::OnPlayBeforeAndAfterSelectionStart(), anonymous_namespace{TransportMenus.cpp}::OnPlayBeforeSelectionEnd(), anonymous_namespace{TransportMenus.cpp}::OnPlayBeforeSelectionStart(), anonymous_namespace{TransportMenus.cpp}::OnPunchAndRoll(), ProjectAudioManager::OnRecord(), LabelTrackMenuTable::OnSetFont(), ModuleSettingsResetHandler::OnSettingResetBegin(), anonymous_namespace{ViewMenus.cpp}::OnShowClipping(), anonymous_namespace{ViewMenus.cpp}::OnShowExtraMenus(), anonymous_namespace{ViewMenus.cpp}::OnShowNameOverlay(), DirectoriesPrefs::OnTempBrowse(), anonymous_namespace{TimerRecordDialog.cpp}::OnTimerRecord(), anonymous_namespace{TransportMenus.cpp}::OnTogglePlayRecording(), anonymous_namespace{TransportMenus.cpp}::OnToggleSWPlaythrough(), anonymous_namespace{LabelMenus.cpp}::OnToggleTypeToCreateLabel(), Registry::OrderingPreferenceInitializer::operator()(), ProjectAudioManager::PlayPlayRegion(), ApplyMacroDialog::Populate(), MacrosWindow::Populate(), ControlToolBar::Populate(), SpectralSelectionBar::Populate(), SplashDialog::Populate(), ExportFFmpegOptions::PopulateOrExchange(), anonymous_namespace{AudacityApp.cpp}::PopulatePreferences(), PrefsDialog::PrefsDialog(), NyquistEffect::Process(), EffectPaulstretch::ProcessOne(), PerTrackEffect::ProcessPass(), ProjectSettings::ProjectSettings(), Read(), ToolBarConfiguration::Read(), ReadBool(), ToolManager::ReadConfig(), ReadDouble(), Importer::ReadImportItems(), ReadLong(), anonymous_namespace{NoiseReduction.cpp}::readPrefs(), anonymous_namespace{Scrubbing.cpp}::ReadScrubEnabledPref(), LabelDialog::ReadSize(), ReadSnapMode(), ChoiceSetting::ReadWithDefault(), RecordingPrefs::RecordingPrefs(), ControlToolBar::RegenerateTooltips(), LabelStruct::RegionRelation(), MacroCommands::ReportAndSkip(), LabelTrackView::ResetFont(), Importer::SelectDefaultOpenType(), GUISettings::SetLang(), HelpSystem::ShowHelp(), ShowWarningDialog(), WaveTrackAffordanceControls::StartEditClipName(), AudioIO::StartMonitoring(), ControlToolBar::StartScrolling(), AudioIO::StartStream(), TagsEditorDialog::TagsEditorDialog(), TempDirectory::TempDir(), ToolsToolBar::ToolsToolBar(), ShuttlePrefs::TransferBool(), ShuttlePrefs::TransferDouble(), ShuttlePrefs::TransferInt(), ShuttlePrefs::TransferString(), anonymous_namespace{ExportFFmpeg.cpp}::ExportOptionsFFmpegCustomEditor::UpdateCodecAndFormat(), CommandManager::UpdatePrefs(), SelectActions::Handler::UpdatePrefs(), ProjectSettings::UpdatePrefs(), ControlToolBar::UpdatePrefs(), SelectionBar::UpdatePrefs(), MeterPanel::UpdatePrefs(), ViewInfo::UpdateSelectedPrefs(), TrackArtist::UpdateSelectedPrefs(), ProjectAudioManager::UseDuplex(), FileNames::WithDefaultPath(), and Importer::WriteImportItems().

◆ Read() [2/15]

wxString BasicSettings::Read ( const wxString &  key,
const char *  defaultValue 
) const

Definition at line 64 of file BasicSettings.cpp.

65{
66 wxString value;
67 if(!Read(key, &value))
68 return { defaultValue };
69 return value;
70}
virtual bool Read(const wxString &key, bool *value) const =0

References key, and Read().

Here is the call graph for this function:

◆ Read() [3/15]

template<typename T >
std::enable_if_t<!std::is_scalar_v< T >, T > audacity::BasicSettings::Read ( const wxString &  key,
const T &  defaultValue 
) const
inline

Definition at line 148 of file BasicSettings.h.

149 {
150 T value;
151 if(!Read(key, &value))
152 return defaultValue;
153 return value;
154 }

References key.

◆ Read() [4/15]

wxString BasicSettings::Read ( const wxString &  key,
const wchar_t *  defaultValue 
) const

Definition at line 72 of file BasicSettings.cpp.

73{
74 wxString value;
75 if(!Read(key, &value))
76 return { defaultValue };
77 return value;
78}

References key, and Read().

Here is the call graph for this function:

◆ Read() [5/15]

wxString BasicSettings::Read ( const wxString &  key,
const wxString &  defaultValue = wxEmptyString 
) const

Definition at line 56 of file BasicSettings.cpp.

57{
58 wxString value;
59 if(!Read(key, &value))
60 return defaultValue;
61 return value;
62}

References key, and Read().

Here is the call graph for this function:

◆ Read() [6/15]

virtual bool audacity::BasicSettings::Read ( const wxString &  key,
double *  value 
) const
pure virtual

Implemented in SettingsWX.

◆ Read() [7/15]

bool BasicSettings::Read ( const wxString &  key,
float *  value 
) const
virtual

Definition at line 45 of file BasicSettings.cpp.

46{
47 double d;
48 if(Read(key, &d))
49 {
50 *value = static_cast<float>(d);
51 return true;
52 }
53 return false;
54}

References key, and Read().

Here is the call graph for this function:

◆ Read() [8/15]

virtual bool audacity::BasicSettings::Read ( const wxString &  key,
int *  value 
) const
pure virtual

Implemented in SettingsWX.

◆ Read() [9/15]

virtual bool audacity::BasicSettings::Read ( const wxString &  key,
long *  value 
) const
pure virtual

Implemented in SettingsWX.

◆ Read() [10/15]

virtual bool audacity::BasicSettings::Read ( const wxString &  key,
long long *  value 
) const
pure virtual

Implemented in SettingsWX.

◆ Read() [11/15]

template<typename T >
bool audacity::BasicSettings::Read ( const wxString &  key,
T *  value 
) const
inline

Uses wxFromString to read object.

Definition at line 100 of file BasicSettings.h.

101 {
102 wxString str;
103 if (!Read(key, &str))
104 return false;
105 return wxFromString(str, value);
106 }
#define str(a)
bool wxFromString(const wxString &str, Stringifyable *obj)

References key, str, and wxFromString().

Here is the call graph for this function:

◆ Read() [12/15]

template<typename T >
std::enable_if_t<!std::is_scalar_v< T >, bool > audacity::BasicSettings::Read ( const wxString &  key,
T *  value,
const T &  defaultValue 
)
inline

Definition at line 122 of file BasicSettings.h.

123 {
124 if(!Read(key, value))
125 {
126 *value = defaultValue;
127 return false;
128 }
129 return true;
130 }

References key.

◆ Read() [13/15]

template<typename T >
std::enable_if_t< std::is_scalar_v< T >, bool > audacity::BasicSettings::Read ( const wxString &  key,
T *  value,
defaultValue 
) const
inline

Definition at line 110 of file BasicSettings.h.

111 {
112 if(!Read(key, value))
113 {
114 *value = defaultValue;
115 return false;
116 }
117 return true;
118 }

References key.

◆ Read() [14/15]

template<typename T >
std::enable_if_t< std::is_scalar_v< T >, T > audacity::BasicSettings::Read ( const wxString &  key,
defaultValue 
) const
inline

Definition at line 138 of file BasicSettings.h.

139 {
140 T value;
141 if(!Read(key, &value))
142 return defaultValue;
143 return value;
144 }

References key.

◆ Read() [15/15]

virtual bool audacity::BasicSettings::Read ( const wxString &  key,
wxString *  value 
) const
pure virtual

Implemented in SettingsWX.

◆ ReadBool()

bool BasicSettings::ReadBool ( const wxString &  key,
bool  defaultValue 
) const

◆ ReadDouble()

double BasicSettings::ReadDouble ( const wxString &  key,
double  defaultValue 
) const

Definition at line 90 of file BasicSettings.cpp.

91{
92 return Read(key, defaultValue);
93}

References key, and Read().

Referenced by TracksPrefs::GetPinnedHeadPositionPreference(), and anonymous_namespace{PluginMenus.cpp}::OnResetConfig().

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

◆ ReadLong()

long BasicSettings::ReadLong ( const wxString &  key,
long  defaultValue 
) const

Definition at line 85 of file BasicSettings.cpp.

86{
87 return Read(key, defaultValue);
88}

References key, and Read().

Referenced by TimerRecordDialog::PopulateOrExchange().

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

◆ ReadObject()

template<typename T >
T audacity::BasicSettings::ReadObject ( const wxString &  key,
const T &  defaultValue 
) const
inline

Definition at line 181 of file BasicSettings.h.

182 {
183 return Read(key, defaultValue);
184 }

References key.

Referenced by KeyConfigPrefs::Commit().

Here is the caller graph for this function:

◆ Remove()

virtual bool audacity::BasicSettings::Remove ( const wxString &  key)
pure virtual

Removes group or entry within the current group, if exists. Pass empty string to remove each entry in the current group.

Implemented in SettingsWX.

Referenced by DeleteEntry(), and DeleteGroup().

Here is the caller graph for this function:

◆ Write() [1/10]

virtual bool audacity::BasicSettings::Write ( const wxString &  key,
bool  value 
)
pure virtual

Implemented in SettingsWX.

Referenced by SetPreferenceCommand::Apply(), ApplyMacroDialog::ApplyMacroToProject(), AudacityApp::AssociateFileTypes(), audacity::cloud::audiocom::sync::AudioComDialogBase::AudioComDialogBase(), ExportMP3::CheckFileName(), GUIPrefs::Commit(), KeyConfigPrefs::Commit(), RecordingPrefs::Commit(), ToolsToolBar::DoToolChanged(), MP3Exporter::FindLibrary(), ModulePrefs::GetAllModuleStatuses(), MP3ExportProcessor::Initialize(), AudacityApp::InitPart2(), UpdateManager::IsTimeForUpdatesChecking(), TracksViewModeEnumSetting::Migrate(), ApplyMacroDialog::OnApplyToFiles(), AdornedRulerPanel::OnAutoScroll(), PrefsDialog::OnCancel(), SpectralSelectionBar::OnChoice(), BrowserDialog::OnClose(), FrequencyPlotDialog::OnCloseButton(), SplashDialog::OnDontShow(), AudacityApp::OnExit(), NyqBench::OnFindDialog(), anonymous_namespace{TrackMenus.cpp}::OnMoveSelectionWithTracks(), PrefsDialog::OnOK(), ExportFFmpegOptions::OnOK(), TagsEditorDialog::OnOk(), TimerRecordDialog::OnOK(), NyqBench::OnOpen(), MeterPanel::OnPreferences(), anonymous_namespace{PluginMenus.cpp}::OnResetConfig(), NyqBench::OnSaveAs(), TagsEditorDialog::OnSaveDefaults(), LabelTrackMenuTable::OnSetFont(), ModuleSettingsResetHandler::OnSettingResetEnd(), anonymous_namespace{ViewMenus.cpp}::OnShowClipping(), anonymous_namespace{ViewMenus.cpp}::OnShowExtraMenus(), anonymous_namespace{ViewMenus.cpp}::OnShowNameOverlay(), AdornedRulerPanel::OnSyncSelToQuickPlay(), anonymous_namespace{TransportMenus.cpp}::OnTogglePlayRecording(), anonymous_namespace{TransportMenus.cpp}::OnToggleSWPlaythrough(), anonymous_namespace{LabelMenus.cpp}::OnToggleTypeToCreateLabel(), Registry::OrderingPreferenceInitializer::operator()(), anonymous_namespace{AudacityApp.cpp}::PopulatePreferences(), CommandManager::ReportDuplicateShortcuts(), MacrosWindow::SaveChanges(), anonymous_namespace{ExportPCM.cpp}::SaveEncoding(), PluginManager::SaveGroup(), anonymous_namespace{ExportPCM.cpp}::SaveOtherFormat(), GlobalPrefsDialog::SavePreferredPage(), NyqBench::SavePrefs(), ProjectSelectionManager::SetAudioTimeFormat(), ProjectSelectionManager::SetBandwidthSelectionFormatName(), PluginManager::SetConfigValue(), Importer::SetDefaultOpenType(), ProjectSelectionManager::SetFrequencySelectionFormatName(), Importer::SetLastOpenType(), ModuleSettings::SetModuleStatus(), TracksPrefs::SetPinnedHeadPositionPreference(), TracksPrefs::SetPinnedHeadPreference(), ProjectSelectionManager::SetSelectionFormat(), ShowWarningDialog(), PlainExportOptionsEditor::Store(), ExportOptionsCLEditor::Store(), MP2ExportOptionsEditor::Store(), MP3ExportOptionsEditor::Store(), anonymous_namespace{ExportOGG.cpp}::ExportOptionOGGEditor::Store(), anonymous_namespace{ExportWavPack.cpp}::ExportOptionsWavPackEditor::Store(), ShuttlePrefs::TransferBool(), TimerRecordDialog::TransferDataFromWindow(), ShuttlePrefs::TransferDouble(), ShuttlePrefs::TransferInt(), ShuttlePrefs::TransferString(), EQCurveReader::UpdateDefaultCurves(), anonymous_namespace{Registry.cpp}::VisitItems(), ToolBarConfiguration::Write(), Write(), ChoiceSetting::Write(), ToolManager::WriteConfig(), Importer::WriteImportItems(), anonymous_namespace{NoiseReduction.cpp}::writePrefs(), anonymous_namespace{Scrubbing.cpp}::WriteScrubEnabledPref(), and LabelDialog::WriteSize().

◆ Write() [2/10]

bool BasicSettings::Write ( const wxString &  key,
const char *  value 
)
virtual

Definition at line 100 of file BasicSettings.cpp.

101{
102 return Write(key, wxString(value));
103}
virtual bool Write(const wxString &key, bool value)=0

References key, and Write().

Here is the call graph for this function:

◆ Write() [3/10]

template<typename T >
bool audacity::BasicSettings::Write ( const wxString &  key,
const T &  value 
)
inline

Uses wxToString to convert object into string.

Definition at line 169 of file BasicSettings.h.

170 {
171 return Write(key, wxToString(value));
172 }
wxString wxToString(const Stringifyable &obj)

References key, and wxToString().

Here is the call graph for this function:

◆ Write() [4/10]

bool BasicSettings::Write ( const wxString &  key,
const wchar_t *  value 
)
virtual

Definition at line 105 of file BasicSettings.cpp.

106{
107 return Write(key, wxString(value));
108}

References key, and Write().

Here is the call graph for this function:

◆ Write() [5/10]

virtual bool audacity::BasicSettings::Write ( const wxString &  key,
const wxString &  value 
)
pure virtual

Implemented in SettingsWX.

◆ Write() [6/10]

virtual bool audacity::BasicSettings::Write ( const wxString &  key,
double  value 
)
pure virtual

Implemented in SettingsWX.

◆ Write() [7/10]

bool BasicSettings::Write ( const wxString &  key,
float  value 
)
virtual

Definition at line 95 of file BasicSettings.cpp.

96{
97 return Write(key, static_cast<double>(value));
98}

References key, and Write().

Here is the call graph for this function:

◆ Write() [8/10]

virtual bool audacity::BasicSettings::Write ( const wxString &  key,
int  value 
)
pure virtual

Implemented in SettingsWX.

◆ Write() [9/10]

virtual bool audacity::BasicSettings::Write ( const wxString &  key,
long long  value 
)
pure virtual

Implemented in SettingsWX.

◆ Write() [10/10]

virtual bool audacity::BasicSettings::Write ( const wxString &  key,
long  value 
)
pure virtual

Implemented in SettingsWX.


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