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

Method GetPreset

libraries/lib-effects/EffectManager.cpp:137–172  ·  view source on GitHub ↗

This function is used only in the macro programming user interface

Source from the content-addressed store, hash-verified

135
136// This function is used only in the macro programming user interface
137wxString EffectManager::GetPreset(
138 const PluginID& ID, const wxString& params, EffectPresetDialog dialog)
139{
140 auto effect = GetEffect(ID);
141
142 if (!effect)
143 {
144 return wxEmptyString;
145 }
146
147 CommandParameters eap(params);
148
149 wxString preset;
150 if (eap.HasEntry(wxT("Use Preset")))
151 {
152 preset = eap.Read(wxT("Use Preset"));
153 }
154
155 if (const auto answer = dialog(*effect, preset))
156 preset = *answer;
157 else
158 preset = wxEmptyString;
159
160 if (preset.empty())
161 {
162 return preset;
163 }
164
165 // This cleans a config "file" backed by a string in memory.
166 eap.DeleteAll();
167
168 eap.Write(wxT("Use Preset"), preset);
169 eap.GetParameters(preset);
170
171 return preset;
172}
173
174// This function is used only in the macro programming user interface
175wxString EffectManager::GetDefaultPreset(const PluginID & ID)

Callers 1

PromptForPresetForMethod · 0.80

Calls 7

GetEffectFunction · 0.85
DeleteAllMethod · 0.80
HasEntryMethod · 0.45
ReadMethod · 0.45
emptyMethod · 0.45
WriteMethod · 0.45
GetParametersMethod · 0.45

Tested by

no test coverage detected