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

Method LoadPreset

modules/import-export/mod-ffmpeg/FFmpegPresets.cpp:230–307  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228}
229
230void FFmpegPresets::LoadPreset(ExportFFmpegOptions *parent, wxString &name)
231{
232 FFmpegPreset *preset = FindPreset(name);
233 if (!preset)
234 {
235 AudacityMessageBox( XO("Preset '%s' does not exist." ).Format(name));
236 return;
237 }
238
239 wxListBox *lb;
240 wxSpinCtrl *sc;
241 wxTextCtrl *tc;
242 wxCheckBox *cb;
243 wxChoice *ch;
244
245 for (int id = FEFirstID; id < FELastID; id++)
246 {
247 wxWindow *wnd = parent->FindWindowById(id,parent);
248 if (wnd != NULL)
249 {
250 wxString readstr;
251 long readlong;
252 bool readbool;
253 switch(id)
254 {
255 // Listbox
256 case FEFormatID:
257 case FECodecID:
258 lb = dynamic_cast<wxListBox*>(wnd);
259 readstr = preset->mControlState[id - FEFirstID];
260 readlong = lb->FindString(readstr);
261 if (readlong > -1) lb->Select(readlong);
262 break;
263 // Spin control
264 case FEBitrateID:
265 case FEQualityID:
266 case FESampleRateID:
267 case FECutoffID:
268 case FEFrameSizeID:
269 case FEBufSizeID:
270 case FECompLevelID:
271 case FELPCCoeffsID:
272 case FEMinPredID:
273 case FEMaxPredID:
274 case FEMinPartOrderID:
275 case FEMaxPartOrderID:
276 case FEMuxRateID:
277 case FEPacketSizeID:
278 sc = dynamic_cast<wxSpinCtrl*>(wnd);
279 preset->mControlState[id - FEFirstID].ToLong(&readlong);
280 sc->SetValue(readlong);
281 break;
282 // Text control
283 case FELanguageID:
284 case FETagID:
285 tc = dynamic_cast<wxTextCtrl*>(wnd);
286 tc->SetValue(preset->mControlState[id - FEFirstID]);
287 break;

Callers 1

OnLoadPresetMethod · 0.45

Calls 3

AudacityMessageBoxFunction · 0.85
SelectMethod · 0.45
SetValueMethod · 0.45

Tested by

no test coverage detected