Sweep unnecessary wxString copies: effects

This commit is contained in:
Paul Licameli 2016-02-22 21:17:19 -05:00
parent 83e8a80f61
commit 99f161c36c
10 changed files with 33 additions and 33 deletions

View File

@ -2022,7 +2022,7 @@ bool Effect::TotalProgress(double frac)
return (updateResult != eProgressSuccess);
}
bool Effect::TrackProgress(int whichTrack, double frac, wxString msg)
bool Effect::TrackProgress(int whichTrack, double frac, const wxString &msg)
{
int updateResult = (mProgress ?
mProgress->Update(whichTrack + frac, (double) mNumTracks, msg) :
@ -2030,7 +2030,7 @@ bool Effect::TrackProgress(int whichTrack, double frac, wxString msg)
return (updateResult != eProgressSuccess);
}
bool Effect::TrackGroupProgress(int whichGroup, double frac, wxString msg)
bool Effect::TrackGroupProgress(int whichGroup, double frac, const wxString &msg)
{
int updateResult = (mProgress ?
mProgress->Update(whichGroup + frac, (double) mNumGroups, msg) :

View File

@ -309,11 +309,11 @@ protected:
// Pass a fraction between 0.0 and 1.0, for the current track
// (when doing one track at a time)
bool TrackProgress(int whichTrack, double frac, wxString = wxT(""));
bool TrackProgress(int whichTrack, double frac, const wxString & = wxEmptyString);
// Pass a fraction between 0.0 and 1.0, for the current track group
// (when doing stereo groups at a time)
bool TrackGroupProgress(int whichGroup, double frac, wxString = wxT(""));
bool TrackGroupProgress(int whichGroup, double frac, const wxString & = wxEmptyString);
int GetNumWaveTracks() { return mNumTracks; }

View File

@ -1362,7 +1362,7 @@ void EffectEqualization::Filter(sampleCount len, float *buffer)
//
// Load external curves with fallback to default, then message
//
void EffectEqualization::LoadCurves(wxString fileName, bool append)
void EffectEqualization::LoadCurves(const wxString &fileName, bool append)
{
// Construct normal curve filename
//
@ -1460,7 +1460,7 @@ void EffectEqualization::LoadCurves(wxString fileName, bool append)
//
// Save curves to external file
//
void EffectEqualization::SaveCurves(wxString fileName)
void EffectEqualization::SaveCurves(const wxString &fileName)
{
wxFileName fn;
if( fileName == wxT(""))
@ -1601,7 +1601,7 @@ void EffectEqualization::setCurve()
setCurve((int) mCurves.GetCount()-1);
}
void EffectEqualization::setCurve(wxString curveName)
void EffectEqualization::setCurve(const wxString &curveName)
{
unsigned i = 0;
for( i = 0; i < mCurves.GetCount(); i++ )
@ -3456,7 +3456,7 @@ void EditCurvesDialog::OnOK(wxCommandEvent & WXUNUSED(event))
#if wxUSE_ACCESSIBILITY
SliderAx::SliderAx( wxWindow * window, wxString fmt ):
SliderAx::SliderAx(wxWindow * window, const wxString &fmt) :
wxWindowAccessible( window )
{
mParent = window;

View File

@ -141,11 +141,11 @@ private:
void EnvelopeUpdated(Envelope *env, bool lin);
bool IsLinear();
void LoadCurves(wxString fileName = wxT(""), bool append = false);
void SaveCurves(wxString fileName = wxT(""));
void LoadCurves(const wxString &fileName = wxEmptyString, bool append = false);
void SaveCurves(const wxString &fileName = wxEmptyString);
void Select(int sel);
void setCurve(int currentCurve);
void setCurve(wxString curveName);
void setCurve(const wxString &curveName);
void setCurve(void);
// XMLTagHandler callback methods for loading and saving
@ -367,7 +367,7 @@ private:
class SliderAx: public wxWindowAccessible
{
public:
SliderAx(wxWindow * window, wxString fmt);
SliderAx(wxWindow * window, const wxString &fmt);
virtual ~ SliderAx();

View File

@ -333,7 +333,7 @@ bool EffectNormalize::TransferDataFromWindow()
// EffectNormalize implementation
void EffectNormalize::AnalyseTrack(WaveTrack * track, wxString msg)
void EffectNormalize::AnalyseTrack(WaveTrack * track, const wxString &msg)
{
if(mGain) {
// Since we need complete summary data, we need to block until the OD tasks are done for this track
@ -361,7 +361,7 @@ void EffectNormalize::AnalyseTrack(WaveTrack * track, wxString msg)
//AnalyseDC() takes a track, transforms it to bunch of buffer-blocks,
//and executes AnalyzeData on it...
// sets mOffset
bool EffectNormalize::AnalyseDC(WaveTrack * track, wxString msg)
bool EffectNormalize::AnalyseDC(WaveTrack * track, const wxString &msg)
{
bool rc = true;
sampleCount s;
@ -427,7 +427,7 @@ bool EffectNormalize::AnalyseDC(WaveTrack * track, wxString msg)
//ProcessOne() takes a track, transforms it to bunch of buffer-blocks,
//and executes ProcessData, on it...
// uses mMult and mOffset to normalize a track. Needs to have them set before being called
bool EffectNormalize::ProcessOne(WaveTrack * track, wxString msg)
bool EffectNormalize::ProcessOne(WaveTrack * track, const wxString &msg)
{
bool rc = true;
sampleCount s;

View File

@ -56,10 +56,10 @@ public:
private:
// EffectNormalize implementation
bool ProcessOne(WaveTrack * t, wxString msg);
virtual void AnalyseTrack(WaveTrack * track, wxString msg);
bool ProcessOne(WaveTrack * t, const wxString &msg);
virtual void AnalyseTrack(WaveTrack * track, const wxString &msg);
virtual void AnalyzeData(float *buffer, sampleCount len);
bool AnalyseDC(WaveTrack * track, wxString msg);
bool AnalyseDC(WaveTrack * track, const wxString &msg);
virtual void ProcessData(float *buffer, sampleCount len);
void OnUpdateUI(wxCommandEvent & evt);

View File

@ -2727,7 +2727,7 @@ wxString VSTEffect::b64encode(const void *in, int len)
return out;
}
int VSTEffect::b64decode(wxString in, void *out)
int VSTEffect::b64decode(const wxString &in, void *out)
{
int len = in.length();
unsigned char *p = (unsigned char *) out;

View File

@ -175,7 +175,7 @@ private:
// Base64 encoding and decoding
static wxString b64encode(const void *in, int len);
static int b64decode(wxString in, void *out);
static int b64decode(const wxString &in, void *out);
// Realtime
int GetChannelCount();

View File

@ -114,7 +114,7 @@ BEGIN_EVENT_TABLE(NyquistEffect, wxEvtHandler)
wxEVT_COMMAND_CHOICE_SELECTED, NyquistEffect::OnChoice)
END_EVENT_TABLE()
NyquistEffect::NyquistEffect(wxString fName)
NyquistEffect::NyquistEffect(const wxString &fName)
{
mAction = _("Applying Nyquist Effect...");
mInputCmd = wxEmptyString;
@ -1290,7 +1290,7 @@ void NyquistEffect::RedirectOutput()
mRedirectOutput = true;
}
void NyquistEffect::SetCommand(wxString cmd)
void NyquistEffect::SetCommand(const wxString &cmd)
{
mExternal = true;
@ -1312,7 +1312,7 @@ void NyquistEffect::Stop()
mStop = true;
}
wxString NyquistEffect::UnQuote(wxString s)
wxString NyquistEffect::UnQuote(const wxString &s)
{
wxString out;
int len = s.Length();
@ -1324,7 +1324,7 @@ wxString NyquistEffect::UnQuote(wxString s)
return s;
}
double NyquistEffect::GetCtrlValue(wxString s)
double NyquistEffect::GetCtrlValue(const wxString &s)
{
/* For this to work correctly requires that the plug-in header is
* parsed on each run so that the correct value for "half-srate" may
@ -1341,10 +1341,10 @@ double NyquistEffect::GetCtrlValue(wxString s)
}
*/
return Internat::CompatibleToDouble(s);;
return Internat::CompatibleToDouble(s);
}
void NyquistEffect::Parse(wxString line)
void NyquistEffect::Parse(const wxString &line)
{
wxArrayString tokens;
@ -2237,7 +2237,7 @@ END_EVENT_TABLE()
NyquistOutputDialog::NyquistOutputDialog(wxWindow * parent, wxWindowID id,
const wxString & title,
const wxString & prompt,
wxString message)
const wxString &message)
: wxDialog(parent, id, title)
{
SetName(GetTitle());

View File

@ -68,7 +68,7 @@ public:
/** @param fName File name of the Nyquist script defining this effect. If
* an empty string, then prompt the user for the Nyquist code to interpret.
*/
NyquistEffect(wxString fName);
NyquistEffect(const wxString &fName);
virtual ~NyquistEffect();
// IdentInterface implementation
@ -106,7 +106,7 @@ public:
// For Nyquist Workbench support
void RedirectOutput();
void SetCommand(wxString cmd);
void SetCommand(const wxString &cmd);
void Continue();
void Break();
void Stop();
@ -152,10 +152,10 @@ private:
void ParseFile();
bool ParseCommand(const wxString & cmd);
bool ParseProgram(wxInputStream & stream);
void Parse(wxString line);
void Parse(const wxString &line);
wxString UnQuote(wxString s);
double GetCtrlValue(wxString s);
wxString UnQuote(const wxString &s);
double GetCtrlValue(const wxString &s);
void OnLoad(wxCommandEvent & evt);
void OnSave(wxCommandEvent & evt);
@ -248,7 +248,7 @@ public:
NyquistOutputDialog(wxWindow * parent, wxWindowID id,
const wxString & title,
const wxString & prompt,
wxString message);
const wxString &message);
private:
void OnOk(wxCommandEvent & event);