mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-04 01:29:43 +02:00
This should fix bug #1111
In addition it adds an option to open the full FFmpeg options dialog.
This commit is contained in:
parent
4cd7757cf4
commit
617e0713df
@ -297,7 +297,6 @@ END_EVENT_TABLE()
|
||||
|
||||
Exporter::Exporter()
|
||||
{
|
||||
mActivePage = NULL;
|
||||
mMixerSpec = NULL;
|
||||
|
||||
SetFileDialogTitle( _("Export Audio") );
|
||||
@ -871,37 +870,22 @@ void Exporter::CreateUserPaneCallback(wxWindow *parent, wxUIntPtr userdata)
|
||||
|
||||
void Exporter::CreateUserPane(wxWindow *parent)
|
||||
{
|
||||
mUserPaneParent = parent;
|
||||
|
||||
ShuttleGui S(parent, eIsCreatingFromPrefs);
|
||||
|
||||
wxSize maxsz;
|
||||
wxSize pageMax;
|
||||
|
||||
S.StartVerticalLay();
|
||||
{
|
||||
S.StartHorizontalLay(wxEXPAND);
|
||||
{
|
||||
S.StartStatic(_("Format Options"), 1);
|
||||
{
|
||||
mBook = new wxSimplebook(parent);
|
||||
S.AddWindow(mBook, wxEXPAND);
|
||||
|
||||
for (size_t i = 0; i < mPlugins.GetCount(); i++)
|
||||
{
|
||||
for (int j = 0; j < mPlugins[i]->GetFormatCount(); j++)
|
||||
{
|
||||
wxWindow *page = mPlugins[i]->OptionsCreate(parent, j);
|
||||
mPages.Add(page);
|
||||
S.Prop(1).AddWindow(page, wxEXPAND|wxALL);
|
||||
|
||||
parent->Layout();
|
||||
wxSize sz = parent->GetBestSize();
|
||||
maxsz.x = wxMax(maxsz.x, sz.x);
|
||||
maxsz.y = wxMax(maxsz.y, sz.y);
|
||||
|
||||
sz = page->GetBestSize();
|
||||
pageMax.x = wxMax(pageMax.x, sz.x);
|
||||
pageMax.y = wxMax(pageMax.y, sz.y);
|
||||
|
||||
S.GetSizer()->Hide(page);
|
||||
mBook->AddPage(mPlugins[i]->OptionsCreate(mBook, j), wxEmptyString);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -911,14 +895,6 @@ void Exporter::CreateUserPane(wxWindow *parent)
|
||||
}
|
||||
S.EndHorizontalLay();
|
||||
|
||||
parent->SetMinSize(maxsz);
|
||||
parent->SetSize(maxsz);
|
||||
|
||||
for (size_t i = 0, cnt = mPages.GetCount(); i < cnt; i++)
|
||||
{
|
||||
mPages[i]->SetSize(pageMax);
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
@ -926,20 +902,12 @@ void Exporter::OnFilterChanged(wxFileCtrlEvent & evt)
|
||||
{
|
||||
int index = evt.GetFilterIndex();
|
||||
|
||||
if (index < 0 || index >= (int) mPages.GetCount())
|
||||
if (index < 0 || index >= (int) mBook->GetPageCount())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (mActivePage)
|
||||
{
|
||||
mActivePage->Hide();
|
||||
mActivePage = NULL;
|
||||
}
|
||||
|
||||
mActivePage = mPages[index];
|
||||
mActivePage->Show();
|
||||
mUserPaneParent->Layout();
|
||||
mBook->ChangeSelection(index);
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <wx/dynarray.h>
|
||||
#include <wx/filename.h>
|
||||
#include <wx/panel.h>
|
||||
#include <wx/simplebook.h>
|
||||
#include "../Tags.h"
|
||||
#include "../SampleFormat.h"
|
||||
|
||||
@ -194,9 +195,7 @@ private:
|
||||
int mChannels;
|
||||
bool mSelectedOnly;
|
||||
|
||||
wxWindow *mUserPaneParent;
|
||||
WindowPtrArray mPages;
|
||||
wxWindow *mActivePage;
|
||||
wxSimplebook *mBook;
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
@ -46,6 +46,8 @@ public:
|
||||
virtual ~ExportCLOptions();
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
void OnBrowse(wxCommandEvent & event);
|
||||
|
||||
@ -79,24 +81,16 @@ ExportCLOptions::ExportCLOptions(wxWindow *parent, int WXUNUSED(format))
|
||||
false);
|
||||
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
|
||||
PopulateOrExchange(S);
|
||||
|
||||
TransferDataToWindow();
|
||||
|
||||
parent->Layout();
|
||||
}
|
||||
|
||||
ExportCLOptions::~ExportCLOptions()
|
||||
{
|
||||
wxString cmd = mCmd->GetValue();
|
||||
|
||||
gPrefs->Write(wxT("/FileFormats/ExternalProgramExportCommand"), cmd);
|
||||
gPrefs->Flush();
|
||||
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
mHistory.AddFileToHistory(cmd, false);
|
||||
mHistory.Save(*gPrefs, wxT("/FileFormats/ExternalProgramHistory"));
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
///
|
||||
@ -136,9 +130,31 @@ void ExportCLOptions::PopulateOrExchange(ShuttleGui & S)
|
||||
S.AddTitle(_("Data will be piped to standard in. \"%f\" uses the file name in the export window."));
|
||||
}
|
||||
S.EndVerticalLay();
|
||||
}
|
||||
|
||||
// Layout();
|
||||
// Fit();
|
||||
///
|
||||
///
|
||||
bool ExportCLOptions::TransferDataToWindow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportCLOptions::TransferDataFromWindow()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
wxString cmd = mCmd->GetValue();
|
||||
|
||||
mHistory.AddFileToHistory(cmd, false);
|
||||
mHistory.Save(*gPrefs, wxT("/FileFormats/ExternalProgramHistory"));
|
||||
|
||||
gPrefs->Write(wxT("/FileFormats/ExternalProgramExportCommand"), cmd);
|
||||
gPrefs->Flush();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
|
@ -1002,12 +1002,7 @@ wxWindow *ExportFFmpeg::OptionsCreate(wxWindow *parent, int format)
|
||||
}
|
||||
else if (mSubFormat == FMT_OTHER)
|
||||
{
|
||||
return ExportPlugin::OptionsCreate(parent, format);
|
||||
#if 0
|
||||
ExportFFmpegOptions od(parent);
|
||||
od.ShowModal();
|
||||
return true;
|
||||
#endif
|
||||
return new ExportFFmpegCustomOptions(parent, format);
|
||||
}
|
||||
|
||||
return ExportPlugin::OptionsCreate(parent, format);
|
||||
|
@ -152,12 +152,13 @@ ExportFFmpegAC3Options::ExportFFmpegAC3Options(wxWindow *parent, int WXUNUSED(fo
|
||||
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
TransferDataToWindow();
|
||||
}
|
||||
|
||||
ExportFFmpegAC3Options::~ExportFFmpegAC3Options()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
///
|
||||
@ -180,6 +181,25 @@ void ExportFFmpegAC3Options::PopulateOrExchange(ShuttleGui & S)
|
||||
S.EndVerticalLay();
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFFmpegAC3Options::TransferDataToWindow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFFmpegAC3Options::TransferDataFromWindow()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
gPrefs->Flush();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ExportFFmpegAACOptions Class
|
||||
//----------------------------------------------------------------------------
|
||||
@ -189,12 +209,13 @@ ExportFFmpegAACOptions::ExportFFmpegAACOptions(wxWindow *parent, int WXUNUSED(fo
|
||||
{
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
TransferDataToWindow();
|
||||
}
|
||||
|
||||
ExportFFmpegAACOptions::~ExportFFmpegAACOptions()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
///
|
||||
@ -218,6 +239,25 @@ void ExportFFmpegAACOptions::PopulateOrExchange(ShuttleGui & S)
|
||||
S.EndVerticalLay();
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFFmpegAACOptions::TransferDataToWindow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFFmpegAACOptions::TransferDataFromWindow()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
gPrefs->Flush();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ExportFFmpegAMRNBOptions Class
|
||||
//----------------------------------------------------------------------------
|
||||
@ -238,12 +278,13 @@ ExportFFmpegAMRNBOptions::ExportFFmpegAMRNBOptions(wxWindow *parent, int WXUNUSE
|
||||
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
TransferDataToWindow();
|
||||
}
|
||||
|
||||
ExportFFmpegAMRNBOptions::~ExportFFmpegAMRNBOptions()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
///
|
||||
@ -266,6 +307,25 @@ void ExportFFmpegAMRNBOptions::PopulateOrExchange(ShuttleGui & S)
|
||||
S.EndVerticalLay();
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFFmpegAMRNBOptions::TransferDataToWindow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFFmpegAMRNBOptions::TransferDataFromWindow()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
gPrefs->Flush();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ExportFFmpegWMAOptions Class
|
||||
//----------------------------------------------------------------------------
|
||||
@ -288,12 +348,13 @@ ExportFFmpegWMAOptions::ExportFFmpegWMAOptions(wxWindow *parent, int WXUNUSED(fo
|
||||
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
TransferDataToWindow();
|
||||
}
|
||||
|
||||
ExportFFmpegWMAOptions::~ExportFFmpegWMAOptions()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
///
|
||||
@ -316,6 +377,86 @@ void ExportFFmpegWMAOptions::PopulateOrExchange(ShuttleGui & S)
|
||||
S.EndVerticalLay();
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFFmpegWMAOptions::TransferDataToWindow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFFmpegWMAOptions::TransferDataFromWindow()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
gPrefs->Flush();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ExportFFmpegCustomOptions Class
|
||||
//----------------------------------------------------------------------------
|
||||
|
||||
#define OpenID 9000
|
||||
|
||||
BEGIN_EVENT_TABLE(ExportFFmpegCustomOptions, wxPanel)
|
||||
EVT_BUTTON(OpenID, ExportFFmpegCustomOptions::OnOpen)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
ExportFFmpegCustomOptions::ExportFFmpegCustomOptions(wxWindow *parent, int WXUNUSED(format))
|
||||
: wxPanel(parent, wxID_ANY)
|
||||
{
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
TransferDataToWindow();
|
||||
}
|
||||
|
||||
ExportFFmpegCustomOptions::~ExportFFmpegCustomOptions()
|
||||
{
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
void ExportFFmpegCustomOptions::PopulateOrExchange(ShuttleGui & S)
|
||||
{
|
||||
S.StartHorizontalLay(wxCENTER);
|
||||
{
|
||||
S.StartHorizontalLay(wxCENTER, 0);
|
||||
{
|
||||
S.Id(OpenID).AddButton(_("Open custom FFmpeg format options"));
|
||||
}
|
||||
S.EndHorizontalLay();
|
||||
}
|
||||
S.EndHorizontalLay();
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFFmpegCustomOptions::TransferDataToWindow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFFmpegCustomOptions::TransferDataFromWindow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
void ExportFFmpegCustomOptions::OnOpen(wxCommandEvent & WXUNUSED(evt))
|
||||
{
|
||||
ExportFFmpegOptions od(wxGetTopLevelParent(this));
|
||||
od.ShowModal();
|
||||
}
|
||||
|
||||
FFmpegPreset::FFmpegPreset(wxString &name)
|
||||
{
|
||||
mPresetName = name;
|
||||
|
@ -63,7 +63,11 @@ public:
|
||||
|
||||
ExportFFmpegAC3Options(wxWindow *parent, int format);
|
||||
virtual ~ExportFFmpegAC3Options();
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
/// Bit Rates supported by AC3 encoder
|
||||
static const int iAC3BitRates[];
|
||||
/// Sample Rates supported by AC3 encoder (must end with zero-element)
|
||||
@ -85,7 +89,10 @@ public:
|
||||
|
||||
ExportFFmpegAACOptions(wxWindow *parent, int format);
|
||||
virtual ~ExportFFmpegAACOptions();
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
private:
|
||||
|
||||
@ -98,7 +105,10 @@ public:
|
||||
|
||||
ExportFFmpegAMRNBOptions(wxWindow *parent, int format);
|
||||
virtual ~ExportFFmpegAMRNBOptions();
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
static int iAMRNBBitRate[];
|
||||
|
||||
@ -117,7 +127,10 @@ public:
|
||||
|
||||
ExportFFmpegWMAOptions(wxWindow *parent, int format);
|
||||
~ExportFFmpegWMAOptions();
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
static const int iWMASampleRates[];
|
||||
static const int iWMABitRate[];
|
||||
@ -131,6 +144,24 @@ private:
|
||||
int mBitRateFromChoice;
|
||||
};
|
||||
|
||||
class ExportFFmpegCustomOptions : public wxPanel
|
||||
{
|
||||
public:
|
||||
|
||||
ExportFFmpegCustomOptions(wxWindow *parent, int format);
|
||||
~ExportFFmpegCustomOptions();
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
void OnOpen(wxCommandEvent & evt);
|
||||
|
||||
private:
|
||||
|
||||
DECLARE_EVENT_TABLE();
|
||||
};
|
||||
|
||||
/// Entry for the Applicability table
|
||||
struct ApplicableFor
|
||||
{
|
||||
|
@ -52,7 +52,11 @@ class ExportFLACOptions : public wxPanel
|
||||
public:
|
||||
|
||||
ExportFLACOptions(wxWindow *parent, int format);
|
||||
virtual ~ExportFLACOptions();
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
};
|
||||
|
||||
///
|
||||
@ -62,6 +66,15 @@ ExportFLACOptions::ExportFLACOptions(wxWindow *parent, int WXUNUSED(format))
|
||||
{
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
TransferDataToWindow();
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
ExportFLACOptions::~ExportFLACOptions()
|
||||
{
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
///
|
||||
@ -103,6 +116,25 @@ void ExportFLACOptions::PopulateOrExchange(ShuttleGui & S)
|
||||
return;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFLACOptions::TransferDataToWindow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportFLACOptions::TransferDataFromWindow()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
gPrefs->Flush();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ExportFLAC Class
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -86,8 +86,11 @@ class ExportMP2Options : public wxPanel
|
||||
{
|
||||
public:
|
||||
ExportMP2Options(wxWindow *parent, int format);
|
||||
virtual ~ExportMP2Options();
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
private:
|
||||
wxArrayString mBitRateNames;
|
||||
@ -107,6 +110,15 @@ ExportMP2Options::ExportMP2Options(wxWindow *parent, int WXUNUSED(format))
|
||||
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
TransferDataToWindow();
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
ExportMP2Options::~ExportMP2Options()
|
||||
{
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
///
|
||||
@ -129,6 +141,25 @@ void ExportMP2Options::PopulateOrExchange(ShuttleGui & S)
|
||||
S.EndVerticalLay();
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportMP2Options::TransferDataToWindow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportMP2Options::TransferDataFromWindow()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
gPrefs->Flush();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ExportMP2
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -267,6 +267,9 @@ public:
|
||||
virtual ~ExportMP3Options();
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
void OnSET(wxCommandEvent& evt);
|
||||
void OnVBR(wxCommandEvent& evt);
|
||||
void OnABR(wxCommandEvent& evt);
|
||||
@ -312,25 +315,15 @@ ExportMP3Options::ExportMP3Options(wxWindow *parent, int WXUNUSED(format))
|
||||
{
|
||||
InitMP3_Statics();
|
||||
|
||||
mSetRate = gPrefs->Read(wxT("/FileFormats/MP3SetRate"), PRESET_STANDARD);
|
||||
mVbrRate = gPrefs->Read(wxT("/FileFormats/MP3VbrRate"), QUALITY_4);
|
||||
mAbrRate = gPrefs->Read(wxT("/FileFormats/MP3AbrRate"), 128);
|
||||
mCbrRate = gPrefs->Read(wxT("/FileFormats/MP3CbrRate"), 128);
|
||||
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
TransferDataToWindow();
|
||||
}
|
||||
|
||||
ExportMP3Options::~ExportMP3Options()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
gPrefs->Write(wxT("/FileFormats/MP3SetRate"), mSetRate);
|
||||
gPrefs->Write(wxT("/FileFormats/MP3VbrRate"), mVbrRate);
|
||||
gPrefs->Write(wxT("/FileFormats/MP3AbrRate"), mAbrRate);
|
||||
gPrefs->Write(wxT("/FileFormats/MP3CbrRate"), mCbrRate);
|
||||
gPrefs->Flush();
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
///
|
||||
@ -425,6 +418,32 @@ void ExportMP3Options::PopulateOrExchange(ShuttleGui & S)
|
||||
S.EndVerticalLay();
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportMP3Options::TransferDataToWindow()
|
||||
{
|
||||
mSetRate = gPrefs->Read(wxT("/FileFormats/MP3SetRate"), PRESET_STANDARD);
|
||||
mVbrRate = gPrefs->Read(wxT("/FileFormats/MP3VbrRate"), QUALITY_4);
|
||||
mAbrRate = gPrefs->Read(wxT("/FileFormats/MP3AbrRate"), 128);
|
||||
mCbrRate = gPrefs->Read(wxT("/FileFormats/MP3CbrRate"), 128);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ExportMP3Options::TransferDataFromWindow()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
gPrefs->Write(wxT("/FileFormats/MP3SetRate"), mSetRate);
|
||||
gPrefs->Write(wxT("/FileFormats/MP3VbrRate"), mVbrRate);
|
||||
gPrefs->Write(wxT("/FileFormats/MP3AbrRate"), mAbrRate);
|
||||
gPrefs->Write(wxT("/FileFormats/MP3CbrRate"), mCbrRate);
|
||||
gPrefs->Flush();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
void ExportMP3Options::OnSET(wxCommandEvent& WXUNUSED(event))
|
||||
|
@ -79,7 +79,7 @@ enum {
|
||||
|
||||
BEGIN_EVENT_TABLE(ExportMultiple, wxDialog)
|
||||
EVT_CHOICE(FormatID, ExportMultiple::OnFormat)
|
||||
EVT_BUTTON(OptionsID, ExportMultiple::OnOptions)
|
||||
// EVT_BUTTON(OptionsID, ExportMultiple::OnOptions)
|
||||
EVT_BUTTON(CreateID, ExportMultiple::OnCreate)
|
||||
EVT_BUTTON(ChooseID, ExportMultiple::OnChoose)
|
||||
EVT_BUTTON(wxID_OK, ExportMultiple::OnExport)
|
||||
@ -115,6 +115,8 @@ ExportMultiple::ExportMultiple(AudacityProject *project)
|
||||
|
||||
this->CountTracksAndLabels();
|
||||
|
||||
mBook = NULL;
|
||||
|
||||
// create array of characters not allowed in file names
|
||||
wxString forbid = wxFileName::GetForbiddenChars();
|
||||
for(unsigned int i=0; i < forbid.Length(); i++)
|
||||
@ -244,82 +246,110 @@ void ExportMultiple::PopulateOrExchange(ShuttleGui& S)
|
||||
|
||||
|
||||
S.SetBorder(5);
|
||||
S.StartMultiColumn(4, true);
|
||||
{
|
||||
wxArrayString formats;
|
||||
|
||||
for (size_t i = 0; i < mPlugins.GetCount(); i++) {
|
||||
for (int j = 0; j < mPlugins[i]->GetFormatCount(); j++)
|
||||
{
|
||||
formats.Add(mPlugins[i]->GetDescription(j));
|
||||
}
|
||||
}
|
||||
|
||||
mFormat = S.Id(FormatID)
|
||||
.TieChoice(_("Export format:"),
|
||||
wxT("/Export/MultipleFormat"),
|
||||
mPlugins[mPluginIndex]->GetFormat(mSubFormatIndex),
|
||||
formats,
|
||||
formats);
|
||||
S.Id(OptionsID).AddButton(_("Options..."));
|
||||
S.AddVariableText(wxT(""), false);
|
||||
|
||||
mDir = S.Id(DirID)
|
||||
.TieTextBox(_("Export location:"),
|
||||
wxT("/Export/MultiplePath"),
|
||||
gPrefs->Read(wxT("/Export/Path"), ::wxGetCwd()),
|
||||
64);
|
||||
S.Id(ChooseID).AddButton(_("Choose..."));
|
||||
S.Id(CreateID).AddButton(_("Create"));
|
||||
}
|
||||
S.EndMultiColumn();
|
||||
|
||||
S.StartHorizontalLay(wxEXPAND, true);
|
||||
{
|
||||
S.SetBorder(5);
|
||||
S.StartStatic(_("Split files based on:"), true);
|
||||
S.StartStatic(_("Export files to:"), true);
|
||||
{
|
||||
S.StartMultiColumn(4, true);
|
||||
{
|
||||
mDir = S.Id(DirID)
|
||||
.TieTextBox(_("Folder:"),
|
||||
wxT("/Export/MultiplePath"),
|
||||
gPrefs->Read(wxT("/Export/Path"), ::wxGetCwd()),
|
||||
64);
|
||||
S.Id(ChooseID).AddButton(_("Choose..."));
|
||||
S.Id(CreateID).AddButton(_("Create"));
|
||||
|
||||
wxArrayString formats;
|
||||
|
||||
for (size_t i = 0; i < mPlugins.GetCount(); i++) {
|
||||
for (int j = 0; j < mPlugins[i]->GetFormatCount(); j++)
|
||||
{
|
||||
formats.Add(mPlugins[i]->GetDescription(j));
|
||||
}
|
||||
}
|
||||
|
||||
mFormat = S.Id(FormatID)
|
||||
.TieChoice(_("Format:"),
|
||||
wxT("/Export/MultipleFormat"),
|
||||
mPlugins[mPluginIndex]->GetFormat(mSubFormatIndex),
|
||||
formats,
|
||||
formats);
|
||||
S.AddVariableText(wxT(""), false);
|
||||
S.AddVariableText(wxT(""), false);
|
||||
|
||||
S.AddPrompt(_("Options:"));
|
||||
if (!mBook)
|
||||
{
|
||||
mBook = new wxSimplebook(S.GetParent(), OptionsID, wxDefaultPosition, wxDefaultSize, wxBORDER_STATIC);
|
||||
for (size_t i = 0; i < mPlugins.GetCount(); i++)
|
||||
{
|
||||
for (int j = 0; j < mPlugins[i]->GetFormatCount(); j++)
|
||||
{
|
||||
mBook->AddPage(mPlugins[i]->OptionsCreate(mBook, j), wxEmptyString);
|
||||
}
|
||||
}
|
||||
mBook->ChangeSelection(mFormat->GetSelection());
|
||||
}
|
||||
S.AddWindow(mBook);
|
||||
S.AddVariableText(wxT(""), false);
|
||||
S.AddVariableText(wxT(""), false);
|
||||
}
|
||||
S.EndMultiColumn();
|
||||
}
|
||||
S.EndStatic();
|
||||
}
|
||||
S.EndHorizontalLay();
|
||||
|
||||
S.StartHorizontalLay(wxEXPAND, false);
|
||||
{
|
||||
S.SetBorder(5);
|
||||
S.StartStatic(_("Split files based on:"), 1);
|
||||
{
|
||||
// Row 1
|
||||
S.SetBorder(1);
|
||||
mLabel = S.Id(LabelID).AddRadioButton(wxString(_("Labels")));
|
||||
mTrack = S.Id(TrackID)
|
||||
.AddRadioButton(wxString(_("Tracks")));
|
||||
mTrack->SetName(_("Tracks"));
|
||||
|
||||
// Row 2
|
||||
S.SetBorder(1);
|
||||
mLabel = S.Id(LabelID).AddRadioButtonToGroup(wxString(_("Labels")));
|
||||
mLabel->SetName(_("Labels"));
|
||||
S.SetBorder(3);
|
||||
|
||||
S.StartMultiColumn(2, false);
|
||||
S.StartMultiColumn(2, wxEXPAND);
|
||||
S.SetStretchyCol(1);
|
||||
{
|
||||
// Row 2 (indented)
|
||||
// Row 3 (indented)
|
||||
S.AddVariableText(wxT(" "), false);
|
||||
mFirst = S.Id(FirstID)
|
||||
.AddCheckBox(_("Include audio before first label"), wxT("false"));
|
||||
|
||||
// Row 3
|
||||
// Row 4
|
||||
S.AddVariableText(wxT(""), false);
|
||||
S.StartHorizontalLay(wxEXPAND, false);
|
||||
S.StartMultiColumn(2, wxEXPAND);
|
||||
S.SetStretchyCol(1);
|
||||
{
|
||||
mFirstFileLabel = S.AddVariableText(_("First file name:"), true);
|
||||
mFirstFileLabel = S.AddVariableText(_("First file name:"), false);
|
||||
mFirstFileName = S.Id(FirstFileNameID)
|
||||
.TieTextBox(wxT(""),
|
||||
.Prop(1).TieTextBox(wxT(""),
|
||||
name,
|
||||
30);
|
||||
mFirstFileName->SetName(_("First file name"));
|
||||
}
|
||||
S.EndHorizontalLay();
|
||||
S.EndMultiColumn();
|
||||
}
|
||||
S.EndMultiColumn();
|
||||
|
||||
// Row 4
|
||||
S.SetBorder(1);
|
||||
mTrack = S.Id(TrackID)
|
||||
.AddRadioButtonToGroup(wxString(_("Tracks")));
|
||||
mTrack->SetName(_("Tracks"));
|
||||
S.SetBorder(3);
|
||||
}
|
||||
S.EndStatic();
|
||||
|
||||
S.SetBorder(5);
|
||||
S.StartStatic(_("Name files:"), false);
|
||||
{
|
||||
S.StartStatic(_("Name files:"), 1);
|
||||
{
|
||||
S.SetBorder(2);
|
||||
S.StartRadioButtonGroup(wxT("/Export/TrackNameWithOrWithoutNumbers"), wxT("labelTrack"));
|
||||
{
|
||||
@ -334,16 +364,19 @@ void ExportMultiple::PopulateOrExchange(ShuttleGui& S)
|
||||
}
|
||||
S.EndRadioButtonGroup();
|
||||
|
||||
S.StartHorizontalLay(wxEXPAND, false);
|
||||
S.StartMultiColumn(3, wxEXPAND);
|
||||
S.SetStretchyCol(2);
|
||||
{
|
||||
mPrefixLabel = S.AddVariableText(_("File name prefix:"), true);
|
||||
// Row 3 (indented)
|
||||
S.AddVariableText(wxT(" "), false);
|
||||
mPrefixLabel = S.AddVariableText(_("File name prefix:"), false);
|
||||
mPrefix = S.Id(PrefixID)
|
||||
.TieTextBox(wxT(""),
|
||||
name,
|
||||
30);
|
||||
mPrefix->SetName(_("File name prefix"));
|
||||
}
|
||||
S.EndHorizontalLay();
|
||||
S.EndMultiColumn();
|
||||
}
|
||||
S.EndStatic();
|
||||
}
|
||||
@ -400,6 +433,8 @@ void ExportMultiple::EnableControls()
|
||||
|
||||
void ExportMultiple::OnFormat(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
mBook->ChangeSelection(mFormat->GetSelection());
|
||||
|
||||
EnableControls();
|
||||
}
|
||||
|
||||
@ -507,20 +542,19 @@ void ExportMultiple::OnExport(wxCommandEvent& WXUNUSED(event))
|
||||
mFilterIndex = mFormat->GetSelection();
|
||||
if (mFilterIndex != wxNOT_FOUND)
|
||||
{
|
||||
size_t c = 0;
|
||||
for (size_t i = 0; i < mPlugins.GetCount(); i++)
|
||||
{
|
||||
for (int j = 0; j < mPlugins[i]->GetFormatCount(); j++)
|
||||
{
|
||||
if ((size_t)mFilterIndex == c)
|
||||
{ // this is the selected format. Store the plug-in and sub-format
|
||||
// needed to acheive it.
|
||||
mPluginIndex = i;
|
||||
mSubFormatIndex = j;
|
||||
for (size_t c = 0, i = 0; i < mPlugins.GetCount(); i++)
|
||||
{
|
||||
for (int j = 0; j < mPlugins[i]->GetFormatCount(); j++, c++)
|
||||
{
|
||||
if ((size_t)mFilterIndex == c)
|
||||
{ // this is the selected format. Store the plug-in and sub-format
|
||||
// needed to acheive it.
|
||||
mPluginIndex = i;
|
||||
mSubFormatIndex = j;
|
||||
mBook->GetPage(mFilterIndex)->TransferDataFromWindow();
|
||||
}
|
||||
}
|
||||
c++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// bool overwrite = mOverwrite->GetValue();
|
||||
@ -955,6 +989,7 @@ wxString ExportMultiple::MakeFileName(wxString input)
|
||||
} // phew - end of file name sanitisation procedure
|
||||
return newname;
|
||||
}
|
||||
|
||||
void SuccessDialog::OnKeyDown(wxListEvent& event)
|
||||
{
|
||||
if (event.GetKeyCode() == WXK_RETURN)
|
||||
|
@ -15,6 +15,7 @@
|
||||
#include <wx/string.h>
|
||||
#include <wx/dynarray.h> // sadly we are using wx dynamic arrays
|
||||
#include <wx/listctrl.h>
|
||||
#include <wx/simplebook.h>
|
||||
|
||||
#include "Export.h"
|
||||
#include "../Tags.h" // we need to know about the Tags class for metadata
|
||||
@ -162,6 +163,8 @@ private:
|
||||
wxButton *mCancel;
|
||||
wxButton *mExport;
|
||||
|
||||
wxSimplebook *mBook;
|
||||
|
||||
DECLARE_EVENT_TABLE()
|
||||
|
||||
};
|
||||
|
@ -48,7 +48,10 @@ public:
|
||||
|
||||
ExportOGGOptions(wxWindow *parent, int format);
|
||||
virtual ~ExportOGGOptions();
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
private:
|
||||
|
||||
@ -64,15 +67,13 @@ ExportOGGOptions::ExportOGGOptions(wxWindow *parent, int WXUNUSED(format))
|
||||
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
TransferDataToWindow();
|
||||
}
|
||||
|
||||
ExportOGGOptions::~ExportOGGOptions()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
gPrefs->Write(wxT("/FileFormats/OggExportQuality"),mOggQualityUnscaled * 10);
|
||||
gPrefs->Flush();
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
///
|
||||
@ -96,6 +97,26 @@ void ExportOGGOptions::PopulateOrExchange(ShuttleGui & S)
|
||||
S.EndVerticalLay();
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportOGGOptions::TransferDataToWindow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportOGGOptions::TransferDataFromWindow()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
gPrefs->Write(wxT("/FileFormats/OggExportQuality"),mOggQualityUnscaled * 10);
|
||||
gPrefs->Flush();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
//----------------------------------------------------------------------------
|
||||
// ExportOGG
|
||||
//----------------------------------------------------------------------------
|
||||
|
@ -98,7 +98,11 @@ public:
|
||||
|
||||
ExportPCMOptions(wxWindow *parent, int format);
|
||||
virtual ~ExportPCMOptions();
|
||||
|
||||
void PopulateOrExchange(ShuttleGui & S);
|
||||
bool TransferDataToWindow();
|
||||
bool TransferDataFromWindow();
|
||||
|
||||
void OnHeaderChoice(wxCommandEvent & evt);
|
||||
|
||||
private:
|
||||
@ -148,10 +152,9 @@ ExportPCMOptions::ExportPCMOptions(wxWindow *parent, int selformat)
|
||||
for (int i = 0, sel = 0, num = sf_num_encodings(); i < num; i++) {
|
||||
int enc = sf_encoding_index_to_subtype(i);
|
||||
int fmt = (format & SF_FORMAT_TYPEMASK) | enc;
|
||||
bool valid = ValidatePair(fmt);
|
||||
bool valid = ValidatePair(fmt);
|
||||
if (valid)
|
||||
{
|
||||
|
||||
mEncodingNames.Add(sf_encoding_index_name(i));
|
||||
mEncodingFormats.Add(enc);
|
||||
if ((format & SF_FORMAT_SUBMASK) == (int)sf_encoding_index_to_subtype(i))
|
||||
@ -163,11 +166,13 @@ ExportPCMOptions::ExportPCMOptions(wxWindow *parent, int selformat)
|
||||
|
||||
ShuttleGui S(this, eIsCreatingFromPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
TransferDataToWindow();
|
||||
}
|
||||
|
||||
ExportPCMOptions::~ExportPCMOptions()
|
||||
{
|
||||
WriteExportFormatPref(GetFormat());
|
||||
TransferDataFromWindow();
|
||||
}
|
||||
|
||||
void ExportPCMOptions::PopulateOrExchange(ShuttleGui & S)
|
||||
@ -197,6 +202,25 @@ void ExportPCMOptions::PopulateOrExchange(ShuttleGui & S)
|
||||
return;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportPCMOptions::TransferDataToWindow()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
///
|
||||
///
|
||||
bool ExportPCMOptions::TransferDataFromWindow()
|
||||
{
|
||||
ShuttleGui S(this, eIsSavingToPrefs);
|
||||
PopulateOrExchange(S);
|
||||
|
||||
WriteExportFormatPref(GetFormat());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ExportPCMOptions::OnHeaderChoice(wxCommandEvent & WXUNUSED(evt))
|
||||
{
|
||||
int format = sf_header_index_to_type(mHeaderChoice->GetSelection());
|
||||
|
Loading…
x
Reference in New Issue
Block a user