| 1233 | } |
| 1234 | |
| 1235 | void ExportFFmpegOptions::DoOnFormatList() |
| 1236 | { |
| 1237 | wxString *selfmt = NULL; |
| 1238 | wxString *selfmtlong = NULL; |
| 1239 | FindSelectedFormat(&selfmt, &selfmtlong); |
| 1240 | if (selfmt == NULL) |
| 1241 | { |
| 1242 | return; |
| 1243 | } |
| 1244 | |
| 1245 | wxString *selcdc = NULL; |
| 1246 | wxString *selcdclong = NULL; |
| 1247 | FindSelectedCodec(&selcdc, &selcdclong); |
| 1248 | |
| 1249 | auto fmt = mFFmpeg->GuessOutputFormat(selfmt->ToUTF8(),NULL,NULL); |
| 1250 | if (fmt == NULL) |
| 1251 | { |
| 1252 | //This shouldn't really happen |
| 1253 | mFormatName->SetLabel(wxString(_("Failed to guess format"))); |
| 1254 | return; |
| 1255 | } |
| 1256 | mFormatName->SetLabel(wxString::Format(wxT("%s"), *selfmtlong)); |
| 1257 | |
| 1258 | AudacityAVCodecID selcdcid = AUDACITY_AV_CODEC_ID_NONE; |
| 1259 | |
| 1260 | if (selcdc != nullptr) |
| 1261 | { |
| 1262 | auto cdc = mFFmpeg->CreateEncoder(selcdc->ToUTF8()); |
| 1263 | |
| 1264 | if (cdc != nullptr) |
| 1265 | { |
| 1266 | selcdcid = mFFmpeg->GetAudacityCodecID(cdc->GetId()); |
| 1267 | } |
| 1268 | } |
| 1269 | int newselcdc = |
| 1270 | FetchCompatibleCodecList(*selfmt, selcdcid); |
| 1271 | |
| 1272 | if (newselcdc >= 0) mCodecList->Select(newselcdc); |
| 1273 | |
| 1274 | std::unique_ptr<AVCodecWrapper> cdc; |
| 1275 | |
| 1276 | if (selcdc != nullptr) |
| 1277 | cdc = mFFmpeg->CreateEncoder(selcdc->ToUTF8()); |
| 1278 | |
| 1279 | EnableDisableControls(cdc.get(), selfmt); |
| 1280 | Layout(); |
| 1281 | Fit(); |
| 1282 | return; |
| 1283 | } |
| 1284 | |
| 1285 | void ExportFFmpegOptions::DoOnCodecList() |
| 1286 | { |
nothing calls this directly
no test coverage detected