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

Method LoadFactoryPreset

libraries/lib-builtin-effects/EqualizationBase.cpp:221–250  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219}
220
221OptionalMessage
222EqualizationBase::LoadFactoryPreset(int id, EffectSettings& settings) const
223{
224 int index = -1;
225 for (size_t i = 0; i < WXSIZEOF(FactoryPresets); i++)
226 {
227 if (
228 (mOptions == kEqOptionGraphic) &&
229 (FactoryPresets[i].bForBoth == false))
230 continue;
231 if (id-- == 0)
232 {
233 index = i;
234 break;
235 }
236 }
237 if (index < 0)
238 return {};
239
240 // mParams =
241 wxString params = FactoryPresets[index].values;
242
243 CommandParameters eap(params);
244 ShuttleSetAutomation S;
245 S.SetForWriting(&eap);
246 // To do: externalize state so const_cast isn't needed
247 if (!const_cast<EqualizationBase*>(this)->VisitSettings(S, settings))
248 return {};
249 return { nullptr };
250}
251
252// Effect implementation
253

Callers

nothing calls this directly

Calls 1

VisitSettingsMethod · 0.45

Tested by

no test coverage detected