11#ifndef __AUDACITY_EXPORT__
12#define __AUDACITY_EXPORT__
16#include <wx/filename.h>
79 void SetFormat(
const wxString &
format,
int index);
84 void SetMaxChannels(
unsigned maxchannels,
unsigned index);
85 void SetCanMetaData(
bool canmetadata,
int index);
87 virtual int GetFormatCount();
88 virtual wxString GetFormat(
int index);
97 virtual unsigned GetMaxChannels(
int index);
98 virtual bool GetCanMetaData(
int index);
100 virtual bool IsExtension(
const FileExtension & ext,
int index);
102 virtual bool DisplayOptions(wxWindow *parent,
int format = 0);
106 virtual bool CheckFileName(wxFileName &filename,
int format = 0);
133 std::unique_ptr<BasicUI::ProgressDialog> &pDialog,
140 const Tags *metadata = NULL,
141 int subformat = 0) = 0;
144 std::unique_ptr<Mixer> CreateMixer(
const TrackList &tracks,
146 double startTime,
double stopTime,
147 unsigned numOutChannels,
size_t outBufferSize,
bool outInterleaved,
152 static void InitProgress(std::unique_ptr<BasicUI::ProgressDialog> &pDialog,
154 static void InitProgress(std::unique_ptr<BasicUI::ProgressDialog> &pDialog,
169 AUDACITY_FILE_SUFFIX_EVENT, wxCommandEvent);
171class AUDACITY_DLL_API
Exporter final :
public wxEvtHandler
177 std::function< std::unique_ptr< ExportPlugin >() >;
199 bool Process(
bool selectedOnly,
200 double t0,
double t1);
201 bool Process(
unsigned numChannels,
203 bool selectedOnly,
double t0,
double t1);
206 unsigned numChannels,
const FileExtension& type,
const wxString& filename,
207 bool selectedOnly,
double t0,
double t1,
208 std::unique_ptr<BasicUI::ProgressDialog>& progressDialog);
210 void DisplayOptions(
int index);
211 int FindFormatIndex(
int exportindex);
216 bool ProcessFromTimerRecording(
bool selectedOnly,
223 bool SetAutoExportOptions();
224 int GetAutoExportFormat();
225 int GetAutoExportSubFormat();
226 int GetAutoExportFilterIndex();
227 wxFileName GetAutoExportFileName();
228 void OnExtensionChanged(wxCommandEvent &evt);
229 void OnHelp(wxCommandEvent &evt);
239 bool ExamineTracks();
241 bool CheckFilename();
242 bool CheckMix(
bool prompt =
true);
243 bool ExportTracks(std::unique_ptr<BasicUI::ProgressDialog>& progressDialog);
245 static void CreateUserPaneCallback(wxWindow *parent, wxUIntPtr userdata);
246 void CreateUserPane(wxWindow *parent);
247 void OnFilterChanged(wxFileCtrlEvent & evt);
275 DECLARE_EVENT_TABLE()
285 MixerSpec *mixerSpec, wxArrayString trackNames,
286 const wxPoint& pos = wxDefaultPosition,
287 const wxSize&
size = wxDefaultSize);
291 void OnPaint(wxPaintEvent & event);
305 void SetFont( wxMemoryDC &memDC,
const wxString &text,
int width,
int height );
306 double Distance( wxPoint &a, wxPoint &b );
307 bool IsOnLine( wxPoint p, wxPoint la, wxPoint lb );
309 DECLARE_EVENT_TABLE()
321 const wxPoint& pos = wxDefaultPosition,
322 const wxSize&
size = wxDefaultSize,
323 long style = wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER );
334 void OnOk( wxCommandEvent &event );
335 void OnCancel( wxCommandEvent &event );
337 void OnSlider( wxCommandEvent &event );
338 void OnSize( wxSizeEvent &event );
341 DECLARE_EVENT_TABLE()
353 bool allowReporting =
true);
AUDACITY_DLL_API void ShowExportErrorDialog(wxString ErrorCode, TranslatableString message=AudacityExportMessageStr(), const TranslatableString &caption=AudacityExportCaptionStr(), bool allowReporting=true)
AUDACITY_DLL_API TranslatableString AudacityExportCaptionStr()
AUDACITY_DLL_API void ShowDiskFullExportErrorDialog(const wxFileNameWrapper &fileName)
std::vector< std::shared_ptr< const WaveTrack > > WaveTrackConstArray
AUDACITY_DLL_API TranslatableString AudacityExportMessageStr()
std::vector< std::unique_ptr< ExportPlugin > > ExportPluginArray
wxDECLARE_EXPORTED_EVENT(AUDACITY_DLL_API, AUDACITY_FILE_SUFFIX_EVENT, wxCommandEvent)
wxString FileExtension
File extension, not including any leading dot.
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Dialog for advanced mixing.
std::unique_ptr< MixerSpec > mMixerSpec
void OnOk(wxCommandEvent &event)
ExportMixerDialog(const TrackList *tracks, bool selectedOnly, unsigned maxNumChannels, wxWindow *parent, wxWindowID id, const TranslatableString &title, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER)
void OnCancel(wxCommandEvent &event)
void OnSize(wxSizeEvent &event)
MixerSpec * GetMixerSpec()
virtual ~ExportMixerDialog()
wxStaticText * mChannelsText
void OnMixerPanelHelp(wxCommandEvent &event)
wxArrayString mTrackNames
void OnSlider(wxCommandEvent &event)
Panel that displays mixing for advanced mixing option.
ExportMixerPanel(wxWindow *parent, wxWindowID id, MixerSpec *mixerSpec, wxArrayString trackNames, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize)
void OnMouseEvent(wxMouseEvent &event)
void SetFont(wxMemoryDC &memDC, const wxString &text, int width, int height)
std::unique_ptr< wxBitmap > mBitmap
bool IsOnLine(wxPoint p, wxPoint la, wxPoint lb)
void OnPaint(wxPaintEvent &event)
double Distance(wxPoint &a, wxPoint &b)
ArrayOf< wxRect > mChannelRects
ArrayOf< wxRect > mTrackRects
virtual ~ExportMixerPanel()
wxArrayString mTrackNames
virtual ProgressResult Export(AudacityProject *project, std::unique_ptr< BasicUI::ProgressDialog > &pDialog, unsigned channels, const wxFileNameWrapper &fName, bool selectedOnly, double t0, double t1, MixerSpec *mixerSpec=NULL, const Tags *metadata=NULL, int subformat=0)=0
called to export audio into a file.
virtual int SetNumExportChannels()
Exporter plug-ins may override this to specify the number of channels in exported file....
std::vector< FormatInfo > mFormatInfos
FileDialogWrapper * mDialog
std::function< std::unique_ptr< ExportPlugin >() > ExportPluginFactory
void SetDefaultFormat(const FileExtension &Format)
FileExtension mFormatName
std::unique_ptr< MixerSpec > mMixerSpec
ExportPluginArray mPlugins
AudacityProject * mProject
TranslatableString mFileDialogTitle
std::vector< FileType > FileTypes
An explicitly nonlocalized string, not meant for the user to see.
Functions for doing the mixdown of the tracks.
A matrix of booleans, one row per input channel, column per output.
Generates classes whose instances register items at construction.
Derived from ShuttleGuiBase, an Audacity specific class for shuttling data to and from GUI.
A flat linked list of tracks supporting Add, Remove, Clear, and Contains, serialization of the list o...
Holds a msgid for the translation catalog; may also bind format arguments.
A Track that contains audio waveform data.
Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.
UndoState::Extensions GetExtensions(AudacityProject &project)
static RegisteredToolbarFactory factory
Exporter::ExportPluginFactory mFactory