MCPcopy Create free account
hub / github.com/audacity/audacity / SetEffectParameters

Method SetEffectParameters

src/EffectAndCommandPluginManager.cpp:210–247  ·  view source on GitHub ↗

This function is used only in the macro programming user interface

Source from the content-addressed store, hash-verified

208
209// This function is used only in the macro programming user interface
210bool EffectAndCommandPluginManager::SetEffectParameters(
211 const PluginID& ID, const wxString& params)
212{
213 auto pair = EffectManager::Get().GetEffectAndDefaultSettings(ID);
214 if (auto effect = pair.first)
215 {
216 assert(pair.second); // postcondition
217 auto& settings = *pair.second;
218 CommandParameters eap(params);
219
220 // Check first for what GetDefaultPreset() might have written
221 if (eap.HasEntry(wxT("Use Preset")))
222 {
223 return effect
224 ->LoadSettingsFromString(eap.Read(wxT("Use Preset")), settings)
225 .has_value();
226 }
227
228 return effect->LoadSettingsFromString(params, settings).has_value();
229 }
230 AudacityCommand* command = GetAudacityCommand(ID);
231
232 if (command)
233 {
234 // Set defaults (if not initialised) before setting values.
235 command->Init();
236 CommandParameters eap(params);
237
238 // Check first for what GetDefaultPreset() might have written
239 if (eap.HasEntry(wxT("Use Preset")))
240 {
241 return command->LoadSettingsFromString(eap.Read(wxT("Use Preset")));
242 }
243
244 return command->LoadSettingsFromString(params);
245 }
246 return false;
247}
248
249//! Shows an effect or command dialog so the user can specify settings for later
250/*!

Callers 2

PromptForParamsForMethod · 0.80
ApplyEffectCommandMethod · 0.80

Calls 7

GetFunction · 0.85
has_valueMethod · 0.80
HasEntryMethod · 0.45
ReadMethod · 0.45
InitMethod · 0.45

Tested by

no test coverage detected