Audacity 3.2.0
ExportFFmpegOptions.h
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 ExportFFmpegOptions.h
6
7 Audacity(R) is copyright (c) 1999-2010 Audacity Team.
8 License: GPL v2 or later. See License.txt.
9
10 LRN
11
12 Vitaly Sverchinsky split from ExportFFmpegDialogs.h
13
14**********************************************************************/
15
16#pragma once
17
18#include "FFmpegFunctions.h"
19#include "wxPanelWrapper.h"
20
21class FFmpegPresets;
22class ShuttleGui;
23class wxListBox;
24class wxStaticText;
25class wxComboBox;
26
29{
33#ifdef SHOW_FFMPEG_OPUS_EXPORT
34 FMT_OPUS,
35#endif
39};
40
43{
44 bool enable;
45 int control;
47 const char *format;
48};
49
52{
53 const wxChar *fmt;
55};
56
59{
61 const wxChar *name;
63 const wxChar *shortname;
64 unsigned maxchannels;
65 const int canmetadata;
66 bool canutf8;
70};
71
74{
75public:
76
77 ExportFFmpegOptions(wxWindow *parent);
80 void OnOK(wxCommandEvent& event);
81 void OnGetURL(wxCommandEvent& event);
82 void OnFormatList(wxCommandEvent& event);
83 void DoOnFormatList();
84 void OnCodecList(wxCommandEvent& event);
85 void DoOnCodecList();
86 void OnAllFormats(wxCommandEvent& event);
87 void OnAllCodecs(wxCommandEvent& event);
88 void OnSavePreset(wxCommandEvent& event);
89 void OnLoadPreset(wxCommandEvent& event);
90 void OnDeletePreset(wxCommandEvent& event);
91 void OnImportPresets(wxCommandEvent& event);
92 void OnExportPresets(wxCommandEvent& event);
93 bool SavePreset( bool bCheckForOverwrite);
94
95
96 // Static tables
99 static const int iAACSampleRates[];
101
102private:
103
104 wxArrayString mShownFormatNames;
106 wxArrayString mShownCodecNames;
107 wxArrayString mShownCodecLongNames;
109 wxArrayString mFormatLongNames;
111 wxArrayString mCodecLongNames;
112
113 wxListBox *mFormatList;
114 wxListBox *mCodecList;
115
116 wxStaticText *mFormatName;
117 wxStaticText *mCodecName;
118
119 wxComboBox *mPresetCombo;
120
123
124 std::unique_ptr<FFmpegPresets> mPresets;
125
127
128 std::shared_ptr<FFmpegFunctions> mFFmpeg;
129
131 void FindSelectedFormat(wxString **name, wxString **longname);
132
134 void FindSelectedCodec(wxString **name, wxString **longname);
135
137 void FetchFormatList();
138
143 int FetchCompatibleFormatList(AudacityAVCodecID id, wxString* selfmt);
144
146 void FetchCodecList();
147
152 int FetchCompatibleCodecList(const wxChar* fmt, AudacityAVCodecID id);
153
156
158
159
160 // Enables/disables controls based on format/codec combination,
161 // leaving only relevant controls enabled.
162 // Hiding the controls may have been a better idea,
163 // but it's hard to hide their text labels too
164 void EnableDisableControls(AVCodecWrapper *cdc, wxString *selfmt);
165 DECLARE_EVENT_TABLE()
166};
const TranslatableString name
Definition: Distortion.cpp:76
FFmpegExposedFormat
Identifiers for pre-set export types.
@ FMT_M4A
@ FMT_OTHER
@ FMT_AC3
@ FMT_WMA2
@ FMT_AMRNB
@ FMT_LAST
wxString FileExtension
File extension, not including any leading dot.
Definition: Identifier.h:224
#define S(N)
Definition: ToChars.cpp:64
Custom FFmpeg export dialog.
void OnExportPresets(wxCommandEvent &event)
void OnSavePreset(wxCommandEvent &event)
static const int iAACSampleRates[]
void OnImportPresets(wxCommandEvent &event)
void FetchPresetList()
Retrieves list of presets from configuration file.
void FindSelectedCodec(wxString **name, wxString **longname)
Finds the codec currently selected and returns its name and description.
wxArrayStringEx mCodecNames
void OnDeletePreset(wxCommandEvent &event)
wxArrayString mShownFormatLongNames
void FetchCodecList()
Retrieves codec list from libavcodec.
static CompatibilityEntry CompatibilityList[]
std::unique_ptr< FFmpegPresets > mPresets
int FetchCompatibleFormatList(AudacityAVCodecID id, wxString *selfmt)
void OnCodecList(wxCommandEvent &event)
void PopulateOrExchange(ShuttleGui &S)
void FindSelectedFormat(wxString **name, wxString **longname)
Finds the format currently selected and returns its name and description.
void OnLoadPreset(wxCommandEvent &event)
wxArrayStringEx mFormatNames
wxArrayString mShownCodecLongNames
wxArrayString mShownCodecNames
int FetchCompatibleCodecList(const wxChar *fmt, AudacityAVCodecID id)
wxArrayString mCodecLongNames
void OnFormatList(wxCommandEvent &event)
void OnAllFormats(wxCommandEvent &event)
wxStaticText * mFormatName
void OnOK(wxCommandEvent &event)
ExportFFmpegOptions(wxWindow *parent)
void OnAllCodecs(wxCommandEvent &event)
bool SavePreset(bool bCheckForOverwrite)
void FetchFormatList()
Retrieves format list from libavformat.
static ExposedFormat fmts[]
List of export types.
static ApplicableFor apptable[]
wxArrayString mShownFormatNames
void OnGetURL(wxCommandEvent &event)
wxArrayStringEx mPresetNames
void EnableDisableControls(AVCodecWrapper *cdc, wxString *selfmt)
std::shared_ptr< FFmpegFunctions > mFFmpeg
wxArrayString mFormatLongNames
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
Definition: ShuttleGui.h:640
Holds a msgid for the translation catalog; may also bind format arguments.
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
Entry for the Applicability table.
int control
control ID
AudacityAVCodecID codec
Codec ID.
bool enable
true if this control should be enabled, false otherwise
const char * format
Format short name.
Describes format-codec compatibility.
const wxChar * fmt
format, recognizable by guess_format()
AudacityAVCodecID codec
codec ID
Describes export type.
FFmpegExposedFormat fmtid
one of the FFmpegExposedFormat
bool compiledIn
support for this codec/format is compiled in (checked at runtime)
const wxChar * shortname
used to guess the format
const int canmetadata
!=0 if format supports metadata, AV_CANMETA any avformat version, otherwise version support added
const TranslatableString description
format description (will be shown in export dialog)
const FileExtension extension
default extension for this format. More extensions may be added later via AddExtension.
const wxChar * name
format name (internal, should be unique; if not - export dialog may show unusual behaviour)
bool canutf8
true if format supports metadata in UTF-8, false otherwise
AudacityAVCodecID codecid
codec ID (see libavcodec/avcodec.h)
unsigned maxchannels
how many channels this format could handle