Audacity  3.0.3
ExportFFmpegDialogs.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3  Audacity: A Digital Audio Editor
4 
5  ExportFFmpegDialogs.cpp
6 
7  Audacity(R) is copyright (c) 1999-2010 Audacity Team.
8  License: GPL v2. See License.txt.
9 
10  LRN
11 
12 ******************************************************************//***************************************************************//***************************************************************//***************************************************************//***************************************************************//***************************************************************//*******************************************************************/
43 
44 
45 #include "ExportFFmpegDialogs.h"
46 
47 #include "../FFmpeg.h"
48 
49 #include <wx/checkbox.h>
50 #include <wx/choice.h>
51 #include <wx/intl.h>
52 #include <wx/timer.h>
53 #include <wx/string.h>
54 #include <wx/textctrl.h>
55 #include <wx/listbox.h>
56 #include <wx/window.h>
57 #include <wx/spinctrl.h>
58 #include <wx/combobox.h>
59 #include <wx/stattext.h>
60 
61 #include "../widgets/FileDialog/FileDialog.h"
62 
63 #include "../Mix.h"
64 #include "../Tags.h"
65 #include "../widgets/AudacityMessageBox.h"
66 #include "../widgets/HelpSystem.h"
67 
68 #include "Export.h"
69 
70 #if defined(USE_FFMPEG)
71 
76 #define FFMPEG_EXPORT_CTRL_ID_ENTRIES \
77  FFMPEG_EXPORT_CTRL_ID_FIRST_ENTRY(FEFirstID, 20000), \
78  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEFormatID), \
79  FFMPEG_EXPORT_CTRL_ID_ENTRY(FECodecID), \
80  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEBitrateID), \
81  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEQualityID), \
82  FFMPEG_EXPORT_CTRL_ID_ENTRY(FESampleRateID), \
83  FFMPEG_EXPORT_CTRL_ID_ENTRY(FELanguageID), \
84  FFMPEG_EXPORT_CTRL_ID_ENTRY(FETagID), \
85  FFMPEG_EXPORT_CTRL_ID_ENTRY(FECutoffID), \
86  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEFrameSizeID), \
87  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEBufSizeID), \
88  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEProfileID), \
89  FFMPEG_EXPORT_CTRL_ID_ENTRY(FECompLevelID), \
90  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEUseLPCID), \
91  FFMPEG_EXPORT_CTRL_ID_ENTRY(FELPCCoeffsID), \
92  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEMinPredID), \
93  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEMaxPredID), \
94  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEPredOrderID), \
95  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEMinPartOrderID), \
96  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEMaxPartOrderID), \
97  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEMuxRateID), \
98  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEPacketSizeID), \
99  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEBitReservoirID), \
100  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEVariableBlockLenID), \
101  FFMPEG_EXPORT_CTRL_ID_ENTRY(FELastID), \
102  \
103  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEFormatLabelID), \
104  FFMPEG_EXPORT_CTRL_ID_ENTRY(FECodecLabelID), \
105  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEFormatNameID), \
106  FFMPEG_EXPORT_CTRL_ID_ENTRY(FECodecNameID), \
107  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEPresetID), \
108  FFMPEG_EXPORT_CTRL_ID_ENTRY(FESavePresetID), \
109  FFMPEG_EXPORT_CTRL_ID_ENTRY(FELoadPresetID), \
110  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEDeletePresetID), \
111  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEAllFormatsID), \
112  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEAllCodecsID), \
113  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEImportPresetsID), \
114  FFMPEG_EXPORT_CTRL_ID_ENTRY(FEExportPresetsID) \
115 
116 // First the enumeration
117 #define FFMPEG_EXPORT_CTRL_ID_FIRST_ENTRY(name, num) name = num
118 #define FFMPEG_EXPORT_CTRL_ID_ENTRY(name) name
119 
122 };
123 
124 // Now the string representations
125 #undef FFMPEG_EXPORT_CTRL_ID_FIRST_ENTRY
126 #define FFMPEG_EXPORT_CTRL_ID_FIRST_ENTRY(name, num) wxT(#name)
127 #undef FFMPEG_EXPORT_CTRL_ID_ENTRY
128 #define FFMPEG_EXPORT_CTRL_ID_ENTRY(name) wxT(#name)
129 static const wxChar *FFmpegExportCtrlIDNames[] = {
131 };
132 
133 #undef FFMPEG_EXPORT_CTRL_ID_ENTRIES
134 #undef FFMPEG_EXPORT_CTRL_ID_ENTRY
135 #undef FFMPEG_EXPORT_CTRL_ID_FIRST_ENTRY
136 
137 //----------------------------------------------------------------------------
138 // ExportFFmpegAC3Options Class
139 //----------------------------------------------------------------------------
140 
141 namespace
142 {
143 
144 // i18n-hint kbps abbreviates "thousands of bits per second"
145 inline TranslatableString n_kbps(int n) { return XO("%d kbps").Format( n ); }
146 
148  n_kbps( 32 ),
149  n_kbps( 40 ),
150  n_kbps( 48 ),
151  n_kbps( 56 ),
152  n_kbps( 64 ),
153  n_kbps( 80 ),
154  n_kbps( 96 ),
155  n_kbps( 112 ),
156  n_kbps( 128 ),
157  n_kbps( 160 ),
158  n_kbps( 192 ),
159  n_kbps( 224 ),
160  n_kbps( 256 ),
161  n_kbps( 320 ),
162  n_kbps( 384 ),
163  n_kbps( 448 ),
164  n_kbps( 512 ),
165  n_kbps( 576 ),
166  n_kbps( 640 ),
167 };
168 
169 const std::vector< int > AC3BitRateValues{
170  32000,
171  40000,
172  48000,
173  56000,
174  64000,
175  80000,
176  96000,
177  112000,
178  128000,
179  160000,
180  192000,
181  224000,
182  256000,
183  320000,
184  384000,
185  448000,
186  512000,
187  576000,
188  640000,
189 };
190 
191 }
192 
193 const int ExportFFmpegAC3Options::iAC3SampleRates[] = { 32000, 44100, 48000, 0 };
194 
196 : wxPanelWrapper(parent, wxID_ANY)
197 {
200 
202 }
203 
205 {
207 }
208 
212 {
213  S.StartVerticalLay();
214  {
215  S.StartHorizontalLay(wxCENTER);
216  {
217  S.StartMultiColumn(2, wxCENTER);
218  {
220  XXO("Bit Rate:"),
221  {wxT("/FileFormats/AC3BitRate"),
222  160000},
225  );
226  }
227  S.EndMultiColumn();
228  }
229  S.EndHorizontalLay();
230  }
231  S.EndVerticalLay();
232 }
233 
237 {
238  return true;
239 }
240 
244 {
245  ShuttleGui S(this, eIsSavingToPrefs);
247 
248  gPrefs->Flush();
249 
250  return true;
251 }
252 
253 //----------------------------------------------------------------------------
254 // ExportFFmpegAACOptions Class
255 //----------------------------------------------------------------------------
256 
258 : wxPanelWrapper(parent, wxID_ANY)
259 {
262 
264 }
265 
267 {
269 }
270 
274 {
275  S.StartVerticalLay();
276  {
277  S.StartHorizontalLay(wxEXPAND);
278  {
279  S.SetSizerProportion(1);
280  S.StartMultiColumn(2, wxCENTER);
281  {
282  S.SetStretchyCol(1);
283  S.Prop(1).TieSlider(
284  XXO("Quality (kbps):"),
285  {wxT("/FileFormats/AACQuality"), 160},320, 98);
286  }
287  S.EndMultiColumn();
288  }
289  S.EndHorizontalLay();
290  }
291  S.EndVerticalLay();
292 }
293 
297 {
298  return true;
299 }
300 
304 {
305  ShuttleGui S(this, eIsSavingToPrefs);
307 
308  gPrefs->Flush();
309 
310  return true;
311 }
312 
313 //----------------------------------------------------------------------------
314 // ExportFFmpegAMRNBOptions Class
315 //----------------------------------------------------------------------------
316 
317 namespace {
318 
319 // i18n-hint kbps abbreviates "thousands of bits per second"
320 inline TranslatableString f_kbps( double d ) { return XO("%.2f kbps").Format( d ); }
321 
325 {
326  f_kbps( 4.75 ),
327  f_kbps( 5.15 ),
328  f_kbps( 5.90 ),
329  f_kbps( 6.70 ),
330  f_kbps( 7.40 ),
331  f_kbps( 7.95 ),
332  f_kbps( 10.20 ),
333  f_kbps( 12.20 ),
334 };
335 
336 const std::vector< int > AMRNBBitRateValues
337 {
338  4750,
339  5150,
340  5900,
341  6700,
342  7400,
343  7950,
344  10200,
345  12200,
346 };
347 
348 }
349 
351 : wxPanelWrapper(parent, wxID_ANY)
352 {
355 
357 }
358 
360 {
362 }
363 
367 {
368  S.StartVerticalLay();
369  {
370  S.StartHorizontalLay(wxCENTER);
371  {
372  S.StartMultiColumn(2, wxCENTER);
373  {
375  XXO("Bit Rate:"),
376  {wxT("/FileFormats/AMRNBBitRate"),
377  12200},
380  );
381  }
382  S.EndMultiColumn();
383  }
384  S.EndHorizontalLay();
385  }
386  S.EndVerticalLay();
387 }
388 
392 {
393  return true;
394 }
395 
399 {
400  ShuttleGui S(this, eIsSavingToPrefs);
402 
403  gPrefs->Flush();
404 
405  return true;
406 }
407 
408 //----------------------------------------------------------------------------
409 // ExportFFmpegOPUSOptions Class
410 //----------------------------------------------------------------------------
411 
412 namespace {
413 
416  {
417  wxT("/FileFormats/OPUSBitrate"),
418  {
419  ByColumns,
420  {
421  n_kbps( 6 ),
422  n_kbps( 8 ),
423  n_kbps( 16 ),
424  n_kbps( 24 ),
425  n_kbps( 32 ),
426  n_kbps( 40 ),
427  n_kbps( 48 ),
428  n_kbps( 64 ),
429  n_kbps( 80 ),
430  n_kbps( 96 ),
431  n_kbps( 128 ),
432  n_kbps( 160 ),
433  n_kbps( 192 ),
434  n_kbps( 256 ),
435  },
436  {
437  wxT("6000"),
438  wxT("8000"),
439  wxT("16000"),
440  wxT("24000"),
441  wxT("32000"),
442  wxT("40000"),
443  wxT("48000"),
444  wxT("64000"),
445  wxT("80000"),
446  wxT("96000"),
447  wxT("128000"),
448  wxT("160000"),
449  wxT("192000"),
450  wxT("256000"),
451  }
452  },
453  7 // "128 kbps"
454  };
455 
457  {
458  wxT("/FileFormats/OPUSCompression"),
459  {
460  ByColumns,
461  {
462  XO("0"),
463  XO("1"),
464  XO("2"),
465  XO("3"),
466  XO("4"),
467  XO("5"),
468  XO("6"),
469  XO("7"),
470  XO("8"),
471  XO("9"),
472  XO("10"),
473  },
474  {
475  wxT("0"),
476  wxT("1"),
477  wxT("2"),
478  wxT("3"),
479  wxT("4"),
480  wxT("5"),
481  wxT("6"),
482  wxT("7"),
483  wxT("8"),
484  wxT("9"),
485  wxT("10"),
486  }
487  },
488  10 // "10"
489  };
490 
491 
493  {
494  wxT("/FileFormats/OPUSVbrMode"),
495  {
496  ByColumns,
497  {
498  XO("Off"),
499  XO("On"),
500  XO("Constrained"),
501  },
502  {
503  wxT("off"),
504  wxT("on"),
505  wxT("constrained"),
506  }
507  },
508  1 // "On"
509  };
510 
512  {
513  wxT("/FileFormats/OPUSApplication"),
514  {
515  ByColumns,
516  {
517  XO("VOIP"),
518  XO("Audio"),
519  XO("Low Delay"),
520  },
521  {
522  wxT("voip"),
523  wxT("audio"),
524  wxT("lowdelay"),
525  }
526  },
527  1 // "Audio"
528  };
529 
531  {
532  wxT("/FileFormats/OPUSFrameDuration"),
533  {
534  ByColumns,
535  {
536  XO("2.5 ms"),
537  XO("5 ms"),
538  XO("10 ms"),
539  XO("20 ms"),
540  XO("40 ms"),
541  XO("60 ms"),
542  },
543  {
544  wxT("2.5"),
545  wxT("5"),
546  wxT("10"),
547  wxT("20"),
548  wxT("40"),
549  wxT("60"),
550  }
551  },
552  3 // "20"
553  };
554 
556  {
557  wxT("/FileFormats/OPUSCutoff"),
558  {
559  ByColumns,
560  {
561  XO("Disabled"),
562  XO("Narrowband"),
563  XO("Mediumband"),
564  XO("Wideband"),
565  XO("Super Wideband"),
566  XO("Fullband"),
567  },
568  {
569  wxT("0"),
570  wxT("4000"),
571  wxT("6000"),
572  wxT("8000"),
573  wxT("12000"),
574  wxT("20000"),
575  }
576  },
577  0 // "Disabled"
578  };
579 }
580 
582 : wxPanelWrapper(parent, wxID_ANY)
583 {
586 
588 }
589 
591 {
593 }
594 
598 {
599  S.SetSizerProportion(1);
600  S.SetBorder(4);
601  S.StartVerticalLay();
602  {
603  S.StartHorizontalLay(wxCENTER);
604  {
605  S.StartMultiColumn(2, wxCENTER);
606  {
607  S.StartMultiColumn(2, wxCENTER);
608  {
609  S.TieChoice(
610  XXO("Bit Rate:"),
611  OPUSBitrate);
612 
613  S.TieChoice(
614  XXO("Compression"),
616 
617  S.TieChoice(
618  XXO("Frame Duration:"),
620  }
621  S.EndMultiColumn();
622 
623  S.StartMultiColumn(2, wxCENTER);
624  {
625  S.TieChoice(
626  XXO("Vbr Mode:"),
627  OPUSVbrMode);
628 
629  S.TieChoice(
630  XXO("Application:"),
632 
633  S.TieChoice(
634  XXO("Cutoff:"),
635  OPUSCutoff);
636 
637  }
638  S.EndMultiColumn();
639  }
640  S.EndMultiColumn();
641  }
642  S.EndHorizontalLay();
643  }
644  S.EndVerticalLay();
645 }
646 
650 {
651  return true;
652 }
653 
657 {
658  ShuttleGui S(this, eIsSavingToPrefs);
660 
661  gPrefs->Flush();
662 
663  return true;
664 }
665 
666 //----------------------------------------------------------------------------
667 // ExportFFmpegWMAOptions Class
668 //----------------------------------------------------------------------------
669 
671 { 8000, 11025, 16000, 22050, 44100, 0};
672 
673 namespace {
674 
677 {
678  n_kbps(24),
679  n_kbps(32),
680  n_kbps(40),
681  n_kbps(48),
682  n_kbps(64),
683  n_kbps(80),
684  n_kbps(96),
685  n_kbps(128),
686  n_kbps(160),
687  n_kbps(192),
688  n_kbps(256),
689  n_kbps(320),
690 };
691 
692 const std::vector< int > WMABitRateValues{
693  24000,
694  32000,
695  40000,
696  48000,
697  64000,
698  80000,
699  96000,
700  128000,
701  160000,
702  192000,
703  256000,
704  320000,
705 };
706 
707 }
708 
710 : wxPanelWrapper(parent, wxID_ANY)
711 {
714 
716 }
717 
719 {
721 }
722 
726 {
727  S.StartVerticalLay();
728  {
729  S.StartHorizontalLay(wxCENTER);
730  {
731  S.StartMultiColumn(2, wxCENTER);
732  {
734  XXO("Bit Rate:"),
735  {wxT("/FileFormats/WMABitRate"),
736  128000},
739  );
740  }
741  S.EndMultiColumn();
742  }
743  S.EndHorizontalLay();
744  }
745  S.EndVerticalLay();
746 }
747 
751 {
752  return true;
753 }
754 
758 {
759  ShuttleGui S(this, eIsSavingToPrefs);
761 
762  gPrefs->Flush();
763 
764  return true;
765 }
766 
767 //----------------------------------------------------------------------------
768 // ExportFFmpegCustomOptions Class
769 //----------------------------------------------------------------------------
770 
771 #define OpenID 9000
772 
773 BEGIN_EVENT_TABLE(ExportFFmpegCustomOptions, wxPanelWrapper)
776 
778 : wxPanelWrapper(parent, wxID_ANY),
779  mFormat(NULL),
780  mCodec(NULL)
781 {
783  PopulateOrExchange(S);
784 
785  TransferDataToWindow();
786 }
787 
789 {
791 }
792 
796 {
797  S.StartHorizontalLay(wxCENTER);
798  {
799  S.StartVerticalLay(wxCENTER, 0);
800  {
801  S.Id(OpenID).AddButton(XXO("Open custom FFmpeg format options"));
802  S.StartMultiColumn(2, wxCENTER);
803  {
804  S.AddPrompt(XXO("Current Format:"));
805  mFormat = S.Style(wxTE_READONLY).AddTextBox({}, wxT(""), 25);
806  S.AddPrompt(XXO("Current Codec:"));
807  mCodec = S.Style(wxTE_READONLY).AddTextBox({}, wxT(""), 25);
808  }
809  S.EndMultiColumn();
810  }
811  S.EndHorizontalLay();
812  }
813  S.EndHorizontalLay();
814 }
815 
819 {
820  if (mFormat)
821  {
822  mFormat->SetValue(gPrefs->Read(wxT("/FileFormats/FFmpegFormat"), wxT("")));
823  mCodec->SetValue(gPrefs->Read(wxT("/FileFormats/FFmpegCodec"), wxT("")));
824  }
825  return true;
826 }
827 
831 {
832  return true;
833 }
834 
837 void ExportFFmpegCustomOptions::OnOpen(wxCommandEvent & WXUNUSED(evt))
838 {
839  // Show "Locate FFmpeg" dialog
840  PickFFmpegLibs();
841  if (!FFmpegLibsInst()->ValidLibsLoaded())
842  {
843  FFmpegLibsInst()->FindLibs(NULL);
845  if (!LoadFFmpeg(true))
846  {
847  return;
848  }
849  }
850  DropFFmpegLibs();
851 
852 #ifdef __WXMAC__
853  // Bug 2077 Must be a parent window on OSX or we will appear behind.
854  auto pWin = wxGetTopLevelParent( this );
855 #else
856  // Use GetTopWindow on windows as there is no hWnd with top level parent.
857  auto pWin = wxTheApp->GetTopWindow();
858 #endif
859 
860  ExportFFmpegOptions od(pWin);
861  od.ShowModal();
862 
864 }
865 
867 {
868  mControlState.resize(FELastID - FEFirstID);
869 }
870 
872 {
873 }
874 
876 {
877  mPreset = NULL;
878  mAbortImport = false;
879 
880  XMLFileReader xmlfile;
881  wxFileName xmlFileName(FileNames::DataDir(), wxT("ffmpeg_presets.xml"));
882  xmlfile.Parse(this,xmlFileName.GetFullPath());
883 }
884 
886 {
887  // We're in a destructor! Don't let exceptions out!
888  GuardedCall( [&] {
889  wxFileName xmlFileName{ FileNames::DataDir(), wxT("ffmpeg_presets.xml") };
890  XMLFileWriter writer{
891  xmlFileName.GetFullPath(), XO("Error Saving FFmpeg Presets") };
892  WriteXMLHeader(writer);
893  WriteXML(writer);
894  writer.Commit();
895  } );
896 }
897 
898 void FFmpegPresets::ImportPresets(wxString &filename)
899 {
900  mPreset = NULL;
901  mAbortImport = false;
902 
903  FFmpegPresetMap savePresets = mPresets;
904 
905  XMLFileReader xmlfile;
906  bool success = xmlfile.Parse(this,filename);
907  if (!success || mAbortImport) {
908  mPresets = savePresets;
909  }
910 }
911 
912 void FFmpegPresets::ExportPresets(wxString &filename)
913 {
914  GuardedCall( [&] {
915  XMLFileWriter writer{ filename, XO("Error Saving FFmpeg Presets") };
916  WriteXMLHeader(writer);
917  WriteXML(writer);
918  writer.Commit();
919  } );
920 }
921 
922 void FFmpegPresets::GetPresetList(wxArrayString &list)
923 {
924  list.clear();
925  FFmpegPresetMap::iterator iter;
926  for (iter = mPresets.begin(); iter != mPresets.end(); ++iter)
927  {
928  list.push_back(iter->second.mPresetName);
929  }
930 
931  std::sort( list.begin(), list.end() );
932 }
933 
935 {
936  FFmpegPresetMap::iterator iter = mPresets.find(name);
937  if (iter != mPresets.end())
938  {
939  mPresets.erase(iter);
940  }
941 }
942 
944 {
945  FFmpegPresetMap::iterator iter = mPresets.find(name);
946  if (iter != mPresets.end())
947  {
948  return &iter->second;
949  }
950 
951  return NULL;
952 }
953 
954 // return false if overwrite was not allowed.
956 {
957  FFmpegPreset *preset = FindPreset(name);
958  if (preset)
959  {
960  auto query = XO("Overwrite preset '%s'?").Format(name);
961  int action = AudacityMessageBox(
962  query,
963  XO("Confirm Overwrite"),
964  wxYES_NO | wxCENTRE);
965  if (action == wxNO) return false;
966  }
967  return true;
968 }
969 
970 
972 {
973  wxString format;
974  wxString codec;
975  FFmpegPreset *preset;
976 
977  {
978  wxWindow *wnd;
979  wxListBox *lb;
980 
981  wnd = dynamic_cast<wxWindow*>(parent)->FindWindowById(FEFormatID,parent);
982  lb = dynamic_cast<wxListBox*>(wnd);
983  if (lb->GetSelection() < 0)
984  {
985  AudacityMessageBox( XO("Please select format before saving a profile") );
986  return false;
987  }
988  format = lb->GetStringSelection();
989 
990  wnd = dynamic_cast<wxWindow*>(parent)->FindWindowById(FECodecID,parent);
991  lb = dynamic_cast<wxListBox*>(wnd);
992  if (lb->GetSelection() < 0)
993  {
994  /* i18n-hint: "codec" is short for a "coder-decoder" algorithm */
995  AudacityMessageBox( XO("Please select codec before saving a profile") );
996  return false;
997  }
998  codec = lb->GetStringSelection();
999  }
1000 
1001  preset = &mPresets[name];
1002  preset->mPresetName = name;
1003 
1004  wxSpinCtrl *sc;
1005  wxTextCtrl *tc;
1006  wxCheckBox *cb;
1007  wxChoice *ch;
1008 
1009  for (int id = FEFirstID; id < FELastID; id++)
1010  {
1011  wxWindow *wnd = dynamic_cast<wxWindow*>(parent)->FindWindowById(id,parent);
1012  if (wnd != NULL)
1013  {
1014  switch(id)
1015  {
1016  case FEFormatID:
1017  preset->mControlState[id - FEFirstID] = format;
1018  break;
1019  case FECodecID:
1020  preset->mControlState[id - FEFirstID] = codec;
1021  break;
1022  // Spin control
1023  case FEBitrateID:
1024  case FEQualityID:
1025  case FESampleRateID:
1026  case FECutoffID:
1027  case FEFrameSizeID:
1028  case FEBufSizeID:
1029  case FECompLevelID:
1030  case FELPCCoeffsID:
1031  case FEMinPredID:
1032  case FEMaxPredID:
1033  case FEMinPartOrderID:
1034  case FEMaxPartOrderID:
1035  case FEMuxRateID:
1036  case FEPacketSizeID:
1037  sc = dynamic_cast<wxSpinCtrl*>(wnd);
1038  preset->mControlState[id - FEFirstID] = wxString::Format(wxT("%d"),sc->GetValue());
1039  break;
1040  // Text control
1041  case FELanguageID:
1042  case FETagID:
1043  tc = dynamic_cast<wxTextCtrl*>(wnd);
1044  preset->mControlState[id - FEFirstID] = tc->GetValue();
1045  break;
1046  // Choice
1047  case FEProfileID:
1048  case FEPredOrderID:
1049  ch = dynamic_cast<wxChoice*>(wnd);
1050  preset->mControlState[id - FEFirstID] = wxString::Format(wxT("%d"),ch->GetSelection());
1051  break;
1052  // Check box
1053  case FEUseLPCID:
1054  case FEBitReservoirID:
1055  case FEVariableBlockLenID:
1056  cb = dynamic_cast<wxCheckBox*>(wnd);
1057  preset->mControlState[id - FEFirstID] = wxString::Format(wxT("%d"),cb->GetValue());
1058  break;
1059  }
1060  }
1061  }
1062  return true;
1063 }
1064 
1066 {
1067  FFmpegPreset *preset = FindPreset(name);
1068  if (!preset)
1069  {
1070  AudacityMessageBox( XO("Preset '%s' does not exist." ).Format(name));
1071  return;
1072  }
1073 
1074  wxListBox *lb;
1075  wxSpinCtrl *sc;
1076  wxTextCtrl *tc;
1077  wxCheckBox *cb;
1078  wxChoice *ch;
1079 
1080  for (int id = FEFirstID; id < FELastID; id++)
1081  {
1082  wxWindow *wnd = parent->FindWindowById(id,parent);
1083  if (wnd != NULL)
1084  {
1085  wxString readstr;
1086  long readlong;
1087  bool readbool;
1088  switch(id)
1089  {
1090  // Listbox
1091  case FEFormatID:
1092  case FECodecID:
1093  lb = dynamic_cast<wxListBox*>(wnd);
1094  readstr = preset->mControlState[id - FEFirstID];
1095  readlong = lb->FindString(readstr);
1096  if (readlong > -1) lb->Select(readlong);
1097  break;
1098  // Spin control
1099  case FEBitrateID:
1100  case FEQualityID:
1101  case FESampleRateID:
1102  case FECutoffID:
1103  case FEFrameSizeID:
1104  case FEBufSizeID:
1105  case FECompLevelID:
1106  case FELPCCoeffsID:
1107  case FEMinPredID:
1108  case FEMaxPredID:
1109  case FEMinPartOrderID:
1110  case FEMaxPartOrderID:
1111  case FEMuxRateID:
1112  case FEPacketSizeID:
1113  sc = dynamic_cast<wxSpinCtrl*>(wnd);
1114  preset->mControlState[id - FEFirstID].ToLong(&readlong);
1115  sc->SetValue(readlong);
1116  break;
1117  // Text control
1118  case FELanguageID:
1119  case FETagID:
1120  tc = dynamic_cast<wxTextCtrl*>(wnd);
1121  tc->SetValue(preset->mControlState[id - FEFirstID]);
1122  break;
1123  // Choice
1124  case FEProfileID:
1125  case FEPredOrderID:
1126  ch = dynamic_cast<wxChoice*>(wnd);
1127  preset->mControlState[id - FEFirstID].ToLong(&readlong);
1128  if (readlong > -1) ch->Select(readlong);
1129  break;
1130  // Check box
1131  case FEUseLPCID:
1132  case FEBitReservoirID:
1133  case FEVariableBlockLenID:
1134  cb = dynamic_cast<wxCheckBox*>(wnd);
1135  preset->mControlState[id - FEFirstID].ToLong(&readlong);
1136  if (readlong) readbool = true; else readbool = false;
1137  cb->SetValue(readbool);
1138  break;
1139  }
1140  }
1141  }
1142 }
1143 
1144 bool FFmpegPresets::HandleXMLTag(const wxChar *tag, const wxChar **attrs)
1145 {
1146  if (mAbortImport)
1147  {
1148  return false;
1149  }
1150 
1151  if (!wxStrcmp(tag,wxT("ffmpeg_presets")))
1152  {
1153  return true;
1154  }
1155 
1156  if (!wxStrcmp(tag,wxT("preset")))
1157  {
1158  while (*attrs)
1159  {
1160  const wxChar *attr = *attrs++;
1161  wxString value = *attrs++;
1162 
1163  if (!value)
1164  break;
1165 
1166  if (!wxStrcmp(attr,wxT("name")))
1167  {
1168  mPreset = FindPreset(value);
1169  if (mPreset)
1170  {
1171  auto query = XO("Replace preset '%s'?").Format( value );
1172  int action = AudacityMessageBox(
1173  query,
1174  XO("Confirm Overwrite"),
1175  wxYES_NO | wxCANCEL | wxCENTRE);
1176  if (action == wxCANCEL)
1177  {
1178  mAbortImport = true;
1179  return false;
1180  }
1181  if (action == wxNO)
1182  {
1183  mPreset = NULL;
1184  return false;
1185  }
1186  *mPreset = FFmpegPreset();
1187  }
1188  else
1189  {
1190  mPreset = &mPresets[value];
1191  }
1192  mPreset->mPresetName = value;
1193  }
1194  }
1195  return true;
1196  }
1197 
1198  if (!wxStrcmp(tag,wxT("setctrlstate")) && mPreset)
1199  {
1200  long id = -1;
1201  while (*attrs)
1202  {
1203  const wxChar *attr = *attrs++;
1204  const wxChar *value = *attrs++;
1205 
1206  if (!value)
1207  break;
1208 
1209  if (!wxStrcmp(attr,wxT("id")))
1210  {
1211  for (long i = FEFirstID; i < FELastID; i++)
1212  if (!wxStrcmp(FFmpegExportCtrlIDNames[i - FEFirstID],value))
1213  id = i;
1214  }
1215  else if (!wxStrcmp(attr,wxT("state")))
1216  {
1217  if (id > FEFirstID && id < FELastID)
1218  mPreset->mControlState[id - FEFirstID] = wxString(value);
1219  }
1220  }
1221  return true;
1222  }
1223 
1224  return false;
1225 }
1226 
1228 {
1229  if (mAbortImport)
1230  {
1231  return NULL;
1232  }
1233 
1234  if (!wxStrcmp(tag, wxT("preset")))
1235  {
1236  return this;
1237  }
1238  else if (!wxStrcmp(tag, wxT("setctrlstate")))
1239  {
1240  return this;
1241  }
1242  return NULL;
1243 }
1244 
1246 // may throw
1247 {
1248  xmlFile.Write(wxT("<?xml "));
1249  xmlFile.Write(wxT("version=\"1.0\" "));
1250  xmlFile.Write(wxT("standalone=\"no\" "));
1251  xmlFile.Write(wxT("?>\n"));
1252 
1253  wxString dtdName = wxT("-//audacityffmpegpreset-1.0.0//DTD//EN");
1254  wxString dtdURI =
1255  wxT("http://audacity.sourceforge.net/xml/audacityffmpegpreset-1.0.0.dtd");
1256 
1257  xmlFile.Write(wxT("<!DOCTYPE "));
1258  xmlFile.Write(wxT("project "));
1259  xmlFile.Write(wxT("PUBLIC "));
1260  xmlFile.Write(wxT("\"-//audacityffmpegpreset-1.0.0//DTD//EN\" "));
1261  xmlFile.Write(wxT("\"http://audacity.sourceforge.net/xml/audacityffmpegpreset-1.0.0.dtd\" "));
1262  xmlFile.Write(wxT(">\n"));
1263 }
1264 
1266 // may throw
1267 {
1268  xmlFile.StartTag(wxT("ffmpeg_presets"));
1269  xmlFile.WriteAttr(wxT("version"),wxT("1.0"));
1270  FFmpegPresetMap::const_iterator iter;
1271  for (iter = mPresets.begin(); iter != mPresets.end(); ++iter)
1272  {
1273  auto preset = &iter->second;
1274  xmlFile.StartTag(wxT("preset"));
1275  xmlFile.WriteAttr(wxT("name"),preset->mPresetName);
1276  for (long i = FEFirstID + 1; i < FELastID; i++)
1277  {
1278  xmlFile.StartTag(wxT("setctrlstate"));
1279  xmlFile.WriteAttr(wxT("id"),wxString(FFmpegExportCtrlIDNames[i - FEFirstID]));
1280  xmlFile.WriteAttr(wxT("state"),preset->mControlState[i - FEFirstID]);
1281  xmlFile.EndTag(wxT("setctrlstate"));
1282  }
1283  xmlFile.EndTag(wxT("preset"));
1284  }
1285  xmlFile.EndTag(wxT("ffmpeg_presets"));
1286 }
1287 
1288 //----------------------------------------------------------------------------
1289 // ExportFFmpegOptions Class
1290 //----------------------------------------------------------------------------
1291 
1292 BEGIN_EVENT_TABLE(ExportFFmpegOptions, wxDialogWrapper)
1295  EVT_LISTBOX(FEFormatID,ExportFFmpegOptions::OnFormatList)
1296  EVT_LISTBOX(FECodecID,ExportFFmpegOptions::OnCodecList)
1305 
1306 CompatibilityEntry ExportFFmpegOptions::CompatibilityList[] =
1309 {
1310  { wxT("adts"), AV_CODEC_ID_AAC },
1311 
1312  { wxT("aiff"), AV_CODEC_ID_PCM_S16BE },
1313  { wxT("aiff"), AV_CODEC_ID_PCM_S8 },
1314  { wxT("aiff"), AV_CODEC_ID_PCM_S24BE },
1315  { wxT("aiff"), AV_CODEC_ID_PCM_S32BE },
1316  { wxT("aiff"), AV_CODEC_ID_PCM_ALAW },
1317  { wxT("aiff"), AV_CODEC_ID_PCM_MULAW },
1318  { wxT("aiff"), AV_CODEC_ID_MACE3 },
1319  { wxT("aiff"), AV_CODEC_ID_MACE6 },
1320  { wxT("aiff"), AV_CODEC_ID_GSM },
1321  { wxT("aiff"), AV_CODEC_ID_ADPCM_G726 },
1322  { wxT("aiff"), AV_CODEC_ID_PCM_S16LE },
1323  { wxT("aiff"), AV_CODEC_ID_ADPCM_IMA_QT },
1324  { wxT("aiff"), AV_CODEC_ID_QDM2 },
1325 
1326  { wxT("amr"), AV_CODEC_ID_AMR_NB },
1327  { wxT("amr"), AV_CODEC_ID_AMR_WB },
1328 
1329  { wxT("asf"), AV_CODEC_ID_PCM_S16LE },
1330  { wxT("asf"), AV_CODEC_ID_PCM_U8 },
1331  { wxT("asf"), AV_CODEC_ID_PCM_S24LE },
1332  { wxT("asf"), AV_CODEC_ID_PCM_S32LE },
1333  { wxT("asf"), AV_CODEC_ID_ADPCM_MS },
1334  { wxT("asf"), AV_CODEC_ID_PCM_ALAW },
1335  { wxT("asf"), AV_CODEC_ID_PCM_MULAW },
1336  { wxT("asf"), AV_CODEC_ID_WMAVOICE },
1337  { wxT("asf"), AV_CODEC_ID_ADPCM_IMA_WAV },
1338  { wxT("asf"), AV_CODEC_ID_ADPCM_YAMAHA },
1339  { wxT("asf"), AV_CODEC_ID_TRUESPEECH },
1340  { wxT("asf"), AV_CODEC_ID_GSM_MS },
1341  { wxT("asf"), AV_CODEC_ID_ADPCM_G726 },
1342  //{ wxT("asf"), AV_CODEC_ID_MP2 }, Bug 59
1343  { wxT("asf"), AV_CODEC_ID_MP3 },
1344 #if LIBAVCODEC_VERSION_MAJOR < 58
1345  { wxT("asf"), AV_CODEC_ID_VOXWARE },
1346 #endif
1347  { wxT("asf"), AV_CODEC_ID_AAC },
1348  { wxT("asf"), AV_CODEC_ID_WMAV1 },
1349  { wxT("asf"), AV_CODEC_ID_WMAV2 },
1350  { wxT("asf"), AV_CODEC_ID_WMAPRO },
1351  { wxT("asf"), AV_CODEC_ID_ADPCM_CT },
1352  { wxT("asf"), AV_CODEC_ID_ATRAC3 },
1353  { wxT("asf"), AV_CODEC_ID_IMC },
1354  { wxT("asf"), AV_CODEC_ID_AC3 },
1355  { wxT("asf"), AV_CODEC_ID_DTS },
1356  { wxT("asf"), AV_CODEC_ID_FLAC },
1357  { wxT("asf"), AV_CODEC_ID_ADPCM_SWF },
1358  { wxT("asf"), AV_CODEC_ID_VORBIS },
1359 
1360  { wxT("au"), AV_CODEC_ID_PCM_MULAW },
1361  { wxT("au"), AV_CODEC_ID_PCM_S8 },
1362  { wxT("au"), AV_CODEC_ID_PCM_S16BE },
1363  { wxT("au"), AV_CODEC_ID_PCM_ALAW },
1364 
1365  { wxT("avi"), AV_CODEC_ID_PCM_S16LE },
1366  { wxT("avi"), AV_CODEC_ID_PCM_U8 },
1367  { wxT("avi"), AV_CODEC_ID_PCM_S24LE },
1368  { wxT("avi"), AV_CODEC_ID_PCM_S32LE },
1369  { wxT("avi"), AV_CODEC_ID_ADPCM_MS },
1370  { wxT("avi"), AV_CODEC_ID_PCM_ALAW },
1371  { wxT("avi"), AV_CODEC_ID_PCM_MULAW },
1372  { wxT("avi"), AV_CODEC_ID_WMAVOICE },
1373  { wxT("avi"), AV_CODEC_ID_ADPCM_IMA_WAV },
1374  { wxT("avi"), AV_CODEC_ID_ADPCM_YAMAHA },
1375  { wxT("avi"), AV_CODEC_ID_TRUESPEECH },
1376  { wxT("avi"), AV_CODEC_ID_GSM_MS },
1377  { wxT("avi"), AV_CODEC_ID_ADPCM_G726 },
1378  // { wxT("avi"), AV_CODEC_ID_MP2 }, //Bug 59
1379  { wxT("avi"), AV_CODEC_ID_MP3 },
1380 #if LIBAVCODEC_VERSION_MAJOR < 58
1381  { wxT("avi"), AV_CODEC_ID_VOXWARE },
1382 #endif
1383  { wxT("avi"), AV_CODEC_ID_AAC },
1384  { wxT("avi"), AV_CODEC_ID_WMAV1 },
1385  { wxT("avi"), AV_CODEC_ID_WMAV2 },
1386  { wxT("avi"), AV_CODEC_ID_WMAPRO },
1387  { wxT("avi"), AV_CODEC_ID_ADPCM_CT },
1388  { wxT("avi"), AV_CODEC_ID_ATRAC3 },
1389  { wxT("avi"), AV_CODEC_ID_IMC },
1390  { wxT("avi"), AV_CODEC_ID_AC3 },
1391  { wxT("avi"), AV_CODEC_ID_DTS },
1392  { wxT("avi"), AV_CODEC_ID_FLAC },
1393  { wxT("avi"), AV_CODEC_ID_ADPCM_SWF },
1394  { wxT("avi"), AV_CODEC_ID_VORBIS },
1395 
1396  { wxT("crc"), AV_CODEC_ID_NONE },
1397 
1398  { wxT("dv"), AV_CODEC_ID_PCM_S16LE },
1399 
1400  { wxT("ffm"), AV_CODEC_ID_NONE },
1401 
1402  { wxT("flv"), AV_CODEC_ID_MP3 },
1403  { wxT("flv"), AV_CODEC_ID_PCM_S8 },
1404  { wxT("flv"), AV_CODEC_ID_PCM_S16BE },
1405  { wxT("flv"), AV_CODEC_ID_PCM_S16LE },
1406  { wxT("flv"), AV_CODEC_ID_ADPCM_SWF },
1407  { wxT("flv"), AV_CODEC_ID_AAC },
1408  { wxT("flv"), AV_CODEC_ID_NELLYMOSER },
1409 
1410  { wxT("framecrc"), AV_CODEC_ID_NONE },
1411 
1412  { wxT("gxf"), AV_CODEC_ID_PCM_S16LE },
1413 
1414  { wxT("matroska"), AV_CODEC_ID_PCM_S16LE },
1415  { wxT("matroska"), AV_CODEC_ID_PCM_U8 },
1416  { wxT("matroska"), AV_CODEC_ID_PCM_S24LE },
1417  { wxT("matroska"), AV_CODEC_ID_PCM_S32LE },
1418  { wxT("matroska"), AV_CODEC_ID_ADPCM_MS },
1419  { wxT("matroska"), AV_CODEC_ID_PCM_ALAW },
1420  { wxT("matroska"), AV_CODEC_ID_PCM_MULAW },
1421  { wxT("matroska"), AV_CODEC_ID_WMAVOICE },
1422  { wxT("matroska"), AV_CODEC_ID_ADPCM_IMA_WAV },
1423  { wxT("matroska"), AV_CODEC_ID_ADPCM_YAMAHA },
1424  { wxT("matroska"), AV_CODEC_ID_TRUESPEECH },
1425  { wxT("matroska"), AV_CODEC_ID_GSM_MS },
1426  { wxT("matroska"), AV_CODEC_ID_ADPCM_G726 },
1427  // { wxT("matroska"), AV_CODEC_ID_MP2 }, // Bug 59
1428  { wxT("matroska"), AV_CODEC_ID_MP3 },
1429 #if LIBAVCODEC_VERSION_MAJOR < 58
1430  { wxT("matroska"), AV_CODEC_ID_VOXWARE },
1431 #endif
1432  { wxT("matroska"), AV_CODEC_ID_AAC },
1433  { wxT("matroska"), AV_CODEC_ID_WMAV1 },
1434  { wxT("matroska"), AV_CODEC_ID_WMAV2 },
1435  { wxT("matroska"), AV_CODEC_ID_WMAPRO },
1436  { wxT("matroska"), AV_CODEC_ID_ADPCM_CT },
1437  { wxT("matroska"), AV_CODEC_ID_ATRAC3 },
1438  { wxT("matroska"), AV_CODEC_ID_IMC },
1439  { wxT("matroska"), AV_CODEC_ID_AC3 },
1440  { wxT("matroska"), AV_CODEC_ID_DTS },
1441  { wxT("matroska"), AV_CODEC_ID_FLAC },
1442  { wxT("matroska"), AV_CODEC_ID_ADPCM_SWF },
1443  { wxT("matroska"), AV_CODEC_ID_VORBIS },
1444 
1445  { wxT("mmf"), AV_CODEC_ID_ADPCM_YAMAHA },
1446 
1447  { wxT("mov"), AV_CODEC_ID_PCM_S32BE }, //mov
1448  { wxT("mov"), AV_CODEC_ID_PCM_S32LE },
1449  { wxT("mov"), AV_CODEC_ID_PCM_S24BE },
1450  { wxT("mov"), AV_CODEC_ID_PCM_S24LE },
1451  { wxT("mov"), AV_CODEC_ID_PCM_S16BE },
1452  { wxT("mov"), AV_CODEC_ID_PCM_S16LE },
1453  { wxT("mov"), AV_CODEC_ID_PCM_S8 },
1454  { wxT("mov"), AV_CODEC_ID_PCM_U8 },
1455  { wxT("mov"), AV_CODEC_ID_PCM_MULAW },
1456  { wxT("mov"), AV_CODEC_ID_PCM_ALAW },
1457  { wxT("mov"), AV_CODEC_ID_ADPCM_IMA_QT },
1458  { wxT("mov"), AV_CODEC_ID_MACE3 },
1459  { wxT("mov"), AV_CODEC_ID_MACE6 },
1460  { wxT("mov"), AV_CODEC_ID_MP3 },
1461  { wxT("mov"), AV_CODEC_ID_AAC },
1462  { wxT("mov"), AV_CODEC_ID_AMR_NB },
1463  { wxT("mov"), AV_CODEC_ID_AMR_WB },
1464  { wxT("mov"), AV_CODEC_ID_GSM },
1465  { wxT("mov"), AV_CODEC_ID_ALAC },
1466  { wxT("mov"), AV_CODEC_ID_QCELP },
1467  { wxT("mov"), AV_CODEC_ID_QDM2 },
1468  { wxT("mov"), AV_CODEC_ID_DVAUDIO },
1469  { wxT("mov"), AV_CODEC_ID_WMAV2 },
1470  { wxT("mov"), AV_CODEC_ID_ALAC },
1471 
1472  { wxT("mp4"), AV_CODEC_ID_AAC },
1473  { wxT("mp4"), AV_CODEC_ID_QCELP },
1474  { wxT("mp4"), AV_CODEC_ID_MP3 },
1475  { wxT("mp4"), AV_CODEC_ID_VORBIS },
1476 
1477  { wxT("psp"), AV_CODEC_ID_AAC },
1478  { wxT("psp"), AV_CODEC_ID_QCELP },
1479  { wxT("psp"), AV_CODEC_ID_MP3 },
1480  { wxT("psp"), AV_CODEC_ID_VORBIS },
1481 
1482  { wxT("ipod"), AV_CODEC_ID_AAC },
1483  { wxT("ipod"), AV_CODEC_ID_QCELP },
1484  { wxT("ipod"), AV_CODEC_ID_MP3 },
1485  { wxT("ipod"), AV_CODEC_ID_VORBIS },
1486 
1487  { wxT("3gp"), AV_CODEC_ID_AAC },
1488  { wxT("3gp"), AV_CODEC_ID_AMR_NB },
1489  { wxT("3gp"), AV_CODEC_ID_AMR_WB },
1490 
1491  { wxT("3g2"), AV_CODEC_ID_AAC },
1492  { wxT("3g2"), AV_CODEC_ID_AMR_NB },
1493  { wxT("3g2"), AV_CODEC_ID_AMR_WB },
1494 
1495  { wxT("mp3"), AV_CODEC_ID_MP3 },
1496 
1497  { wxT("mpeg"), AV_CODEC_ID_AC3 },
1498  { wxT("mpeg"), AV_CODEC_ID_DTS },
1499  { wxT("mpeg"), AV_CODEC_ID_PCM_S16BE },
1500  //{ wxT("mpeg"), AV_CODEC_ID_MP2 },// Bug 59
1501 
1502  { wxT("vcd"), AV_CODEC_ID_AC3 },
1503  { wxT("vcd"), AV_CODEC_ID_DTS },
1504  { wxT("vcd"), AV_CODEC_ID_PCM_S16BE },
1505  //{ wxT("vcd"), AV_CODEC_ID_MP2 },// Bug 59
1506 
1507  { wxT("vob"), AV_CODEC_ID_AC3 },
1508  { wxT("vob"), AV_CODEC_ID_DTS },
1509  { wxT("vob"), AV_CODEC_ID_PCM_S16BE },
1510  //{ wxT("vob"), AV_CODEC_ID_MP2 },// Bug 59
1511 
1512  { wxT("svcd"), AV_CODEC_ID_AC3 },
1513  { wxT("svcd"), AV_CODEC_ID_DTS },
1514  { wxT("svcd"), AV_CODEC_ID_PCM_S16BE },
1515  //{ wxT("svcd"), AV_CODEC_ID_MP2 },// Bug 59
1516 
1517  { wxT("dvd"), AV_CODEC_ID_AC3 },
1518  { wxT("dvd"), AV_CODEC_ID_DTS },
1519  { wxT("dvd"), AV_CODEC_ID_PCM_S16BE },
1520  //{ wxT("dvd"), AV_CODEC_ID_MP2 },// Bug 59
1521 
1522  { wxT("nut"), AV_CODEC_ID_PCM_S16LE },
1523  { wxT("nut"), AV_CODEC_ID_PCM_U8 },
1524  { wxT("nut"), AV_CODEC_ID_PCM_S24LE },
1525  { wxT("nut"), AV_CODEC_ID_PCM_S32LE },
1526  { wxT("nut"), AV_CODEC_ID_ADPCM_MS },
1527  { wxT("nut"), AV_CODEC_ID_PCM_ALAW },
1528  { wxT("nut"), AV_CODEC_ID_PCM_MULAW },
1529  { wxT("nut"), AV_CODEC_ID_WMAVOICE },
1530  { wxT("nut"), AV_CODEC_ID_ADPCM_IMA_WAV },
1531  { wxT("nut"), AV_CODEC_ID_ADPCM_YAMAHA },
1532  { wxT("nut"), AV_CODEC_ID_TRUESPEECH },
1533  { wxT("nut"), AV_CODEC_ID_GSM_MS },
1534  { wxT("nut"), AV_CODEC_ID_ADPCM_G726 },
1535  //{ wxT("nut"), AV_CODEC_ID_MP2 },// Bug 59
1536  { wxT("nut"), AV_CODEC_ID_MP3 },
1537  #if LIBAVCODEC_VERSION_MAJOR < 58
1538  { wxT("nut"), AV_CODEC_ID_VOXWARE },
1539  #endif
1540  { wxT("nut"), AV_CODEC_ID_AAC },
1541  { wxT("nut"), AV_CODEC_ID_WMAV1 },
1542  { wxT("nut"), AV_CODEC_ID_WMAV2 },
1543  { wxT("nut"), AV_CODEC_ID_WMAPRO },
1544  { wxT("nut"), AV_CODEC_ID_ADPCM_CT },
1545  { wxT("nut"), AV_CODEC_ID_ATRAC3 },
1546  { wxT("nut"), AV_CODEC_ID_IMC },
1547  { wxT("nut"), AV_CODEC_ID_AC3 },
1548  { wxT("nut"), AV_CODEC_ID_DTS },
1549  { wxT("nut"), AV_CODEC_ID_FLAC },
1550  { wxT("nut"), AV_CODEC_ID_ADPCM_SWF },
1551  { wxT("nut"), AV_CODEC_ID_VORBIS },
1552 
1553  { wxT("ogg"), AV_CODEC_ID_VORBIS },
1554  { wxT("ogg"), AV_CODEC_ID_FLAC },
1555 
1556  { wxT("ac3"), AV_CODEC_ID_AC3 },
1557 
1558  { wxT("dts"), AV_CODEC_ID_DTS },
1559 
1560  { wxT("flac"), AV_CODEC_ID_FLAC },
1561 
1562  { wxT("RoQ"), AV_CODEC_ID_ROQ_DPCM },
1563 
1564  { wxT("rm"), AV_CODEC_ID_AC3 },
1565 
1566  { wxT("swf"), AV_CODEC_ID_MP3 },
1567 
1568  { wxT("avm2"), AV_CODEC_ID_MP3 },
1569 
1570  { wxT("voc"), AV_CODEC_ID_PCM_U8 },
1571 
1572  { wxT("wav"), AV_CODEC_ID_PCM_S16LE },
1573  { wxT("wav"), AV_CODEC_ID_PCM_U8 },
1574  { wxT("wav"), AV_CODEC_ID_PCM_S24LE },
1575  { wxT("wav"), AV_CODEC_ID_PCM_S32LE },
1576  { wxT("wav"), AV_CODEC_ID_ADPCM_MS },
1577  { wxT("wav"), AV_CODEC_ID_PCM_ALAW },
1578  { wxT("wav"), AV_CODEC_ID_PCM_MULAW },
1579  { wxT("wav"), AV_CODEC_ID_WMAVOICE },
1580  { wxT("wav"), AV_CODEC_ID_ADPCM_IMA_WAV },
1581  { wxT("wav"), AV_CODEC_ID_ADPCM_YAMAHA },
1582  { wxT("wav"), AV_CODEC_ID_TRUESPEECH },
1583  { wxT("wav"), AV_CODEC_ID_GSM_MS },
1584  { wxT("wav"), AV_CODEC_ID_ADPCM_G726 },
1585  //{ wxT("wav"), AV_CODEC_ID_MP2 }, Bug 59 - It crashes.
1586  { wxT("wav"), AV_CODEC_ID_MP3 },
1587 #if LIBAVCODEC_VERSION_MAJOR < 58
1588  { wxT("wav"), AV_CODEC_ID_VOXWARE },
1589 #endif
1590  { wxT("wav"), AV_CODEC_ID_AAC },
1591  // { wxT("wav"), AV_CODEC_ID_WMAV1 },
1592  // { wxT("wav"), AV_CODEC_ID_WMAV2 },
1593  { wxT("wav"), AV_CODEC_ID_WMAPRO },
1594  { wxT("wav"), AV_CODEC_ID_ADPCM_CT },
1595  { wxT("wav"), AV_CODEC_ID_ATRAC3 },
1596  { wxT("wav"), AV_CODEC_ID_IMC },
1597  { wxT("wav"), AV_CODEC_ID_AC3 },
1598  //{ wxT("wav"), AV_CODEC_ID_DTS },
1599  { wxT("wav"), AV_CODEC_ID_FLAC },
1600  { wxT("wav"), AV_CODEC_ID_ADPCM_SWF },
1601  { wxT("wav"), AV_CODEC_ID_VORBIS },
1602 
1603  { NULL, AV_CODEC_ID_NONE }
1604 };
1605 
1607 // The FF_PROFILE_* enumeration is defined in the ffmpeg library
1608 // PRL: I cant find where this preference is used!
1609 ChoiceSetting AACProfiles { wxT("/FileFormats/FFmpegAACProfile"),
1610  {
1611  {wxT("1") /*FF_PROFILE_AAC_LOW*/, XO("LC")},
1612  {wxT("0") /*FF_PROFILE_AAC_MAIN*/, XO("Main")},
1613  // {wxT("2") /*FF_PROFILE_AAC_SSR*/, XO("SSR")}, //SSR is not supported
1614  {wxT("3") /*FF_PROFILE_AAC_LTP*/, XO("LTP")},
1615  },
1616  0, // "1"
1617 };
1618 
1621 {
1622  {FMT_M4A, wxT("M4A"), wxT("m4a"), wxT("ipod"), 48, AV_CANMETA, true, XO("M4A (AAC) Files (FFmpeg)"), AV_CODEC_ID_AAC, true},
1623  {FMT_AC3, wxT("AC3"), wxT("ac3"), wxT("ac3"), 7, AV_VERSION_INT(0,0,0), false, XO("AC3 Files (FFmpeg)"), AV_CODEC_ID_AC3, true},
1624  {FMT_AMRNB, wxT("AMRNB"), wxT("amr"), wxT("amr"), 1, AV_VERSION_INT(0,0,0), false, XO("AMR (narrow band) Files (FFmpeg)"), AV_CODEC_ID_AMR_NB, true},
1625  {FMT_OPUS, wxT("OPUS"), wxT("opus"), wxT("opus"), 255, AV_CANMETA, true, XO("Opus (OggOpus) Files (FFmpeg)"), AV_CODEC_ID_OPUS, true},
1626  {FMT_WMA2, wxT("WMA"), wxT("wma"), wxT("asf"), 2, AV_VERSION_INT(52,53,0), false, XO("WMA (version 2) Files (FFmpeg)"), AV_CODEC_ID_WMAV2, true},
1627  {FMT_OTHER, wxT("FFMPEG"), wxT(""), wxT(""), 255, AV_CANMETA, true, XO("Custom FFmpeg Export"), AV_CODEC_ID_NONE, true}
1628 };
1629 
1638 {
1639  {TRUE,FEQualityID,AV_CODEC_ID_AAC,"any"},
1640  {TRUE,FEQualityID,AV_CODEC_ID_MP3,"any"},
1641  {TRUE,FEQualityID,AV_CODEC_ID_VORBIS,"any"},
1642  {FALSE,FEQualityID,AV_CODEC_ID_NONE,"any"},
1643 
1644  {TRUE,FECutoffID,AV_CODEC_ID_AC3,"any"},
1645  {TRUE,FECutoffID,AV_CODEC_ID_AAC,"any"},
1646  {TRUE,FECutoffID,AV_CODEC_ID_VORBIS,"any"},
1647  {FALSE,FECutoffID,AV_CODEC_ID_NONE,"any"},
1648 
1649  {TRUE,FEFrameSizeID,AV_CODEC_ID_FLAC,"any"},
1650  {FALSE,FEFrameSizeID,AV_CODEC_ID_NONE,"any"},
1651 
1652  {TRUE,FEProfileID,AV_CODEC_ID_AAC,"any"},
1653  {FALSE,FEProfileID,AV_CODEC_ID_NONE,"any"},
1654 
1655  {TRUE,FECompLevelID,AV_CODEC_ID_FLAC,"any"},
1656  {FALSE,FECompLevelID,AV_CODEC_ID_NONE,"any"},
1657 
1658  {TRUE,FEUseLPCID,AV_CODEC_ID_FLAC,"any"},
1659  {FALSE,FEUseLPCID,AV_CODEC_ID_NONE,"any"},
1660 
1661  {TRUE,FELPCCoeffsID,AV_CODEC_ID_FLAC,"any"},
1662  {FALSE,FELPCCoeffsID,AV_CODEC_ID_NONE,"any"},
1663 
1664  {TRUE,FEMinPredID,AV_CODEC_ID_FLAC,"any"},
1665  {FALSE,FEMinPredID,AV_CODEC_ID_NONE,"any"},
1666 
1667  {TRUE,FEMaxPredID,AV_CODEC_ID_FLAC,"any"},
1668  {FALSE,FEMaxPredID,AV_CODEC_ID_NONE,"any"},
1669 
1670  {TRUE,FEPredOrderID,AV_CODEC_ID_FLAC,"any"},
1671  {FALSE,FEPredOrderID,AV_CODEC_ID_NONE,"any"},
1672 
1673  {TRUE,FEMinPartOrderID,AV_CODEC_ID_FLAC,"any"},
1674  {FALSE,FEMinPartOrderID,AV_CODEC_ID_NONE,"any"},
1675 
1676  {TRUE,FEMaxPartOrderID,AV_CODEC_ID_FLAC,"any"},
1677  {FALSE,FEMaxPartOrderID,AV_CODEC_ID_NONE,"any"},
1678 
1679  {TRUE,FEMuxRateID,AV_CODEC_ID_NONE,"mpeg"},
1680  {TRUE,FEMuxRateID,AV_CODEC_ID_NONE,"vcd"},
1681  {TRUE,FEMuxRateID,AV_CODEC_ID_NONE,"vob"},
1682  {TRUE,FEMuxRateID,AV_CODEC_ID_NONE,"svcd"},
1683  {TRUE,FEMuxRateID,AV_CODEC_ID_NONE,"dvd"},
1684  {FALSE,FEMuxRateID,AV_CODEC_ID_NONE,"any"},
1685 
1686  {TRUE,FEPacketSizeID,AV_CODEC_ID_NONE,"mpeg"},
1687  {TRUE,FEPacketSizeID,AV_CODEC_ID_NONE,"vcd"},
1688  {TRUE,FEPacketSizeID,AV_CODEC_ID_NONE,"vob"},
1689  {TRUE,FEPacketSizeID,AV_CODEC_ID_NONE,"svcd"},
1690  {TRUE,FEPacketSizeID,AV_CODEC_ID_NONE,"dvd"},
1691  {FALSE,FEPacketSizeID,AV_CODEC_ID_NONE,"any"},
1692 
1693  {TRUE,FELanguageID,AV_CODEC_ID_NONE,"matroska"},
1694  {TRUE,FELanguageID,AV_CODEC_ID_NONE,"mov"},
1695  {TRUE,FELanguageID,AV_CODEC_ID_NONE,"3gp"},
1696  {TRUE,FELanguageID,AV_CODEC_ID_NONE,"mp4"},
1697  {TRUE,FELanguageID,AV_CODEC_ID_NONE,"psp"},
1698  {TRUE,FELanguageID,AV_CODEC_ID_NONE,"3g2"},
1699  {TRUE,FELanguageID,AV_CODEC_ID_NONE,"ipod"},
1700  {TRUE,FELanguageID,AV_CODEC_ID_NONE,"mpegts"},
1701  {FALSE,FELanguageID,AV_CODEC_ID_NONE,"any"},
1702 
1703  {TRUE,FEBitReservoirID,AV_CODEC_ID_MP3,"any"},
1704  {TRUE,FEBitReservoirID,AV_CODEC_ID_WMAV1,"any"},
1705  {TRUE,FEBitReservoirID,AV_CODEC_ID_WMAV2,"any"},
1706  {FALSE,FEBitReservoirID,AV_CODEC_ID_NONE,"any"},
1707 
1708  {TRUE,FEVariableBlockLenID,AV_CODEC_ID_WMAV1,"any"},
1709  {TRUE,FEVariableBlockLenID,AV_CODEC_ID_WMAV2,"any"},
1710  {FALSE,FEVariableBlockLenID,AV_CODEC_ID_NONE,"any"},
1711 
1712  {FALSE,FFmpegExportCtrlID(0),AV_CODEC_ID_NONE,NULL}
1713 };
1714 
1715 namespace {
1716 
1719  XO("Estimate"),
1720  XO("2-level"),
1721  XO("4-level"),
1722  XO("8-level"),
1723  XO("Full search"),
1724  XO("Log search"),
1725 };
1726 
1727 }
1728 
1729 
1730 
1732 {
1733  DropFFmpegLibs();
1734 }
1735 
1737 : wxDialogWrapper(parent, wxID_ANY,
1738  XO("Configure custom FFmpeg options"))
1739 {
1740  SetName();
1742  PickFFmpegLibs();
1743  //FFmpegLibsInst()->LoadLibs(NULL,true); //Loaded at startup or from Prefs now
1744 
1745  mPresets = std::make_unique<FFmpegPresets>();
1746  mPresets->GetPresetList(mPresetNames);
1747 
1748  if (FFmpegLibsInst()->ValidLibsLoaded())
1749  {
1750  FetchFormatList();
1751  FetchCodecList();
1752 
1753  PopulateOrExchange(S);
1754 
1755  //Select the format that was selected last time this dialog was closed
1756  mFormatList->Select(mFormatList->FindString(gPrefs->Read(wxT("/FileFormats/FFmpegFormat"))));
1757  DoOnFormatList();
1758 
1759  //Select the codec that was selected last time this dialog was closed
1760  AVCodec *codec = avcodec_find_encoder_by_name(gPrefs->Read(wxT("/FileFormats/FFmpegCodec")).ToUTF8());
1761  if (codec != NULL) mCodecList->Select(mCodecList->FindString(wxString::FromUTF8(codec->name)));
1762  DoOnCodecList();
1763  }
1764 
1765 }
1766 
1770 {
1771  // Enumerate all output formats
1772  AVOutputFormat *ofmt = NULL;
1773  while ((ofmt = av_oformat_next(ofmt))!=NULL)
1774  {
1775  // Any audio-capable format has default audio codec.
1776  // If it doesn't, then it doesn't supports any audio codecs
1777  if (ofmt->audio_codec != AV_CODEC_ID_NONE)
1778  {
1779  mFormatNames.push_back(wxString::FromUTF8(ofmt->name));
1780  mFormatLongNames.push_back(wxString::Format(wxT("%s - %s"),mFormatNames.back(),wxString::FromUTF8(ofmt->long_name)));
1781  }
1782  }
1783  // Show all formats
1786 }
1787 
1791 {
1792  // Enumerate all codecs
1793  AVCodec *codec = NULL;
1794  while ((codec = av_codec_next(codec))!=NULL)
1795  {
1796  // We're only interested in audio and only in encoders
1797  if (codec->type == AVMEDIA_TYPE_AUDIO && av_codec_is_encoder(codec))
1798  {
1799  // MP2 Codec is broken. Don't allow it.
1800  if( codec->id == AV_CODEC_ID_MP2)
1801  continue;
1802  mCodecNames.push_back(wxString::FromUTF8(codec->name));
1803  mCodecLongNames.push_back(wxString::Format(wxT("%s - %s"),mCodecNames.back(),wxString::FromUTF8(codec->long_name)));
1804  }
1805  }
1806  // Show all codecs
1809 }
1810 
1814 {
1815  S.StartVerticalLay(1);
1816  S.StartMultiColumn(1, wxEXPAND);
1817  {
1818  S.SetStretchyRow(3);
1819  S.StartMultiColumn(7, wxEXPAND);
1820  {
1821  S.SetStretchyCol(1);
1822  mPresetCombo = S.Id(FEPresetID).AddCombo(XXO("Preset:"), gPrefs->Read(wxT("/FileFormats/FFmpegPreset"),wxEmptyString), mPresetNames);
1823  S.Id(FELoadPresetID).AddButton(XXO("Load Preset"));
1824  S.Id(FESavePresetID).AddButton(XXO("Save Preset"));
1825  S.Id(FEDeletePresetID).AddButton(XXO("Delete Preset"));
1826  S.Id(FEImportPresetsID).AddButton(XXO("Import Presets"));
1827  S.Id(FEExportPresetsID).AddButton(XXO("Export Presets"));
1828  }
1829  S.EndMultiColumn();
1830  S.StartMultiColumn(4, wxALIGN_LEFT);
1831  {
1832  S.SetStretchyCol(1);
1833  S.SetStretchyCol(3);
1834  S.Id(FEFormatLabelID).AddFixedText(XO("Format:"));
1835  mFormatName = S.Id(FEFormatNameID).AddVariableText( {} );
1836  /* i18n-hint: "codec" is short for a "coder-decoder" algorithm */
1837  S.Id(FECodecLabelID).AddFixedText(XO("Codec:"));
1838  mCodecName = S.Id(FECodecNameID).AddVariableText( {} );
1839  }
1840  S.EndMultiColumn();
1841  S.AddVariableText(XO(
1842 "Not all formats and codecs are compatible. Nor are all option combinations compatible with all codecs."),
1843  false);
1844  S.StartMultiColumn(2, wxEXPAND);
1845  {
1846  S.StartMultiColumn(2, wxEXPAND);
1847  {
1848  S.SetStretchyRow(1);
1849  S.Id(FEAllFormatsID).AddButton(XXO("Show All Formats"));
1850  S.Id(FEAllCodecsID).AddButton(XXO("Show All Codecs"));
1851  mFormatList = S.Id(FEFormatID).AddListBox(mFormatNames);
1852  mFormatList->DeselectAll();
1853  mCodecList = S.Id(FECodecID).AddListBox(mCodecNames);
1854  mCodecList->DeselectAll();
1855  }
1856  S.EndMultiColumn();
1857  S.StartVerticalLay();
1858  {
1859  //S.StartScroller( );
1860  S.SetBorder( 3 );
1861  S.StartStatic(XO("General Options"), 0);
1862  {
1863  S.StartMultiColumn(8, wxEXPAND);
1864  {
1865  S.Id(FELanguageID)
1866  .ToolTip(XO("ISO 639 3-letter language code\nOptional\nempty - automatic"))
1867  .TieTextBox(XXO("Language:"), {wxT("/FileFormats/FFmpegLanguage"), wxEmptyString}, 9);
1868 
1869  S.AddSpace( 20,0 );
1870  S.AddVariableText(XO("Bit Reservoir"));
1871  S.Id(FEBitReservoirID).TieCheckBox( {}, {wxT("/FileFormats/FFmpegBitReservoir"), true});
1872 
1873  S.AddSpace( 20,0 );
1874  S.AddVariableText(XO("VBL"));
1875  S.Id(FEVariableBlockLenID).TieCheckBox( {}, {wxT("/FileFormats/FFmpegVariableBlockLen"), true});
1876  }
1877  S.EndMultiColumn();
1878  S.StartMultiColumn(4, wxALIGN_LEFT);
1879  {
1880  S.Id(FETagID)
1881  /* i18n-hint: "codec" is short for a "coder-decoder" algorithm */
1882  .ToolTip(XO("Codec tag (FOURCC)\nOptional\nempty - automatic"))
1883  .TieTextBox(XXO("Tag:"), {wxT("/FileFormats/FFmpegTag"), wxEmptyString}, 4);
1884 
1885  S.Id(FEBitrateID)
1886  .ToolTip(XO("Bit Rate (bits/second) - influences the resulting file size and quality\nSome codecs may only accept specific values (128k, 192k, 256k etc)\n0 - automatic\nRecommended - 192000"))
1887  .TieSpinCtrl(XXO("Bit Rate:"), {wxT("/FileFormats/FFmpegBitRate"), 0}, 1000000, 0);
1888 
1889  S.Id(FEQualityID)
1890  .ToolTip(XO("Overall quality, used differently by different codecs\nRequired for vorbis\n0 - automatic\n-1 - off (use bitrate instead)"))
1891  .TieSpinCtrl(XXO("Quality:"), {wxT("/FileFormats/FFmpegQuality"), 0}, 500, -1);
1892 
1893  S.Id(FESampleRateID)
1894  .ToolTip(XO("Sample rate (Hz)\n0 - don't change sample rate"))
1895  .TieSpinCtrl(XXO("Sample Rate:"), {wxT("/FileFormats/FFmpegSampleRate"), 0}, 200000, 0);
1896 
1897  S.Id(FECutoffID)
1898  .ToolTip(XO("Audio cutoff bandwidth (Hz)\nOptional\n0 - automatic"))
1899  .TieSpinCtrl(XXO("Cutoff:"), {wxT("/FileFormats/FFmpegCutOff"), 0}, 10000000, 0);
1900 
1901  S.Id(FEProfileID)
1902  .ToolTip(XO("AAC Profile\nLow Complexity - default\nMost players won't play anything other than LC"))
1903  .MinSize( { 100, -1 } )
1904  .TieChoice(XXO("Profile:"), AACProfiles);
1905  }
1906  S.EndMultiColumn();
1907  }
1908  S.EndStatic();
1909  S.StartStatic(XO("FLAC options"),0);
1910  {
1911  S.StartMultiColumn(4, wxALIGN_LEFT);
1912  {
1913  S
1914  .ToolTip(XO("Compression level\nRequired for FLAC\n-1 - automatic\nmin - 0 (fast encoding, large output file)\nmax - 10 (slow encoding, small output file)"))
1915  .Id(FECompLevelID).TieSpinCtrl(XXO("Compression:"), {wxT("/FileFormats/FFmpegCompLevel"), 0}, 10, -1);
1916 
1917  S.Id(FEFrameSizeID)
1918  .ToolTip(XO("Frame size\nOptional\n0 - default\nmin - 16\nmax - 65535"))
1919  .TieSpinCtrl(XXO("Frame:"), {wxT("/FileFormats/FFmpegFrameSize"), 0}, 65535, 0);
1920 
1921  S.Id(FELPCCoeffsID)
1922  .ToolTip(XO("LPC coefficients precision\nOptional\n0 - default\nmin - 1\nmax - 15"))
1923  .TieSpinCtrl(XXO("LPC"), {wxT("/FileFormats/FFmpegLPCCoefPrec"), 0}, 15, 0);
1924 
1925  S.Id(FEPredOrderID)
1926  .ToolTip(XO("Prediction Order Method\nEstimate - fastest, lower compression\nLog search - slowest, best compression\nFull search - default"))
1927  .MinSize( { 100, -1 } )
1928  .TieNumberAsChoice(
1929  XXO("PdO Method:"),
1930  {wxT("/FileFormats/FFmpegPredOrderMethod"),
1931  4}, // Full search
1933  );
1934 
1935  S.Id(FEMinPredID)
1936  .ToolTip(XO("Minimal prediction order\nOptional\n-1 - default\nmin - 0\nmax - 32 (with LPC) or 4 (without LPC)"))
1937  .TieSpinCtrl(XXO("Min. PdO"), {wxT("/FileFormats/FFmpegMinPredOrder"), -1}, 32, -1);
1938 
1939  S.Id(FEMaxPredID)
1940  .ToolTip(XO("Maximal prediction order\nOptional\n-1 - default\nmin - 0\nmax - 32 (with LPC) or 4 (without LPC)"))
1941  .TieSpinCtrl(XXO("Max. PdO"), {wxT("/FileFormats/FFmpegMaxPredOrder"), -1}, 32, -1);
1942 
1943  S.Id(FEMinPartOrderID)
1944  .ToolTip(XO("Minimal partition order\nOptional\n-1 - default\nmin - 0\nmax - 8"))
1945  .TieSpinCtrl(XXO("Min. PtO"), {wxT("/FileFormats/FFmpegMinPartOrder"), -1}, 8, -1);
1946 
1947  S.Id(FEMaxPartOrderID)
1948  .ToolTip(XO("Maximal partition order\nOptional\n-1 - default\nmin - 0\nmax - 8"))
1949  .TieSpinCtrl(XXO("Max. PtO"), {wxT("/FileFormats/FFmpegMaxPartOrder"), -1}, 8, -1);
1950 
1951  /* i18n-hint: Abbreviates "Linear Predictive Coding",
1952  but this text needs to be kept very short */
1953  S.AddVariableText(XO("Use LPC"));
1954  // PRL: This preference is not used anywhere!
1955  S.Id(FEUseLPCID).TieCheckBox( {}, {wxT("/FileFormats/FFmpegUseLPC"), true});
1956  }
1957  S.EndMultiColumn();
1958  }
1959  S.EndStatic();
1960  S.StartStatic(XO("MPEG container options"),0);
1961  {
1962  S.StartMultiColumn(4, wxALIGN_LEFT);
1963  {
1964  S.Id(FEMuxRateID)
1965  .ToolTip(XO("Maximum bit rate of the multiplexed stream\nOptional\n0 - default"))
1966  /* i18n-hint: 'mux' is short for multiplexor, a device that selects between several inputs
1967  'Mux Rate' is a parameter that has some bearing on compression ratio for MPEG
1968  it has a hard to predict effect on the degree of compression */
1969  .TieSpinCtrl(XXO("Mux Rate:"), {wxT("/FileFormats/FFmpegMuxRate"), 0}, 10000000, 0);
1970 
1971  S.Id(FEPacketSizeID)
1972  /* i18n-hint: 'Packet Size' is a parameter that has some bearing on compression ratio for MPEG
1973  compression. It measures how big a chunk of audio is compressed in one piece. */
1974  .ToolTip(XO("Packet size\nOptional\n0 - default"))
1975  /* i18n-hint: 'Packet Size' is a parameter that has some bearing on compression ratio for MPEG
1976  compression. It measures how big a chunk of audio is compressed in one piece. */
1977  .TieSpinCtrl(XXO("Packet Size:"), {wxT("/FileFormats/FFmpegPacketSize"), 0}, 10000000, 0);
1978  }
1979  S.EndMultiColumn();
1980  }
1981  S.EndStatic();
1982  //S.EndScroller();
1983  S.SetBorder( 5 );
1985  }
1986  S.EndVerticalLay();
1987  }
1988  S.EndMultiColumn();
1989  }
1990  S.EndMultiColumn();
1991  S.EndVerticalLay();
1992 
1993  Layout();
1994  Fit();
1995  SetMinSize(GetSize());
1996  Center();
1997 
1998  return;
1999 }
2000 
2003 void ExportFFmpegOptions::FindSelectedFormat(wxString **name, wxString **longname)
2004 {
2005  // Get current selection
2006  wxArrayInt selections;
2007  int n = mFormatList->GetSelections(selections);
2008  if (n <= 0) return;
2009 
2010  // Get selected format short name
2011  wxString selfmt = mFormatList->GetString(selections[0]);
2012 
2013  // Find its index
2014  int nFormat = make_iterator_range( mFormatNames ).index( selfmt );
2015  if (nFormat == wxNOT_FOUND) return;
2016 
2017  // Return short name and description
2018  if (name != NULL) *name = &mFormatNames[nFormat];
2019  if (longname != NULL) *longname = &mFormatLongNames[nFormat];
2020  return;
2021 }
2024 void ExportFFmpegOptions::FindSelectedCodec(wxString **name, wxString **longname)
2025 {
2026  // Get current selection
2027  wxArrayInt selections;
2028  int n = mCodecList->GetSelections(selections);
2029  if (n <= 0) return;
2030 
2031  // Get selected codec short name
2032  wxString selcdc = mCodecList->GetString(selections[0]);
2033 
2034  // Find its index
2035  int nCodec = make_iterator_range( mCodecNames ).index( selcdc );
2036  if (nCodec == wxNOT_FOUND) return;
2037 
2038  // Return short name and description
2039  if (name != NULL) *name = &mCodecNames[nCodec];
2040  if (longname != NULL) *longname = &mCodecLongNames[nCodec];
2041 }
2042 
2045 int ExportFFmpegOptions::FetchCompatibleCodecList(const wxChar *fmt, AVCodecID id)
2046 {
2047  // By default assume that id is not in the list
2048  int index = -1;
2049  // By default no codecs are compatible (yet)
2050  mShownCodecNames.clear();
2051  mShownCodecLongNames.clear();
2052  // Clear the listbox
2053  mCodecList->Clear();
2054  // Zero - format is not found at all
2055  int found = 0;
2056  wxString str(fmt);
2057  for (int i = 0; CompatibilityList[i].fmt != NULL; i++)
2058  {
2059  if (str == CompatibilityList[i].fmt)
2060  {
2061  // Format is found in the list
2062  found = 1;
2063  if (CompatibilityList[i].codec == AV_CODEC_ID_NONE)
2064  {
2065  // Format is found in the list and it is compatible with AV_CODEC_ID_NONE (means that it is compatible to anything)
2066  found = 2;
2067  break;
2068  }
2069  // Find the codec, that is claimed to be compatible
2070  AVCodec *codec = avcodec_find_encoder(CompatibilityList[i].codec);
2071  // If it exists, is audio and has encoder
2072  if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && av_codec_is_encoder(codec))
2073  {
2074  // If it was selected - remember its NEW index
2075  if ((id >= 0) && codec->id == id) index = mShownCodecNames.size();
2076  mShownCodecNames.push_back(wxString::FromUTF8(codec->name));
2077  mShownCodecLongNames.push_back(wxString::Format(wxT("%s - %s"),mShownCodecNames.back(),wxString::FromUTF8(codec->long_name)));
2078  }
2079  }
2080  }
2081  // All codecs are compatible with this format
2082  if (found == 2)
2083  {
2084  AVCodec *codec = NULL;
2085  while ((codec = av_codec_next(codec))!=NULL)
2086  {
2087  if (codec->type == AVMEDIA_TYPE_AUDIO && av_codec_is_encoder(codec))
2088  {
2089  // MP2 is broken.
2090  if( codec->id == AV_CODEC_ID_MP2)
2091  continue;
2093  .contains( wxString::FromUTF8(codec->name) ) )
2094  {
2095  if ((id >= 0) && codec->id == id) index = mShownCodecNames.size();
2096  mShownCodecNames.push_back(wxString::FromUTF8(codec->name));
2097  mShownCodecLongNames.push_back(wxString::Format(wxT("%s - %s"),mShownCodecNames.back(),wxString::FromUTF8(codec->long_name)));
2098  }
2099  }
2100  }
2101  }
2102  // Format is not found - find format in libavformat and add its default audio codec
2103  // This allows us to provide limited support for NEW formats without modifying the compatibility list
2104  else if (found == 0)
2105  {
2106  wxCharBuffer buf = str.ToUTF8();
2107  AVOutputFormat *format = av_guess_format(buf,NULL,NULL);
2108  if (format != NULL)
2109  {
2110  AVCodec *codec = avcodec_find_encoder(format->audio_codec);
2111  if (codec != NULL && (codec->type == AVMEDIA_TYPE_AUDIO) && av_codec_is_encoder(codec))
2112  {
2113  if ((id >= 0) && codec->id == id) index = mShownCodecNames.size();
2114  mShownCodecNames.push_back(wxString::FromUTF8(codec->name));
2115  mShownCodecLongNames.push_back(wxString::Format(wxT("%s - %s"),mShownCodecNames.back(),wxString::FromUTF8(codec->long_name)));
2116  }
2117  }
2118  }
2119  // Show NEW codec list
2120  mCodecList->Append(mShownCodecNames);
2121 
2122  return index;
2123 }
2124 
2127 int ExportFFmpegOptions::FetchCompatibleFormatList(AVCodecID id, wxString *selfmt)
2128 {
2129  int index = -1;
2130  mShownFormatNames.clear();
2131  mShownFormatLongNames.clear();
2132  mFormatList->Clear();
2133  AVOutputFormat *ofmt = NULL;
2134  ofmt = NULL;
2135  wxArrayString FromList;
2136  // Find all formats compatible to this codec in compatibility list
2137  for (int i = 0; CompatibilityList[i].fmt != NULL; i++)
2138  {
2139  if (CompatibilityList[i].codec == id || (CompatibilityList[i].codec == AV_CODEC_ID_NONE) )
2140  {
2141  if ((selfmt != NULL) && (*selfmt == CompatibilityList[i].fmt)) index = mShownFormatNames.size();
2142  FromList.push_back(CompatibilityList[i].fmt);
2143  mShownFormatNames.push_back(CompatibilityList[i].fmt);
2144  AVOutputFormat *tofmt = av_guess_format(wxString(CompatibilityList[i].fmt).ToUTF8(),NULL,NULL);
2145  if (tofmt != NULL) mShownFormatLongNames.push_back(wxString::Format(wxT("%s - %s"),CompatibilityList[i].fmt,wxString::FromUTF8(tofmt->long_name)));
2146  }
2147  }
2148  bool found = false;
2149  if (selfmt != NULL)
2150  {
2151  for (int i = 0; CompatibilityList[i].fmt != NULL; i++)
2152  {
2153  if (*selfmt == CompatibilityList[i].fmt)
2154  {
2155  found = true;
2156  break;
2157  }
2158  }
2159  }
2160  // Format was in the compatibility list
2161  if (found)
2162  {
2163  // Find all formats which have this codec as default and which are not in the list yet and add them too
2164  while ((ofmt = av_oformat_next(ofmt))!=NULL)
2165  {
2166  if (ofmt->audio_codec == id)
2167  {
2168  wxString ofmtname = wxString::FromUTF8(ofmt->name);
2169  found = false;
2170  for (unsigned int i = 0; i < FromList.size(); i++)
2171  {
2172  if (ofmtname == FromList[i])
2173  {
2174  found = true;
2175  break;
2176  }
2177  }
2178  if (!found)
2179  {
2180  if ((selfmt != NULL) &&
2181  (*selfmt == wxString::FromUTF8(ofmt->name)))
2182  index = mShownFormatNames.size();
2183  mShownFormatNames.push_back(wxString::FromUTF8(ofmt->name));
2184  mShownFormatLongNames.push_back(wxString::Format(wxT("%s - %s"),mShownFormatNames.back(),wxString::FromUTF8(ofmt->long_name)));
2185  }
2186  }
2187  }
2188  }
2189  mFormatList->Append(mShownFormatNames);
2190  return index;
2191 }
2192 
2195 void ExportFFmpegOptions::OnDeletePreset(wxCommandEvent& WXUNUSED(event))
2196 {
2197  wxComboBox *preset = dynamic_cast<wxComboBox*>(FindWindowById(FEPresetID,this));
2198  wxString presetname = preset->GetValue();
2199  if (presetname.empty())
2200  {
2201  AudacityMessageBox( XO("You can't delete a preset without name") );
2202  return;
2203  }
2204 
2205  auto query = XO("Delete preset '%s'?").Format( presetname );
2206  int action = AudacityMessageBox(
2207  query,
2208  XO("Confirm Deletion"),
2209  wxYES_NO | wxCENTRE);
2210  if (action == wxNO) return;
2211 
2212  mPresets->DeletePreset(presetname);
2213  long index = preset->FindString(presetname);
2214  preset->SetValue(wxEmptyString);
2215  preset->Delete(index);
2216  mPresetNames.erase(
2217  std::find( mPresetNames.begin(), mPresetNames.end(), presetname )
2218  );
2219 }
2220 
2223 void ExportFFmpegOptions::OnSavePreset(wxCommandEvent& WXUNUSED(event))
2224 { const bool kCheckForOverwrite = true;
2225  SavePreset(kCheckForOverwrite);
2226 }
2227 
2228 // Return false if failed to save.
2229 bool ExportFFmpegOptions::SavePreset(bool bCheckForOverwrite)
2230 {
2231  wxComboBox *preset = dynamic_cast<wxComboBox*>(FindWindowById(FEPresetID,this));
2232  wxString name = preset->GetValue();
2233  if (name.empty())
2234  {
2235  AudacityMessageBox( XO("You can't save a preset without a name") );
2236  return false;
2237  }
2238  if( bCheckForOverwrite && !mPresets->OverwriteIsOk(name))
2239  return false;
2240  if( !mPresets->SavePreset(this,name) )
2241  return false;
2242  int index = mPresetNames.Index(name,false);
2243  if (index == -1)
2244  {
2245  mPresetNames.push_back(name);
2246  mPresetCombo->Clear();
2247  mPresetCombo->Append(mPresetNames);
2248  mPresetCombo->Select(mPresetNames.Index(name,false));
2249  }
2250  return true;
2251 }
2252 
2255 void ExportFFmpegOptions::OnLoadPreset(wxCommandEvent& WXUNUSED(event))
2256 {
2257  wxComboBox *preset = dynamic_cast<wxComboBox*>(FindWindowById(FEPresetID,this));
2258  wxString presetname = preset->GetValue();
2259 
2262  mFormatList->Clear();
2263  mFormatList->Append(mFormatNames);
2264 
2267  mCodecList->Clear();
2268  mCodecList->Append(mCodecNames);
2269 
2270  mPresets->LoadPreset(this,presetname);
2271 
2272  DoOnFormatList();
2273  DoOnCodecList();
2274 }
2275 
2277 {
2278  static const FileNames::FileTypes result{
2280  return result;
2281 };
2282 
2285 void ExportFFmpegOptions::OnImportPresets(wxCommandEvent& WXUNUSED(event))
2286 {
2287  wxString path;
2288  FileDialogWrapper dlg(this,
2289  XO("Select xml file with presets to import"),
2290  gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
2291  wxEmptyString,
2292  FileTypes(),
2293  wxFD_OPEN);
2294  if (dlg.ShowModal() == wxID_CANCEL) return;
2295  path = dlg.GetPath();
2296  mPresets->ImportPresets(path);
2297  mPresets->GetPresetList(mPresetNames);
2298  mPresetCombo->Clear();
2299  mPresetCombo->Append(mPresetNames);
2300 }
2301 
2304 void ExportFFmpegOptions::OnExportPresets(wxCommandEvent& WXUNUSED(event))
2305 {
2306  const bool kCheckForOverwrite = true;
2307  // Bug 1180 save any pending preset before exporting the lot.
2308  // If saving fails, don't try to export.
2309  if( !SavePreset(!kCheckForOverwrite) )
2310  return;
2311 
2312  wxArrayString presets;
2313  mPresets->GetPresetList( presets);
2314  if( presets.Count() < 1)
2315  {
2316  AudacityMessageBox( XO("No presets to export") );
2317  return;
2318  }
2319 
2320  wxString path;
2321  FileDialogWrapper dlg(this,
2322  XO("Select xml file to export presets into"),
2323  gPrefs->Read(wxT("/FileFormats/FFmpegPresetDir")),
2324  wxEmptyString,
2325  FileTypes(),
2326  wxFD_SAVE|wxFD_OVERWRITE_PROMPT);
2327  if (dlg.ShowModal() == wxID_CANCEL) return;
2328  path = dlg.GetPath();
2329  mPresets->ExportPresets(path);
2330 }
2331 
2334 void ExportFFmpegOptions::OnAllFormats(wxCommandEvent& WXUNUSED(event))
2335 {
2338  mFormatList->Clear();
2339  mFormatList->Append(mFormatNames);
2340 }
2341 
2344 void ExportFFmpegOptions::OnAllCodecs(wxCommandEvent& WXUNUSED(event))
2345 {
2348  mCodecList->Clear();
2349  mCodecList->Append(mCodecNames);
2350 }
2351 
2360 {
2361  wxString *selcdc = NULL;
2362  wxString *selcdclong = NULL;
2363  FindSelectedCodec(&selcdc, &selcdclong);
2364  if (selcdc == NULL)
2365  return false; // unrecognised codec. Treated as OK
2366  AVCodec *cdc = avcodec_find_encoder_by_name(selcdc->ToUTF8());
2367  if (cdc == NULL)
2368  return false; // unrecognised codec. Treated as OK
2369 
2370  wxString *selfmt = NULL;
2371  wxString *selfmtlong = NULL;
2372  FindSelectedFormat(&selfmt, &selfmtlong);
2373  if( selfmt == NULL )
2374  return false; // unrecognised format; Treated as OK
2375 
2376  // This is intended to test for illegal combinations.
2377  // However, the list updating now seems to be working correctly
2378  // making it impossible to select illegal combinations
2379  bool bFound = false;
2380  for (int i = 0; CompatibilityList[i].fmt != NULL; i++)
2381  {
2382  if (*selfmt == CompatibilityList[i].fmt)
2383  {
2384  if (CompatibilityList[i].codec == cdc->id || (CompatibilityList[i].codec == AV_CODEC_ID_NONE) ){
2385  bFound = true;
2386  break;
2387  }
2388  }
2389  }
2390 
2391  // We can put extra code in here, to disallow combinations
2392  // We could also test for illegal parameters, and deliver
2393  // custom error messages in that case.
2394  // The below would make AAC codec disallowed.
2395  //if( cdc->id == AV_CODEC_ID_AAC)
2396  // bFound = false;
2397 
2398  // Valid combination was found, so no reporting.
2399  if( bFound )
2400  return false;
2401 
2403  /* i18n-hint: "codec" is short for a "coder-decoder" algorithm */
2404  XO("Format %s is not compatible with codec %s.")
2405  .Format( *selfmt, *selcdc ),
2406  /* i18n-hint: "codec" is short for a "coder-decoder" algorithm */
2407  XO("Incompatible format and codec"));
2408 
2409  return true;
2410 }
2411 
2412 
2413 
2414 void ExportFFmpegOptions::EnableDisableControls(AVCodec *cdc, wxString *selfmt)
2415 {
2416  int handled = -1;
2417  for (int i = 0; apptable[i].control != 0; i++)
2418  {
2419  if (apptable[i].control != handled)
2420  {
2421  bool codec = false;
2422  bool format = false;
2423  if (apptable[i].codec == AV_CODEC_ID_NONE) codec = true;
2424  else if (cdc != NULL && apptable[i].codec == cdc->id) codec = true;
2425  if (wxString::FromUTF8(apptable[i].format) == wxT("any")) format = true;
2426  else if (selfmt != NULL &&
2427  *selfmt == wxString::FromUTF8(apptable[i].format)) format = true;
2428  if (codec && format)
2429  {
2430  handled = apptable[i].control;
2431  wxWindow *item = FindWindowById(apptable[i].control,this);
2432  if (item != NULL) item->Enable(apptable[i].enable);
2433  }
2434  }
2435  }
2436 }
2437 
2439 {
2440  wxString *selfmt = NULL;
2441  wxString *selfmtlong = NULL;
2442  FindSelectedFormat(&selfmt, &selfmtlong);
2443  if (selfmt == NULL)
2444  {
2445  return;
2446  }
2447 
2448  wxString *selcdc = NULL;
2449  wxString *selcdclong = NULL;
2450  FindSelectedCodec(&selcdc, &selcdclong);
2451 
2452  AVOutputFormat *fmt = av_guess_format(selfmt->ToUTF8(),NULL,NULL);
2453  if (fmt == NULL)
2454  {
2455  //This shouldn't really happen
2456  mFormatName->SetLabel(wxString(_("Failed to guess format")));
2457  return;
2458  }
2459  mFormatName->SetLabel(wxString::Format(wxT("%s"), *selfmtlong));
2460  int selcdcid = -1;
2461 
2462  if (selcdc != NULL)
2463  {
2464  AVCodec *cdc = avcodec_find_encoder_by_name(selcdc->ToUTF8());
2465  if (cdc != NULL)
2466  {
2467  selcdcid = cdc->id;
2468  }
2469  }
2470  int newselcdc = FetchCompatibleCodecList(*selfmt, (AVCodecID)selcdcid);
2471  if (newselcdc >= 0) mCodecList->Select(newselcdc);
2472 
2473  AVCodec *cdc = NULL;
2474  if (selcdc != NULL)
2475  cdc = avcodec_find_encoder_by_name(selcdc->ToUTF8());
2476  EnableDisableControls(cdc, selfmt);
2477  Layout();
2478  Fit();
2479  return;
2480 }
2481 
2483 {
2484  wxString *selcdc = NULL;
2485  wxString *selcdclong = NULL;
2486  FindSelectedCodec(&selcdc, &selcdclong);
2487  if (selcdc == NULL)
2488  {
2489  return;
2490  }
2491 
2492  wxString *selfmt = NULL;
2493  wxString *selfmtlong = NULL;
2494  FindSelectedFormat(&selfmt, &selfmtlong);
2495 
2496  AVCodec *cdc = avcodec_find_encoder_by_name(selcdc->ToUTF8());
2497  if (cdc == NULL)
2498  {
2499  //This shouldn't really happen
2500  /* i18n-hint: "codec" is short for a "coder-decoder" algorithm */
2501  mCodecName->SetLabel(wxString(_("Failed to find the codec")));
2502  return;
2503  }
2504  mCodecName->SetLabel(wxString::Format(wxT("[%d] %s"), (int) cdc->id, *selcdclong));
2505 
2506  if (selfmt != NULL)
2507  {
2508  AVOutputFormat *fmt = av_guess_format(selfmt->ToUTF8(),NULL,NULL);
2509  if (fmt == NULL)
2510  {
2511  selfmt = NULL;
2512  selfmtlong = NULL;
2513  }
2514  }
2515 
2516  int newselfmt = FetchCompatibleFormatList(cdc->id,selfmt);
2517  if (newselfmt >= 0) mFormatList->Select(newselfmt);
2518 
2519  EnableDisableControls(cdc, selfmt);
2520  Layout();
2521  Fit();
2522  return;
2523 }
2524 
2527 void ExportFFmpegOptions::OnFormatList(wxCommandEvent& WXUNUSED(event))
2528 {
2529  DoOnFormatList();
2530 }
2531 
2534 void ExportFFmpegOptions::OnCodecList(wxCommandEvent& WXUNUSED(event))
2535 {
2536  DoOnCodecList();
2537 }
2538 
2539 
2542 void ExportFFmpegOptions::OnOK(wxCommandEvent& WXUNUSED(event))
2543 {
2544  if( ReportIfBadCombination() )
2545  return;
2546 
2547  int selcdc = mCodecList->GetSelection();
2548  int selfmt = mFormatList->GetSelection();
2549  if (selcdc > -1) gPrefs->Write(wxT("/FileFormats/FFmpegCodec"),mCodecList->GetString(selcdc));
2550  if (selfmt > -1) gPrefs->Write(wxT("/FileFormats/FFmpegFormat"),mFormatList->GetString(selfmt));
2551  gPrefs->Flush();
2552 
2553  ShuttleGui S(this, eIsSavingToPrefs);
2554  PopulateOrExchange(S);
2555 
2556  gPrefs->Flush();
2557 
2558  EndModal(wxID_OK);
2559 
2560  return;
2561 }
2562 
2563 void ExportFFmpegOptions::OnGetURL(wxCommandEvent & WXUNUSED(event))
2564 {
2565  HelpSystem::ShowHelp(this, wxT("Custom_FFmpeg_Export_Options"));
2566 }
2567 
2568 
2569 #endif
XMLWriter
Base class for XMLFileWriter and XMLStringWriter that provides the general functionality for creating...
Definition: XMLWriter.h:23
ApplicableFor
Entry for the Applicability table.
Definition: ExportFFmpegDialogs.h:197
EVT_BUTTON
EVT_BUTTON(wxID_NO, DependencyDialog::OnNo) EVT_BUTTON(wxID_YES
ExportFFmpegOptions::mShownCodecNames
wxArrayString mShownCodecNames
Definition: ExportFFmpegDialogs.h:240
TranslatableString
Definition: Types.h:290
FFmpegPresets::WriteXML
void WriteXML(XMLWriter &xmlFile) const
Definition: ExportFFmpegDialogs.cpp:1265
ExportFFmpegAC3Options::ExportFFmpegAC3Options
ExportFFmpegAC3Options(wxWindow *parent, int format)
Definition: ExportFFmpegDialogs.cpp:195
ExportFFmpegOptions::FindSelectedCodec
void FindSelectedCodec(wxString **name, wxString **longname)
Finds the codec currently selected and returns its name and description.
Definition: ExportFFmpegDialogs.cpp:2024
TranslatableString::empty
bool empty() const
Definition: Types.h:329
ExportFFmpegWMAOptions::iWMASampleRates
static const int iWMASampleRates[]
Definition: ExportFFmpegDialogs.h:167
ExportFFmpegWMAOptions::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: ExportFFmpegDialogs.cpp:757
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1177
make_iterator_range
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:625
ExportFFmpegAMRNBOptions::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: ExportFFmpegDialogs.cpp:398
ExportFFmpegOptions::OnExportPresets
void OnExportPresets(wxCommandEvent &event)
Definition: ExportFFmpegDialogs.cpp:2304
ExportFFmpegOptions::OnAllCodecs
void OnAllCodecs(wxCommandEvent &event)
Definition: ExportFFmpegDialogs.cpp:2344
ExportFFmpegAACOptions::ExportFFmpegAACOptions
ExportFFmpegAACOptions(wxWindow *parent, int format)
Definition: ExportFFmpegDialogs.cpp:257
ExportFFmpegOPUSOptions::TransferDataToWindow
bool TransferDataToWindow() override
Definition: ExportFFmpegDialogs.cpp:649
ExportFFmpegOptions::OnSavePreset
void OnSavePreset(wxCommandEvent &event)
Definition: ExportFFmpegDialogs.cpp:2223
ExportFFmpegAACOptions::~ExportFFmpegAACOptions
virtual ~ExportFFmpegAACOptions()
Definition: ExportFFmpegDialogs.cpp:266
CompatibilityEntry::fmt
const wxChar * fmt
format, recognizable by guess_format()
Definition: ExportFFmpegDialogs.h:66
ExportFFmpegAC3Options::TransferDataToWindow
bool TransferDataToWindow() override
Definition: ExportFFmpegDialogs.cpp:236
ExportFFmpegOptions::FetchFormatList
void FetchFormatList()
Retrieves format list from libavformat.
Definition: ExportFFmpegDialogs.cpp:1769
FFmpegPresets::mPreset
FFmpegPreset * mPreset
Definition: ExportFFmpegDialogs.h:341
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:67
ExportFFmpegAACOptions::TransferDataToWindow
bool TransferDataToWindow() override
Definition: ExportFFmpegDialogs.cpp:296
anonymous_namespace{ExportFFmpegDialogs.cpp}::WMABitRateValues
const std::vector< int > WMABitRateValues
Definition: ExportFFmpegDialogs.cpp:692
ExportFFmpegOptions::OnAllFormats
void OnAllFormats(wxCommandEvent &event)
Definition: ExportFFmpegDialogs.cpp:2334
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption=AudacityMessageBoxCaptionStr(), long style=wxOK|wxCENTRE, wxWindow *parent=NULL, int x=wxDefaultCoord, int y=wxDefaultCoord)
Definition: AudacityMessageBox.h:20
ShuttleGui::ToolTip
ShuttleGui & ToolTip(const TranslatableString &tip)
Definition: ShuttleGui.h:663
FMT_AC3
@ FMT_AC3
Definition: ExportFFmpegDialogs.h:37
FFmpegLibs::FreeLibs
void FreeLibs()
! Frees (unloads) loaded libraries
Definition: FFmpeg.cpp:1016
anonymous_namespace{ExportFFmpegDialogs.cpp}::f_kbps
TranslatableString f_kbps(double d)
Definition: ExportFFmpegDialogs.cpp:320
wxPanelWrapper
Definition: wxPanelWrapper.h:41
ExportFFmpegOptions::FetchCodecList
void FetchCodecList()
Retrieves codec list from libavcodec.
Definition: ExportFFmpegDialogs.cpp:1790
FFmpegPresets::mPresets
FFmpegPresetMap mPresets
Definition: ExportFFmpegDialogs.h:340
FileTypes
static const FileNames::FileTypes & FileTypes()
Definition: ExportFFmpegDialogs.cpp:2276
FFmpegLibs::FindLibs
bool FindLibs(wxWindow *parent)
Definition: FFmpeg.cpp:644
ExportFFmpegOptions::FindSelectedFormat
void FindSelectedFormat(wxString **name, wxString **longname)
Finds the format currently selected and returns its name and description.
Definition: ExportFFmpegDialogs.cpp:2003
ShuttleGuiBase::TieCheckBox
wxCheckBox * TieCheckBox(const TranslatableString &Prompt, bool &Var)
Definition: ShuttleGui.cpp:1603
FFmpegPresets::HandleXMLTag
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs) override
Definition: ExportFFmpegDialogs.cpp:1144
ExportFFmpegOptions::OnGetURL
void OnGetURL(wxCommandEvent &event)
Definition: ExportFFmpegDialogs.cpp:2563
OpenID
#define OpenID
Definition: ExportFFmpegDialogs.cpp:771
ExportFFmpegAMRNBOptions::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportFFmpegDialogs.cpp:366
Format
Abstract base class used in importing a file.
ExportFFmpegCustomOptions
Definition: ExportFFmpegDialogs.h:176
ShuttleGuiBase::TieSlider
wxSlider * TieSlider(const TranslatableString &Prompt, int &pos, const int max, const int min=0)
Definition: ShuttleGui.cpp:1661
FFmpegPreset::FFmpegPreset
FFmpegPreset()
Definition: ExportFFmpegDialogs.cpp:866
FileNames::DataDir
AUDACITY_DLL_API FilePath DataDir()
Audacity user data directory.
FFmpegPresets::SavePreset
bool SavePreset(ExportFFmpegOptions *parent, wxString &name)
Definition: ExportFFmpegDialogs.cpp:971
FFMPEG_EXPORT_CTRL_ID_ENTRIES
#define FFMPEG_EXPORT_CTRL_ID_ENTRIES
Definition: ExportFFmpegDialogs.cpp:76
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2421
ExportFFmpegAC3Options::iAC3SampleRates
static const int iAC3SampleRates[]
Definition: ExportFFmpegDialogs.h:85
ExportFFmpegOPUSOptions::ExportFFmpegOPUSOptions
ExportFFmpegOPUSOptions(wxWindow *parent, int format)
Definition: ExportFFmpegDialogs.cpp:581
FFmpegPresets::FFmpegPresets
FFmpegPresets()
Definition: ExportFFmpegDialogs.cpp:875
ExportFFmpegOptions::SavePreset
bool SavePreset(bool bCheckForOverwrite)
Definition: ExportFFmpegDialogs.cpp:2229
XO
#define XO(s)
Definition: Internat.h:32
ExportFFmpegOptions::mPresetCombo
wxComboBox * mPresetCombo
Definition: ExportFFmpegDialogs.h:253
FileNames::XMLFiles
AUDACITY_DLL_API const FileType XMLFiles
Definition: FileNames.h:77
FFmpegPresets::ExportPresets
void ExportPresets(wxString &filename)
Definition: ExportFFmpegDialogs.cpp:912
ExportFFmpegCustomOptions::OnOpen
void OnOpen(wxCommandEvent &evt)
Definition: ExportFFmpegDialogs.cpp:837
anonymous_namespace{ExportFFmpegDialogs.cpp}::AMRNBBitRateNames
const TranslatableStrings AMRNBBitRateNames
Definition: ExportFFmpegDialogs.cpp:325
ExportFFmpegOptions::FetchCompatibleFormatList
int FetchCompatibleFormatList(AVCodecID id, wxString *selfmt)
Definition: ExportFFmpegDialogs.cpp:2127
anonymous_namespace{ExportFFmpegDialogs.cpp}::OPUSFrameDuration
ChoiceSetting OPUSFrameDuration
Definition: ExportFFmpegDialogs.cpp:531
eCancelButton
@ eCancelButton
Definition: ShuttleGui.h:608
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1212
ExportFFmpegOptions::OnOK
void OnOK(wxCommandEvent &event)
Definition: ExportFFmpegDialogs.cpp:2542
PickFFmpegLibs
FFmpegLibs * PickFFmpegLibs()
Definition: FFmpeg.cpp:51
ExportFFmpegWMAOptions::~ExportFFmpegWMAOptions
~ExportFFmpegWMAOptions()
Definition: ExportFFmpegDialogs.cpp:718
ExportFFmpegCustomOptions::TransferDataToWindow
bool TransferDataToWindow() override
Definition: ExportFFmpegDialogs.cpp:818
FileNames::AllFiles
AUDACITY_DLL_API const FileType AllFiles
Definition: FileNames.h:74
ExportFFmpegOptions::apptable
static ApplicableFor apptable[]
Definition: ExportFFmpegDialogs.h:234
ShuttleGui::Id
ShuttleGui & Id(int id)
Definition: ShuttleGui.cpp:2248
ShuttleGuiBase::TieTextBox
wxTextCtrl * TieTextBox(const TranslatableString &Caption, wxString &Value, const int nChars=0)
Definition: ShuttleGui.cpp:1626
FFmpegPreset::mPresetName
wxString mPresetName
Definition: ExportFFmpegDialogs.h:310
XMLFileReader::Parse
bool Parse(XMLTagHandler *baseHandler, const FilePath &fname)
Definition: XMLFileReader.cpp:41
LoadFFmpeg
bool LoadFFmpeg(bool showerror)
Definition: FFmpeg.cpp:71
AV_CANMETA
#define AV_CANMETA
Definition: ExportFFmpegDialogs.h:45
ExposedFormat
Describes export type.
Definition: ExportFFmpegDialogs.h:49
FFmpegPresets::~FFmpegPresets
~FFmpegPresets()
Definition: ExportFFmpegDialogs.cpp:885
CompatibilityEntry
Describes format-codec compatibility.
Definition: ExportFFmpegDialogs.h:65
ShuttleGui::Style
ShuttleGui & Style(long iStyle)
Definition: ShuttleGui.h:734
ExportFFmpegOptions::mPresetNames
wxArrayStringEx mPresetNames
Definition: ExportFFmpegDialogs.h:260
eOkButton
@ eOkButton
Definition: ShuttleGui.h:607
ChoiceSetting
Definition: Prefs.h:90
ExportFFmpegOptions::ReportIfBadCombination
bool ReportIfBadCombination()
Definition: ExportFFmpegDialogs.cpp:2359
anonymous_namespace{ExportFFmpegDialogs.cpp}::OPUSCompression
ChoiceSetting OPUSCompression
Definition: ExportFFmpegDialogs.cpp:457
TranslatableStrings
std::vector< TranslatableString > TranslatableStrings
Definition: Types.h:555
ShuttleGuiBase::SetSizerProportion
void SetSizerProportion(int iProp)
Definition: ShuttleGui.h:498
ExportFFmpegOPUSOptions::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: ExportFFmpegDialogs.cpp:656
ExportFFmpegCustomOptions::mFormat
wxTextCtrl * mFormat
Definition: ExportFFmpegDialogs.h:189
XXO
#define XXO(s)
Definition: Internat.h:45
ExportFFmpegOptions::OnFormatList
void OnFormatList(wxCommandEvent &event)
Definition: ExportFFmpegDialogs.cpp:2527
FFmpegPresets::ImportPresets
void ImportPresets(wxString &filename)
Definition: ExportFFmpegDialogs.cpp:898
ExportFFmpegWMAOptions::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportFFmpegDialogs.cpp:725
ExportFFmpegOptions::DoOnFormatList
void DoOnFormatList()
Definition: ExportFFmpegDialogs.cpp:2438
ShuttleGuiBase::EndHorizontalLay
void EndHorizontalLay()
Definition: ShuttleGui.cpp:1170
ExportFFmpegOptions::mCodecList
wxListBox * mCodecList
Definition: ExportFFmpegDialogs.h:248
ExportFFmpegWMAOptions::ExportFFmpegWMAOptions
ExportFFmpegWMAOptions(wxWindow *parent, int format)
Definition: ExportFFmpegDialogs.cpp:709
ExportFFmpegOPUSOptions::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportFFmpegDialogs.cpp:597
ExportFFmpegOptions::OnDeletePreset
void OnDeletePreset(wxCommandEvent &event)
Definition: ExportFFmpegDialogs.cpp:2195
ExportFFmpegOptions::OnCodecList
void OnCodecList(wxCommandEvent &event)
Definition: ExportFFmpegDialogs.cpp:2534
FFmpegPresetMap
std::unordered_map< wxString, FFmpegPreset > FFmpegPresetMap
Definition: ExportFFmpegDialogs.h:315
ShuttleGuiBase::StartHorizontalLay
void StartHorizontalLay(int PositionFlags=wxALIGN_CENTRE, int iProp=1)
Definition: ShuttleGui.cpp:1160
ShuttleGuiBase::AddTextBox
wxTextCtrl * AddTextBox(const TranslatableString &Caption, const wxString &Value, const int nChars)
Definition: ShuttleGui.cpp:631
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1203
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1196
FileDialog::GetPath
virtual wxString GetPath() const
Definition: gtk/FileDialogPrivate.cpp:514
ExportFFmpegOptions::OnLoadPreset
void OnLoadPreset(wxCommandEvent &event)
Definition: ExportFFmpegDialogs.cpp:2255
FFmpegExportCtrlIDNames
static const wxChar * FFmpegExportCtrlIDNames[]
Definition: ExportFFmpegDialogs.cpp:129
FMT_OTHER
@ FMT_OTHER
Definition: ExportFFmpegDialogs.h:41
ExportFFmpegOptions::mFormatList
wxListBox * mFormatList
Definition: ExportFFmpegDialogs.h:247
eHelpButton
@ eHelpButton
Definition: ShuttleGui.h:611
anonymous_namespace{ExportFFmpegDialogs.cpp}::WMABitRateNames
const TranslatableStrings WMABitRateNames
Bit Rates supported by WMA encoder. Setting bit rate to other values will not result in different fil...
Definition: ExportFFmpegDialogs.cpp:677
ExportFFmpegOptions::CompatibilityList
static CompatibilityEntry CompatibilityList[]
Definition: ExportFFmpegDialogs.h:231
ShuttleGuiBase::AddFixedText
void AddFixedText(const TranslatableString &Str, bool bCenter=false, int wrapWidth=0)
Definition: ShuttleGui.cpp:433
ExportFFmpegAMRNBOptions::TransferDataToWindow
bool TransferDataToWindow() override
Definition: ExportFFmpegDialogs.cpp:391
FMT_AMRNB
@ FMT_AMRNB
Definition: ExportFFmpegDialogs.h:38
AACProfiles
ChoiceSetting AACProfiles
AAC profiles.
Definition: ExportFFmpegDialogs.cpp:1609
name
const TranslatableString name
Definition: Distortion.cpp:98
ExportFFmpegOptions
Custom FFmpeg export dialog.
Definition: ExportFFmpegDialogs.h:208
anonymous_namespace{ExportFFmpegDialogs.cpp}::OPUSApplication
ChoiceSetting OPUSApplication
Definition: ExportFFmpegDialogs.cpp:512
ExportFFmpegOptions::mCodecName
wxStaticText * mCodecName
Definition: ExportFFmpegDialogs.h:251
ExportFFmpegAC3Options::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportFFmpegDialogs.cpp:211
format
int format
Definition: ExportPCM.cpp:54
FFmpegPresets::HandleXMLChild
XMLTagHandler * HandleXMLChild(const wxChar *tag) override
Definition: ExportFFmpegDialogs.cpp:1227
anonymous_namespace{ExportFFmpegDialogs.cpp}::OPUSCutoff
ChoiceSetting OPUSCutoff
Definition: ExportFFmpegDialogs.cpp:556
FFmpegPresets::DeletePreset
void DeletePreset(wxString &name)
Definition: ExportFFmpegDialogs.cpp:934
Export.h
FFmpegPresets::OverwriteIsOk
bool OverwriteIsOk(wxString &name)
Definition: ExportFFmpegDialogs.cpp:955
ExportFFmpegWMAOptions::TransferDataToWindow
bool TransferDataToWindow() override
Definition: ExportFFmpegDialogs.cpp:750
FFmpegExportCtrlID
FFmpegExportCtrlID
Definition: ExportFFmpegDialogs.cpp:120
ExportFFmpegAACOptions::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: ExportFFmpegDialogs.cpp:303
anonymous_namespace{ExportFFmpegDialogs.cpp}::PredictionOrderMethodNames
const TranslatableStrings PredictionOrderMethodNames
Prediction order method - names.
Definition: ExportFFmpegDialogs.cpp:1718
FFmpegPreset::~FFmpegPreset
~FFmpegPreset()
Definition: ExportFFmpegDialogs.cpp:871
ExportFFmpegOptions::mShownFormatNames
wxArrayString mShownFormatNames
Definition: ExportFFmpegDialogs.h:238
ShuttleGui::Prop
ShuttleGui & Prop(int iProp)
Definition: ShuttleGui.h:732
FFmpegPresets::WriteXMLHeader
void WriteXMLHeader(XMLWriter &xmlFile) const
Definition: ExportFFmpegDialogs.cpp:1245
ShuttleGuiBase::TieSpinCtrl
wxSpinCtrl * TieSpinCtrl(const TranslatableString &Prompt, int &Value, const int max, const int min=0)
Definition: ShuttleGui.cpp:1619
XMLTagHandler
This class is an interface which should be implemented by classes which wish to be able to load and s...
Definition: XMLTagHandler.h:80
ShuttleGuiBase::AddButton
wxButton * AddButton(const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
Definition: ShuttleGui.cpp:353
FFmpegPreset
Definition: ExportFFmpegDialogs.h:305
FFmpegPresets::GetPresetList
void GetPresetList(wxArrayString &list)
Definition: ExportFFmpegDialogs.cpp:922
ExportFFmpegOptions::fmts
static ExposedFormat fmts[]
List of export types.
Definition: ExportFFmpegDialogs.h:232
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:886
eIsSavingToPrefs
@ eIsSavingToPrefs
Definition: ShuttleGui.h:46
ExportFFmpegDialogs.h
anonymous_namespace{ExportFFmpegDialogs.cpp}::OPUSVbrMode
ChoiceSetting OPUSVbrMode
Definition: ExportFFmpegDialogs.cpp:493
wxDialogWrapper
Definition: wxPanelWrapper.h:81
FFmpegPresets::FindPreset
FFmpegPreset * FindPreset(wxString &name)
Definition: ExportFFmpegDialogs.cpp:943
ExportFFmpegOptions::mShownFormatLongNames
wxArrayString mShownFormatLongNames
Definition: ExportFFmpegDialogs.h:239
ExportFFmpegOptions::mShownCodecLongNames
wxArrayString mShownCodecLongNames
Definition: ExportFFmpegDialogs.h:241
FileConfig::Flush
virtual bool Flush(bool bCurrentOnly=false) wxOVERRIDE
Definition: FileConfig.cpp:151
ExportFFmpegCustomOptions::mCodec
wxTextCtrl * mCodec
Definition: ExportFFmpegDialogs.h:190
HelpSystem::ShowHelp
static void ShowHelp(wxWindow *parent, const wxString &localFileName, const wxString &remoteURL, bool bModal=false, bool alwaysDefaultBrowser=false)
Definition: HelpSystem.cpp:238
XMLFileReader
Reads a file and passes the results through an XMLTagHandler.
Definition: XMLFileReader.h:20
FFmpegLibsInst
FFmpegLibs * FFmpegLibsInst()
Definition: FFmpeg.cpp:46
FileDialogWrapper
Definition: wxPanelWrapper.h:165
_
#define _(s)
Definition: Internat.h:76
ExportFFmpegAMRNBOptions::ExportFFmpegAMRNBOptions
ExportFFmpegAMRNBOptions(wxWindow *parent, int format)
Definition: ExportFFmpegDialogs.cpp:350
ExportFFmpegAACOptions::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportFFmpegDialogs.cpp:273
ExportFFmpegOptions::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportFFmpegDialogs.cpp:1813
ExportFFmpegOptions::OnImportPresets
void OnImportPresets(wxCommandEvent &event)
Definition: ExportFFmpegDialogs.cpp:2285
ExportFFmpegOptions::EnableDisableControls
void EnableDisableControls(AVCodec *cdc, wxString *selfmt)
Definition: ExportFFmpegDialogs.cpp:2414
ExportFFmpegOptions::mFormatLongNames
wxArrayString mFormatLongNames
Definition: ExportFFmpegDialogs.h:243
XMLFileWriter
Wrapper to output XML data to files.
Definition: XMLWriter.h:81
ApplicableFor::control
int control
control ID
Definition: ExportFFmpegDialogs.h:199
GuardedCall
R GuardedCall(const F1 &body, const F2 &handler=F2::Default(), const F3 &delayedHandler={})
Execute some code on any thread; catch any AudacityException; enqueue error report on the main thread...
Definition: AudacityException.h:189
n_kbps
TranslatableString n_kbps(int n)
Definition: ExportMP3.cpp:127
ExportFFmpegAC3Options::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: ExportFFmpegDialogs.cpp:243
ExportFFmpegAC3Options::~ExportFFmpegAC3Options
virtual ~ExportFFmpegAC3Options()
Definition: ExportFFmpegDialogs.cpp:204
ShuttleGuiBase::TieNumberAsChoice
virtual wxChoice * TieNumberAsChoice(const TranslatableString &Prompt, const SettingSpec< int > &Setting, const TranslatableStrings &Choices, const std::vector< int > *pInternalChoices=nullptr, int iNoMatchSelector=0)
Definition: ShuttleGui.cpp:1985
anonymous_namespace{ExportFFmpegDialogs.cpp}::AC3BitRateValues
const std::vector< int > AC3BitRateValues
Definition: ExportFFmpegDialogs.cpp:169
ExportFFmpegCustomOptions::~ExportFFmpegCustomOptions
~ExportFFmpegCustomOptions()
Definition: ExportFFmpegDialogs.cpp:788
DropFFmpegLibs
void DropFFmpegLibs()
Definition: FFmpeg.cpp:61
ExportFFmpegAMRNBOptions::~ExportFFmpegAMRNBOptions
virtual ~ExportFFmpegAMRNBOptions()
Definition: ExportFFmpegDialogs.cpp:359
ExportFFmpegOptions::FetchCompatibleCodecList
int FetchCompatibleCodecList(const wxChar *fmt, AVCodecID id)
Definition: ExportFFmpegDialogs.cpp:2045
anonymous_namespace{ExportFFmpegDialogs.cpp}::AC3BitRateNames
const TranslatableStrings AC3BitRateNames
Definition: ExportFFmpegDialogs.cpp:147
ExportFFmpegOptions::mCodecLongNames
wxArrayString mCodecLongNames
Definition: ExportFFmpegDialogs.h:245
FFmpegPreset::mControlState
wxArrayString mControlState
Definition: ExportFFmpegDialogs.h:311
ExportFFmpegOPUSOptions::~ExportFFmpegOPUSOptions
~ExportFFmpegOPUSOptions()
Definition: ExportFFmpegDialogs.cpp:590
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2406
FileNames::FileTypes
std::vector< FileType > FileTypes
Definition: FileNames.h:79
ExportFFmpegOptions::mFormatName
wxStaticText * mFormatName
Definition: ExportFFmpegDialogs.h:250
ShuttleGuiBase::AddPrompt
void AddPrompt(const TranslatableString &Prompt, int wrapWidth=0)
Right aligned text string.
Definition: ShuttleGui.cpp:231
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:497
ByColumns
ByColumns_t ByColumns
Definition: Prefs.cpp:373
wxDialogWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:81
ExportFFmpegOptions::mFormatNames
wxArrayStringEx mFormatNames
Definition: ExportFFmpegDialogs.h:242
eIsCreatingFromPrefs
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:45
FFmpegPresets::LoadPreset
void LoadPreset(ExportFFmpegOptions *parent, wxString &name)
Definition: ExportFFmpegDialogs.cpp:1065
FMT_OPUS
@ FMT_OPUS
Definition: ExportFFmpegDialogs.h:39
ShuttleGuiBase::AddVariableText
wxStaticText * AddVariableText(const TranslatableString &Str, bool bCenter=false, int PositionFlags=0, int wrapWidth=0)
Definition: ShuttleGui.cpp:456
ShuttleGuiBase::EndStatic
void EndStatic()
Definition: ShuttleGui.cpp:915
ExportFFmpegOptions::~ExportFFmpegOptions
~ExportFFmpegOptions()
Definition: ExportFFmpegDialogs.cpp:1731
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:195
anonymous_namespace{ExportFFmpegDialogs.cpp}::OPUSBitrate
ChoiceSetting OPUSBitrate
Bit Rates supported by OPUS encoder. Setting bit rate to other values will not result in different fi...
Definition: ExportFFmpegDialogs.cpp:416
FileDialog::ShowModal
virtual int ShowModal()
Definition: gtk/FileDialogPrivate.cpp:445
ExportFFmpegOptions::DoOnCodecList
void DoOnCodecList()
Definition: ExportFFmpegDialogs.cpp:2482
ShuttleGuiBase::AddListBox
wxListBox * AddListBox(const wxArrayStringEx &choices)
Definition: ShuttleGui.cpp:746
ExportFFmpegOptions::mCodecNames
wxArrayStringEx mCodecNames
Definition: ExportFFmpegDialogs.h:244
END_EVENT_TABLE
END_EVENT_TABLE()
ExportFFmpegOptions::ExportFFmpegOptions
ExportFFmpegOptions(wxWindow *parent)
Definition: ExportFFmpegDialogs.cpp:1736
ShuttleGuiBase::TieChoice
wxChoice * TieChoice(const TranslatableString &Prompt, TranslatableString &Selected, const TranslatableStrings &choices)
Definition: ShuttleGui.cpp:1701
ShuttleGuiBase::SetStretchyRow
void SetStretchyRow(int i)
Used to modify an already placed FlexGridSizer to make a row stretchy.
Definition: ShuttleGui.cpp:205
ShuttleGuiBase::AddCombo
wxComboBox * AddCombo(const TranslatableString &Prompt, const wxString &Selected, const wxArrayStringEx &choices)
Definition: ShuttleGui.cpp:510
ExportFFmpegCustomOptions::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportFFmpegDialogs.cpp:795
FMT_M4A
@ FMT_M4A
Definition: ExportFFmpegDialogs.h:36
FFmpegPresets::mAbortImport
bool mAbortImport
Definition: ExportFFmpegDialogs.h:342
ExportFFmpegCustomOptions::TransferDataFromWindow
bool TransferDataFromWindow() override
Definition: ExportFFmpegDialogs.cpp:830
anonymous_namespace{ExportFFmpegDialogs.cpp}::AMRNBBitRateValues
const std::vector< int > AMRNBBitRateValues
Definition: ExportFFmpegDialogs.cpp:337
ShuttleGui
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:638
ExportFFmpegOptions::mPresets
std::unique_ptr< FFmpegPresets > mPresets
Definition: ExportFFmpegDialogs.h:258
CompatibilityEntry::codec
AVCodecID codec
codec ID
Definition: ExportFFmpegDialogs.h:67
FMT_WMA2
@ FMT_WMA2
Definition: ExportFFmpegDialogs.h:40