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

Method SavePreset

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

Source from the content-addressed store, hash-verified

134
135
136bool FFmpegPresets::SavePreset(ExportFFmpegOptions *parent, wxString &name)
137{
138 wxString format;
139 wxString codec;
140 FFmpegPreset *preset;
141
142 {
143 wxWindow *wnd;
144 wxListBox *lb;
145
146 wnd = dynamic_cast<wxWindow*>(parent)->FindWindowById(FEFormatID,parent);
147 lb = dynamic_cast<wxListBox*>(wnd);
148 if (lb->GetSelection() < 0)
149 {
150 AudacityMessageBox( XO("Please select format before saving a profile") );
151 return false;
152 }
153 format = lb->GetStringSelection();
154
155 wnd = dynamic_cast<wxWindow*>(parent)->FindWindowById(FECodecID,parent);
156 lb = dynamic_cast<wxListBox*>(wnd);
157 if (lb->GetSelection() < 0)
158 {
159 /* i18n-hint: "codec" is short for a "coder-decoder" algorithm */
160 AudacityMessageBox( XO("Please select codec before saving a profile") );
161 return false;
162 }
163 codec = lb->GetStringSelection();
164 }
165
166 preset = &mPresets[name];
167 preset->mPresetName = name;
168
169 wxSpinCtrl *sc;
170 wxTextCtrl *tc;
171 wxCheckBox *cb;
172 wxChoice *ch;
173
174 for (int id = FEFirstID; id < FELastID; id++)
175 {
176 wxWindow *wnd = dynamic_cast<wxWindow*>(parent)->FindWindowById(id,parent);
177 if (wnd != NULL)
178 {
179 switch(id)
180 {
181 case FEFormatID:
182 preset->mControlState[id - FEFirstID] = format;
183 break;
184 case FECodecID:
185 preset->mControlState[id - FEFirstID] = codec;
186 break;
187 // Spin control
188 case FEBitrateID:
189 case FEQualityID:
190 case FESampleRateID:
191 case FECutoffID:
192 case FEFrameSizeID:
193 case FEBufSizeID:

Callers

nothing calls this directly

Calls 3

AudacityMessageBoxFunction · 0.85
GetSelectionMethod · 0.45
GetValueMethod · 0.45

Tested by

no test coverage detected