| 219 | } |
| 220 | |
| 221 | OptionalMessage |
| 222 | EqualizationBase::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 |
nothing calls this directly
no test coverage detected