1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-17 00:20:06 +02:00

Add FFmpeg format/codec to Export options panel

This commit is contained in:
Leland Lucius 2020-03-30 19:37:06 -05:00
parent 4806c02e81
commit 8d3e6eb2ad
2 changed files with 22 additions and 2 deletions

View File

@ -778,7 +778,9 @@ BEGIN_EVENT_TABLE(ExportFFmpegCustomOptions, wxPanelWrapper)
END_EVENT_TABLE() END_EVENT_TABLE()
ExportFFmpegCustomOptions::ExportFFmpegCustomOptions(wxWindow *parent, int WXUNUSED(format)) ExportFFmpegCustomOptions::ExportFFmpegCustomOptions(wxWindow *parent, int WXUNUSED(format))
: wxPanelWrapper(parent, wxID_ANY) : wxPanelWrapper(parent, wxID_ANY),
mFormat(NULL),
mCodec(NULL)
{ {
ShuttleGui S(this, eIsCreatingFromPrefs); ShuttleGui S(this, eIsCreatingFromPrefs);
PopulateOrExchange(S); PopulateOrExchange(S);
@ -797,10 +799,19 @@ void ExportFFmpegCustomOptions::PopulateOrExchange(ShuttleGui & S)
{ {
S.StartHorizontalLay(wxCENTER); S.StartHorizontalLay(wxCENTER);
{ {
S.StartHorizontalLay(wxCENTER, 0); S.StartVerticalLay(wxCENTER, 0);
{ {
S.Id(OpenID).AddButton(XO("Open custom FFmpeg format options")); S.Id(OpenID).AddButton(XO("Open custom FFmpeg format options"));
S.StartMultiColumn(2, wxCENTER);
{
S.AddPrompt(XO("Current Format:"));
mFormat = S.Style(wxTE_READONLY).AddTextBox({}, wxT(""), 25);
S.AddPrompt(XO("Current Codec:"));
mCodec = S.Style(wxTE_READONLY).AddTextBox({}, wxT(""), 25);
}
S.EndMultiColumn();
} }
#
S.EndHorizontalLay(); S.EndHorizontalLay();
} }
S.EndHorizontalLay(); S.EndHorizontalLay();
@ -810,6 +821,11 @@ void ExportFFmpegCustomOptions::PopulateOrExchange(ShuttleGui & S)
/// ///
bool ExportFFmpegCustomOptions::TransferDataToWindow() bool ExportFFmpegCustomOptions::TransferDataToWindow()
{ {
if (mFormat)
{
mFormat->SetValue(gPrefs->Read(wxT("/FileFormats/FFmpegFormat"), wxT("")));
mCodec->SetValue(gPrefs->Read(wxT("/FileFormats/FFmpegCodec"), wxT("")));
}
return true; return true;
} }
@ -847,6 +863,8 @@ void ExportFFmpegCustomOptions::OnOpen(wxCommandEvent & WXUNUSED(evt))
ExportFFmpegOptions od(pWin); ExportFFmpegOptions od(pWin);
od.ShowModal(); od.ShowModal();
TransferDataToWindow();
} }
FFmpegPreset::FFmpegPreset() FFmpegPreset::FFmpegPreset()

View File

@ -190,6 +190,8 @@ public:
void OnOpen(wxCommandEvent & evt); void OnOpen(wxCommandEvent & evt);
private: private:
wxTextCtrl *mFormat;
wxTextCtrl *mCodec;
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };