Audacity  3.0.3
Classes | Typedefs | Enumerations | Functions
PluginSettings Namespace Reference

Classes

struct  ConfigReferenceGenerator
 Define a reference to a variable of one of the types in ConfigValueTypes. More...
 
struct  ConfigReferenceGenerator< is_const, std::tuple< Types... > >
 

Typedefs

using ConfigValueTypes = std::tuple< wxString, int, bool, float, double >
 Supported types for settings. More...
 
using ConfigReference = ConfigReferenceGenerator< false, ConfigValueTypes >::type
 
using ConfigConstReference = ConfigReferenceGenerator< true, ConfigValueTypes >::type
 

Enumerations

enum  ConfigurationType : unsigned { Shared, Private }
 

Functions

bool HasConfigGroup (EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group)
 
bool GetConfigSubgroups (EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group, RegistryPaths &subgroups)
 
bool GetConfigValue (EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group, const RegistryPath &key, ConfigReference var, ConfigConstReference defval)
 
bool SetConfigValue (EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group, const RegistryPath &key, ConfigConstReference value)
 
bool RemoveConfigSubgroup (EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group)
 
bool RemoveConfig (EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group, const RegistryPath &key)
 
template<typename Value >
bool GetConfig (EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var, const Value &defval)
 
template<typename Value , typename ConvertibleToValue >
bool GetConfig (EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var, ConvertibleToValue defval)
 
template<typename Value >
bool GetConfig (EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var)
 
template<typename Value >
bool SetConfig (EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, const Value &value)
 

Typedef Documentation

◆ ConfigConstReference

Definition at line 78 of file PluginInterface.h.

◆ ConfigReference

Definition at line 76 of file PluginInterface.h.

◆ ConfigValueTypes

using PluginSettings::ConfigValueTypes = typedef std::tuple< wxString , int , bool , float , double >

Supported types for settings.

Definition at line 60 of file PluginInterface.h.

Enumeration Type Documentation

◆ ConfigurationType

Enumerator
Shared 
Private 

Definition at line 55 of file PluginInterface.h.

55  : unsigned {
57 };

Function Documentation

◆ GetConfig() [1/3]

template<typename Value >
bool PluginSettings::GetConfig ( EffectDefinitionInterface ident,
ConfigurationType  type,
const RegistryPath group,
const RegistryPath key,
Value &  var 
)
inline

Definition at line 85 of file ConfigInterface.h.

88 {
89  return GetConfig(ident, type, group, key, var, Value{});
90 }

References GetConfig(), ident(), and key.

Here is the call graph for this function:

◆ GetConfig() [2/3]

template<typename Value >
bool PluginSettings::GetConfig ( EffectDefinitionInterface ident,
ConfigurationType  type,
const RegistryPath group,
const RegistryPath key,
Value &  var,
const Value &  defval 
)
inline

Definition at line 70 of file ConfigInterface.h.

73 { return GetConfigValue(ident, type, group, key,
74  std::ref(var), std::cref(defval)); }

References GetConfigValue(), ident(), and key.

Referenced by Effect::DoEffect(), GetConfig(), LadspaEffect::LoadParameters(), LV2Effect::LoadParameters(), VSTEffect::LoadParameters(), AudioUnitEffect::LoadPreset(), Effect::LoadUserPreset(), EffectChangeSpeed::PopulateOrExchange(), LV2Effect::PopulateUI(), VSTEffect::PopulateUI(), AudioUnitEffect::SetHost(), LadspaEffect::SetHost(), LV2Effect::SetHost(), VSTEffect::SetHost(), AudioUnitEffect::ShowOptions(), LadspaEffect::ShowOptions(), LV2Effect::ShowOptions(), VSTEffect::ShowOptions(), Effect::Startup(), and EffectChangeSpeed::Update_Vinyl().

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

◆ GetConfig() [3/3]

template<typename Value , typename ConvertibleToValue >
bool PluginSettings::GetConfig ( EffectDefinitionInterface ident,
ConfigurationType  type,
const RegistryPath group,
const RegistryPath key,
Value &  var,
ConvertibleToValue  defval 
)
inline

Definition at line 78 of file ConfigInterface.h.

81 { return GetConfig(ident, type, group, key, var, static_cast<Value>(defval)); }

References GetConfig(), ident(), and key.

Here is the call graph for this function:

◆ GetConfigSubgroups()

AUDACITY_DLL_API bool PluginSettings::GetConfigSubgroups ( EffectDefinitionInterface ident,
PluginSettings::ConfigurationType  type,
const RegistryPath group,
RegistryPaths subgroups 
)

Definition at line 23 of file ConfigInterface.cpp.

26 {
27  auto &pluginManager = PluginManager::Get();
28  const auto &id = pluginManager.GetID(&ident);
29  return pluginManager.GetConfigSubgroups(
30  type, id, group, subgroups);
31 }

References PluginManager::Get(), and ident().

Referenced by Effect::GetUserPresets(), and EffectUIHost::LoadUserPresets().

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

◆ GetConfigValue()

AUDACITY_DLL_API bool PluginSettings::GetConfigValue ( EffectDefinitionInterface ident,
PluginSettings::ConfigurationType  type,
const RegistryPath group,
const RegistryPath key,
ConfigReference  var,
ConfigConstReference  defval 
)

Definition at line 33 of file ConfigInterface.cpp.

37 {
38  auto &pluginManager = PluginManager::Get();
39  const auto &id = pluginManager.GetID(&ident);
40  return pluginManager.GetConfigValue(type, id, group, key, var, defval);
41 }

References PluginManager::Get(), ident(), and key.

Referenced by GetConfig().

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

◆ HasConfigGroup()

AUDACITY_DLL_API bool PluginSettings::HasConfigGroup ( EffectDefinitionInterface ident,
PluginSettings::ConfigurationType  type,
const RegistryPath group 
)

Definition at line 14 of file ConfigInterface.cpp.

17 {
18  auto &pluginManager = PluginManager::Get();
19  const auto &id = pluginManager.GetID(&ident);
20  return pluginManager.HasConfigGroup(type, id, group);
21 }

References PluginManager::Get(), and ident().

Referenced by Effect::HasCurrentSettings(), and Effect::HasFactoryDefaults().

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

◆ RemoveConfig()

AUDACITY_DLL_API bool PluginSettings::RemoveConfig ( EffectDefinitionInterface ident,
PluginSettings::ConfigurationType  type,
const RegistryPath group,
const RegistryPath key 
)

Definition at line 62 of file ConfigInterface.cpp.

65 {
66  auto &pluginManager = PluginManager::Get();
67  const auto &id = pluginManager.GetID(&ident);
68  return pluginManager.RemoveConfig(type, id, group, key);
69 }

References PluginManager::Get(), ident(), and key.

Referenced by AudioUnitEffect::LoadPreset().

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

◆ RemoveConfigSubgroup()

AUDACITY_DLL_API bool PluginSettings::RemoveConfigSubgroup ( EffectDefinitionInterface ident,
PluginSettings::ConfigurationType  type,
const RegistryPath group 
)

Definition at line 53 of file ConfigInterface.cpp.

56 {
57  auto &pluginManager = PluginManager::Get();
58  const auto &id = pluginManager.GetID(&ident);
59  return pluginManager.RemoveConfigSubgroup(type, id, group);
60 }

References PluginManager::Get(), and ident().

Referenced by EffectUIHost::OnDeletePreset().

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

◆ SetConfig()

template<typename Value >
bool PluginSettings::SetConfig ( EffectDefinitionInterface ident,
ConfigurationType  type,
const RegistryPath group,
const RegistryPath key,
const Value &  value 
)
inline

Definition at line 97 of file ConfigInterface.h.

100 {
101  return SetConfigValue(ident, type, group, key, std::cref(value));
102 }

References ident(), key, and SetConfigValue().

Referenced by AudioUnitEffectImportDialog::Import(), EffectChangeSpeed::OnChoice_Vinyl(), AudioUnitEffectOptionsDialog::OnOk(), LadspaEffectOptionsDialog::OnOk(), LV2EffectSettingsDialog::OnOk(), VSTEffectOptionsDialog::OnOk(), LadspaEffect::SaveParameters(), LV2Effect::SaveParameters(), VSTEffect::SaveParameters(), AudioUnitEffect::SavePreset(), Effect::SaveUserPreset(), Effect::SetDuration(), AudioUnitEffect::SetHost(), LadspaEffect::SetHost(), LV2Effect::SetHost(), VSTEffect::SetHost(), EffectChangeSpeed::Startup(), EffectEqualization::Startup(), Effect::Startup(), EffectChangeSpeed::TransferDataFromWindow(), and EffectEqualization::ValidateUI().

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

◆ SetConfigValue()

AUDACITY_DLL_API bool PluginSettings::SetConfigValue ( EffectDefinitionInterface ident,
PluginSettings::ConfigurationType  type,
const RegistryPath group,
const RegistryPath key,
ConfigConstReference  value 
)

Definition at line 43 of file ConfigInterface.cpp.

47 {
48  auto &pluginManager = PluginManager::Get();
49  const auto &id = pluginManager.GetID(&ident);
50  return pluginManager.SetConfigValue(type, id, group, key, value);
51 }

References PluginManager::Get(), ident(), and key.

Referenced by SetConfig().

Here is the call graph for this function:
Here is the caller graph for this function:
ident
static CommandHandlerObject & ident(AudacityProject &project)
Definition: ModNullCallback.cpp:65
PluginSettings::GetConfig
bool GetConfig(EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var)
Definition: ConfigInterface.h:85
PluginSettings::Shared
@ Shared
Definition: PluginInterface.h:56
PluginSettings::GetConfigValue
bool GetConfigValue(EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group, const RegistryPath &key, ConfigReference var, ConfigConstReference defval)
Definition: ConfigInterface.cpp:33
PluginManager::Get
static PluginManager & Get()
Definition: PluginManager.cpp:581
key
static const AudacityProject::AttachedObjects::RegisteredFactory key
Definition: CommandManager.cpp:201
PluginSettings::SetConfigValue
bool SetConfigValue(EffectDefinitionInterface &ident, PluginSettings::ConfigurationType type, const RegistryPath &group, const RegistryPath &key, ConfigConstReference value)
Definition: ConfigInterface.cpp:43
PluginSettings::Private
@ Private
Definition: PluginInterface.h:56