Audacity 3.2.0
Functions
anonymous_namespace{EffectManager.cpp} Namespace Reference

Functions

void InitializePreset (EffectSettingsManager &manager, EffectSettings &settings)
 
std::pair< ComponentInterface *, EffectSettingsLoadComponent (const PluginID &ID)
 

Function Documentation

◆ InitializePreset()

void anonymous_namespace{EffectManager.cpp}::InitializePreset ( EffectSettingsManager manager,
EffectSettings settings 
)

Definition at line 230 of file EffectManager.cpp.

231 {
232 // Config key remembering whether we already stored FactoryDefaults
233 constexpr auto InitializedKey = L"Initialized";
234 if (bool haveDefaults{};
236 InitializedKey, haveDefaults, false),
237 !haveDefaults
238 ) {
239 manager.SaveUserPreset(FactoryDefaultsGroup(), settings);
240 // Also initialize the "current" settings --
241 if (bool haveCurrent{};
243 InitializedKey, haveCurrent, false),
244 !haveCurrent
245 ) {
246 manager.SaveUserPreset(CurrentSettingsGroup(), settings);
247 }
249 InitializedKey, true);
250 }
251 // ignore failure
252 (void) manager.LoadUserPreset(CurrentSettingsGroup(), settings);
253}
const RegistryPath & FactoryDefaultsGroup()
Component of a configuration key path, for default state of MakeSettings()
const RegistryPath & CurrentSettingsGroup()
Component of a configuration key path, for last-used destructive settings.
static const AttachedProjectObjects::RegisteredFactory manager
static Settings & settings()
Definition: TrackInfo.cpp:51
bool SetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, const Value &value)
bool GetConfig(const EffectDefinitionInterface &ident, ConfigurationType type, const RegistryPath &group, const RegistryPath &key, Value &var, const Value &defval)

References CurrentSettingsGroup(), FactoryDefaultsGroup(), PluginSettings::GetConfig(), manager, PluginSettings::Private, PluginSettings::SetConfig(), and settings().

Referenced by LoadComponent().

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

◆ LoadComponent()

std::pair< ComponentInterface *, EffectSettings > anonymous_namespace{EffectManager.cpp}::LoadComponent ( const PluginID ID)

Definition at line 256 of file EffectManager.cpp.

257{
258 if (auto result = dynamic_cast<EffectSettingsManager*>(
259 PluginManager::Get().Load(ID))) {
260 auto settings = result->MakeSettings();
261 InitializePreset(*result, settings);
262 return { result, std::move(settings) };
263 }
264 return { nullptr, {} };
265}
EffectSettingsManager is an EffectDefinitionInterface that adds a factory function for EffectSettings...
static PluginManager & Get()
THEME_RESOURCES_API void Load()
void InitializePreset(EffectSettingsManager &manager, EffectSettings &settings)

References PluginManager::Get(), InitializePreset(), ThemeResources::Load(), and settings().

Referenced by EffectManager::DoGetEffect().

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