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