Use type aliases RegistryPath, RegistryPaths...

... for wxString and vector thereof, holding strings that key into wxConfigBase;
to be replaced later with different types
This commit is contained in:
Paul Licameli 2019-03-01 12:20:51 -05:00
parent dcd211affa
commit df6a2cf479
20 changed files with 295 additions and 287 deletions

View File

@ -42,6 +42,8 @@
#ifndef __AUDACITY_CONFIGINTERFACE_H__
#define __AUDACITY_CONFIGINTERFACE_H__
#include "audacity/Types.h"
/*************************************************************************************//**
\class ConfigClientInterface
@ -56,41 +58,41 @@ class AUDACITY_DLL_API ConfigClientInterface /* not final */
public:
virtual ~ConfigClientInterface() {};
virtual bool HasSharedConfigGroup(const wxString & group) = 0;
virtual bool GetSharedConfigSubgroups(const wxString & group, wxArrayString & subgroups) = 0;
virtual bool HasSharedConfigGroup(const RegistryPath & group) = 0;
virtual bool GetSharedConfigSubgroups(const RegistryPath & group, RegistryPaths & subgroups) = 0;
virtual bool GetSharedConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval) = 0;
virtual bool GetSharedConfig(const wxString & group, const wxString & key, int & value, int defval) = 0;
virtual bool GetSharedConfig(const wxString & group, const wxString & key, bool & value, bool defval) = 0;
virtual bool GetSharedConfig(const wxString & group, const wxString & key, float & value, float defval) = 0;
virtual bool GetSharedConfig(const wxString & group, const wxString & key, double & value, double defval) = 0;
virtual bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval) = 0;
virtual bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval) = 0;
virtual bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval) = 0;
virtual bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval) = 0;
virtual bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval) = 0;
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const wxString & value) = 0;
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const int & value) = 0;
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const bool & value) = 0;
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const float & value) = 0;
virtual bool SetSharedConfig(const wxString & group, const wxString & key, const double & value) = 0;
virtual bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value) = 0;
virtual bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const int & value) = 0;
virtual bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const bool & value) = 0;
virtual bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const float & value) = 0;
virtual bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const double & value) = 0;
virtual bool RemoveSharedConfigSubgroup(const wxString & group) = 0;
virtual bool RemoveSharedConfig(const wxString & group, const wxString & key) = 0;
virtual bool RemoveSharedConfigSubgroup(const RegistryPath & group) = 0;
virtual bool RemoveSharedConfig(const RegistryPath & group, const RegistryPath & key) = 0;
virtual bool HasPrivateConfigGroup(const wxString & group) = 0;
virtual bool GetPrivateConfigSubgroups(const wxString & group, wxArrayString & subgroups) = 0;
virtual bool HasPrivateConfigGroup(const RegistryPath & group) = 0;
virtual bool GetPrivateConfigSubgroups(const RegistryPath & group, RegistryPaths &subgroups) = 0;
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval) = 0;
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, int & value, int defval) = 0;
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, bool & value, bool defval) = 0;
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, float & value, float defval) = 0;
virtual bool GetPrivateConfig(const wxString & group, const wxString & key, double & value, double defval) = 0;
virtual bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval) = 0;
virtual bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval) = 0;
virtual bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval) = 0;
virtual bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval) = 0;
virtual bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval) = 0;
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const wxString & value) = 0;
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const int & value) = 0;
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const bool & value) = 0;
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const float & value) = 0;
virtual bool SetPrivateConfig(const wxString & group, const wxString & key, const double & value) = 0;
virtual bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value) = 0;
virtual bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const int & value) = 0;
virtual bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const bool & value) = 0;
virtual bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const float & value) = 0;
virtual bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const double & value) = 0;
virtual bool RemovePrivateConfigSubgroup(const wxString & group) = 0;
virtual bool RemovePrivateConfig(const wxString & group, const wxString & key) = 0;
virtual bool RemovePrivateConfigSubgroup(const RegistryPath & group) = 0;
virtual bool RemovePrivateConfig(const RegistryPath & group, const RegistryPath & key) = 0;
};
#if 0

View File

@ -128,9 +128,9 @@ public:
virtual wxDialog *CreateUI(wxWindow *parent, EffectUIClientInterface *client) = 0;
// Preset handling
virtual wxString GetUserPresetsGroup(const wxString & name) = 0;
virtual wxString GetCurrentSettingsGroup() = 0;
virtual wxString GetFactoryDefaultsGroup() = 0;
virtual RegistryPath GetUserPresetsGroup(const RegistryPath & name) = 0;
virtual RegistryPath GetCurrentSettingsGroup() = 0;
virtual RegistryPath GetFactoryDefaultsGroup() = 0;
};
/*************************************************************************************//**
@ -187,10 +187,10 @@ public:
virtual bool GetAutomationParameters(CommandParameters & parms) = 0;
virtual bool SetAutomationParameters(CommandParameters & parms) = 0;
virtual bool LoadUserPreset(const wxString & name) = 0;
virtual bool SaveUserPreset(const wxString & name) = 0;
virtual bool LoadUserPreset(const RegistryPath & name) = 0;
virtual bool SaveUserPreset(const RegistryPath & name) = 0;
virtual wxArrayString GetFactoryPresets() = 0;
virtual RegistryPaths GetFactoryPresets() = 0;
virtual bool LoadFactoryPreset(int id) = 0;
virtual bool LoadFactoryDefaults() = 0;
};

View File

@ -72,39 +72,39 @@ public:
wxArrayString & files,
bool directories = false) = 0;
virtual bool GetSharedConfigSubgroups(const PluginID & ID, const wxString & group, wxArrayString & subgroups) = 0;
virtual bool GetSharedConfigSubgroups(const PluginID & ID, const RegistryPath & group, RegistryPaths & subgroups) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval = wxString()) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval = 0) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval = false) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval = 0.0) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval = 0.0) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval = wxString()) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, int & value, int defval = 0) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, bool & value, bool defval = false) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, float & value, float defval = 0.0) = 0;
virtual bool GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, double & value, double defval = 0.0) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const wxString & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const int & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const bool & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const float & value) = 0;
virtual bool SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const double & value) = 0;
virtual bool RemoveSharedConfigSubgroup(const PluginID & ID, const wxString & group) = 0;
virtual bool RemoveSharedConfig(const PluginID & ID, const wxString & group, const wxString & key) = 0;
virtual bool RemoveSharedConfigSubgroup(const PluginID & ID, const RegistryPath & group) = 0;
virtual bool RemoveSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key) = 0;
virtual bool GetPrivateConfigSubgroups(const PluginID & ID, const wxString & group, wxArrayString & subgroups) = 0;
virtual bool GetPrivateConfigSubgroups(const PluginID & ID, const RegistryPath & group, RegistryPaths & subgroups) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval = wxString()) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval = 0) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval = false) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval = 0.0) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval = 0.0) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval = wxString()) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, int & value, int defval = 0) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, bool & value, bool defval = false) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, float & value, float defval = 0.0) = 0;
virtual bool GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, double & value, double defval = 0.0) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const wxString & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const int & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const bool & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const float & value) = 0;
virtual bool SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const double & value) = 0;
virtual bool RemovePrivateConfigSubgroup(const PluginID & ID, const wxString & group) = 0;
virtual bool RemovePrivateConfig(const PluginID & ID, const wxString & group, const wxString & key) = 0;
virtual bool RemovePrivateConfigSubgroup(const PluginID & ID, const RegistryPath & group) = 0;
virtual bool RemovePrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key) = 0;
};
#endif // __AUDACITY_PLUGININTERFACE_H__

View File

@ -63,6 +63,10 @@ file system path
using PluginPath = wxString;
using PluginPaths = std::vector< PluginPath >;
// A key to be passed to wxConfigBase
using RegistryPath = wxString;
using RegistryPaths = std::vector< RegistryPath >;
// ----------------------------------------------------------------------------
// A native 64-bit integer...used when referring to any number of samples
// ----------------------------------------------------------------------------

View File

@ -1527,67 +1527,67 @@ void PluginManager::FindFilesInPathList(const wxString & pattern,
return;
}
bool PluginManager::HasSharedConfigGroup(const PluginID & ID, const wxString & group)
bool PluginManager::HasSharedConfigGroup(const PluginID & ID, const RegistryPath & group)
{
return HasGroup(SharedGroup(ID, group));
}
bool PluginManager::GetSharedConfigSubgroups(const PluginID & ID, const wxString & group, wxArrayString & subgroups)
bool PluginManager::GetSharedConfigSubgroups(const PluginID & ID, const RegistryPath & group, RegistryPaths & subgroups)
{
return GetSubgroups(SharedGroup(ID, group), subgroups);
}
bool PluginManager::GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval)
bool PluginManager::GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval)
{
return GetConfig(SharedKey(ID, group, key), value, defval);
}
bool PluginManager::GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval)
bool PluginManager::GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, int & value, int defval)
{
return GetConfig(SharedKey(ID, group, key), value, defval);
}
bool PluginManager::GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval)
bool PluginManager::GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, bool & value, bool defval)
{
return GetConfig(SharedKey(ID, group, key), value, defval);
}
bool PluginManager::GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval)
bool PluginManager::GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, float & value, float defval)
{
return GetConfig(SharedKey(ID, group, key), value, defval);
}
bool PluginManager::GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval)
bool PluginManager::GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, double & value, double defval)
{
return GetConfig(SharedKey(ID, group, key), value, defval);
}
bool PluginManager::SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value)
bool PluginManager::SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const wxString & value)
{
return SetConfig(SharedKey(ID, group, key), value);
}
bool PluginManager::SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value)
bool PluginManager::SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const int & value)
{
return SetConfig(SharedKey(ID, group, key), value);
}
bool PluginManager::SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value)
bool PluginManager::SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const bool & value)
{
return SetConfig(SharedKey(ID, group, key), value);
}
bool PluginManager::SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value)
bool PluginManager::SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const float & value)
{
return SetConfig(SharedKey(ID, group, key), value);
}
bool PluginManager::SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value)
bool PluginManager::SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const double & value)
{
return SetConfig(SharedKey(ID, group, key), value);
}
bool PluginManager::RemoveSharedConfigSubgroup(const PluginID & ID, const wxString & group)
bool PluginManager::RemoveSharedConfigSubgroup(const PluginID & ID, const RegistryPath & group)
{
bool result = GetSettings()->DeleteGroup(SharedGroup(ID, group));
if (result)
@ -1598,7 +1598,7 @@ bool PluginManager::RemoveSharedConfigSubgroup(const PluginID & ID, const wxStri
return result;
}
bool PluginManager::RemoveSharedConfig(const PluginID & ID, const wxString & group, const wxString & key)
bool PluginManager::RemoveSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key)
{
bool result = GetSettings()->DeleteEntry(SharedKey(ID, group, key));
if (result)
@ -1609,67 +1609,67 @@ bool PluginManager::RemoveSharedConfig(const PluginID & ID, const wxString & gro
return result;
}
bool PluginManager::HasPrivateConfigGroup(const PluginID & ID, const wxString & group)
bool PluginManager::HasPrivateConfigGroup(const PluginID & ID, const RegistryPath & group)
{
return HasGroup(PrivateGroup(ID, group));
}
bool PluginManager::GetPrivateConfigSubgroups(const PluginID & ID, const wxString & group, wxArrayString & subgroups)
bool PluginManager::GetPrivateConfigSubgroups(const PluginID & ID, const RegistryPath & group, RegistryPaths & subgroups)
{
return GetSubgroups(PrivateGroup(ID, group), subgroups);
}
bool PluginManager::GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval)
bool PluginManager::GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval)
{
return GetConfig(PrivateKey(ID, group, key), value, defval);
}
bool PluginManager::GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval)
bool PluginManager::GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, int & value, int defval)
{
return GetConfig(PrivateKey(ID, group, key), value, defval);
}
bool PluginManager::GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval)
bool PluginManager::GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, bool & value, bool defval)
{
return GetConfig(PrivateKey(ID, group, key), value, defval);
}
bool PluginManager::GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval)
bool PluginManager::GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, float & value, float defval)
{
return GetConfig(PrivateKey(ID, group, key), value, defval);
}
bool PluginManager::GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval)
bool PluginManager::GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, double & value, double defval)
{
return GetConfig(PrivateKey(ID, group, key), value, defval);
}
bool PluginManager::SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value)
bool PluginManager::SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const wxString & value)
{
return SetConfig(PrivateKey(ID, group, key), value);
}
bool PluginManager::SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value)
bool PluginManager::SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const int & value)
{
return SetConfig(PrivateKey(ID, group, key), value);
}
bool PluginManager::SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value)
bool PluginManager::SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const bool & value)
{
return SetConfig(PrivateKey(ID, group, key), value);
}
bool PluginManager::SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value)
bool PluginManager::SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const float & value)
{
return SetConfig(PrivateKey(ID, group, key), value);
}
bool PluginManager::SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value)
bool PluginManager::SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const double & value)
{
return SetConfig(PrivateKey(ID, group, key), value);
}
bool PluginManager::RemovePrivateConfigSubgroup(const PluginID & ID, const wxString & group)
bool PluginManager::RemovePrivateConfigSubgroup(const PluginID & ID, const RegistryPath & group)
{
bool result = GetSettings()->DeleteGroup(PrivateGroup(ID, group));
if (result)
@ -1680,7 +1680,7 @@ bool PluginManager::RemovePrivateConfigSubgroup(const PluginID & ID, const wxStr
return result;
}
bool PluginManager::RemovePrivateConfig(const PluginID & ID, const wxString & group, const wxString & key)
bool PluginManager::RemovePrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key)
{
bool result = GetSettings()->DeleteEntry(PrivateKey(ID, group, key));
if (result)
@ -2772,7 +2772,7 @@ wxFileConfig *PluginManager::GetSettings()
return mSettings.get();
}
bool PluginManager::HasGroup(const wxString & group)
bool PluginManager::HasGroup(const RegistryPath & group)
{
wxFileConfig *settings = GetSettings();
@ -2789,7 +2789,7 @@ bool PluginManager::HasGroup(const wxString & group)
return res;
}
bool PluginManager::GetSubgroups(const wxString & group, wxArrayString & subgroups)
bool PluginManager::GetSubgroups(const RegistryPath & group, RegistryPaths & subgroups)
{
if (group.empty() || !HasGroup(group))
{
@ -2814,7 +2814,7 @@ bool PluginManager::GetSubgroups(const wxString & group, wxArrayString & subgrou
return true;
}
bool PluginManager::GetConfig(const wxString & key, int & value, int defval)
bool PluginManager::GetConfig(const RegistryPath & key, int & value, int defval)
{
bool result = false;
@ -2826,7 +2826,7 @@ bool PluginManager::GetConfig(const wxString & key, int & value, int defval)
return result;
}
bool PluginManager::GetConfig(const wxString & key, wxString & value, const wxString & defval)
bool PluginManager::GetConfig(const RegistryPath & key, wxString & value, const wxString & defval)
{
bool result = false;
@ -2842,7 +2842,7 @@ bool PluginManager::GetConfig(const wxString & key, wxString & value, const wxSt
return result;
}
bool PluginManager::GetConfig(const wxString & key, bool & value, bool defval)
bool PluginManager::GetConfig(const RegistryPath & key, bool & value, bool defval)
{
bool result = false;
@ -2854,7 +2854,7 @@ bool PluginManager::GetConfig(const wxString & key, bool & value, bool defval)
return result;
}
bool PluginManager::GetConfig(const wxString & key, float & value, float defval)
bool PluginManager::GetConfig(const RegistryPath & key, float & value, float defval)
{
bool result = false;
@ -2870,7 +2870,7 @@ bool PluginManager::GetConfig(const wxString & key, float & value, float defval)
return result;
}
bool PluginManager::GetConfig(const wxString & key, double & value, double defval)
bool PluginManager::GetConfig(const RegistryPath & key, double & value, double defval)
{
bool result = false;
@ -2882,7 +2882,7 @@ bool PluginManager::GetConfig(const wxString & key, double & value, double defva
return result;
}
bool PluginManager::SetConfig(const wxString & key, const wxString & value)
bool PluginManager::SetConfig(const RegistryPath & key, const wxString & value)
{
bool result = false;
@ -2899,7 +2899,7 @@ bool PluginManager::SetConfig(const wxString & key, const wxString & value)
return result;
}
bool PluginManager::SetConfig(const wxString & key, const int & value)
bool PluginManager::SetConfig(const RegistryPath & key, const int & value)
{
bool result = false;
@ -2915,7 +2915,7 @@ bool PluginManager::SetConfig(const wxString & key, const int & value)
return result;
}
bool PluginManager::SetConfig(const wxString & key, const bool & value)
bool PluginManager::SetConfig(const RegistryPath & key, const bool & value)
{
bool result = false;
@ -2931,7 +2931,7 @@ bool PluginManager::SetConfig(const wxString & key, const bool & value)
return result;
}
bool PluginManager::SetConfig(const wxString & key, const float & value)
bool PluginManager::SetConfig(const RegistryPath & key, const float & value)
{
bool result = false;
@ -2947,7 +2947,7 @@ bool PluginManager::SetConfig(const wxString & key, const float & value)
return result;
}
bool PluginManager::SetConfig(const wxString & key, const double & value)
bool PluginManager::SetConfig(const RegistryPath & key, const double & value)
{
bool result = false;
@ -2964,7 +2964,7 @@ bool PluginManager::SetConfig(const wxString & key, const double & value)
}
/* Return value is a key for lookup in a config file */
wxString PluginManager::SettingsPath(const PluginID & ID, bool shared)
RegistryPath PluginManager::SettingsPath(const PluginID & ID, bool shared)
{
// All the strings reported by PluginDescriptor and used in this function
// persist in the plugin settings configuration file, so they should not
@ -2994,7 +2994,7 @@ wxString PluginManager::SettingsPath(const PluginID & ID, bool shared)
}
/* Return value is a key for lookup in a config file */
wxString PluginManager::SharedGroup(const PluginID & ID, const wxString & group)
RegistryPath PluginManager::SharedGroup(const PluginID & ID, const RegistryPath & group)
{
wxString path = SettingsPath(ID, true);
@ -3008,9 +3008,9 @@ wxString PluginManager::SharedGroup(const PluginID & ID, const wxString & group)
}
/* Return value is a key for lookup in a config file */
wxString PluginManager::SharedKey(const PluginID & ID, const wxString & group, const wxString & key)
RegistryPath PluginManager::SharedKey(const PluginID & ID, const RegistryPath & group, const RegistryPath & key)
{
wxString path = SharedGroup(ID, group);
auto path = SharedGroup(ID, group);
if (path.empty())
{
return path;
@ -3020,9 +3020,9 @@ wxString PluginManager::SharedKey(const PluginID & ID, const wxString & group, c
}
/* Return value is a key for lookup in a config file */
wxString PluginManager::PrivateGroup(const PluginID & ID, const wxString & group)
RegistryPath PluginManager::PrivateGroup(const PluginID & ID, const RegistryPath & group)
{
wxString path = SettingsPath(ID, false);
auto path = SettingsPath(ID, false);
wxFileName ff(group);
if (!ff.GetName().empty())
@ -3034,9 +3034,9 @@ wxString PluginManager::PrivateGroup(const PluginID & ID, const wxString & group
}
/* Return value is a key for lookup in a config file */
wxString PluginManager::PrivateKey(const PluginID & ID, const wxString & group, const wxString & key)
RegistryPath PluginManager::PrivateKey(const PluginID & ID, const RegistryPath & group, const RegistryPath & key)
{
wxString path = PrivateGroup(ID, group);
auto path = PrivateGroup(ID, group);
if (path.empty())
{
return path;

View File

@ -187,41 +187,41 @@ public:
wxArrayString & files,
bool directories = false) override;
bool HasSharedConfigGroup(const PluginID & ID, const wxString & group) /* not override */;
bool GetSharedConfigSubgroups(const PluginID & ID, const wxString & group, wxArrayString & subgroups) override;
bool HasSharedConfigGroup(const PluginID & ID, const RegistryPath & group) /* not override */;
bool GetSharedConfigSubgroups(const PluginID & ID, const RegistryPath & group, RegistryPaths &subgroups) override;
bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval = _T("")) override;
bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval = 0) override;
bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval = false) override;
bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval = 0.0) override;
bool GetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval = 0.0) override;
bool GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval = _T("")) override;
bool GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, int & value, int defval = 0) override;
bool GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, bool & value, bool defval = false) override;
bool GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, float & value, float defval = 0.0) override;
bool GetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, double & value, double defval = 0.0) override;
bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value) override;
bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value) override;
bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value) override;
bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value) override;
bool SetSharedConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value) override;
bool SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const wxString & value) override;
bool SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const int & value) override;
bool SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const bool & value) override;
bool SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const float & value) override;
bool SetSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const double & value) override;
bool RemoveSharedConfigSubgroup(const PluginID & ID, const wxString & group) override;
bool RemoveSharedConfig(const PluginID & ID, const wxString & group, const wxString & key) override;
bool RemoveSharedConfigSubgroup(const PluginID & ID, const RegistryPath & group) override;
bool RemoveSharedConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key) override;
bool HasPrivateConfigGroup(const PluginID & ID, const wxString & group) /* not override */;
bool GetPrivateConfigSubgroups(const PluginID & ID, const wxString & group, wxArrayString & subgroups) override;
bool HasPrivateConfigGroup(const PluginID & ID, const RegistryPath & group) /* not override */;
bool GetPrivateConfigSubgroups(const PluginID & ID, const RegistryPath & group, RegistryPaths &subgroups) override;
bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, wxString & value, const wxString & defval = _T("")) override;
bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, int & value, int defval = 0) override;
bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, bool & value, bool defval = false) override;
bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, float & value, float defval = 0.0) override;
bool GetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, double & value, double defval = 0.0) override;
bool GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval = _T("")) override;
bool GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, int & value, int defval = 0) override;
bool GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, bool & value, bool defval = false) override;
bool GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, float & value, float defval = 0.0) override;
bool GetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, double & value, double defval = 0.0) override;
bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const wxString & value) override;
bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const int & value) override;
bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const bool & value) override;
bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const float & value) override;
bool SetPrivateConfig(const PluginID & ID, const wxString & group, const wxString & key, const double & value) override;
bool SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const wxString & value) override;
bool SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const int & value) override;
bool SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const bool & value) override;
bool SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const float & value) override;
bool SetPrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key, const double & value) override;
bool RemovePrivateConfigSubgroup(const PluginID & ID, const wxString & group) override;
bool RemovePrivateConfig(const PluginID & ID, const wxString & group, const wxString & key) override;
bool RemovePrivateConfigSubgroup(const PluginID & ID, const RegistryPath & group) override;
bool RemovePrivateConfig(const PluginID & ID, const RegistryPath & group, const RegistryPath & key) override;
// PluginManager implementation
@ -277,27 +277,27 @@ private:
wxFileConfig *GetSettings();
bool HasGroup(const wxString & group);
bool GetSubgroups(const wxString & group, wxArrayString & subgroups);
bool HasGroup(const RegistryPath & group);
bool GetSubgroups(const RegistryPath & group, RegistryPaths & subgroups);
bool GetConfig(const wxString & key, wxString & value, const wxString & defval = L"");
bool GetConfig(const wxString & key, int & value, int defval = 0);
bool GetConfig(const wxString & key, bool & value, bool defval = false);
bool GetConfig(const wxString & key, float & value, float defval = 0.0);
bool GetConfig(const wxString & key, double & value, double defval = 0.0);
bool GetConfig(const RegistryPath & key, wxString & value, const wxString & defval = L"");
bool GetConfig(const RegistryPath & key, int & value, int defval = 0);
bool GetConfig(const RegistryPath & key, bool & value, bool defval = false);
bool GetConfig(const RegistryPath & key, float & value, float defval = 0.0);
bool GetConfig(const RegistryPath & key, double & value, double defval = 0.0);
bool SetConfig(const wxString & key, const wxString & value);
bool SetConfig(const wxString & key, const int & value);
bool SetConfig(const wxString & key, const bool & value);
bool SetConfig(const wxString & key, const float & value);
bool SetConfig(const wxString & key, const double & value);
bool SetConfig(const RegistryPath & key, const wxString & value);
bool SetConfig(const RegistryPath & key, const int & value);
bool SetConfig(const RegistryPath & key, const bool & value);
bool SetConfig(const RegistryPath & key, const float & value);
bool SetConfig(const RegistryPath & key, const double & value);
/* Return values are keys for lookup in a config file */
wxString SettingsPath(const PluginID & ID, bool shared);
wxString SharedGroup(const PluginID & ID, const wxString & group);
wxString SharedKey(const PluginID & ID, const wxString & group, const wxString & key);
wxString PrivateGroup(const PluginID & ID, const wxString & group);
wxString PrivateKey(const PluginID & ID, const wxString & group, const wxString & key);
RegistryPath SettingsPath(const PluginID & ID, bool shared);
RegistryPath SharedGroup(const PluginID & ID, const RegistryPath & group);
RegistryPath SharedKey(const PluginID & ID, const RegistryPath & group, const RegistryPath & key);
RegistryPath PrivateGroup(const PluginID & ID, const RegistryPath & group);
RegistryPath PrivateKey(const PluginID & ID, const RegistryPath & group, const RegistryPath & key);
// The PluginID must be kept unique. Since the wxFileConfig class does not preserve
// case, we use base64 encoding.

View File

@ -326,9 +326,9 @@ bool EffectDistortion::SetAutomationParameters(CommandParameters & parms)
return true;
}
wxArrayString EffectDistortion::GetFactoryPresets()
RegistryPaths EffectDistortion::GetFactoryPresets()
{
wxArrayString names;
RegistryPaths names;
for (size_t i = 0; i < WXSIZEOF(FactoryPresets); i++)
{

View File

@ -89,7 +89,7 @@ public:
bool DefineParams( ShuttleParams & S ) override;
bool GetAutomationParameters(CommandParameters & parms) override;
bool SetAutomationParameters(CommandParameters & parms) override;
wxArrayString GetFactoryPresets() override;
RegistryPaths GetFactoryPresets() override;
bool LoadFactoryPreset(int id) override;
// Effect implementation

View File

@ -584,7 +584,7 @@ bool Effect::SetAutomationParameters(CommandParameters & parms)
return true;
}
bool Effect::LoadUserPreset(const wxString & name)
bool Effect::LoadUserPreset(const RegistryPath & name)
{
if (mClient)
{
@ -600,7 +600,7 @@ bool Effect::LoadUserPreset(const wxString & name)
return SetAutomationParameters(parms);
}
bool Effect::SaveUserPreset(const wxString & name)
bool Effect::SaveUserPreset(const RegistryPath & name)
{
if (mClient)
{
@ -616,14 +616,14 @@ bool Effect::SaveUserPreset(const wxString & name)
return SetPrivateConfig(name, wxT("Parameters"), parms);
}
wxArrayString Effect::GetFactoryPresets()
RegistryPaths Effect::GetFactoryPresets()
{
if (mClient)
{
return mClient->GetFactoryPresets();
}
return wxArrayString();
return {};
}
bool Effect::LoadFactoryPreset(int id)
@ -791,9 +791,9 @@ wxDialog *Effect::CreateUI(wxWindow *parent, EffectUIClientInterface *client)
return NULL;
}
wxString Effect::GetUserPresetsGroup(const wxString & name)
RegistryPath Effect::GetUserPresetsGroup(const RegistryPath & name)
{
wxString group = wxT("UserPresets");
RegistryPath group = wxT("UserPresets");
if (!name.empty())
{
group += wxCONFIG_PATH_SEPARATOR + name;
@ -802,12 +802,12 @@ wxString Effect::GetUserPresetsGroup(const wxString & name)
return group;
}
wxString Effect::GetCurrentSettingsGroup()
RegistryPath Effect::GetCurrentSettingsGroup()
{
return wxT("CurrentSettings");
}
wxString Effect::GetFactoryDefaultsGroup()
RegistryPath Effect::GetFactoryDefaultsGroup()
{
return wxT("FactoryDefaults");
}
@ -818,142 +818,142 @@ wxString Effect::GetSavedStateGroup()
}
// ConfigClientInterface implementation
bool Effect::HasSharedConfigGroup(const wxString & group)
bool Effect::HasSharedConfigGroup(const RegistryPath & group)
{
return PluginManager::Get().HasSharedConfigGroup(GetID(), group);
}
bool Effect::GetSharedConfigSubgroups(const wxString & group, wxArrayString & subgroups)
bool Effect::GetSharedConfigSubgroups(const RegistryPath & group, RegistryPaths &subgroups)
{
return PluginManager::Get().GetSharedConfigSubgroups(GetID(), group, subgroups);
}
bool Effect::GetSharedConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval)
bool Effect::GetSharedConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval)
{
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
}
bool Effect::GetSharedConfig(const wxString & group, const wxString & key, int & value, int defval)
bool Effect::GetSharedConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval)
{
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
}
bool Effect::GetSharedConfig(const wxString & group, const wxString & key, bool & value, bool defval)
bool Effect::GetSharedConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval)
{
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
}
bool Effect::GetSharedConfig(const wxString & group, const wxString & key, float & value, float defval)
bool Effect::GetSharedConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval)
{
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
}
bool Effect::GetSharedConfig(const wxString & group, const wxString & key, double & value, double defval)
bool Effect::GetSharedConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval)
{
return PluginManager::Get().GetSharedConfig(GetID(), group, key, value, defval);
}
bool Effect::SetSharedConfig(const wxString & group, const wxString & key, const wxString & value)
bool Effect::SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value)
{
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
}
bool Effect::SetSharedConfig(const wxString & group, const wxString & key, const int & value)
bool Effect::SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const int & value)
{
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
}
bool Effect::SetSharedConfig(const wxString & group, const wxString & key, const bool & value)
bool Effect::SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const bool & value)
{
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
}
bool Effect::SetSharedConfig(const wxString & group, const wxString & key, const float & value)
bool Effect::SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const float & value)
{
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
}
bool Effect::SetSharedConfig(const wxString & group, const wxString & key, const double & value)
bool Effect::SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const double & value)
{
return PluginManager::Get().SetSharedConfig(GetID(), group, key, value);
}
bool Effect::RemoveSharedConfigSubgroup(const wxString & group)
bool Effect::RemoveSharedConfigSubgroup(const RegistryPath & group)
{
return PluginManager::Get().RemoveSharedConfigSubgroup(GetID(), group);
}
bool Effect::RemoveSharedConfig(const wxString & group, const wxString & key)
bool Effect::RemoveSharedConfig(const RegistryPath & group, const RegistryPath & key)
{
return PluginManager::Get().RemoveSharedConfig(GetID(), group, key);
}
bool Effect::HasPrivateConfigGroup(const wxString & group)
bool Effect::HasPrivateConfigGroup(const RegistryPath & group)
{
return PluginManager::Get().HasPrivateConfigGroup(GetID(), group);
}
bool Effect::GetPrivateConfigSubgroups(const wxString & group, wxArrayString & subgroups)
bool Effect::GetPrivateConfigSubgroups(const RegistryPath & group, RegistryPaths & subgroups)
{
return PluginManager::Get().GetPrivateConfigSubgroups(GetID(), group, subgroups);
}
bool Effect::GetPrivateConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval)
bool Effect::GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval)
{
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
}
bool Effect::GetPrivateConfig(const wxString & group, const wxString & key, int & value, int defval)
bool Effect::GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval)
{
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
}
bool Effect::GetPrivateConfig(const wxString & group, const wxString & key, bool & value, bool defval)
bool Effect::GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval)
{
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
}
bool Effect::GetPrivateConfig(const wxString & group, const wxString & key, float & value, float defval)
bool Effect::GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval)
{
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
}
bool Effect::GetPrivateConfig(const wxString & group, const wxString & key, double & value, double defval)
bool Effect::GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval)
{
return PluginManager::Get().GetPrivateConfig(GetID(), group, key, value, defval);
}
bool Effect::SetPrivateConfig(const wxString & group, const wxString & key, const wxString & value)
bool Effect::SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value)
{
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
}
bool Effect::SetPrivateConfig(const wxString & group, const wxString & key, const int & value)
bool Effect::SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const int & value)
{
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
}
bool Effect::SetPrivateConfig(const wxString & group, const wxString & key, const bool & value)
bool Effect::SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const bool & value)
{
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
}
bool Effect::SetPrivateConfig(const wxString & group, const wxString & key, const float & value)
bool Effect::SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const float & value)
{
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
}
bool Effect::SetPrivateConfig(const wxString & group, const wxString & key, const double & value)
bool Effect::SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const double & value)
{
return PluginManager::Get().SetPrivateConfig(GetID(), group, key, value);
}
bool Effect::RemovePrivateConfigSubgroup(const wxString & group)
bool Effect::RemovePrivateConfigSubgroup(const RegistryPath & group)
{
return PluginManager::Get().RemovePrivateConfigSubgroup(GetID(), group);
}
bool Effect::RemovePrivateConfig(const wxString & group, const wxString & key)
bool Effect::RemovePrivateConfig(const RegistryPath & group, const RegistryPath & key)
{
return PluginManager::Get().RemovePrivateConfig(GetID(), group, key);
}
@ -1091,10 +1091,10 @@ bool Effect::SetAutomationParameters(const wxString & parms)
return TransferDataToWindow();
}
wxArrayString Effect::GetUserPresets()
RegistryPaths Effect::GetUserPresets()
{
wxArrayString presets;
RegistryPaths presets;
GetPrivateConfigSubgroups(GetUserPresetsGroup(wxEmptyString), presets);
std::sort( presets.begin(), presets.end() );
@ -3386,7 +3386,7 @@ void EffectUIHost::OnMenu(wxCommandEvent & WXUNUSED(evt))
sub->AppendSeparator();
for (size_t i = 0, cnt = factory.size(); i < cnt; i++)
{
wxString label = factory[i];
auto label = factory[i];
if (label.empty())
{
label = _("None");
@ -3616,7 +3616,7 @@ void EffectUIHost::OnFactoryPreset(wxCommandEvent & evt)
void EffectUIHost::OnDeletePreset(wxCommandEvent & evt)
{
wxString preset = mUserPresets[evt.GetId() - kDeletePresetID];
auto preset = mUserPresets[evt.GetId() - kDeletePresetID];
int res = AudacityMessageBox(wxString::Format(_("Are you sure you want to delete \"%s\"?"), preset),
_("Delete Preset"),
@ -3997,7 +3997,8 @@ void EffectPresetsDialog::SetPrefix(const wxString & type, const wxString & pref
if (type == _("User Presets"))
{
mPresets->Clear();
mPresets->Append(mUserPresets);
for (const auto &preset : mUserPresets)
mPresets->Append(preset);
mPresets->Enable(true);
mPresets->SetStringSelection(prefix);
if (mPresets->GetSelection() == wxNOT_FOUND)
@ -4011,7 +4012,7 @@ void EffectPresetsDialog::SetPrefix(const wxString & type, const wxString & pref
mPresets->Clear();
for (size_t i = 0, cnt = mFactoryPresets.size(); i < cnt; i++)
{
wxString label = mFactoryPresets[i];
auto label = mFactoryPresets[i];
if (label.empty())
{
label = _("None");
@ -4059,7 +4060,8 @@ void EffectPresetsDialog::UpdateUI()
}
mPresets->Clear();
mPresets->Append(mUserPresets);
for (const auto &preset : mUserPresets)
mPresets->Append(preset);
mPresets->Enable(true);
mPresets->SetSelection(selected);
mSelection = Effect::kUserPresetIdent + mPresets->GetString(selected);
@ -4075,7 +4077,7 @@ void EffectPresetsDialog::UpdateUI()
mPresets->Clear();
for (size_t i = 0, cnt = mFactoryPresets.size(); i < cnt; i++)
{
wxString label = mFactoryPresets[i];
auto label = mFactoryPresets[i];
if (label.empty())
{
label = _("None");

View File

@ -134,10 +134,10 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
bool GetAutomationParameters(CommandParameters & parms) override;
bool SetAutomationParameters(CommandParameters & parms) override;
bool LoadUserPreset(const wxString & name) override;
bool SaveUserPreset(const wxString & name) override;
bool LoadUserPreset(const RegistryPath & name) override;
bool SaveUserPreset(const RegistryPath & name) override;
wxArrayString GetFactoryPresets() override;
RegistryPaths GetFactoryPresets() override;
bool LoadFactoryPreset(int id) override;
bool LoadFactoryDefaults() override;
@ -170,48 +170,48 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
wxDialog *CreateUI(wxWindow *parent, EffectUIClientInterface *client) override;
wxString GetUserPresetsGroup(const wxString & name) override;
wxString GetCurrentSettingsGroup() override;
wxString GetFactoryDefaultsGroup() override;
RegistryPath GetUserPresetsGroup(const RegistryPath & name) override;
RegistryPath GetCurrentSettingsGroup() override;
RegistryPath GetFactoryDefaultsGroup() override;
virtual wxString GetSavedStateGroup() /* not override? */;
// ConfigClientInterface implementation
bool HasSharedConfigGroup(const wxString & group) override;
bool GetSharedConfigSubgroups(const wxString & group, wxArrayString & subgroups) override;
bool HasSharedConfigGroup(const RegistryPath & group) override;
bool GetSharedConfigSubgroups(const RegistryPath & group, RegistryPaths &subgroups) override;
bool GetSharedConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval = {}) override;
bool GetSharedConfig(const wxString & group, const wxString & key, int & value, int defval = 0) override;
bool GetSharedConfig(const wxString & group, const wxString & key, bool & value, bool defval = false) override;
bool GetSharedConfig(const wxString & group, const wxString & key, float & value, float defval = 0.0) override;
bool GetSharedConfig(const wxString & group, const wxString & key, double & value, double defval = 0.0) override;
bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval = {}) override;
bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval = 0) override;
bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval = false) override;
bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval = 0.0) override;
bool GetSharedConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval = 0.0) override;
bool SetSharedConfig(const wxString & group, const wxString & key, const wxString & value) override;
bool SetSharedConfig(const wxString & group, const wxString & key, const int & value) override;
bool SetSharedConfig(const wxString & group, const wxString & key, const bool & value) override;
bool SetSharedConfig(const wxString & group, const wxString & key, const float & value) override;
bool SetSharedConfig(const wxString & group, const wxString & key, const double & value) override;
bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value) override;
bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const int & value) override;
bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const bool & value) override;
bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const float & value) override;
bool SetSharedConfig(const RegistryPath & group, const RegistryPath & key, const double & value) override;
bool RemoveSharedConfigSubgroup(const wxString & group) override;
bool RemoveSharedConfig(const wxString & group, const wxString & key) override;
bool RemoveSharedConfigSubgroup(const RegistryPath & group) override;
bool RemoveSharedConfig(const RegistryPath & group, const RegistryPath & key) override;
bool HasPrivateConfigGroup(const wxString & group) override;
bool GetPrivateConfigSubgroups(const wxString & group, wxArrayString & subgroups) override;
bool HasPrivateConfigGroup(const RegistryPath & group) override;
bool GetPrivateConfigSubgroups(const RegistryPath & group, RegistryPaths &paths) override;
bool GetPrivateConfig(const wxString & group, const wxString & key, wxString & value, const wxString & defval = {}) override;
bool GetPrivateConfig(const wxString & group, const wxString & key, int & value, int defval = 0) override;
bool GetPrivateConfig(const wxString & group, const wxString & key, bool & value, bool defval = false) override;
bool GetPrivateConfig(const wxString & group, const wxString & key, float & value, float defval = 0.0) override;
bool GetPrivateConfig(const wxString & group, const wxString & key, double & value, double defval = 0.0) override;
bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, wxString & value, const wxString & defval = {}) override;
bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, int & value, int defval = 0) override;
bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, bool & value, bool defval = false) override;
bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, float & value, float defval = 0.0) override;
bool GetPrivateConfig(const RegistryPath & group, const RegistryPath & key, double & value, double defval = 0.0) override;
bool SetPrivateConfig(const wxString & group, const wxString & key, const wxString & value) override;
bool SetPrivateConfig(const wxString & group, const wxString & key, const int & value) override;
bool SetPrivateConfig(const wxString & group, const wxString & key, const bool & value) override;
bool SetPrivateConfig(const wxString & group, const wxString & key, const float & value) override;
bool SetPrivateConfig(const wxString & group, const wxString & key, const double & value) override;
bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const wxString & value) override;
bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const int & value) override;
bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const bool & value) override;
bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const float & value) override;
bool SetPrivateConfig(const RegistryPath & group, const RegistryPath & key, const double & value) override;
bool RemovePrivateConfigSubgroup(const wxString & group) override;
bool RemovePrivateConfig(const wxString & group, const wxString & key) override;
bool RemovePrivateConfigSubgroup(const RegistryPath & group) override;
bool RemovePrivateConfig(const RegistryPath & group, const RegistryPath & key) override;
// Effect implementation
@ -224,7 +224,7 @@ class AUDACITY_DLL_API Effect /* not final */ : public wxEvtHandler,
virtual bool GetAutomationParameters(wxString & parms);
virtual bool SetAutomationParameters(const wxString & parms);
virtual wxArrayString GetUserPresets();
virtual RegistryPaths GetUserPresets();
virtual bool HasCurrentSettings();
virtual bool HasFactoryDefaults();
virtual wxString GetPreset(wxWindow * parent, const wxString & parms);
@ -649,7 +649,7 @@ private:
AudacityCommand * mCommand;
EffectUIClientInterface *mClient;
wxArrayString mUserPresets;
RegistryPaths mUserPresets;
bool mInitialized;
bool mSupportsRealtime;
bool mIsGUI;
@ -707,8 +707,8 @@ private:
wxChoice *mType;
wxListBox *mPresets;
wxArrayString mFactoryPresets;
wxArrayString mUserPresets;
RegistryPaths mFactoryPresets;
RegistryPaths mUserPresets;
wxString mSelection;
DECLARE_EVENT_TABLE()

View File

@ -326,9 +326,9 @@ bool EffectReverb::SetAutomationParameters(CommandParameters & parms)
return true;
}
wxArrayString EffectReverb::GetFactoryPresets()
RegistryPaths EffectReverb::GetFactoryPresets()
{
wxArrayString names;
RegistryPaths names;
for (size_t i = 0; i < WXSIZEOF(FactoryPresets); i++)
{

View File

@ -66,7 +66,7 @@ public:
bool DefineParams( ShuttleParams & S ) override;
bool GetAutomationParameters(CommandParameters & parms) override;
bool SetAutomationParameters(CommandParameters & parms) override;
wxArrayString GetFactoryPresets() override;
RegistryPaths GetFactoryPresets() override;
bool LoadFactoryPreset(int id) override;
// Effect implementation

View File

@ -1678,7 +1678,7 @@ bool VSTEffect::SetAutomationParameters(CommandParameters & parms)
}
bool VSTEffect::LoadUserPreset(const wxString & name)
bool VSTEffect::LoadUserPreset(const RegistryPath & name)
{
if (!LoadParameters(name))
{
@ -1690,14 +1690,14 @@ bool VSTEffect::LoadUserPreset(const wxString & name)
return true;
}
bool VSTEffect::SaveUserPreset(const wxString & name)
bool VSTEffect::SaveUserPreset(const RegistryPath & name)
{
return SaveParameters(name);
}
wxArrayString VSTEffect::GetFactoryPresets()
RegistryPaths VSTEffect::GetFactoryPresets()
{
wxArrayString progs;
RegistryPaths progs;
// Some plugins, like Guitar Rig 5, only report 128 programs while they have hundreds. While
// I was able to come up with a hack in the Guitar Rig case to gather all of the program names
@ -2295,7 +2295,7 @@ std::vector<int> VSTEffect::GetEffectIDs()
return effectIDs;
}
bool VSTEffect::LoadParameters(const wxString & group)
bool VSTEffect::LoadParameters(const RegistryPath & group)
{
wxString value;
@ -2339,7 +2339,7 @@ bool VSTEffect::LoadParameters(const wxString & group)
return SetAutomationParameters(eap);
}
bool VSTEffect::SaveParameters(const wxString & group)
bool VSTEffect::SaveParameters(const RegistryPath & group)
{
mHost->SetPrivateConfig(group, wxT("UniqueID"), mAEffect->uniqueID);
mHost->SetPrivateConfig(group, wxT("Version"), mAEffect->version);

View File

@ -141,10 +141,10 @@ class VSTEffect final : public wxEvtHandler,
bool GetAutomationParameters(CommandParameters & parms) override;
bool SetAutomationParameters(CommandParameters & parms) override;
bool LoadUserPreset(const wxString & name) override;
bool SaveUserPreset(const wxString & name) override;
bool LoadUserPreset(const RegistryPath & name) override;
bool SaveUserPreset(const RegistryPath & name) override;
wxArrayString GetFactoryPresets() override;
RegistryPaths GetFactoryPresets() override;
bool LoadFactoryPreset(int id) override;
bool LoadFactoryDefaults() override;
@ -183,8 +183,8 @@ private:
std::vector<int> GetEffectIDs();
// Parameter loading and saving
bool LoadParameters(const wxString & group);
bool SaveParameters(const wxString & group);
bool LoadParameters(const RegistryPath & group);
bool SaveParameters(const RegistryPath & group);
// Base64 encoding and decoding
static wxString b64encode(const void *in, int len);

View File

@ -522,7 +522,7 @@ void AudioUnitEffectExportDialog::PopulateOrExchange(ShuttleGui & S)
S.AddStandardButtons();
wxArrayString presets;
RegistryPaths presets;
mEffect->mHost->GetPrivateConfigSubgroups(mEffect->mHost->GetUserPresetsGroup(wxEmptyString), presets);
@ -1623,12 +1623,12 @@ bool AudioUnitEffect::SetAutomationParameters(CommandParameters & parms)
return true;
}
bool AudioUnitEffect::LoadUserPreset(const wxString & name)
bool AudioUnitEffect::LoadUserPreset(const RegistryPath & name)
{
return LoadParameters(name);
}
bool AudioUnitEffect::SaveUserPreset(const wxString & name)
bool AudioUnitEffect::SaveUserPreset(const RegistryPath & name)
{
return SaveParameters(name);
}
@ -1683,10 +1683,10 @@ bool AudioUnitEffect::LoadFactoryDefaults()
return LoadParameters(mHost->GetFactoryDefaultsGroup());
}
wxArrayString AudioUnitEffect::GetFactoryPresets()
RegistryPaths AudioUnitEffect::GetFactoryPresets()
{
OSStatus result;
wxArrayString presets;
RegistryPaths presets;
// Retrieve the list of factory presets
CFArrayRef array{};
@ -1873,7 +1873,7 @@ void AudioUnitEffect::ShowOptions()
// AudioUnitEffect Implementation
// ============================================================================
bool AudioUnitEffect::LoadParameters(const wxString & group)
bool AudioUnitEffect::LoadParameters(const RegistryPath & group)
{
wxString parms;
if (!mHost->GetPrivateConfig(group, wxT("Parameters"), parms, wxEmptyString))
@ -1890,7 +1890,7 @@ bool AudioUnitEffect::LoadParameters(const wxString & group)
return SetAutomationParameters(eap);
}
bool AudioUnitEffect::SaveParameters(const wxString & group)
bool AudioUnitEffect::SaveParameters(const RegistryPath & group)
{
CommandParameters eap;
if (!GetAutomationParameters(eap))

View File

@ -106,12 +106,12 @@ public:
bool GetAutomationParameters(CommandParameters & parms) override;
bool SetAutomationParameters(CommandParameters & parms) override;
bool LoadUserPreset(const wxString & name) override;
bool SaveUserPreset(const wxString & name) override;
bool LoadUserPreset(const RegistryPath & name) override;
bool SaveUserPreset(const RegistryPath & name) override;
bool LoadFactoryPreset(int id) override;
bool LoadFactoryDefaults() override;
wxArrayString GetFactoryPresets() override;
RegistryPaths GetFactoryPresets() override;
// EffectUIClientInterface implementation
@ -162,8 +162,8 @@ private:
void GetChannelCounts();
bool LoadParameters(const wxString & group);
bool SaveParameters(const wxString & group);
bool LoadParameters(const RegistryPath & group);
bool SaveParameters(const RegistryPath & group);
bool CreatePlain(wxWindow *parent);

View File

@ -1107,7 +1107,7 @@ bool LadspaEffect::SetAutomationParameters(CommandParameters & parms)
return true;
}
bool LadspaEffect::LoadUserPreset(const wxString & name)
bool LadspaEffect::LoadUserPreset(const RegistryPath & name)
{
if (!LoadParameters(name))
{
@ -1119,14 +1119,14 @@ bool LadspaEffect::LoadUserPreset(const wxString & name)
return true;
}
bool LadspaEffect::SaveUserPreset(const wxString & name)
bool LadspaEffect::SaveUserPreset(const RegistryPath & name)
{
return SaveParameters(name);
}
wxArrayString LadspaEffect::GetFactoryPresets()
RegistryPaths LadspaEffect::GetFactoryPresets()
{
return wxArrayString();
return {};
}
bool LadspaEffect::LoadFactoryPreset(int WXUNUSED(id))
@ -1591,7 +1591,7 @@ void LadspaEffect::Unload()
}
}
bool LadspaEffect::LoadParameters(const wxString & group)
bool LadspaEffect::LoadParameters(const RegistryPath & group)
{
wxString parms;
if (!mHost->GetPrivateConfig(group, wxT("Parameters"), parms, wxEmptyString))
@ -1608,7 +1608,7 @@ bool LadspaEffect::LoadParameters(const wxString & group)
return SetAutomationParameters(eap);
}
bool LadspaEffect::SaveParameters(const wxString & group)
bool LadspaEffect::SaveParameters(const RegistryPath & group)
{
CommandParameters eap;
if (!GetAutomationParameters(eap))

View File

@ -103,10 +103,10 @@ public:
bool GetAutomationParameters(CommandParameters & parms) override;
bool SetAutomationParameters(CommandParameters & parms) override;
bool LoadUserPreset(const wxString & name) override;
bool SaveUserPreset(const wxString & name) override;
bool LoadUserPreset(const RegistryPath & name) override;
bool SaveUserPreset(const RegistryPath & name) override;
wxArrayString GetFactoryPresets() override;
RegistryPaths GetFactoryPresets() override;
bool LoadFactoryPreset(int id) override;
bool LoadFactoryDefaults() override;
@ -132,8 +132,8 @@ private:
bool Load();
void Unload();
bool LoadParameters(const wxString & group);
bool SaveParameters(const wxString & group);
bool LoadParameters(const RegistryPath & group);
bool SaveParameters(const RegistryPath & group);
LADSPA_Handle InitInstance(float sampleRate);
void FreeInstance(LADSPA_Handle handle);

View File

@ -1118,7 +1118,7 @@ bool LV2Effect::CloseUI()
return true;
}
bool LV2Effect::LoadUserPreset(const wxString & name)
bool LV2Effect::LoadUserPreset(const RegistryPath & name)
{
if (!LoadParameters(name))
{
@ -1128,12 +1128,12 @@ bool LV2Effect::LoadUserPreset(const wxString & name)
return TransferDataToWindow();
}
bool LV2Effect::SaveUserPreset(const wxString & name)
bool LV2Effect::SaveUserPreset(const RegistryPath & name)
{
return SaveParameters(name);
}
wxArrayString LV2Effect::GetFactoryPresets()
RegistryPaths LV2Effect::GetFactoryPresets()
{
if (mFactoryPresetsLoaded)
{
@ -1243,7 +1243,7 @@ void LV2Effect::ShowOptions()
// LV2Effect Implementation
// ============================================================================
bool LV2Effect::LoadParameters(const wxString & group)
bool LV2Effect::LoadParameters(const RegistryPath & group)
{
wxString parms;
if (!mHost->GetPrivateConfig(group, wxT("Parameters"), parms, wxEmptyString))
@ -1260,7 +1260,7 @@ bool LV2Effect::LoadParameters(const wxString & group)
return SetAutomationParameters(eap);
}
bool LV2Effect::SaveParameters(const wxString & group)
bool LV2Effect::SaveParameters(const RegistryPath & group)
{
CommandParameters eap;
if (!GetAutomationParameters(eap))

View File

@ -172,10 +172,10 @@ public:
bool HideUI() override;
bool CloseUI() override;
bool LoadUserPreset(const wxString & name) override;
bool SaveUserPreset(const wxString & name) override;
bool LoadUserPreset(const RegistryPath & name) override;
bool SaveUserPreset(const RegistryPath & name) override;
wxArrayString GetFactoryPresets() override;
RegistryPaths GetFactoryPresets() override;
bool LoadFactoryPreset(int id) override;
bool LoadFactoryDefaults() override;
@ -192,8 +192,8 @@ private:
bool Load();
void Unload();
bool LoadParameters(const wxString & group);
bool SaveParameters(const wxString & group);
bool LoadParameters(const RegistryPath & group);
bool SaveParameters(const RegistryPath & group);
LilvInstance *InitInstance(float sampleRate);
void FreeInstance(LilvInstance *handle);
@ -321,7 +321,7 @@ private:
ArrayOf<wxTextCtrl*> mFields;
bool mFactoryPresetsLoaded;
wxArrayString mFactoryPresetNames;
RegistryPaths mFactoryPresetNames;
wxArrayString mFactoryPresetUris;
DECLARE_EVENT_TABLE()