Audacity 3.2.0
|
Custom FFmpeg export dialog. More...
#include <ExportFFmpegOptions.h>
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 | |
wxTabTraversalWrapper & | operator= (const wxTabTraversalWrapper &)=delete |
wxTabTraversalWrapper & | operator= (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 (AudacityAVCodecID id, wxString *selfmt) |
void | FetchCodecList () |
Retrieves codec list from libavcodec. More... | |
int | FetchCompatibleCodecList (const wxChar *fmt, AudacityAVCodecID id) |
void | FetchPresetList () |
Retrieves list of presets from configuration file. More... | |
bool | ReportIfBadCombination () |
void | EnableDisableControls (AVCodecWrapper *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< FFmpegPresets > | mPresets |
wxArrayStringEx | mPresetNames |
std::shared_ptr< FFmpegFunctions > | mFFmpeg |
Custom FFmpeg export dialog.
Definition at line 73 of file ExportFFmpegOptions.h.
ExportFFmpegOptions::ExportFFmpegOptions | ( | wxWindow * | parent | ) |
Definition at line 477 of file ExportFFmpegOptions.cpp.
References DoOnCodecList(), DoOnFormatList(), eIsCreatingFromPrefs, FetchCodecList(), FetchFormatList(), gPrefs, FFmpegFunctions::Load(), mCodecList, mFFmpeg, mFormatList, mPresetNames, mPresets, PopulateOrExchange(), audacity::BasicSettings::Read(), S, wxDialogWrapper::SetName(), audacity::ToUTF8(), and wxT().
ExportFFmpegOptions::~ExportFFmpegOptions | ( | ) |
Definition at line 473 of file ExportFFmpegOptions.cpp.
void ExportFFmpegOptions::DoOnCodecList | ( | ) |
Definition at line 1284 of file ExportFFmpegOptions.cpp.
References _, EnableDisableControls(), FetchCompatibleFormatList(), FindSelectedCodec(), FindSelectedFormat(), mCodecName, mFFmpeg, mFormatList, and wxT().
Referenced by ExportFFmpegOptions(), OnCodecList(), and OnLoadPreset().
void ExportFFmpegOptions::DoOnFormatList | ( | ) |
Definition at line 1234 of file ExportFFmpegOptions.cpp.
References _, AUDACITY_AV_CODEC_ID_NONE, EnableDisableControls(), FetchCompatibleCodecList(), FindSelectedCodec(), FindSelectedFormat(), mCodecList, mFFmpeg, mFormatName, and wxT().
Referenced by ExportFFmpegOptions(), OnFormatList(), and OnLoadPreset().
|
private |
Definition at line 1201 of file ExportFFmpegOptions.cpp.
References apptable, AUDACITY_AV_CODEC_ID_NONE, ApplicableFor::control, anonymous_namespace{ExportPCM.cpp}::format, AVCodecWrapper::GetId(), mFFmpeg, and wxT().
Referenced by DoOnCodecList(), and DoOnFormatList().
|
private |
Retrieves codec list from libavcodec.
Definition at line 535 of file ExportFFmpegOptions.cpp.
References AUDACITY_AV_CODEC_ID_MP2, mCodecLongNames, mCodecNames, mFFmpeg, mShownCodecLongNames, mShownCodecNames, and wxT().
Referenced by ExportFFmpegOptions().
|
private |
Retrieves a list of codecs compatible to format
fmt | Format short name |
id | id of the codec selected at the moment |
Definition at line 803 of file ExportFFmpegOptions.cpp.
References AUDACITY_AV_CODEC_ID_MP2, AUDACITY_AV_CODEC_ID_NONE, CompatibilityEntry::codec, CompatibilityList, CompatibilityEntry::fmt, anonymous_namespace{ExportPCM.cpp}::format, make_iterator_range(), mCodecList, mFFmpeg, mShownCodecLongNames, mShownCodecNames, str, and wxT().
Referenced by DoOnFormatList().
|
private |
Retrieves a list of formats compatible to codec
id | Codec ID |
selfmt | format selected at the moment |
Definition at line 897 of file ExportFFmpegOptions.cpp.
References AUDACITY_AV_CODEC_ID_NONE, CompatibilityList, CompatibilityEntry::fmt, mFFmpeg, mFormatList, mShownFormatLongNames, mShownFormatNames, audacity::ToUTF8(), and wxT().
Referenced by DoOnCodecList().
|
private |
Retrieves format list from libavformat.
Definition at line 513 of file ExportFFmpegOptions.cpp.
References AUDACITY_AV_CODEC_ID_NONE, mFFmpeg, mFormatLongNames, mFormatNames, mShownFormatLongNames, mShownFormatNames, and wxT().
Referenced by ExportFFmpegOptions().
|
private |
Retrieves list of presets from configuration file.
|
private |
Finds the codec currently selected and returns its name and description.
Definition at line 782 of file ExportFFmpegOptions.cpp.
References make_iterator_range(), mCodecList, mCodecLongNames, mCodecNames, and name.
Referenced by DoOnCodecList(), DoOnFormatList(), and ReportIfBadCombination().
|
private |
Finds the format currently selected and returns its name and description.
Definition at line 761 of file ExportFFmpegOptions.cpp.
References make_iterator_range(), mFormatList, mFormatLongNames, mFormatNames, and name.
Referenced by DoOnCodecList(), DoOnFormatList(), and ReportIfBadCombination().
void ExportFFmpegOptions::OnAllCodecs | ( | wxCommandEvent & | event | ) |
Definition at line 1125 of file ExportFFmpegOptions.cpp.
References mCodecList, mCodecLongNames, mCodecNames, mShownCodecLongNames, and mShownCodecNames.
void ExportFFmpegOptions::OnAllFormats | ( | wxCommandEvent & | event | ) |
Definition at line 1115 of file ExportFFmpegOptions.cpp.
References mFormatList, mFormatLongNames, mFormatNames, mShownFormatLongNames, and mShownFormatNames.
void ExportFFmpegOptions::OnCodecList | ( | wxCommandEvent & | event | ) |
Definition at line 1343 of file ExportFFmpegOptions.cpp.
References DoOnCodecList().
void ExportFFmpegOptions::OnDeletePreset | ( | wxCommandEvent & | event | ) |
Definition at line 976 of file ExportFFmpegOptions.cpp.
References AudacityMessageBox(), mPresetNames, mPresets, preset, and XO().
void ExportFFmpegOptions::OnExportPresets | ( | wxCommandEvent & | event | ) |
Definition at line 1085 of file ExportFFmpegOptions.cpp.
References AudacityMessageBox(), FileTypes(), FileDialog::GetPath(), gPrefs, mPresets, audacity::BasicSettings::Read(), SavePreset(), FileDialog::ShowModal(), wxT(), and XO().
void ExportFFmpegOptions::OnFormatList | ( | wxCommandEvent & | event | ) |
Definition at line 1336 of file ExportFFmpegOptions.cpp.
References DoOnFormatList().
void ExportFFmpegOptions::OnGetURL | ( | wxCommandEvent & | event | ) |
Definition at line 1372 of file ExportFFmpegOptions.cpp.
References HelpSystem::ShowHelp().
void ExportFFmpegOptions::OnImportPresets | ( | wxCommandEvent & | event | ) |
Definition at line 1066 of file ExportFFmpegOptions.cpp.
References FileTypes(), FileDialog::GetPath(), gPrefs, mPresetCombo, mPresetNames, mPresets, audacity::BasicSettings::Read(), FileDialog::ShowModal(), wxT(), and XO().
void ExportFFmpegOptions::OnLoadPreset | ( | wxCommandEvent & | event | ) |
Definition at line 1036 of file ExportFFmpegOptions.cpp.
References DoOnCodecList(), DoOnFormatList(), mCodecList, mCodecLongNames, mCodecNames, mFormatList, mFormatLongNames, mFormatNames, mPresets, mShownCodecLongNames, mShownCodecNames, mShownFormatLongNames, mShownFormatNames, and preset.
void ExportFFmpegOptions::OnOK | ( | wxCommandEvent & | event | ) |
Definition at line 1351 of file ExportFFmpegOptions.cpp.
References eIsSavingToPrefs, audacity::BasicSettings::Flush(), gPrefs, mCodecList, mFormatList, PopulateOrExchange(), ReportIfBadCombination(), S, audacity::BasicSettings::Write(), and wxT().
void ExportFFmpegOptions::OnSavePreset | ( | wxCommandEvent & | event | ) |
Definition at line 1004 of file ExportFFmpegOptions.cpp.
References SavePreset().
void ExportFFmpegOptions::PopulateOrExchange | ( | ShuttleGui & | S | ) |
Definition at line 561 of file ExportFFmpegOptions.cpp.
References AACProfiles, eCancelButton, eHelpButton, eOkButton, gPrefs, mCodecList, mCodecName, mCodecNames, mFormatList, mFormatName, mFormatNames, mPresetCombo, mPresetNames, anonymous_namespace{ExportFFmpegOptions.cpp}::PredictionOrderMethodNames, audacity::BasicSettings::Read(), S, safenew, wxT(), XO(), and XXO().
Referenced by ExportFFmpegOptions(), and OnOK().
|
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.
Definition at line 1140 of file ExportFFmpegOptions.cpp.
References AUDACITY_AV_CODEC_ID_NONE, AudacityMessageBox(), CompatibilityEntry::codec, CompatibilityList, FindSelectedCodec(), FindSelectedFormat(), CompatibilityEntry::fmt, mFFmpeg, and XO().
Referenced by OnOK().
bool ExportFFmpegOptions::SavePreset | ( | bool | bCheckForOverwrite | ) |
Definition at line 1010 of file ExportFFmpegOptions.cpp.
References AudacityMessageBox(), mPresetCombo, mPresetNames, mPresets, name, preset, and XO().
Referenced by OnExportPresets(), and OnSavePreset().
|
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 AUDACITY_AV_CODEC_ID_NONE - any codec This list must end with {FALSE,FFmpegExportCtrlID(0),AUDACITY_AV_CODEC_ID_NONE,NULL}
Definition at line 100 of file ExportFFmpegOptions.h.
Referenced by EnableDisableControls().
|
static |
Format-codec compatibility list Must end with NULL entry
Definition at line 97 of file ExportFFmpegOptions.h.
Referenced by FetchCompatibleCodecList(), FetchCompatibleFormatList(), and ReportIfBadCombination().
|
static |
List of export types.
Definition at line 98 of file ExportFFmpegOptions.h.
Referenced by AdjustFormatIndex(), ExportFFmpeg::ExportFFmpeg(), FFmpegExporter::Init(), FFmpegExporter::InitCodecs(), and FFmpegExportProcessor::Initialize().
|
static |
Definition at line 99 of file ExportFFmpegOptions.h.
|
private |
Definition at line 121 of file ExportFFmpegOptions.h.
|
private |
Definition at line 114 of file ExportFFmpegOptions.h.
Referenced by DoOnFormatList(), ExportFFmpegOptions(), FetchCompatibleCodecList(), FindSelectedCodec(), OnAllCodecs(), OnLoadPreset(), OnOK(), and PopulateOrExchange().
|
private |
Definition at line 111 of file ExportFFmpegOptions.h.
Referenced by FetchCodecList(), FindSelectedCodec(), OnAllCodecs(), and OnLoadPreset().
|
private |
Definition at line 117 of file ExportFFmpegOptions.h.
Referenced by DoOnCodecList(), and PopulateOrExchange().
|
private |
Definition at line 110 of file ExportFFmpegOptions.h.
Referenced by FetchCodecList(), FindSelectedCodec(), OnAllCodecs(), OnLoadPreset(), and PopulateOrExchange().
|
private |
Definition at line 128 of file ExportFFmpegOptions.h.
Referenced by DoOnCodecList(), DoOnFormatList(), EnableDisableControls(), ExportFFmpegOptions(), FetchCodecList(), FetchCompatibleCodecList(), FetchCompatibleFormatList(), FetchFormatList(), and ReportIfBadCombination().
|
private |
Definition at line 113 of file ExportFFmpegOptions.h.
Referenced by DoOnCodecList(), ExportFFmpegOptions(), FetchCompatibleFormatList(), FindSelectedFormat(), OnAllFormats(), OnLoadPreset(), OnOK(), and PopulateOrExchange().
|
private |
Definition at line 109 of file ExportFFmpegOptions.h.
Referenced by FetchFormatList(), FindSelectedFormat(), OnAllFormats(), and OnLoadPreset().
|
private |
Definition at line 116 of file ExportFFmpegOptions.h.
Referenced by DoOnFormatList(), and PopulateOrExchange().
|
private |
Definition at line 108 of file ExportFFmpegOptions.h.
Referenced by FetchFormatList(), FindSelectedFormat(), OnAllFormats(), OnLoadPreset(), and PopulateOrExchange().
|
private |
Definition at line 119 of file ExportFFmpegOptions.h.
Referenced by OnImportPresets(), PopulateOrExchange(), and SavePreset().
|
private |
Definition at line 126 of file ExportFFmpegOptions.h.
Referenced by ExportFFmpegOptions(), OnDeletePreset(), OnImportPresets(), PopulateOrExchange(), and SavePreset().
|
private |
Definition at line 124 of file ExportFFmpegOptions.h.
Referenced by ExportFFmpegOptions(), OnDeletePreset(), OnExportPresets(), OnImportPresets(), OnLoadPreset(), and SavePreset().
|
private |
Definition at line 122 of file ExportFFmpegOptions.h.
|
private |
Definition at line 107 of file ExportFFmpegOptions.h.
Referenced by FetchCodecList(), FetchCompatibleCodecList(), OnAllCodecs(), and OnLoadPreset().
|
private |
Definition at line 106 of file ExportFFmpegOptions.h.
Referenced by FetchCodecList(), FetchCompatibleCodecList(), OnAllCodecs(), and OnLoadPreset().
|
private |
Definition at line 105 of file ExportFFmpegOptions.h.
Referenced by FetchCompatibleFormatList(), FetchFormatList(), OnAllFormats(), and OnLoadPreset().
|
private |
Definition at line 104 of file ExportFFmpegOptions.h.
Referenced by FetchCompatibleFormatList(), FetchFormatList(), OnAllFormats(), and OnLoadPreset().