1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-05 06:59:07 +02:00

Sweep unnecessary wxString copies: export

This commit is contained in:
Paul Licameli 2016-02-22 21:17:04 -05:00
parent d21c0aa478
commit 83e8a80f61
11 changed files with 31 additions and 69 deletions

View File

@ -242,35 +242,6 @@ wxWindow *ExportPlugin::OptionsCreate(wxWindow *parent, int WXUNUSED(format))
return p;
}
int ExportPlugin::Export(AudacityProject *project,
int channels,
wxString fName,
bool selectedOnly,
double t0,
double t1,
MixerSpec *mixerSpec,
Tags * WXUNUSED(metadata),
int subformat)
{
if (project == NULL) {
project = GetActiveProject();
}
return DoExport(project, channels, fName, selectedOnly, t0, t1, mixerSpec, subformat);
}
int ExportPlugin::DoExport(AudacityProject * WXUNUSED(project),
int WXUNUSED(channels),
wxString WXUNUSED(fName),
bool WXUNUSED(selectedOnly),
double WXUNUSED(t0),
double WXUNUSED(t1),
MixerSpec * WXUNUSED(mixerSpec),
int WXUNUSED(subformat))
{
return false;
}
//Create a mixer by computing the time warp factor
Mixer* ExportPlugin::CreateMixer(int numInputTracks, WaveTrack **inputTracks,
TimeTrack *timeTrack,
@ -952,7 +923,7 @@ ExportMixerPanel::~ExportMixerPanel()
}
//set the font on memDC such that text can fit in specified width and height
void ExportMixerPanel::SetFont( wxMemoryDC &memDC, wxString text, int width,
void ExportMixerPanel::SetFont(wxMemoryDC &memDC, const wxString &text, int width,
int height )
{
int l = 0, u = 13, m, w, h;

View File

@ -105,22 +105,13 @@ public:
*/
virtual int Export(AudacityProject *project,
int channels,
wxString fName,
const wxString &fName,
bool selectedOnly,
double t0,
double t1,
MixerSpec *mixerSpec = NULL,
Tags *metadata = NULL,
int subformat = 0);
virtual int DoExport(AudacityProject *project,
int channels,
wxString fName,
bool selectedOnly,
double t0,
double t1,
MixerSpec *mixerSpec,
int subformat);
int subformat = 0) = 0;
protected:
Mixer* CreateMixer(int numInputTracks, WaveTrack **inputTracks,
@ -227,7 +218,7 @@ private:
wxArrayString mTrackNames;
int mBoxWidth, mChannelHeight, mTrackHeight;
void SetFont( wxMemoryDC &memDC, wxString text, int width, int height );
void SetFont( wxMemoryDC &memDC, const wxString &text, int width, int height );
double Distance( wxPoint &a, wxPoint &b );
bool IsOnLine( wxPoint p, wxPoint la, wxPoint lb );

View File

@ -286,13 +286,13 @@ public:
int Export(AudacityProject *project,
int channels,
wxString fName,
const wxString &fName,
bool selectedOnly,
double t0,
double t1,
MixerSpec *mixerSpec = NULL,
Tags *metadata = NULL,
int subformat = 0);
int subformat = 0) override;
};
ExportCL::ExportCL()
@ -313,7 +313,7 @@ void ExportCL::Destroy()
int ExportCL::Export(AudacityProject *project,
int channels,
wxString fName,
const wxString &fName,
bool selectionOnly,
double t0,
double t1,

View File

@ -140,13 +140,13 @@ public:
///\return true if export succeded
int Export(AudacityProject *project,
int channels,
wxString fName,
const wxString &fName,
bool selectedOnly,
double t0,
double t1,
MixerSpec *mixerSpec = NULL,
Tags *metadata = NULL,
int subformat = 0);
int subformat = 0) override;
private:
@ -791,7 +791,7 @@ bool ExportFFmpeg::EncodeAudioFrame(int16_t *pFrame, int frameSize)
int ExportFFmpeg::Export(AudacityProject *project,
int channels, wxString fName,
int channels, const wxString &fName,
bool selectionOnly, double t0, double t1, MixerSpec *mixerSpec, Tags *metadata, int subformat)
{
if (!CheckFFmpegPresence())

View File

@ -185,13 +185,13 @@ public:
wxWindow *OptionsCreate(wxWindow *parent, int format);
int Export(AudacityProject *project,
int channels,
wxString fName,
const wxString &fName,
bool selectedOnly,
double t0,
double t1,
MixerSpec *mixerSpec = NULL,
Tags *metadata = NULL,
int subformat = 0);
int subformat = 0) override;
private:
@ -220,7 +220,7 @@ void ExportFLAC::Destroy()
int ExportFLAC::Export(AudacityProject *project,
int numChannels,
wxString fName,
const wxString &fName,
bool selectionOnly,
double t0,
double t1,

View File

@ -176,13 +176,13 @@ public:
wxWindow *OptionsCreate(wxWindow *parent, int format);
int Export(AudacityProject *project,
int channels,
wxString fName,
const wxString &fName,
bool selectedOnly,
double t0,
double t1,
MixerSpec *mixerSpec = NULL,
Tags *metadata = NULL,
int subformat = 0);
int subformat = 0) override;
private:
@ -210,7 +210,7 @@ void ExportMP2::Destroy()
}
int ExportMP2::Export(AudacityProject *project,
int channels, wxString fName,
int channels, const wxString &fName,
bool selectionOnly, double t0, double t1, MixerSpec *mixerSpec, Tags *metadata,
int WXUNUSED(subformat))
{

View File

@ -1564,13 +1564,13 @@ public:
wxWindow *OptionsCreate(wxWindow *parent, int format);
int Export(AudacityProject *project,
int channels,
wxString fName,
const wxString &fName,
bool selectedOnly,
double t0,
double t1,
MixerSpec *mixerSpec = NULL,
Tags *metadata = NULL,
int subformat = 0);
int subformat = 0) override;
private:
@ -1619,7 +1619,7 @@ bool ExportMP3::CheckFileName(wxFileName & WXUNUSED(filename), int WXUNUSED(form
int ExportMP3::Export(AudacityProject *project,
int channels,
wxString fName,
const wxString &fName,
bool selectionOnly,
double t0,
double t1,

View File

@ -619,7 +619,7 @@ bool ExportMultiple::DirOk()
}
int ExportMultiple::ExportMultipleByLabel(bool byName,
wxString prefix, bool addNumber)
const wxString &prefix, bool addNumber)
{
wxASSERT(mProject);
bool tagsPrompt = mProject->GetShowId3Dialog();
@ -737,7 +737,7 @@ int ExportMultiple::ExportMultipleByLabel(bool byName,
}
int ExportMultiple::ExportMultipleByTrack(bool byName,
wxString prefix, bool addNumber)
const wxString &prefix, bool addNumber)
{
wxASSERT(mProject);
bool tagsPrompt = mProject->GetShowId3Dialog();
@ -953,7 +953,7 @@ int ExportMultiple::DoExport(int channels,
return success;
}
wxString ExportMultiple::MakeFileName(wxString input)
wxString ExportMultiple::MakeFileName(const wxString &input)
{
wxString newname; // name we are generating

View File

@ -54,7 +54,7 @@ private:
* labels that define them (true), or just numbered (false).
* @param prefix The string used to prefix the file number if files are being
* numbered rather than named */
int ExportMultipleByLabel(bool byName, wxString prefix, bool addNumber);
int ExportMultipleByLabel(bool byName, const wxString &prefix, bool addNumber);
/** \brief Export each track in the project to a separate file
*
@ -62,7 +62,7 @@ private:
* (true), or just numbered (false).
* @param prefix The string used to prefix the file number if files are being
* numbered rather than named */
int ExportMultipleByTrack(bool byName, wxString prefix, bool addNumber);
int ExportMultipleByTrack(bool byName, const wxString &prefix, bool addNumber);
/** Export one file of an export multiple set
*
@ -83,7 +83,7 @@ private:
/** \brief Takes an arbitrary text string and converts it to a form that can
* be used as a file name, if necessary prompting the user to edit the file
* name produced */
wxString MakeFileName(wxString input);
wxString MakeFileName(const wxString &input);
// Dialog
void PopulateOrExchange(ShuttleGui& S);
void EnableControls();

View File

@ -135,13 +135,13 @@ public:
int Export(AudacityProject *project,
int channels,
wxString fName,
const wxString &fName,
bool selectedOnly,
double t0,
double t1,
MixerSpec *mixerSpec = NULL,
Tags *metadata = NULL,
int subformat = 0);
int subformat = 0) override;
private:
@ -166,7 +166,7 @@ void ExportOGG::Destroy()
int ExportOGG::Export(AudacityProject *project,
int numChannels,
wxString fName,
const wxString &fName,
bool selectionOnly,
double t0,
double t1,

View File

@ -315,13 +315,13 @@ public:
wxWindow *OptionsCreate(wxWindow *parent, int format);
int Export(AudacityProject *project,
int channels,
wxString fName,
const wxString &fName,
bool selectedOnly,
double t0,
double t1,
MixerSpec *mixerSpec = NULL,
Tags *metadata = NULL,
int subformat = 0);
int subformat = 0) override;
// optional
wxString GetExtension(int index);
virtual bool CheckFileName(wxFileName &filename, int format);
@ -390,7 +390,7 @@ void ExportPCM::Destroy()
*/
int ExportPCM::Export(AudacityProject *project,
int numChannels,
wxString fName,
const wxString &fName,
bool selectionOnly,
double t0,
double t1,