Audacity  3.0.3
Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes | List of all members
ExportFFmpegOptions Class Referencefinal

Custom FFmpeg export dialog. More...

#include <ExportFFmpegDialogs.h>

Inheritance diagram for ExportFFmpegOptions:
[legend]
Collaboration diagram for ExportFFmpegOptions:
[legend]

Public Member Functions

 ExportFFmpegOptions (wxWindow *parent)
 
 ~ExportFFmpegOptions ()
 
void PopulateOrExchange (ShuttleGui &S)
 
void OnOK (wxCommandEvent &event)
 
void OnGetURL (wxCommandEvent &event)
 
void OnFormatList (wxCommandEvent &event)
 
void DoOnFormatList ()
 
void OnCodecList (wxCommandEvent &event)
 
void DoOnCodecList ()
 
void OnAllFormats (wxCommandEvent &event)
 
void OnAllCodecs (wxCommandEvent &event)
 
void OnSavePreset (wxCommandEvent &event)
 
void OnLoadPreset (wxCommandEvent &event)
 
void OnDeletePreset (wxCommandEvent &event)
 
void OnImportPresets (wxCommandEvent &event)
 
void OnExportPresets (wxCommandEvent &event)
 
bool SavePreset (bool bCheckForOverwrite)
 
- Public Member Functions inherited from wxDialogWrapper
 wxDialogWrapper ()
 
 wxDialogWrapper (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
bool Create (wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE, const TranslatableString &name=XO("Dialog"))
 
void SetTitle (const TranslatableString &title)
 
void SetLabel (const TranslatableString &title)
 
void SetName (const TranslatableString &title)
 
void SetName ()
 
- Public Member Functions inherited from wxTabTraversalWrapper< wxDialog >
 wxTabTraversalWrapper (Args &&... args)
 
 wxTabTraversalWrapper (const wxTabTraversalWrapper &)=delete
 
 wxTabTraversalWrapper (wxTabTraversalWrapper &&)=delete
 
wxTabTraversalWrapperoperator= (const wxTabTraversalWrapper &)=delete
 
wxTabTraversalWrapperoperator= (wxTabTraversalWrapper &&)=delete
 

Static Public Attributes

static CompatibilityEntry CompatibilityList []
 
static ExposedFormat fmts []
 List of export types. More...
 
static const int iAACSampleRates []
 
static ApplicableFor apptable []
 

Private Member Functions

void FindSelectedFormat (wxString **name, wxString **longname)
 Finds the format currently selected and returns its name and description. More...
 
void FindSelectedCodec (wxString **name, wxString **longname)
 Finds the codec currently selected and returns its name and description. More...
 
void FetchFormatList ()
 Retrieves format list from libavformat. More...
 
int FetchCompatibleFormatList (AVCodecID id, wxString *selfmt)
 
void FetchCodecList ()
 Retrieves codec list from libavcodec. More...
 
int FetchCompatibleCodecList (const wxChar *fmt, AVCodecID id)
 
void FetchPresetList ()
 Retrieves list of presets from configuration file. More...
 
bool ReportIfBadCombination ()
 
void EnableDisableControls (AVCodec *cdc, wxString *selfmt)
 

Private Attributes

wxArrayString mShownFormatNames
 
wxArrayString mShownFormatLongNames
 
wxArrayString mShownCodecNames
 
wxArrayString mShownCodecLongNames
 
wxArrayStringEx mFormatNames
 
wxArrayString mFormatLongNames
 
wxArrayStringEx mCodecNames
 
wxArrayString mCodecLongNames
 
wxListBox * mFormatList
 
wxListBox * mCodecList
 
wxStaticText * mFormatName
 
wxStaticText * mCodecName
 
wxComboBox * mPresetCombo
 
int mBitRateFromChoice
 
int mSampleRateFromChoice
 
std::unique_ptr< FFmpegPresetsmPresets
 
wxArrayStringEx mPresetNames
 

Detailed Description

Custom FFmpeg export dialog.

Options dialog for Custom FFmpeg export format.

Definition at line 207 of file ExportFFmpegDialogs.h.

Constructor & Destructor Documentation

◆ ExportFFmpegOptions()

ExportFFmpegOptions::ExportFFmpegOptions ( wxWindow *  parent)

Definition at line 1737 of file ExportFFmpegDialogs.cpp.

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 }

References DoOnCodecList(), DoOnFormatList(), eIsCreatingFromPrefs, FetchCodecList(), FetchFormatList(), FFmpegLibsInst(), gPrefs, mCodecList, mFormatList, mPresetNames, mPresets, PickFFmpegLibs(), PopulateOrExchange(), wxDialogWrapper::SetName(), and audacity::ToUTF8().

Here is the call graph for this function:

◆ ~ExportFFmpegOptions()

ExportFFmpegOptions::~ExportFFmpegOptions ( )

Definition at line 1732 of file ExportFFmpegDialogs.cpp.

1733 {
1734  DropFFmpegLibs();
1735 }

References DropFFmpegLibs().

Here is the call graph for this function:

Member Function Documentation

◆ DoOnCodecList()

void ExportFFmpegOptions::DoOnCodecList ( )

Definition at line 2483 of file ExportFFmpegDialogs.cpp.

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 }

References _, EnableDisableControls(), FetchCompatibleFormatList(), FindSelectedCodec(), FindSelectedFormat(), mCodecName, and mFormatList.

Referenced by ExportFFmpegOptions(), OnCodecList(), and OnLoadPreset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DoOnFormatList()

void ExportFFmpegOptions::DoOnFormatList ( )

Definition at line 2439 of file ExportFFmpegDialogs.cpp.

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 }

References _, EnableDisableControls(), FetchCompatibleCodecList(), FindSelectedCodec(), FindSelectedFormat(), mCodecList, and mFormatName.

Referenced by ExportFFmpegOptions(), OnFormatList(), and OnLoadPreset().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ EnableDisableControls()

void ExportFFmpegOptions::EnableDisableControls ( AVCodec *  cdc,
wxString *  selfmt 
)
private

Definition at line 2415 of file ExportFFmpegDialogs.cpp.

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 }

References apptable, ApplicableFor::control, and format.

Referenced by DoOnCodecList(), and DoOnFormatList().

Here is the caller graph for this function:

◆ FetchCodecList()

void ExportFFmpegOptions::FetchCodecList ( )
private

Retrieves codec list from libavcodec.

Definition at line 1791 of file ExportFFmpegDialogs.cpp.

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 }

References mCodecLongNames, mCodecNames, mShownCodecLongNames, and mShownCodecNames.

Referenced by ExportFFmpegOptions().

Here is the caller graph for this function:

◆ FetchCompatibleCodecList()

int ExportFFmpegOptions::FetchCompatibleCodecList ( const wxChar *  fmt,
AVCodecID  id 
)
private

Retrieves a list of codecs compatible to format

Parameters
fmtFormat short name
idid of the codec selected at the moment
Returns
index of the id in NEW codec list or -1 if it is not in the list

Definition at line 2046 of file ExportFFmpegDialogs.cpp.

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 }

References CompatibilityList, CompatibilityEntry::fmt, format, make_iterator_range(), mCodecList, mShownCodecLongNames, and mShownCodecNames.

Referenced by DoOnFormatList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FetchCompatibleFormatList()

int ExportFFmpegOptions::FetchCompatibleFormatList ( AVCodecID  id,
wxString *  selfmt 
)
private

Retrieves a list of formats compatible to codec

Parameters
idCodec ID
selfmtformat selected at the moment
Returns
index of the selfmt in NEW format list or -1 if it is not in the list

Definition at line 2128 of file ExportFFmpegDialogs.cpp.

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 }

References CompatibilityList, CompatibilityEntry::fmt, mFormatList, mShownFormatLongNames, mShownFormatNames, and audacity::ToUTF8().

Referenced by DoOnCodecList().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FetchFormatList()

void ExportFFmpegOptions::FetchFormatList ( )
private

Retrieves format list from libavformat.

Definition at line 1770 of file ExportFFmpegDialogs.cpp.

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 }

References mFormatLongNames, mFormatNames, mShownFormatLongNames, and mShownFormatNames.

Referenced by ExportFFmpegOptions().

Here is the caller graph for this function:

◆ FetchPresetList()

void ExportFFmpegOptions::FetchPresetList ( )
private

Retrieves list of presets from configuration file.

◆ FindSelectedCodec()

void ExportFFmpegOptions::FindSelectedCodec ( wxString **  name,
wxString **  longname 
)
private

Finds the codec currently selected and returns its name and description.

Definition at line 2025 of file ExportFFmpegDialogs.cpp.

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 }

References make_iterator_range(), mCodecList, mCodecLongNames, mCodecNames, and name.

Referenced by DoOnCodecList(), DoOnFormatList(), and ReportIfBadCombination().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ FindSelectedFormat()

void ExportFFmpegOptions::FindSelectedFormat ( wxString **  name,
wxString **  longname 
)
private

Finds the format currently selected and returns its name and description.

Definition at line 2004 of file ExportFFmpegDialogs.cpp.

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 }

References make_iterator_range(), mFormatList, mFormatLongNames, mFormatNames, and name.

Referenced by DoOnCodecList(), DoOnFormatList(), and ReportIfBadCombination().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ OnAllCodecs()

void ExportFFmpegOptions::OnAllCodecs ( wxCommandEvent &  event)

Definition at line 2345 of file ExportFFmpegDialogs.cpp.

2346 {
2349  mCodecList->Clear();
2350  mCodecList->Append(mCodecNames);
2351 }

References mCodecList, mCodecLongNames, mCodecNames, mShownCodecLongNames, and mShownCodecNames.

◆ OnAllFormats()

void ExportFFmpegOptions::OnAllFormats ( wxCommandEvent &  event)

◆ OnCodecList()

void ExportFFmpegOptions::OnCodecList ( wxCommandEvent &  event)

Definition at line 2535 of file ExportFFmpegDialogs.cpp.

2536 {
2537  DoOnCodecList();
2538 }

References DoOnCodecList().

Here is the call graph for this function:

◆ OnDeletePreset()

void ExportFFmpegOptions::OnDeletePreset ( wxCommandEvent &  event)

Definition at line 2196 of file ExportFFmpegDialogs.cpp.

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 }

References AudacityMessageBox(), mPresetNames, mPresets, and XO.

Here is the call graph for this function:

◆ OnExportPresets()

void ExportFFmpegOptions::OnExportPresets ( wxCommandEvent &  event)

Definition at line 2305 of file ExportFFmpegDialogs.cpp.

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 }

References AudacityMessageBox(), FileTypes(), FileDialog::GetPath(), gPrefs, mPresets, SavePreset(), FileDialog::ShowModal(), and XO.

Here is the call graph for this function:

◆ OnFormatList()

void ExportFFmpegOptions::OnFormatList ( wxCommandEvent &  event)

Definition at line 2528 of file ExportFFmpegDialogs.cpp.

2529 {
2530  DoOnFormatList();
2531 }

References DoOnFormatList().

Here is the call graph for this function:

◆ OnGetURL()

void ExportFFmpegOptions::OnGetURL ( wxCommandEvent &  event)

Definition at line 2564 of file ExportFFmpegDialogs.cpp.

2565 {
2566  HelpSystem::ShowHelp(this, L"Custom_FFmpeg_Export_Options");
2567 }

References HelpSystem::ShowHelp().

Here is the call graph for this function:

◆ OnImportPresets()

void ExportFFmpegOptions::OnImportPresets ( wxCommandEvent &  event)

Definition at line 2286 of file ExportFFmpegDialogs.cpp.

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 }

References FileTypes(), FileDialog::GetPath(), gPrefs, mPresetCombo, mPresetNames, mPresets, FileDialog::ShowModal(), and XO.

Here is the call graph for this function:

◆ OnLoadPreset()

void ExportFFmpegOptions::OnLoadPreset ( wxCommandEvent &  event)

Definition at line 2256 of file ExportFFmpegDialogs.cpp.

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 }

References DoOnCodecList(), DoOnFormatList(), mCodecList, mCodecLongNames, mCodecNames, mFormatList, mFormatLongNames, mFormatNames, mPresets, mShownCodecLongNames, mShownCodecNames, mShownFormatLongNames, and mShownFormatNames.

Here is the call graph for this function:

◆ OnOK()

void ExportFFmpegOptions::OnOK ( wxCommandEvent &  event)

Definition at line 2543 of file ExportFFmpegDialogs.cpp.

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 }

References eIsSavingToPrefs, FileConfig::Flush(), gPrefs, mCodecList, mFormatList, PopulateOrExchange(), and ReportIfBadCombination().

Here is the call graph for this function:

◆ OnSavePreset()

void ExportFFmpegOptions::OnSavePreset ( wxCommandEvent &  event)

Definition at line 2224 of file ExportFFmpegDialogs.cpp.

2225 { const bool kCheckForOverwrite = true;
2226  SavePreset(kCheckForOverwrite);
2227 }

References SavePreset().

Here is the call graph for this function:

◆ PopulateOrExchange()

void ExportFFmpegOptions::PopulateOrExchange ( ShuttleGui S)

Definition at line 1814 of file ExportFFmpegDialogs.cpp.

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 }

References AACProfiles, ShuttleGuiBase::AddButton(), ShuttleGuiBase::AddCombo(), ShuttleGuiBase::AddFixedText(), ShuttleGuiBase::AddListBox(), ShuttleGui::AddSpace(), ShuttleGui::AddStandardButtons(), ShuttleGuiBase::AddVariableText(), eCancelButton, eHelpButton, ShuttleGuiBase::EndMultiColumn(), ShuttleGuiBase::EndStatic(), ShuttleGuiBase::EndVerticalLay(), eOkButton, gPrefs, ShuttleGui::Id(), mCodecList, mCodecName, mCodecNames, mFormatList, mFormatName, mFormatNames, mPresetCombo, mPresetNames, anonymous_namespace{ExportFFmpegDialogs.cpp}::PredictionOrderMethodNames, ShuttleGuiBase::SetBorder(), ShuttleGuiBase::SetStretchyCol(), ShuttleGuiBase::SetStretchyRow(), ShuttleGuiBase::StartMultiColumn(), ShuttleGuiBase::StartStatic(), ShuttleGuiBase::StartVerticalLay(), ShuttleGuiBase::TieCheckBox(), ShuttleGuiBase::TieSpinCtrl(), ShuttleGuiBase::TieTextBox(), ShuttleGui::ToolTip(), XO, and XXO.

Referenced by ExportFFmpegOptions(), and OnOK().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ReportIfBadCombination()

bool ExportFFmpegOptions::ReportIfBadCombination ( )
private

ReportIfBadCombination will trap bad combinations of format and codec and report using a message box. We may later extend it to catch bad parameters too.

Returns
true iff a bad combination was reported At the moment we don't trap unrecognised format or codec. (We do not expect them to happen ever).

Definition at line 2360 of file ExportFFmpegDialogs.cpp.

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 }

References AudacityMessageBox(), CompatibilityEntry::codec, CompatibilityList, FindSelectedCodec(), FindSelectedFormat(), CompatibilityEntry::fmt, and XO.

Referenced by OnOK().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ SavePreset()

bool ExportFFmpegOptions::SavePreset ( bool  bCheckForOverwrite)

Definition at line 2230 of file ExportFFmpegDialogs.cpp.

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 }

References AudacityMessageBox(), TranslatableString::empty(), mPresetCombo, mPresetNames, mPresets, name, and XO.

Referenced by OnExportPresets(), and OnSavePreset().

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ apptable

ApplicableFor ExportFFmpegOptions::apptable
static

Some controls (parameters they represent) are only applicable to a number of codecs and/or formats. Syntax: first, enable a control for each applicable format-codec combination then disable it for anything else "any" - any format AV_CODEC_ID_NONE - any codec This list must end with {FALSE,FFmpegExportCtrlID(0),AV_CODEC_ID_NONE,NULL}

Definition at line 234 of file ExportFFmpegDialogs.h.

Referenced by EnableDisableControls().

◆ CompatibilityList

CompatibilityEntry ExportFFmpegOptions::CompatibilityList
static

Format-codec compatibility list Must end with NULL entry

Definition at line 231 of file ExportFFmpegDialogs.h.

Referenced by FetchCompatibleCodecList(), FetchCompatibleFormatList(), and ReportIfBadCombination().

◆ fmts

ExposedFormat ExportFFmpegOptions::fmts
static
Initial value:
=
{
{FMT_M4A, wxT("M4A"), wxT("m4a"), wxT("ipod"), 48, AV_CANMETA, true, XO("M4A (AAC) Files (FFmpeg)"), AV_CODEC_ID_AAC, true},
{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},
{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},
{FMT_OPUS, wxT("OPUS"), wxT("opus"), wxT("opus"), 255, AV_CANMETA, true, XO("Opus (OggOpus) Files (FFmpeg)"), AV_CODEC_ID_OPUS, true},
{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},
{FMT_OTHER, wxT("FFMPEG"), wxT(""), wxT(""), 255, AV_CANMETA, true, XO("Custom FFmpeg Export"), AV_CODEC_ID_NONE, true}
}

List of export types.

Definition at line 232 of file ExportFFmpegDialogs.h.

Referenced by AdjustFormatIndex(), ExportFFmpeg::Export(), ExportFFmpeg::ExportFFmpeg(), ExportFFmpeg::Init(), and ExportFFmpeg::InitCodecs().

◆ iAACSampleRates

const int ExportFFmpegOptions::iAACSampleRates[]
static

Definition at line 233 of file ExportFFmpegDialogs.h.

◆ mBitRateFromChoice

int ExportFFmpegOptions::mBitRateFromChoice
private

Definition at line 255 of file ExportFFmpegDialogs.h.

◆ mCodecList

wxListBox* ExportFFmpegOptions::mCodecList
private

◆ mCodecLongNames

wxArrayString ExportFFmpegOptions::mCodecLongNames
private

◆ mCodecName

wxStaticText* ExportFFmpegOptions::mCodecName
private

Definition at line 251 of file ExportFFmpegDialogs.h.

Referenced by DoOnCodecList(), and PopulateOrExchange().

◆ mCodecNames

wxArrayStringEx ExportFFmpegOptions::mCodecNames
private

◆ mFormatList

wxListBox* ExportFFmpegOptions::mFormatList
private

◆ mFormatLongNames

wxArrayString ExportFFmpegOptions::mFormatLongNames
private

◆ mFormatName

wxStaticText* ExportFFmpegOptions::mFormatName
private

Definition at line 250 of file ExportFFmpegDialogs.h.

Referenced by DoOnFormatList(), and PopulateOrExchange().

◆ mFormatNames

wxArrayStringEx ExportFFmpegOptions::mFormatNames
private

◆ mPresetCombo

wxComboBox* ExportFFmpegOptions::mPresetCombo
private

Definition at line 253 of file ExportFFmpegDialogs.h.

Referenced by OnImportPresets(), PopulateOrExchange(), and SavePreset().

◆ mPresetNames

wxArrayStringEx ExportFFmpegOptions::mPresetNames
private

◆ mPresets

std::unique_ptr<FFmpegPresets> ExportFFmpegOptions::mPresets
private

◆ mSampleRateFromChoice

int ExportFFmpegOptions::mSampleRateFromChoice
private

Definition at line 256 of file ExportFFmpegDialogs.h.

◆ mShownCodecLongNames

wxArrayString ExportFFmpegOptions::mShownCodecLongNames
private

◆ mShownCodecNames

wxArrayString ExportFFmpegOptions::mShownCodecNames
private

◆ mShownFormatLongNames

wxArrayString ExportFFmpegOptions::mShownFormatLongNames
private

◆ mShownFormatNames

wxArrayString ExportFFmpegOptions::mShownFormatNames
private

The documentation for this class was generated from the following files:
ExportFFmpegOptions::mShownCodecNames
wxArrayString mShownCodecNames
Definition: ExportFFmpegDialogs.h:240
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
ShuttleGuiBase::StartVerticalLay
void StartVerticalLay(int iProp=1)
Definition: ShuttleGui.cpp:1184
make_iterator_range
IteratorRange< Iterator > make_iterator_range(const Iterator &i1, const Iterator &i2)
Definition: MemoryX.h:549
AudacityMessageBox
int AudacityMessageBox(const TranslatableString &message, const TranslatableString &caption, long style, wxWindow *parent, int x, int y)
Definition: AudacityMessageBox.cpp:17
CompatibilityEntry::fmt
const wxChar * fmt
format, recognizable by guess_format()
Definition: ExportFFmpegDialogs.h:66
ExportFFmpegOptions::FetchFormatList
void FetchFormatList()
Retrieves format list from libavformat.
Definition: ExportFFmpegDialogs.cpp:1770
gPrefs
FileConfig * gPrefs
Definition: Prefs.cpp:70
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
ExportFFmpegOptions::FetchCodecList
void FetchCodecList()
Retrieves codec list from libavcodec.
Definition: ExportFFmpegDialogs.cpp:1791
FileTypes
static const FileNames::FileTypes & FileTypes()
Definition: ExportFFmpegDialogs.cpp:2277
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
Format
Abstract base class used in importing a file.
ShuttleGui::AddSpace
wxSizerItem * AddSpace(int width, int height, int prop=0)
Definition: ShuttleGui.cpp:2459
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
ExportFFmpegOptions::FetchCompatibleFormatList
int FetchCompatibleFormatList(AVCodecID id, wxString *selfmt)
Definition: ExportFFmpegDialogs.cpp:2128
ShuttleGuiBase::EndMultiColumn
void EndMultiColumn()
Definition: ShuttleGui.cpp:1238
PickFFmpegLibs
FFmpegLibs * PickFFmpegLibs()
Definition: FFmpeg.cpp:52
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
AV_CANMETA
#define AV_CANMETA
Definition: ExportFFmpegDialogs.h:45
ExportFFmpegOptions::mPresetNames
wxArrayStringEx mPresetNames
Definition: ExportFFmpegDialogs.h:260
ExportFFmpegOptions::ReportIfBadCombination
bool ReportIfBadCombination()
Definition: ExportFFmpegDialogs.cpp:2360
XXO
#define XXO(s)
Definition: Internat.h:44
eCancelButton
@ eCancelButton
Definition: ShuttleGui.h:601
ExportFFmpegOptions::DoOnFormatList
void DoOnFormatList()
Definition: ExportFFmpegDialogs.cpp:2439
ExportFFmpegOptions::mCodecList
wxListBox * mCodecList
Definition: ExportFFmpegDialogs.h:248
ShuttleGuiBase::StartMultiColumn
void StartMultiColumn(int nCols, int PositionFlags=wxALIGN_LEFT)
Definition: ShuttleGui.cpp:1229
ShuttleGuiBase::EndVerticalLay
void EndVerticalLay()
Definition: ShuttleGui.cpp:1203
FMT_OTHER
@ FMT_OTHER
Definition: ExportFFmpegDialogs.h:41
ExportFFmpegOptions::mFormatList
wxListBox * mFormatList
Definition: ExportFFmpegDialogs.h:247
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
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::mCodecName
wxStaticText * mCodecName
Definition: ExportFFmpegDialogs.h:251
format
int format
Definition: ExportPCM.cpp:56
anonymous_namespace{ExportFFmpegDialogs.cpp}::PredictionOrderMethodNames
const TranslatableStrings PredictionOrderMethodNames
Prediction order method - names.
Definition: ExportFFmpegDialogs.cpp:1719
ExportFFmpegOptions::mShownFormatNames
wxArrayString mShownFormatNames
Definition: ExportFFmpegDialogs.h:238
ShuttleGuiBase::TieSpinCtrl
wxSpinCtrl * TieSpinCtrl(const TranslatableString &Prompt, int &Value, const int max, const int min=0)
Definition: ShuttleGui.cpp:1645
ShuttleGuiBase::AddButton
wxButton * AddButton(const TranslatableString &Text, int PositionFlags=wxALIGN_CENTRE, bool setDefault=false)
Definition: ShuttleGui.cpp:360
ShuttleGuiBase::StartStatic
wxStaticBox * StartStatic(const TranslatableString &Str, int iProp=0)
Definition: ShuttleGui.cpp:893
eIsSavingToPrefs
@ eIsSavingToPrefs
Definition: ShuttleGui.h:48
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
FFmpegLibsInst
FFmpegLibs * FFmpegLibsInst()
Definition: FFmpeg.cpp:47
FileDialogWrapper
Definition: wxPanelWrapper.h:165
_
#define _(s)
Definition: Internat.h:75
ExportFFmpegOptions::PopulateOrExchange
void PopulateOrExchange(ShuttleGui &S)
Definition: ExportFFmpegDialogs.cpp:1814
ExportFFmpegOptions::EnableDisableControls
void EnableDisableControls(AVCodec *cdc, wxString *selfmt)
Definition: ExportFFmpegDialogs.cpp:2415
ExportFFmpegOptions::mFormatLongNames
wxArrayString mFormatLongNames
Definition: ExportFFmpegDialogs.h:243
ApplicableFor::control
int control
control ID
Definition: ExportFFmpegDialogs.h:199
DropFFmpegLibs
void DropFFmpegLibs()
Definition: FFmpeg.cpp:62
ExportFFmpegOptions::FetchCompatibleCodecList
int FetchCompatibleCodecList(const wxChar *fmt, AVCodecID id)
Definition: ExportFFmpegDialogs.cpp:2046
wxDialogWrapper::wxDialogWrapper
wxDialogWrapper()
Definition: wxPanelWrapper.h:84
ExportFFmpegOptions::mCodecLongNames
wxArrayString mCodecLongNames
Definition: ExportFFmpegDialogs.h:245
ShuttleGui::AddStandardButtons
void AddStandardButtons(long buttons=eOkButton|eCancelButton, wxWindow *extra=NULL)
Definition: ShuttleGui.cpp:2444
ExportFFmpegOptions::mFormatName
wxStaticText * mFormatName
Definition: ExportFFmpegDialogs.h:250
ShuttleGuiBase::SetBorder
void SetBorder(int Border)
Definition: ShuttleGui.h:489
wxDialogWrapper::SetName
void SetName()
Definition: wxPanelWrapper.cpp:81
ExportFFmpegOptions::mFormatNames
wxArrayStringEx mFormatNames
Definition: ExportFFmpegDialogs.h:242
eIsCreatingFromPrefs
@ eIsCreatingFromPrefs
Definition: ShuttleGui.h:47
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
ShuttleGuiBase::SetStretchyCol
void SetStretchyCol(int i)
Used to modify an already placed FlexGridSizer to make a column stretchy.
Definition: ShuttleGui.cpp:202
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
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
FMT_M4A
@ FMT_M4A
Definition: ExportFFmpegDialogs.h:36
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