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

Sweep unnecessary wxString copies in argument passing (but not yet in returns)

This commit is contained in:
Paul Licameli 2016-02-23 02:16:47 -05:00
commit a9028e1184
113 changed files with 316 additions and 337 deletions

View File

@ -892,7 +892,7 @@ wxString AboutDialog::GetCreditsByRole(AboutDialog::Role role)
* *
* Used when creating the build information tab to show if each optional * Used when creating the build information tab to show if each optional
* library is enabled or not, and what it does */ * library is enabled or not, and what it does */
void AboutDialog::AddBuildinfoRow( wxString* htmlstring, const wxChar * libname, const wxChar * libdesc, wxString status) void AboutDialog::AddBuildinfoRow( wxString* htmlstring, const wxChar * libname, const wxChar * libdesc, const wxString &status)
{ {
*htmlstring += wxT("<tr><td>"); *htmlstring += wxT("<tr><td>");
*htmlstring += libname; *htmlstring += libname;

View File

@ -76,7 +76,7 @@ class AboutDialog:public wxDialog {
void AddCredit(wxString &&description, Role role); void AddCredit(wxString &&description, Role role);
wxString GetCreditsByRole(AboutDialog::Role role); wxString GetCreditsByRole(AboutDialog::Role role);
void AddBuildinfoRow( wxString* htmlstring, const wxChar * libname, const wxChar * libdesc, wxString status); void AddBuildinfoRow( wxString* htmlstring, const wxChar * libname, const wxChar * libdesc, const wxString &status);
void AddBuildinfoRow( wxString* htmlstring, const wxChar * libname, const wxChar * libdesc); void AddBuildinfoRow( wxString* htmlstring, const wxChar * libname, const wxChar * libdesc);
}; };

View File

@ -769,7 +769,7 @@ END_EVENT_TABLE()
// TODO: Would be nice to make this handle not opening a file with more panache. // TODO: Would be nice to make this handle not opening a file with more panache.
// - Inform the user if DefaultOpenPath not set. // - Inform the user if DefaultOpenPath not set.
// - Switch focus to correct instance of project window, if already open. // - Switch focus to correct instance of project window, if already open.
bool AudacityApp::MRUOpen(wxString fullPathStr) { bool AudacityApp::MRUOpen(const wxString &fullPathStr) {
// Most of the checks below are copied from AudacityProject::OpenFiles. // Most of the checks below are copied from AudacityProject::OpenFiles.
// - some rationalisation might be possible. // - some rationalisation might be possible.
@ -1630,7 +1630,7 @@ bool AudacityApp::InitTempDir()
// //
// Use "dir" for creating lockfiles (on OS X and Unix). // Use "dir" for creating lockfiles (on OS X and Unix).
bool AudacityApp::CreateSingleInstanceChecker(wxString dir) bool AudacityApp::CreateSingleInstanceChecker(const wxString &dir)
{ {
wxString name = wxString::Format(wxT("audacity-lock-%s"), wxGetUserId().c_str()); wxString name = wxString::Format(wxT("audacity-lock-%s"), wxGetUserId().c_str());
mChecker = new wxSingleInstanceChecker(); mChecker = new wxSingleInstanceChecker();
@ -1868,12 +1868,12 @@ wxCmdLineParser *AudacityApp::ParseCommandLine()
} }
// static // static
void AudacityApp::AddUniquePathToPathList(wxString path, void AudacityApp::AddUniquePathToPathList(const wxString &pathArg,
wxArrayString &pathList) wxArrayString &pathList)
{ {
wxFileName pathNorm = path; wxFileName pathNorm = pathArg;
pathNorm.Normalize(); pathNorm.Normalize();
path = pathNorm.GetFullPath(); wxString path = pathNorm.GetFullPath();
for(unsigned int i=0; i<pathList.GetCount(); i++) { for(unsigned int i=0; i<pathList.GetCount(); i++) {
if (wxFileName(path) == wxFileName(pathList[i])) if (wxFileName(path) == wxFileName(pathList[i]))
@ -1884,9 +1884,10 @@ void AudacityApp::AddUniquePathToPathList(wxString path,
} }
// static // static
void AudacityApp::AddMultiPathsToPathList(wxString multiPathString, void AudacityApp::AddMultiPathsToPathList(const wxString &multiPathStringArg,
wxArrayString &pathList) wxArrayString &pathList)
{ {
wxString multiPathString(multiPathStringArg);
while (multiPathString != wxT("")) { while (multiPathString != wxT("")) {
wxString onePath = multiPathString.BeforeFirst(wxPATH_SEP[0]); wxString onePath = multiPathString.BeforeFirst(wxPATH_SEP[0]);
multiPathString = multiPathString.AfterFirst(wxPATH_SEP[0]); multiPathString = multiPathString.AfterFirst(wxPATH_SEP[0]);

View File

@ -123,7 +123,7 @@ class AudacityApp:public wxApp {
void OnMRUClear(wxCommandEvent &event); void OnMRUClear(wxCommandEvent &event);
void OnMRUFile(wxCommandEvent &event); void OnMRUFile(wxCommandEvent &event);
// Backend for above - returns true for success, false for failure // Backend for above - returns true for success, false for failure
bool MRUOpen(wxString fileName); bool MRUOpen(const wxString &fileName);
void OnReceiveCommand(AppCommandEvent &event); void OnReceiveCommand(AppCommandEvent &event);
@ -174,9 +174,9 @@ class AudacityApp:public wxApp {
wxString defaultTempDir; wxString defaultTempDir;
// Useful functions for working with search paths // Useful functions for working with search paths
static void AddUniquePathToPathList(wxString path, static void AddUniquePathToPathList(const wxString &path,
wxArrayString &pathList); wxArrayString &pathList);
static void AddMultiPathsToPathList(wxString multiPathString, static void AddMultiPathsToPathList(const wxString &multiPathString,
wxArrayString &pathList); wxArrayString &pathList);
static void FindFilesInPathList(const wxString & pattern, static void FindFilesInPathList(const wxString & pattern,
const wxArrayString & pathList, const wxArrayString & pathList,
@ -214,7 +214,7 @@ class AudacityApp:public wxApp {
void DeInitCommandHandler(); void DeInitCommandHandler();
bool InitTempDir(); bool InitTempDir();
bool CreateSingleInstanceChecker(wxString dir); bool CreateSingleInstanceChecker(const wxString &dir);
wxCmdLineParser *ParseCommandLine(); wxCmdLineParser *ParseCommandLine();

View File

@ -841,7 +841,7 @@ wxString HostName(const PaDeviceInfo* info)
return hostapiName; return hostapiName;
} }
bool AudioIO::ValidateDeviceNames(wxString play, wxString rec) bool AudioIO::ValidateDeviceNames(const wxString &play, const wxString &rec)
{ {
const PaDeviceInfo *pInfo = Pa_GetDeviceInfo(AudioIO::getPlayDevIndex(play)); const PaDeviceInfo *pInfo = Pa_GetDeviceInfo(AudioIO::getPlayDevIndex(play));
const PaDeviceInfo *rInfo = Pa_GetDeviceInfo(AudioIO::getRecordDevIndex(rec)); const PaDeviceInfo *rInfo = Pa_GetDeviceInfo(AudioIO::getRecordDevIndex(rec));
@ -2920,8 +2920,9 @@ int AudioIO::getRecordSourceIndex(PxMixer *portMixer)
} }
#endif #endif
int AudioIO::getPlayDevIndex(wxString devName) int AudioIO::getPlayDevIndex(const wxString &devNameArg)
{ {
wxString devName(devNameArg);
// if we don't get given a device, look up the preferences // if we don't get given a device, look up the preferences
if (devName.IsEmpty()) if (devName.IsEmpty())
{ {
@ -2973,8 +2974,9 @@ int AudioIO::getPlayDevIndex(wxString devName)
return deviceNum; return deviceNum;
} }
int AudioIO::getRecordDevIndex(wxString devName) int AudioIO::getRecordDevIndex(const wxString &devNameArg)
{ {
wxString devName(devNameArg);
// if we don't get given a device, look up the preferences // if we don't get given a device, look up the preferences
if (devName.IsEmpty()) if (devName.IsEmpty())
{ {

View File

@ -388,7 +388,7 @@ class AUDACITY_DLL_API AudioIO {
/** \brief Ensure selected device names are valid /** \brief Ensure selected device names are valid
* *
*/ */
static bool ValidateDeviceNames(wxString play, wxString rec); static bool ValidateDeviceNames(const wxString &play, const wxString &rec);
/** \brief Function to automatically set an acceptable volume /** \brief Function to automatically set an acceptable volume
* *
@ -475,7 +475,7 @@ private:
* and would be neater done once. If the device isn't found, return the * and would be neater done once. If the device isn't found, return the
* default device index. * default device index.
*/ */
static int getRecordDevIndex(wxString devName = wxT("")); static int getRecordDevIndex(const wxString &devName = wxEmptyString);
/** \brief get the index of the device selected in the preferences. /** \brief get the index of the device selected in the preferences.
* *
* If the device isn't found, returns -1 * If the device isn't found, returns -1
@ -491,7 +491,7 @@ private:
* and would be neater done once. If the device isn't found, return the * and would be neater done once. If the device isn't found, return the
* default device index. * default device index.
*/ */
static int getPlayDevIndex(wxString devName = wxT("")); static int getPlayDevIndex(const wxString &devName = wxEmptyString);
/** \brief Array of audio sample rates to try to use /** \brief Array of audio sample rates to try to use
* *

View File

@ -411,7 +411,7 @@ bool BatchCommands::IsMono()
return mono; return mono;
} }
wxString BatchCommands::BuildCleanFileName(wxString fileName, wxString extension) wxString BatchCommands::BuildCleanFileName(const wxString &fileName, const wxString &extension)
{ {
wxFileName newFileName(fileName); wxFileName newFileName(fileName);
wxString justName = newFileName.GetName(); wxString justName = newFileName.GetName();

View File

@ -33,7 +33,7 @@ class BatchCommands {
void AbortBatch(); void AbortBatch();
// Utility functions for the special commands. // Utility functions for the special commands.
wxString BuildCleanFileName(wxString fileName, wxString extension); wxString BuildCleanFileName(const wxString &fileName, const wxString &extension);
bool WriteMp3File( const wxString & Name, int bitrate ); bool WriteMp3File( const wxString & Name, int bitrate );
double GetEndTime(); double GetEndTime();
bool IsMono(); bool IsMono();

View File

@ -561,12 +561,12 @@ wxString DirManager::GetDataFilesDir() const
return projFull != wxT("")? projFull: mytemp; return projFull != wxT("")? projFull: mytemp;
} }
void DirManager::SetLocalTempDir(wxString path) void DirManager::SetLocalTempDir(const wxString &path)
{ {
mytemp = path; mytemp = path;
} }
wxFileName DirManager::MakeBlockFilePath(wxString value){ wxFileName DirManager::MakeBlockFilePath(const wxString &value) {
wxFileName dir; wxFileName dir;
dir.AssignDir(GetDataFilesDir()); dir.AssignDir(GetDataFilesDir());
@ -596,7 +596,7 @@ wxFileName DirManager::MakeBlockFilePath(wxString value){
} }
bool DirManager::AssignFile(wxFileName &fileName, bool DirManager::AssignFile(wxFileName &fileName,
wxString value, const wxString &value,
bool diskcheck) bool diskcheck)
{ {
wxFileName dir=MakeBlockFilePath(value); wxFileName dir=MakeBlockFilePath(value);
@ -678,7 +678,7 @@ void DirManager::BalanceFileAdd(int midkey)
} }
} }
void DirManager::BalanceInfoAdd(wxString file) void DirManager::BalanceInfoAdd(const wxString &file)
{ {
const wxChar *s=file.c_str(); const wxChar *s=file.c_str();
if(s[0]==wxT('e')){ if(s[0]==wxT('e')){
@ -698,7 +698,7 @@ void DirManager::BalanceInfoAdd(wxString file)
// Note that this will try to clean up directories out from under even // Note that this will try to clean up directories out from under even
// locked blockfiles; this is actually harmless as the rmdir will fail // locked blockfiles; this is actually harmless as the rmdir will fail
// on non-empty directories. // on non-empty directories.
void DirManager::BalanceInfoDel(wxString file) void DirManager::BalanceInfoDel(const wxString &file)
{ {
const wxChar *s=file.c_str(); const wxChar *s=file.c_str();
if(s[0]==wxT('e')){ if(s[0]==wxT('e')){
@ -887,7 +887,7 @@ BlockFile *DirManager::NewSimpleBlockFile(
} }
BlockFile *DirManager::NewAliasBlockFile( BlockFile *DirManager::NewAliasBlockFile(
wxString aliasedFile, sampleCount aliasStart, const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel) sampleCount aliasLen, int aliasChannel)
{ {
wxFileName fileName = MakeBlockFileName(); wxFileName fileName = MakeBlockFileName();
@ -903,7 +903,7 @@ BlockFile *DirManager::NewAliasBlockFile(
} }
BlockFile *DirManager::NewODAliasBlockFile( BlockFile *DirManager::NewODAliasBlockFile(
wxString aliasedFile, sampleCount aliasStart, const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel) sampleCount aliasLen, int aliasChannel)
{ {
wxFileName fileName = MakeBlockFileName(); wxFileName fileName = MakeBlockFileName();
@ -919,7 +919,7 @@ BlockFile *DirManager::NewODAliasBlockFile(
} }
BlockFile *DirManager::NewODDecodeBlockFile( BlockFile *DirManager::NewODDecodeBlockFile(
wxString aliasedFile, sampleCount aliasStart, const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel, int decodeType) sampleCount aliasLen, int aliasChannel, int decodeType)
{ {
wxFileName fileName = MakeBlockFileName(); wxFileName fileName = MakeBlockFileName();
@ -943,7 +943,7 @@ bool DirManager::ContainsBlockFile(BlockFile *b) const
return it != mBlockFileHash.end() && it->second == b; return it != mBlockFileHash.end() && it->second == b;
} }
bool DirManager::ContainsBlockFile(wxString filepath) const bool DirManager::ContainsBlockFile(const wxString &filepath) const
{ {
// check what the hash returns in case the blockfile is from a different project // check what the hash returns in case the blockfile is from a different project
BlockHash::const_iterator it = mBlockFileHash.find(filepath); BlockHash::const_iterator it = mBlockFileHash.find(filepath);

View File

@ -43,7 +43,7 @@ class DirManager: public XMLTagHandler {
// MM: Only called by Deref() when refcount reaches zero. // MM: Only called by Deref() when refcount reaches zero.
virtual ~DirManager(); virtual ~DirManager();
static void SetTempDir(wxString _temp) { globaltemp = _temp; } static void SetTempDir(const wxString &_temp) { globaltemp = _temp; }
// MM: Ref count mechanism for the DirManager itself // MM: Ref count mechanism for the DirManager itself
void Ref(); void Ref();
@ -64,19 +64,19 @@ class DirManager: public XMLTagHandler {
sampleFormat format, sampleFormat format,
bool allowDeferredWrite = false); bool allowDeferredWrite = false);
BlockFile *NewAliasBlockFile( wxString aliasedFile, sampleCount aliasStart, BlockFile *NewAliasBlockFile( const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel); sampleCount aliasLen, int aliasChannel);
BlockFile *NewODAliasBlockFile( wxString aliasedFile, sampleCount aliasStart, BlockFile *NewODAliasBlockFile( const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel); sampleCount aliasLen, int aliasChannel);
BlockFile *NewODDecodeBlockFile( wxString aliasedFile, sampleCount aliasStart, BlockFile *NewODDecodeBlockFile( const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel, int decodeType); sampleCount aliasLen, int aliasChannel, int decodeType);
/// Returns true if the blockfile pointed to by b is contained by the DirManager /// Returns true if the blockfile pointed to by b is contained by the DirManager
bool ContainsBlockFile(BlockFile *b) const; bool ContainsBlockFile(BlockFile *b) const;
/// Check for existing using filename using complete filename /// Check for existing using filename using complete filename
bool ContainsBlockFile(wxString filepath) const; bool ContainsBlockFile(const wxString &filepath) const;
// Adds one to the reference count of the block file, // Adds one to the reference count of the block file,
// UNLESS it is "locked", then it makes a NEW copy of // UNLESS it is "locked", then it makes a NEW copy of
@ -116,7 +116,7 @@ class DirManager: public XMLTagHandler {
bool HandleXMLTag(const wxChar *tag, const wxChar **attrs); bool HandleXMLTag(const wxChar *tag, const wxChar **attrs);
XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; } XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; }
void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); } // This class only reads tags. void WriteXML(XMLWriter & WXUNUSED(xmlFile)) { wxASSERT(false); } // This class only reads tags.
bool AssignFile(wxFileName &filename,wxString value,bool check); bool AssignFile(wxFileName &filename, const wxString &value, bool check);
// Clean the temp dir. Note that now where we have auto recovery the temp // Clean the temp dir. Note that now where we have auto recovery the temp
// dir is not cleaned at start up anymore. But it is cleaned when the // dir is not cleaned at start up anymore. But it is cleaned when the
@ -154,7 +154,7 @@ class DirManager: public XMLTagHandler {
wxString GetDataFilesDir() const; wxString GetDataFilesDir() const;
// This should only be used by the auto save functionality // This should only be used by the auto save functionality
void SetLocalTempDir(wxString path); void SetLocalTempDir(const wxString &path);
// Do not DELETE any temporary files on exit. This is only called if // Do not DELETE any temporary files on exit. This is only called if
// auto recovery is cancelled and should be retried later // auto recovery is cancelled and should be retried later
@ -169,7 +169,7 @@ class DirManager: public XMLTagHandler {
private: private:
wxFileName MakeBlockFileName(); wxFileName MakeBlockFileName();
wxFileName MakeBlockFilePath(wxString value); wxFileName MakeBlockFilePath(const wxString &value);
bool MoveOrCopyToNewProjectDirectory(BlockFile *f, bool copy); bool MoveOrCopyToNewProjectDirectory(BlockFile *f, bool copy);
@ -181,8 +181,8 @@ class DirManager: public XMLTagHandler {
DirHash dirMidPool; // available two-level dirs DirHash dirMidPool; // available two-level dirs
DirHash dirMidFull; // full two-level dirs DirHash dirMidFull; // full two-level dirs
void BalanceInfoDel(wxString); void BalanceInfoDel(const wxString&);
void BalanceInfoAdd(wxString); void BalanceInfoAdd(const wxString&);
void BalanceFileAdd(int); void BalanceFileAdd(int);
int BalanceMidAdd(int, int); int BalanceMidAdd(int, int);

View File

@ -715,7 +715,7 @@ bool FFmpegLibs::ValidLibsLoaded()
return mLibsLoaded; return mLibsLoaded;
} }
bool FFmpegLibs::InitLibs(wxString libpath_format, bool WXUNUSED(showerr)) bool FFmpegLibs::InitLibs(const wxString &libpath_format, bool WXUNUSED(showerr))
{ {
#if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG) #if !defined(DISABLE_DYNAMIC_LOADING_FFMPEG)
FreeLibs(); FreeLibs();

View File

@ -256,7 +256,7 @@ public:
///\param showerr - controls whether or not to show an error dialog if libraries cannot be loaded ///\param showerr - controls whether or not to show an error dialog if libraries cannot be loaded
///\return true if initialization completed without errors, false otherwise ///\return true if initialization completed without errors, false otherwise
/// do not call (it is called by FindLibs automatically) /// do not call (it is called by FindLibs automatically)
bool InitLibs(wxString libpath_codec, bool showerr); bool InitLibs(const wxString &libpath_codec, bool showerr);
///! Frees (unloads) loaded libraries ///! Frees (unloads) loaded libraries
void FreeLibs(); void FreeLibs();

View File

@ -358,7 +358,7 @@ bool LabelDialog::Validate()
return true; return true;
} }
wxString LabelDialog::TrackName(int & index, wxString dflt) wxString LabelDialog::TrackName(int & index, const wxString &dflt)
{ {
// Generate a NEW track name if the passed index is out of range // Generate a NEW track name if the passed index is out of range
if (index < 1 || index >= (int)mTrackNames.GetCount()) { if (index < 1 || index >= (int)mTrackNames.GetCount()) {

View File

@ -52,7 +52,7 @@ class LabelDialog:public wxDialog
void FindAllLabels(); void FindAllLabels();
void AddLabels(LabelTrack *t); void AddLabels(LabelTrack *t);
void FindInitialRow(); void FindInitialRow();
wxString TrackName(int & index, wxString dflt = _("Label Track")); wxString TrackName(int & index, const wxString &dflt = _("Label Track"));
void OnUpdate(wxCommandEvent &event); void OnUpdate(wxCommandEvent &event);
void OnInsert(wxCommandEvent &event); void OnInsert(wxCommandEvent &event);

View File

@ -143,7 +143,7 @@ void Lyrics::AddLabels(const LabelTrack *pLT)
mHighlightTextCtrl->AppendText(highlightText); mHighlightTextCtrl->AppendText(highlightText);
} }
void Lyrics::Add(double t, wxString syllable, wxString &highlightText) void Lyrics::Add(double t, const wxString &syllable, wxString &highlightText)
{ {
int i = mSyllables.GetCount(); int i = mSyllables.GetCount();

View File

@ -105,7 +105,7 @@ class Lyrics : public wxPanel
void HandleLayout(); void HandleLayout();
private: private:
void Add(double t, wxString syllable, wxString &highlightText); void Add(double t, const wxString &syllable, wxString &highlightText);
unsigned int GetDefaultFontSize() const; // Depends on mLyricsStyle. Call only after mLyricsStyle is set. unsigned int GetDefaultFontSize() const; // Depends on mLyricsStyle. Call only after mLyricsStyle is set.

View File

@ -53,7 +53,7 @@ END_EVENT_TABLE()
MixerTrackSlider::MixerTrackSlider(wxWindow * parent, MixerTrackSlider::MixerTrackSlider(wxWindow * parent,
wxWindowID id, wxWindowID id,
wxString name, const wxString &name,
const wxPoint & pos, const wxPoint & pos,
const wxSize & size, const wxSize & size,
int style /*= FRAC_SLIDER*/, int style /*= FRAC_SLIDER*/,

View File

@ -36,7 +36,7 @@ class MixerTrackSlider : public ASlider
public: public:
MixerTrackSlider(wxWindow * parent, MixerTrackSlider(wxWindow * parent,
wxWindowID id, wxWindowID id,
wxString name, const wxString &name,
const wxPoint & pos, const wxPoint & pos,
const wxSize & size, const wxSize & size,
int style = FRAC_SLIDER, int style = FRAC_SLIDER,

View File

@ -168,7 +168,7 @@ int Module::Dispatch(ModuleDispatchTypes type)
return 0; return 0;
} }
void * Module::GetSymbol(wxString name) void * Module::GetSymbol(const wxString &name)
{ {
return mLib->GetSymbol(name); return mLib->GetSymbol(name);
} }

View File

@ -53,7 +53,7 @@ public:
bool Load(); bool Load();
void Unload(); void Unload();
int Dispatch(ModuleDispatchTypes type); int Dispatch(ModuleDispatchTypes type);
void * GetSymbol(wxString name); void * GetSymbol(const wxString &name);
private: private:
wxString mName; wxString mName;

View File

@ -724,7 +724,7 @@ Alg_seq_ptr NoteTrack::MakeExportableSeq()
} }
bool NoteTrack::ExportMIDI(wxString f) bool NoteTrack::ExportMIDI(const wxString &f)
{ {
Alg_seq_ptr seq = MakeExportableSeq(); Alg_seq_ptr seq = MakeExportableSeq();
bool rslt = seq->smf_write(f.mb_str()); bool rslt = seq->smf_write(f.mb_str());
@ -732,7 +732,7 @@ bool NoteTrack::ExportMIDI(wxString f)
return rslt; return rslt;
} }
bool NoteTrack::ExportAllegro(wxString f) bool NoteTrack::ExportAllegro(const wxString &f)
{ {
double offset = GetOffset(); double offset = GetOffset();
bool in_seconds; bool in_seconds;

View File

@ -78,8 +78,8 @@ class AUDACITY_DLL_API NoteTrack:public Track {
int GetVisibleChannels(); int GetVisibleChannels();
Alg_seq_ptr MakeExportableSeq(); Alg_seq_ptr MakeExportableSeq();
bool ExportMIDI(wxString f); bool ExportMIDI(const wxString &f);
bool ExportAllegro(wxString f); bool ExportAllegro(const wxString &f);
/* REQUIRES PORTMIDI */ /* REQUIRES PORTMIDI */
// int GetLastMidiPosition() const { return mLastMidiPosition; } // int GetLastMidiPosition() const { return mLastMidiPosition; }

View File

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

View File

@ -301,7 +301,7 @@ private:
// case, we use base64 encoding. // case, we use base64 encoding.
wxString ConvertID(const PluginID & ID); wxString ConvertID(const PluginID & ID);
wxString b64encode(const void *in, int len); wxString b64encode(const void *in, int len);
int b64decode(wxString in, void *out); int b64decode(const wxString &in, void *out);
private: private:
static PluginManager *mInstance; static PluginManager *mInstance;

View File

@ -153,7 +153,7 @@ void HandlePageSetup(wxWindow *parent)
(*gPageSetupData) = pageSetupDialog.GetPageSetupData(); (*gPageSetupData) = pageSetupDialog.GetPageSetupData();
} }
void HandlePrint(wxWindow *parent, wxString name, TrackList *tracks) void HandlePrint(wxWindow *parent, const wxString &name, TrackList *tracks)
{ {
if (gPageSetupData == NULL) if (gPageSetupData == NULL)
gPageSetupData = new wxPageSetupDialogData(); gPageSetupData = new wxPageSetupDialogData();

View File

@ -18,7 +18,7 @@ class wxWindow;
class TrackList; class TrackList;
void HandlePageSetup(wxWindow *parent); void HandlePageSetup(wxWindow *parent);
void HandlePrint(wxWindow *parent, wxString name, TrackList *tracks); void HandlePrint(wxWindow *parent, const wxString &name, TrackList *tracks);
#endif // __AUDACITY_PRINTING__ #endif // __AUDACITY_PRINTING__

View File

@ -2397,7 +2397,7 @@ void AudacityProject::OnOpenAudioFile(wxCommandEvent & event)
} }
// static method, can be called outside of a project // static method, can be called outside of a project
wxArrayString AudacityProject::ShowOpenDialog(wxString extraformat, wxString extrafilter) wxArrayString AudacityProject::ShowOpenDialog(const wxString &extraformat, const wxString &extrafilter)
{ {
FormatList l; FormatList l;
wxString filter; ///< List of file format names and extensions, separated wxString filter; ///< List of file format names and extensions, separated
@ -2605,8 +2605,10 @@ bool AudacityProject::WarnOfLegacyFile( )
// FIXME? This should return a result that is checked. // FIXME? This should return a result that is checked.
// See comment in AudacityApp::MRUOpen(). // See comment in AudacityApp::MRUOpen().
void AudacityProject::OpenFile(wxString fileName, bool addtohistory) void AudacityProject::OpenFile(const wxString &fileNameArg, bool addtohistory)
{ {
wxString fileName(fileNameArg);
// On Win32, we may be given a short (DOS-compatible) file name on rare // On Win32, we may be given a short (DOS-compatible) file name on rare
// occassions (e.g. stuff like "C:\PROGRA~1\AUDACI~1\PROJEC~1.AUP"). We // occassions (e.g. stuff like "C:\PROGRA~1\AUDACI~1\PROJEC~1.AUP"). We
// convert these to long file name first. // convert these to long file name first.
@ -3704,7 +3706,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
#endif #endif
void AudacityProject::AddImportedTracks(wxString fileName, void AudacityProject::AddImportedTracks(const wxString &fileName,
Track **newTracks, int numTracks) Track **newTracks, int numTracks)
{ {
SelectNone(); SelectNone();
@ -3784,7 +3786,7 @@ void AudacityProject::AddImportedTracks(wxString fileName,
} }
// If pNewTrackList is passed in non-NULL, it gets filled with the pointers to NEW tracks. // If pNewTrackList is passed in non-NULL, it gets filled with the pointers to NEW tracks.
bool AudacityProject::Import(wxString fileName, WaveTrackArray* pTrackArray /*= NULL*/) bool AudacityProject::Import(const wxString &fileName, WaveTrackArray* pTrackArray /*= NULL*/)
{ {
Track **newTracks; Track **newTracks;
int numTracks; int numTracks;
@ -3994,8 +3996,8 @@ void AudacityProject::InitialState()
this->UpdateMixerBoard(); this->UpdateMixerBoard();
} }
void AudacityProject::PushState(wxString desc, void AudacityProject::PushState(const wxString &desc,
wxString shortDesc, const wxString &shortDesc,
int flags ) int flags )
{ {
mUndoManager.PushState(mTracks, mViewInfo.selectedRegion, mUndoManager.PushState(mTracks, mViewInfo.selectedRegion,
@ -4627,7 +4629,7 @@ void AudacityProject::EditClipboardByLabel( EditDestFunction action )
// TrackPanel callback method // TrackPanel callback method
void AudacityProject::TP_DisplayStatusMessage(wxString msg) void AudacityProject::TP_DisplayStatusMessage(const wxString &msg)
{ {
mStatusBar->SetStatusText(msg, mainStatusBarField); mStatusBar->SetStatusText(msg, mainStatusBarField);
mLastStatusUpdateTime = ::wxGetUTCTime(); mLastStatusUpdateTime = ::wxGetUTCTime();
@ -4696,7 +4698,7 @@ void AudacityProject::RefreshTPTrack(Track* pTrk, bool refreshbacking /*= true*/
// TrackPanel callback method // TrackPanel callback method
void AudacityProject::TP_PushState(wxString desc, wxString shortDesc, void AudacityProject::TP_PushState(const wxString &desc, const wxString &shortDesc,
int flags) int flags)
{ {
PushState(desc, shortDesc, flags); PushState(desc, shortDesc, flags);

View File

@ -219,17 +219,17 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
* @return Array of file paths which the user selected to open (multiple * @return Array of file paths which the user selected to open (multiple
* selections allowed). * selections allowed).
*/ */
static wxArrayString ShowOpenDialog(wxString extraformat = wxEmptyString, static wxArrayString ShowOpenDialog(const wxString &extraformat = wxEmptyString,
wxString extrafilter = wxEmptyString); const wxString &extrafilter = wxEmptyString);
static bool IsAlreadyOpen(const wxString & projPathName); static bool IsAlreadyOpen(const wxString & projPathName);
static void OpenFiles(AudacityProject *proj); static void OpenFiles(AudacityProject *proj);
void OpenFile(wxString fileName, bool addtohistory = true); void OpenFile(const wxString &fileName, bool addtohistory = true);
bool WarnOfLegacyFile( ); bool WarnOfLegacyFile( );
// If pNewTrackList is passed in non-NULL, it gets filled with the pointers to NEW tracks. // If pNewTrackList is passed in non-NULL, it gets filled with the pointers to NEW tracks.
bool Import(wxString fileName, WaveTrackArray *pTrackArray = NULL); bool Import(const wxString &fileName, WaveTrackArray *pTrackArray = NULL);
void AddImportedTracks(wxString fileName, void AddImportedTracks(const wxString &fileName,
Track **newTracks, int numTracks); Track **newTracks, int numTracks);
void LockAllBlocks(); void LockAllBlocks();
void UnlockAllBlocks(); void UnlockAllBlocks();
@ -394,12 +394,12 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
// TrackPanel callback methods, overrides of TrackPanelListener // TrackPanel callback methods, overrides of TrackPanelListener
virtual void TP_DisplaySelection(); virtual void TP_DisplaySelection();
virtual void TP_DisplayStatusMessage(wxString msg); virtual void TP_DisplayStatusMessage(const wxString &msg) override;
virtual ToolsToolBar * TP_GetToolsToolBar(); virtual ToolsToolBar * TP_GetToolsToolBar();
virtual void TP_PushState(wxString longDesc, wxString shortDesc, virtual void TP_PushState(const wxString &longDesc, const wxString &shortDesc,
int flags); int flags) override;
virtual void TP_ModifyState(bool bWantsAutoSave); // if true, writes auto-save file. Should set only if you really want the state change restored after virtual void TP_ModifyState(bool bWantsAutoSave); // if true, writes auto-save file. Should set only if you really want the state change restored after
// a crash, as it can take many seconds for large (eg. 10 track-hours) projects // a crash, as it can take many seconds for large (eg. 10 track-hours) projects
virtual void TP_RedrawScrollbars(); virtual void TP_RedrawScrollbars();
@ -486,7 +486,7 @@ public:
static void AllProjectsDeleteLock(); static void AllProjectsDeleteLock();
static void AllProjectsDeleteUnlock(); static void AllProjectsDeleteUnlock();
void PushState(wxString desc, wxString shortDesc, void PushState(const wxString &desc, const wxString &shortDesc,
int flags = PUSH_AUTOSAVE); int flags = PUSH_AUTOSAVE);
void RollbackState(); void RollbackState();

View File

@ -708,7 +708,7 @@ bool Sequence::InsertSilence(sampleCount s0, sampleCount len)
return bResult && ConsistencyCheck(wxT("InsertSilence")); return bResult && ConsistencyCheck(wxT("InsertSilence"));
} }
bool Sequence::AppendAlias(wxString fullPath, bool Sequence::AppendAlias(const wxString &fullPath,
sampleCount start, sampleCount start,
sampleCount len, int channel, bool useOD) sampleCount len, int channel, bool useOD)
{ {
@ -728,7 +728,7 @@ bool Sequence::AppendAlias(wxString fullPath,
return true; return true;
} }
bool Sequence::AppendCoded(wxString fName, sampleCount start, bool Sequence::AppendCoded(const wxString &fName, sampleCount start,
sampleCount len, int channel, int decodeType) sampleCount len, int channel, int decodeType)
{ {
// Quick check to make sure that it doesn't overflow // Quick check to make sure that it doesn't overflow

View File

@ -109,11 +109,11 @@ class Sequence: public XMLTagHandler {
bool Append(samplePtr buffer, sampleFormat format, sampleCount len, bool Append(samplePtr buffer, sampleFormat format, sampleCount len,
XMLWriter* blockFileLog=NULL); XMLWriter* blockFileLog=NULL);
bool Delete(sampleCount start, sampleCount len); bool Delete(sampleCount start, sampleCount len);
bool AppendAlias(wxString fullPath, bool AppendAlias(const wxString &fullPath,
sampleCount start, sampleCount start,
sampleCount len, int channel, bool useOD); sampleCount len, int channel, bool useOD);
bool AppendCoded(wxString fName, sampleCount start, bool AppendCoded(const wxString &fName, sampleCount start,
sampleCount len, int channel, int decodeType); sampleCount len, int channel, int decodeType);
///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc. ///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc.

View File

@ -521,7 +521,7 @@ void Tags::WriteXML(XMLWriter &xmlFile)
xmlFile.EndTag(wxT("tags")); xmlFile.EndTag(wxT("tags"));
} }
bool Tags::ShowEditDialog(wxWindow *parent, wxString title, bool force) bool Tags::ShowEditDialog(wxWindow *parent, const wxString &title, bool force)
{ {
if (force) { if (force) {
TagsEditor dlg(parent, title, this, mEditTitle, mEditTrackNumber); TagsEditor dlg(parent, title, this, mEditTitle, mEditTrackNumber);
@ -639,7 +639,7 @@ BEGIN_EVENT_TABLE(TagsEditor, wxDialog)
END_EVENT_TABLE() END_EVENT_TABLE()
TagsEditor::TagsEditor(wxWindow * parent, TagsEditor::TagsEditor(wxWindow * parent,
wxString title, const wxString &title,
Tags * tags, Tags * tags,
bool editTitle, bool editTitle,
bool editTrack) bool editTrack)

View File

@ -78,7 +78,7 @@ class AUDACITY_DLL_API Tags: public XMLTagHandler {
Tags & operator= (const Tags & src ); Tags & operator= (const Tags & src );
bool ShowEditDialog(wxWindow *parent, wxString title, bool force = false); bool ShowEditDialog(wxWindow *parent, const wxString &title, bool force = false);
virtual bool HandleXMLTag(const wxChar *tag, const wxChar **attrs); virtual bool HandleXMLTag(const wxChar *tag, const wxChar **attrs);
virtual XMLTagHandler *HandleXMLChild(const wxChar *tag); virtual XMLTagHandler *HandleXMLChild(const wxChar *tag);
@ -126,7 +126,7 @@ class TagsEditor: public wxDialog
public: public:
// constructors and destructors // constructors and destructors
TagsEditor(wxWindow * parent, TagsEditor(wxWindow * parent,
wxString title, const wxString &title,
Tags * tags, Tags * tags,
bool editTitle, bool editTitle,
bool editTrackNumber); bool editTrackNumber);

View File

@ -103,7 +103,7 @@ const double TimeDialog::GetTimeValue()
return mTime; return mTime;
} }
void TimeDialog::SetFormatString(wxString formatString) void TimeDialog::SetFormatString(const wxString &formatString)
{ {
mFormat = formatString; mFormat = formatString;
TransferDataToWindow(); TransferDataToWindow();

View File

@ -30,7 +30,7 @@ class TimeDialog:public wxDialog
double time, double time,
const wxString &prompt = _("Duration")); const wxString &prompt = _("Duration"));
void SetFormatString(wxString formatString); void SetFormatString(const wxString &formatString);
void SetSampleRate(double sampleRate); void SetSampleRate(double sampleRate);
void SetTimeValue(double newTime); void SetTimeValue(double newTime);
const double GetTimeValue(); const double GetTimeValue();

View File

@ -153,9 +153,9 @@ class AUDACITY_DLL_API Track: public XMLTagHandler
virtual void Merge(const Track &orig); virtual void Merge(const Track &orig);
wxString GetName() const { return mName; } wxString GetName() const { return mName; }
void SetName( wxString n ) { mName = n; } void SetName( const wxString &n ) { mName = n; }
wxString GetDefaultName() const { return mDefaultName; } wxString GetDefaultName() const { return mDefaultName; }
void SetDefaultName( wxString n ) { mDefaultName = n; } void SetDefaultName( const wxString &n ) { mDefaultName = n; }
bool GetSelected() const { return mSelected; } bool GetSelected() const { return mSelected; }
bool GetMute () const { return mMute; } bool GetMute () const { return mMute; }

View File

@ -1491,7 +1491,7 @@ void TrackPanel::OnPaint(wxPaintEvent & /* event */)
/// Makes our Parent (well, whoever is listening to us) push their state. /// Makes our Parent (well, whoever is listening to us) push their state.
/// this causes application state to be preserved on a stack for undo ops. /// this causes application state to be preserved on a stack for undo ops.
void TrackPanel::MakeParentPushState(wxString desc, wxString shortDesc, void TrackPanel::MakeParentPushState(const wxString &desc, const wxString &shortDesc,
int flags) int flags)
{ {
mListener->TP_PushState(desc, shortDesc, flags); mListener->TP_PushState(desc, shortDesc, flags);

View File

@ -457,7 +457,7 @@ protected:
virtual void MakeParentRedrawScrollbars(); virtual void MakeParentRedrawScrollbars();
// AS: Pushing the state preserves state for Undo operations. // AS: Pushing the state preserves state for Undo operations.
virtual void MakeParentPushState(wxString desc, wxString shortDesc, virtual void MakeParentPushState(const wxString &desc, const wxString &shortDesc,
int flags = PUSH_AUTOSAVE); int flags = PUSH_AUTOSAVE);
virtual void MakeParentModifyState(bool bWantsAutoSave); // if true, writes auto-save file. Should set only if you really want the state change restored after virtual void MakeParentModifyState(bool bWantsAutoSave); // if true, writes auto-save file. Should set only if you really want the state change restored after
// a crash, as it can take many seconds for large (eg. 10 track-hours) projects // a crash, as it can take many seconds for large (eg. 10 track-hours) projects

View File

@ -21,11 +21,11 @@ class AUDACITY_DLL_API TrackPanelListener {
virtual ~TrackPanelListener(){}; virtual ~TrackPanelListener(){};
virtual void TP_DisplaySelection() = 0; virtual void TP_DisplaySelection() = 0;
virtual void TP_DisplayStatusMessage(wxString msg) = 0; virtual void TP_DisplayStatusMessage(const wxString &msg) = 0;
virtual ToolsToolBar * TP_GetToolsToolBar() = 0; virtual ToolsToolBar * TP_GetToolsToolBar() = 0;
virtual void TP_PushState(wxString shortDesc, wxString longDesc, virtual void TP_PushState(const wxString &shortDesc, const wxString &longDesc,
int flags = PUSH_AUTOSAVE) = 0; int flags = PUSH_AUTOSAVE) = 0;
virtual void TP_ModifyState(bool bWantsAutoSave) = 0; // if true, writes auto-save file. Should set only if you really want the state change restored after virtual void TP_ModifyState(bool bWantsAutoSave) = 0; // if true, writes auto-save file. Should set only if you really want the state change restored after
// a crash, as it can take many seconds for large (eg. 10 track-hours) projects // a crash, as it can take many seconds for large (eg. 10 track-hours) projects

View File

@ -128,7 +128,7 @@ void UndoManager::GetShortDescription(unsigned int n, wxString *desc)
*desc = stack[n]->shortDescription; *desc = stack[n]->shortDescription;
} }
void UndoManager::SetLongDescription(unsigned int n, wxString desc) void UndoManager::SetLongDescription(unsigned int n, const wxString &desc)
{ {
n -= 1; n -= 1;
@ -212,8 +212,8 @@ void UndoManager::ModifyState(TrackList * l,
void UndoManager::PushState(TrackList * l, void UndoManager::PushState(TrackList * l,
const SelectedRegion &selectedRegion, const SelectedRegion &selectedRegion,
wxString longDescription, const wxString &longDescription,
wxString shortDescription, const wxString &shortDescription,
int flags) int flags)
{ {
unsigned int i; unsigned int i;

View File

@ -82,7 +82,7 @@ class AUDACITY_DLL_API UndoManager {
void PushState(TrackList * l, void PushState(TrackList * l,
const SelectedRegion &selectedRegion, const SelectedRegion &selectedRegion,
wxString longDescription, wxString shortDescription, const wxString &longDescription, const wxString &shortDescription,
int flags = PUSH_AUTOSAVE); int flags = PUSH_AUTOSAVE);
void ModifyState(TrackList * l, void ModifyState(TrackList * l,
const SelectedRegion &selectedRegion); const SelectedRegion &selectedRegion);
@ -94,7 +94,7 @@ class AUDACITY_DLL_API UndoManager {
void GetShortDescription(unsigned int n, wxString *desc); void GetShortDescription(unsigned int n, wxString *desc);
wxLongLong_t GetLongDescription(unsigned int n, wxString *desc, wxString *size); wxLongLong_t GetLongDescription(unsigned int n, wxString *desc, wxString *size);
void SetLongDescription(unsigned int n, wxString desc); void SetLongDescription(unsigned int n, const wxString &desc);
TrackList *SetStateTo(unsigned int n, SelectedRegion *selectedRegion); TrackList *SetStateTo(unsigned int n, SelectedRegion *selectedRegion);
TrackList *Undo(SelectedRegion *selectedRegion); TrackList *Undo(SelectedRegion *selectedRegion);

View File

@ -1297,7 +1297,7 @@ bool WaveClip::Append(samplePtr buffer, sampleFormat format,
return true; return true;
} }
bool WaveClip::AppendAlias(wxString fName, sampleCount start, bool WaveClip::AppendAlias(const wxString &fName, sampleCount start,
sampleCount len, int channel,bool useOD) sampleCount len, int channel,bool useOD)
{ {
bool result = mSequence->AppendAlias(fName, start, len, channel,useOD); bool result = mSequence->AppendAlias(fName, start, len, channel,useOD);
@ -1309,7 +1309,7 @@ bool WaveClip::AppendAlias(wxString fName, sampleCount start,
return result; return result;
} }
bool WaveClip::AppendCoded(wxString fName, sampleCount start, bool WaveClip::AppendCoded(const wxString &fName, sampleCount start,
sampleCount len, int channel, int decodeType) sampleCount len, int channel, int decodeType)
{ {
bool result = mSequence->AppendCoded(fName, start, len, channel, decodeType); bool result = mSequence->AppendCoded(fName, start, len, channel, decodeType);

View File

@ -309,10 +309,10 @@ public:
/// Flush must be called after last Append /// Flush must be called after last Append
bool Flush(); bool Flush();
bool AppendAlias(wxString fName, sampleCount start, bool AppendAlias(const wxString &fName, sampleCount start,
sampleCount len, int channel,bool useOD); sampleCount len, int channel,bool useOD);
bool AppendCoded(wxString fName, sampleCount start, bool AppendCoded(const wxString &fName, sampleCount start,
sampleCount len, int channel, int decodeType); sampleCount len, int channel, int decodeType);
/// This name is consistent with WaveTrack::Clear. It performs a "Cut" /// This name is consistent with WaveTrack::Clear. It performs a "Cut"

View File

@ -1566,14 +1566,14 @@ bool WaveTrack::Append(samplePtr buffer, sampleFormat format,
blockFileLog); blockFileLog);
} }
bool WaveTrack::AppendAlias(wxString fName, sampleCount start, bool WaveTrack::AppendAlias(const wxString &fName, sampleCount start,
sampleCount len, int channel,bool useOD) sampleCount len, int channel,bool useOD)
{ {
return RightmostOrNewClip()->AppendAlias(fName, start, len, channel, useOD); return RightmostOrNewClip()->AppendAlias(fName, start, len, channel, useOD);
} }
bool WaveTrack::AppendCoded(wxString fName, sampleCount start, bool WaveTrack::AppendCoded(const wxString &fName, sampleCount start,
sampleCount len, int channel, int decodeType) sampleCount len, int channel, int decodeType)
{ {
return RightmostOrNewClip()->AppendCoded(fName, start, len, channel, decodeType); return RightmostOrNewClip()->AppendCoded(fName, start, len, channel, decodeType);

View File

@ -202,14 +202,14 @@ class AUDACITY_DLL_API WaveTrack : public Track {
/// Flush must be called after last Append /// Flush must be called after last Append
bool Flush(); bool Flush();
bool AppendAlias(wxString fName, sampleCount start, bool AppendAlias(const wxString &fName, sampleCount start,
sampleCount len, int channel,bool useOD); sampleCount len, int channel,bool useOD);
///for use with On-Demand decoding of compressed files. ///for use with On-Demand decoding of compressed files.
///decodeType should be an enum from ODDecodeTask that specifies what ///decodeType should be an enum from ODDecodeTask that specifies what
///Type of encoded file this is, such as eODFLAC ///Type of encoded file this is, such as eODFLAC
//vvv Why not use the ODTypeEnum typedef to enforce that for the parameter? //vvv Why not use the ODTypeEnum typedef to enforce that for the parameter?
bool AppendCoded(wxString fName, sampleCount start, bool AppendCoded(const wxString &fName, sampleCount start,
sampleCount len, int channel, int decodeType); sampleCount len, int channel, int decodeType);
///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc. ///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc.

View File

@ -81,7 +81,7 @@ void LegacyAliasBlockFile::SaveXML(XMLWriter &xmlFile)
// BuildFromXML methods should always return a BlockFile, not NULL, // BuildFromXML methods should always return a BlockFile, not NULL,
// even if the result is flawed (e.g., refers to nonexistent file), // even if the result is flawed (e.g., refers to nonexistent file),
// as testing will be done in DirManager::ProjectFSCK(). // as testing will be done in DirManager::ProjectFSCK().
BlockFile *LegacyAliasBlockFile::BuildFromXML(wxString projDir, const wxChar **attrs) BlockFile *LegacyAliasBlockFile::BuildFromXML(const wxString &projDir, const wxChar **attrs)
{ {
wxFileName summaryFileName; wxFileName summaryFileName;
wxFileName aliasFileName; wxFileName aliasFileName;

View File

@ -35,7 +35,7 @@ class LegacyAliasBlockFile : public PCMAliasBlockFile
virtual BlockFile *Copy(wxFileName fileName); virtual BlockFile *Copy(wxFileName fileName);
virtual void Recover(); virtual void Recover();
static BlockFile *BuildFromXML(wxString projDir, const wxChar **attrs); static BlockFile *BuildFromXML(const wxString &projDir, const wxChar **attrs);
}; };
#endif #endif

View File

@ -284,7 +284,7 @@ void LegacyBlockFile::SaveXML(XMLWriter &xmlFile)
// even if the result is flawed (e.g., refers to nonexistent file), // even if the result is flawed (e.g., refers to nonexistent file),
// as testing will be done in DirManager::ProjectFSCK(). // as testing will be done in DirManager::ProjectFSCK().
/// static /// static
BlockFile *LegacyBlockFile::BuildFromXML(wxString projDir, const wxChar **attrs, BlockFile *LegacyBlockFile::BuildFromXML(const wxString &projDir, const wxChar **attrs,
sampleCount len, sampleFormat format) sampleCount len, sampleFormat format)
{ {
wxFileName fileName; wxFileName fileName;

View File

@ -60,7 +60,7 @@ class LegacyBlockFile : public BlockFile {
virtual wxLongLong GetSpaceUsage(); virtual wxLongLong GetSpaceUsage();
virtual void Recover(); virtual void Recover();
static BlockFile *BuildFromXML(wxString dir, const wxChar **attrs, static BlockFile *BuildFromXML(const wxString &dir, const wxChar **attrs,
sampleCount len, sampleCount len,
sampleFormat format); sampleFormat format);

View File

@ -39,12 +39,12 @@ void DecoratedCommand::Progress(double completed)
mCommand->Progress(completed); mCommand->Progress(completed);
} }
void DecoratedCommand::Status(wxString message) void DecoratedCommand::Status(const wxString &message)
{ {
mCommand->Status(message); mCommand->Status(message);
} }
void DecoratedCommand::Error(wxString message) void DecoratedCommand::Error(const wxString &message)
{ {
mCommand->Error(message); mCommand->Error(message);
} }
@ -162,12 +162,12 @@ void CommandImplementation::Progress(double completed)
mOutput->Progress(completed); mOutput->Progress(completed);
} }
void CommandImplementation::Status(wxString status) void CommandImplementation::Status(const wxString &status)
{ {
mOutput->Status(status); mOutput->Status(status);
} }
void CommandImplementation::Error(wxString message) void CommandImplementation::Error(const wxString &message)
{ {
mOutput->Error(message); mOutput->Error(message);
} }

View File

@ -61,8 +61,8 @@ class Command
{ {
public: public:
virtual void Progress(double completed) = 0; virtual void Progress(double completed) = 0;
virtual void Status(wxString message) = 0; virtual void Status(const wxString &message) = 0;
virtual void Error(wxString message) = 0; virtual void Error(const wxString &message) = 0;
virtual ~Command() { } virtual ~Command() { }
virtual wxString GetName() = 0; virtual wxString GetName() = 0;
virtual CommandSignature &GetSignature() = 0; virtual CommandSignature &GetSignature() = 0;
@ -77,8 +77,8 @@ protected:
Command *mCommand; Command *mCommand;
public: public:
virtual void Progress(double completed); virtual void Progress(double completed);
virtual void Status(wxString message); virtual void Status(const wxString &message) override;
virtual void Error(wxString message); virtual void Error(const wxString &message) override;
DecoratedCommand(Command *cmd) DecoratedCommand(Command *cmd)
: mCommand(cmd) : mCommand(cmd)
@ -130,8 +130,8 @@ protected:
public: public:
// Convenience methods for passing messages to the output target // Convenience methods for passing messages to the output target
void Progress(double completed); void Progress(double completed);
void Status(wxString status); void Status(const wxString &status) override;
void Error(wxString message); void Error(const wxString &message) override;
/// Constructor should not be called directly; only by a factory which /// Constructor should not be called directly; only by a factory which
/// ensures name and params are set appropriately for the command. /// ensures name and params are set appropriately for the command.

View File

@ -87,7 +87,7 @@ void CommandBuilder::Success(Command *cmd)
} }
void CommandBuilder::BuildCommand(const wxString &cmdName, void CommandBuilder::BuildCommand(const wxString &cmdName,
wxString cmdParams) const wxString &cmdParamsArg)
{ {
// Stage 1: create a Command object of the right type // Stage 1: create a Command object of the right type
@ -106,7 +106,7 @@ void CommandBuilder::BuildCommand(const wxString &cmdName,
wxASSERT(type != NULL); wxASSERT(type != NULL);
mCommand = type->Create(output); mCommand = type->Create(output);
mCommand->SetParameter(wxT("CommandName"), cmdName); mCommand->SetParameter(wxT("CommandName"), cmdName);
mCommand->SetParameter(wxT("ParamString"), cmdParams); mCommand->SetParameter(wxT("ParamString"), cmdParamsArg);
Success(new ApplyAndSendResponse(mCommand)); Success(new ApplyAndSendResponse(mCommand));
return; return;
} }
@ -117,7 +117,7 @@ void CommandBuilder::BuildCommand(const wxString &cmdName,
// Stage 2: set the parameters // Stage 2: set the parameters
ShuttleCli shuttle; ShuttleCli shuttle;
shuttle.mParams = cmdParams; shuttle.mParams = cmdParamsArg;
shuttle.mbStoreInClient = true; shuttle.mbStoreInClient = true;
ParamValueMap::const_iterator iter; ParamValueMap::const_iterator iter;
@ -138,6 +138,8 @@ void CommandBuilder::BuildCommand(const wxString &cmdName,
// Check for unrecognised parameters // Check for unrecognised parameters
wxString cmdParams(cmdParamsArg);
while (cmdParams != wxEmptyString) while (cmdParams != wxEmptyString)
{ {
cmdParams.Trim(true); cmdParams.Trim(true);
@ -166,8 +168,10 @@ void CommandBuilder::BuildCommand(const wxString &cmdName,
Success(new ApplyAndSendResponse(mCommand)); Success(new ApplyAndSendResponse(mCommand));
} }
void CommandBuilder::BuildCommand(wxString cmdString) void CommandBuilder::BuildCommand(const wxString &cmdStringArg)
{ {
wxString cmdString(cmdStringArg);
// Find the command name terminator... If there is more than one word and // Find the command name terminator... If there is more than one word and
// no terminator, the command is badly formed // no terminator, the command is badly formed
cmdString.Trim(true); cmdString.Trim(false); cmdString.Trim(true); cmdString.Trim(false);

View File

@ -31,8 +31,8 @@ class CommandBuilder
void Failure(const wxString &msg = wxEmptyString); void Failure(const wxString &msg = wxEmptyString);
void Success(Command *cmd); void Success(Command *cmd);
void BuildCommand(const wxString &cmdName, wxString cmdParams); void BuildCommand(const wxString &cmdName, const wxString &cmdParams);
void BuildCommand(wxString cmdString); void BuildCommand(const wxString &cmdString);
public: public:
CommandBuilder(const wxString &cmdString); CommandBuilder(const wxString &cmdString);
CommandBuilder(const wxString &cmdName, CommandBuilder(const wxString &cmdName,

View File

@ -957,7 +957,7 @@ void CommandManager::Enable(CommandListEntry *entry, bool enabled)
} }
} }
void CommandManager::Enable(wxString name, bool enabled) void CommandManager::Enable(const wxString &name, bool enabled)
{ {
CommandListEntry *entry = mCommandNameHash[name]; CommandListEntry *entry = mCommandNameHash[name];
if (!entry || !entry->menu) { if (!entry || !entry->menu) {
@ -997,7 +997,7 @@ bool CommandManager::GetEnabled(const wxString &name)
return entry->enabled; return entry->enabled;
} }
void CommandManager::Check(wxString name, bool checked) void CommandManager::Check(const wxString &name, bool checked)
{ {
CommandListEntry *entry = mCommandNameHash[name]; CommandListEntry *entry = mCommandNameHash[name];
if (!entry || !entry->menu) { if (!entry || !entry->menu) {
@ -1008,7 +1008,7 @@ void CommandManager::Check(wxString name, bool checked)
} }
///Changes the label text of a menu item ///Changes the label text of a menu item
void CommandManager::Modify(wxString name, wxString newLabel) void CommandManager::Modify(const wxString &name, const wxString &newLabel)
{ {
CommandListEntry *entry = mCommandNameHash[name]; CommandListEntry *entry = mCommandNameHash[name];
if (entry && entry->menu) { if (entry && entry->menu) {
@ -1017,7 +1017,7 @@ void CommandManager::Modify(wxString name, wxString newLabel)
} }
} }
void CommandManager::SetKeyFromName(wxString name, wxString key) void CommandManager::SetKeyFromName(const wxString &name, const wxString &key)
{ {
CommandListEntry *entry = mCommandNameHash[name]; CommandListEntry *entry = mCommandNameHash[name];
if (entry) { if (entry) {
@ -1025,7 +1025,7 @@ void CommandManager::SetKeyFromName(wxString name, wxString key)
} }
} }
void CommandManager::SetKeyFromIndex(int i, wxString key) void CommandManager::SetKeyFromIndex(int i, const wxString &key)
{ {
const auto &entry = mCommandList[i]; const auto &entry = mCommandList[i];
entry->key = KeyStringNormalize(key); entry->key = KeyStringNormalize(key);
@ -1284,7 +1284,7 @@ void CommandManager::GetAllCommandData(
} }
} }
} }
wxString CommandManager::GetLabelFromName(wxString name) wxString CommandManager::GetLabelFromName(const wxString &name)
{ {
CommandListEntry *entry = mCommandNameHash[name]; CommandListEntry *entry = mCommandNameHash[name];
if (!entry) if (!entry)
@ -1293,7 +1293,7 @@ wxString CommandManager::GetLabelFromName(wxString name)
return entry->label; return entry->label;
} }
wxString CommandManager::GetPrefixedLabelFromName(wxString name) wxString CommandManager::GetPrefixedLabelFromName(const wxString &name)
{ {
CommandListEntry *entry = mCommandNameHash[name]; CommandListEntry *entry = mCommandNameHash[name];
if (!entry) if (!entry)
@ -1310,7 +1310,7 @@ wxString CommandManager::GetPrefixedLabelFromName(wxString name)
#endif #endif
} }
wxString CommandManager::GetCategoryFromName(wxString name) wxString CommandManager::GetCategoryFromName(const wxString &name)
{ {
CommandListEntry *entry = mCommandNameHash[name]; CommandListEntry *entry = mCommandNameHash[name];
if (!entry) if (!entry)
@ -1319,7 +1319,7 @@ wxString CommandManager::GetCategoryFromName(wxString name)
return entry->labelTop; return entry->labelTop;
} }
wxString CommandManager::GetKeyFromName(wxString name) wxString CommandManager::GetKeyFromName(const wxString &name)
{ {
CommandListEntry *entry = mCommandNameHash[name]; CommandListEntry *entry = mCommandNameHash[name];
if (!entry) if (!entry)
@ -1328,7 +1328,7 @@ wxString CommandManager::GetKeyFromName(wxString name)
return entry->key; return entry->key;
} }
wxString CommandManager::GetDefaultKeyFromName(wxString name) wxString CommandManager::GetDefaultKeyFromName(const wxString &name)
{ {
CommandListEntry *entry = mCommandNameHash[name]; CommandListEntry *entry = mCommandNameHash[name];
if (!entry) if (!entry)
@ -1411,7 +1411,7 @@ void CommandManager::SetDefaultFlags(wxUint32 flags, wxUint32 mask)
mDefaultMask = mask; mDefaultMask = mask;
} }
void CommandManager::SetCommandFlags(wxString name, void CommandManager::SetCommandFlags(const wxString &name,
wxUint32 flags, wxUint32 mask) wxUint32 flags, wxUint32 mask)
{ {
CommandListEntry *entry = mCommandNameHash[name]; CommandListEntry *entry = mCommandNameHash[name];

View File

@ -184,7 +184,7 @@ class AUDACITY_DLL_API CommandManager: public XMLTagHandler
// For NEW items/commands // For NEW items/commands
void SetDefaultFlags(wxUint32 flags, wxUint32 mask); void SetDefaultFlags(wxUint32 flags, wxUint32 mask);
void SetCommandFlags(wxString name, wxUint32 flags, wxUint32 mask); void SetCommandFlags(const wxString &name, wxUint32 flags, wxUint32 mask);
void SetCommandFlags(const wxChar **names, void SetCommandFlags(const wxChar **names,
wxUint32 flags, wxUint32 mask); wxUint32 flags, wxUint32 mask);
// Pass multiple command names as const wxChar *, terminated by NULL // Pass multiple command names as const wxChar *, terminated by NULL
@ -195,16 +195,16 @@ class AUDACITY_DLL_API CommandManager: public XMLTagHandler
// //
void EnableUsingFlags(wxUint32 flags, wxUint32 mask); void EnableUsingFlags(wxUint32 flags, wxUint32 mask);
void Enable(wxString name, bool enabled); void Enable(const wxString &name, bool enabled);
void Check(wxString name, bool checked); void Check(const wxString &name, bool checked);
void Modify(wxString name, wxString newLabel); void Modify(const wxString &name, const wxString &newLabel);
// //
// Modifying accelerators // Modifying accelerators
// //
void SetKeyFromName(wxString name, wxString key); void SetKeyFromName(const wxString &name, const wxString &key);
void SetKeyFromIndex(int i, wxString key); void SetKeyFromIndex(int i, const wxString &key);
// //
// Executing commands // Executing commands
@ -231,11 +231,11 @@ class AUDACITY_DLL_API CommandManager: public XMLTagHandler
#endif #endif
bool includeMultis); bool includeMultis);
wxString GetLabelFromName(wxString name); wxString GetLabelFromName(const wxString &name);
wxString GetPrefixedLabelFromName(wxString name); wxString GetPrefixedLabelFromName(const wxString &name);
wxString GetCategoryFromName(wxString name); wxString GetCategoryFromName(const wxString &name);
wxString GetKeyFromName(wxString name); wxString GetKeyFromName(const wxString &name);
wxString GetDefaultKeyFromName(wxString name); wxString GetDefaultKeyFromName(const wxString &name);
bool GetEnabled(const wxString &name); bool GetEnabled(const wxString &name);

View File

@ -66,7 +66,7 @@ class CommandMessageTarget
{ {
public: public:
virtual ~CommandMessageTarget() {} virtual ~CommandMessageTarget() {}
virtual void Update(wxString message) = 0; virtual void Update(const wxString &message) = 0;
}; };
/// ///
@ -93,7 +93,7 @@ class NullMessageTarget : public CommandMessageTarget
{ {
public: public:
virtual ~NullMessageTarget() {} virtual ~NullMessageTarget() {}
virtual void Update(wxString message) {} virtual void Update(const wxString &message) override {}
}; };
/// Displays messages from a command in a wxMessageBox /// Displays messages from a command in a wxMessageBox
@ -101,7 +101,7 @@ class MessageBoxTarget : public CommandMessageTarget
{ {
public: public:
virtual ~MessageBoxTarget() {} virtual ~MessageBoxTarget() {}
virtual void Update(wxString message) virtual void Update(const wxString &message) override
{ {
wxMessageBox(message); wxMessageBox(message);
} }
@ -116,7 +116,7 @@ public:
StatusBarTarget(wxStatusBar &sb) StatusBarTarget(wxStatusBar &sb)
: mStatus(sb) : mStatus(sb)
{} {}
virtual void Update(wxString message) virtual void Update(const wxString &message) override
{ {
mStatus.SetStatusText(message, 0); mStatus.SetStatusText(message, 0);
} }
@ -135,7 +135,7 @@ public:
{ {
mResponseQueue.AddResponse(wxString(wxT("\n"))); mResponseQueue.AddResponse(wxString(wxT("\n")));
} }
virtual void Update(wxString message) virtual void Update(const wxString &message) override
{ {
mResponseQueue.AddResponse(message); mResponseQueue.AddResponse(message);
} }
@ -158,7 +158,7 @@ public:
delete m1; delete m1;
delete m2; delete m2;
} }
virtual void Update(wxString message) virtual void Update(const wxString &message) override
{ {
m1->Update(message); m1->Update(message);
m2->Update(message); m2->Update(message);
@ -220,12 +220,12 @@ public:
if (mProgressTarget) if (mProgressTarget)
mProgressTarget->Update(completed); mProgressTarget->Update(completed);
} }
void Status(wxString status) void Status(const wxString &status)
{ {
if (mStatusTarget) if (mStatusTarget)
mStatusTarget->Update(status); mStatusTarget->Update(status);
} }
void Error(wxString message) void Error(const wxString &message)
{ {
if (mErrorTarget) if (mErrorTarget)
mErrorTarget->Update(message); mErrorTarget->Update(message);

View File

@ -152,7 +152,7 @@ static void Yield()
} }
} }
void ScreenshotCommand::Capture(wxString filename, void ScreenshotCommand::Capture(const wxString &filename,
wxWindow *window, wxWindow *window,
int x, int y, int width, int height, int x, int y, int width, int height,
bool bg) bool bg)
@ -226,7 +226,7 @@ void ScreenshotCommand::Capture(wxString filename,
::wxBell(); ::wxBell();
} }
void ScreenshotCommand::CaptureToolbar(ToolManager *man, int type, wxString name) void ScreenshotCommand::CaptureToolbar(ToolManager *man, int type, const wxString &name)
{ {
bool visible = man->IsVisible(type); bool visible = man->IsVisible(type);
if (!visible) { if (!visible) {
@ -251,7 +251,7 @@ void ScreenshotCommand::CaptureToolbar(ToolManager *man, int type, wxString name
} }
} }
void ScreenshotCommand::CaptureDock(wxWindow *win, wxString fileName) void ScreenshotCommand::CaptureDock(wxWindow *win, const wxString &fileName)
{ {
int x = 0, y = 0; int x = 0, y = 0;
int width, height; int width, height;
@ -311,7 +311,7 @@ Command *ScreenshotCommandType::Create(CommandOutputTarget *target)
return new ScreenshotCommand(*this, target); return new ScreenshotCommand(*this, target);
} }
wxString ScreenshotCommand::MakeFileName(wxString path, wxString basename) wxString ScreenshotCommand::MakeFileName(const wxString &path, const wxString &basename)
{ {
wxFileName prefixPath; wxFileName prefixPath;
prefixPath.AssignDir(path); prefixPath.AssignDir(path);

View File

@ -40,15 +40,15 @@ private:
bool mBackground; bool mBackground;
wxColour mBackColor; wxColour mBackColor;
wxString MakeFileName(wxString path, wxString basename); wxString MakeFileName(const wxString &path, const wxString &basename);
wxRect GetBackgroundRect(); wxRect GetBackgroundRect();
void Capture(wxString basename, void Capture(const wxString &basename,
wxWindow *window, wxWindow *window,
int x, int y, int width, int height, int x, int y, int width, int height,
bool bg = false); bool bg = false);
void CaptureToolbar(ToolManager *man, int type, wxString name); void CaptureToolbar(ToolManager *man, int type, const wxString &name);
void CaptureDock(wxWindow *win, wxString fileName); void CaptureDock(wxWindow *win, const wxString &fileName);
public: public:
wxTopLevelWindow *GetFrontWindow(AudacityProject *project); wxTopLevelWindow *GetFrontWindow(AudacityProject *project);

View File

@ -75,7 +75,7 @@ bool SetProjectInfoCommand::Apply(CommandExecutionContext context)
// *********************** Private Methods ******************* // *********************** Private Methods *******************
void SetProjectInfoCommand::SetAllTracksParam(TrackList *projTracks, wxString boolValueStr, Setter functPtrToSetter) void SetProjectInfoCommand::SetAllTracksParam(TrackList *projTracks, const wxString &boolValueStr, Setter functPtrToSetter)
{ {
unsigned int i=0; unsigned int i=0;
TrackListIterator iter(projTracks); TrackListIterator iter(projTracks);

View File

@ -48,7 +48,7 @@ private:
typedef void (SetProjectInfoCommand::*Setter)(Track *trk, bool setting) const; typedef void (SetProjectInfoCommand::*Setter)(Track *trk, bool setting) const;
// Uses the Function pointer to set a particular parameter within a loop of otherwise duplicate code // Uses the Function pointer to set a particular parameter within a loop of otherwise duplicate code
void SetAllTracksParam(TrackList *projTracks, wxString boolValueStr, Setter functPtrToSetter); void SetAllTracksParam(TrackList *projTracks, const wxString &boolValueStr, Setter functPtrToSetter);
// Function pointer to accessing a particular parameter within a loop of otherwise duplicate code // Function pointer to accessing a particular parameter within a loop of otherwise duplicate code
void setSelected(Track *trk, bool setting) const; void setSelected(Track *trk, bool setting) const;

View File

@ -2022,7 +2022,7 @@ bool Effect::TotalProgress(double frac)
return (updateResult != eProgressSuccess); 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 ? int updateResult = (mProgress ?
mProgress->Update(whichTrack + frac, (double) mNumTracks, msg) : mProgress->Update(whichTrack + frac, (double) mNumTracks, msg) :
@ -2030,7 +2030,7 @@ bool Effect::TrackProgress(int whichTrack, double frac, wxString msg)
return (updateResult != eProgressSuccess); 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 ? int updateResult = (mProgress ?
mProgress->Update(whichGroup + frac, (double) mNumGroups, msg) : 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 // Pass a fraction between 0.0 and 1.0, for the current track
// (when doing one track at a time) // (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 // Pass a fraction between 0.0 and 1.0, for the current track group
// (when doing stereo groups at a time) // (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; } 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 // 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 // Construct normal curve filename
// //
@ -1460,7 +1460,7 @@ void EffectEqualization::LoadCurves(wxString fileName, bool append)
// //
// Save curves to external file // Save curves to external file
// //
void EffectEqualization::SaveCurves(wxString fileName) void EffectEqualization::SaveCurves(const wxString &fileName)
{ {
wxFileName fn; wxFileName fn;
if( fileName == wxT("")) if( fileName == wxT(""))
@ -1601,7 +1601,7 @@ void EffectEqualization::setCurve()
setCurve((int) mCurves.GetCount()-1); setCurve((int) mCurves.GetCount()-1);
} }
void EffectEqualization::setCurve(wxString curveName) void EffectEqualization::setCurve(const wxString &curveName)
{ {
unsigned i = 0; unsigned i = 0;
for( i = 0; i < mCurves.GetCount(); i++ ) for( i = 0; i < mCurves.GetCount(); i++ )
@ -3456,7 +3456,7 @@ void EditCurvesDialog::OnOK(wxCommandEvent & WXUNUSED(event))
#if wxUSE_ACCESSIBILITY #if wxUSE_ACCESSIBILITY
SliderAx::SliderAx( wxWindow * window, wxString fmt ): SliderAx::SliderAx(wxWindow * window, const wxString &fmt) :
wxWindowAccessible( window ) wxWindowAccessible( window )
{ {
mParent = window; mParent = window;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -114,7 +114,7 @@ BEGIN_EVENT_TABLE(NyquistEffect, wxEvtHandler)
wxEVT_COMMAND_CHOICE_SELECTED, NyquistEffect::OnChoice) wxEVT_COMMAND_CHOICE_SELECTED, NyquistEffect::OnChoice)
END_EVENT_TABLE() END_EVENT_TABLE()
NyquistEffect::NyquistEffect(wxString fName) NyquistEffect::NyquistEffect(const wxString &fName)
{ {
mAction = _("Applying Nyquist Effect..."); mAction = _("Applying Nyquist Effect...");
mInputCmd = wxEmptyString; mInputCmd = wxEmptyString;
@ -1290,7 +1290,7 @@ void NyquistEffect::RedirectOutput()
mRedirectOutput = true; mRedirectOutput = true;
} }
void NyquistEffect::SetCommand(wxString cmd) void NyquistEffect::SetCommand(const wxString &cmd)
{ {
mExternal = true; mExternal = true;
@ -1312,7 +1312,7 @@ void NyquistEffect::Stop()
mStop = true; mStop = true;
} }
wxString NyquistEffect::UnQuote(wxString s) wxString NyquistEffect::UnQuote(const wxString &s)
{ {
wxString out; wxString out;
int len = s.Length(); int len = s.Length();
@ -1324,7 +1324,7 @@ wxString NyquistEffect::UnQuote(wxString s)
return 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 /* 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 * 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; wxArrayString tokens;
@ -2237,7 +2237,7 @@ END_EVENT_TABLE()
NyquistOutputDialog::NyquistOutputDialog(wxWindow * parent, wxWindowID id, NyquistOutputDialog::NyquistOutputDialog(wxWindow * parent, wxWindowID id,
const wxString & title, const wxString & title,
const wxString & prompt, const wxString & prompt,
wxString message) const wxString &message)
: wxDialog(parent, id, title) : wxDialog(parent, id, title)
{ {
SetName(GetTitle()); SetName(GetTitle());

View File

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

View File

@ -242,35 +242,6 @@ wxWindow *ExportPlugin::OptionsCreate(wxWindow *parent, int WXUNUSED(format))
return p; 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 //Create a mixer by computing the time warp factor
Mixer* ExportPlugin::CreateMixer(int numInputTracks, WaveTrack **inputTracks, Mixer* ExportPlugin::CreateMixer(int numInputTracks, WaveTrack **inputTracks,
TimeTrack *timeTrack, TimeTrack *timeTrack,
@ -952,7 +923,7 @@ ExportMixerPanel::~ExportMixerPanel()
} }
//set the font on memDC such that text can fit in specified width and height //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 height )
{ {
int l = 0, u = 13, m, w, h; int l = 0, u = 13, m, w, h;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -54,7 +54,7 @@ private:
* labels that define them (true), or just numbered (false). * labels that define them (true), or just numbered (false).
* @param prefix The string used to prefix the file number if files are being * @param prefix The string used to prefix the file number if files are being
* numbered rather than named */ * 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 /** \brief Export each track in the project to a separate file
* *
@ -62,7 +62,7 @@ private:
* (true), or just numbered (false). * (true), or just numbered (false).
* @param prefix The string used to prefix the file number if files are being * @param prefix The string used to prefix the file number if files are being
* numbered rather than named */ * 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 /** 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 /** \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 * be used as a file name, if necessary prompting the user to edit the file
* name produced */ * name produced */
wxString MakeFileName(wxString input); wxString MakeFileName(const wxString &input);
// Dialog // Dialog
void PopulateOrExchange(ShuttleGui& S); void PopulateOrExchange(ShuttleGui& S);
void EnableControls(); void EnableControls();

View File

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

View File

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

View File

@ -348,7 +348,7 @@ ExtImportItem *Importer::CreateDefaultImportItem()
} }
// returns number of tracks imported // returns number of tracks imported
int Importer::Import(wxString fName, int Importer::Import(const wxString &fName,
TrackFactory *trackFactory, TrackFactory *trackFactory,
Track *** tracks, Track *** tracks,
Tags *tags, Tags *tags,

View File

@ -31,7 +31,7 @@ public:
wxString formatName; wxString formatName;
wxArrayString formatExtensions; wxArrayString formatExtensions;
Format(wxString _formatName, wxArrayString _formatExtensions): Format(const wxString &_formatName, const wxArrayString &_formatExtensions):
formatName(_formatName), formatName(_formatName),
formatExtensions(_formatExtensions) formatExtensions(_formatExtensions)
{ {
@ -139,7 +139,7 @@ public:
// returns number of tracks imported // returns number of tracks imported
// if zero, the import failed and errorMessage will be set. // if zero, the import failed and errorMessage will be set.
int Import(wxString fName, int Import(const wxString &fName,
TrackFactory *trackFactory, TrackFactory *trackFactory,
Track *** tracks, Track *** tracks,
Tags *tags, Tags *tags,

View File

@ -182,7 +182,7 @@ public:
wxString GetPluginFormatDescription(); wxString GetPluginFormatDescription();
///! Probes the file and opens it if appropriate ///! Probes the file and opens it if appropriate
ImportFileHandle *Open(wxString Filename); ImportFileHandle *Open(const wxString &Filename) override;
}; };
///! Does acual import, returned by FFmpegImportPlugin::Open ///! Does acual import, returned by FFmpegImportPlugin::Open
@ -292,7 +292,7 @@ wxString FFmpegImportPlugin::GetPluginFormatDescription()
return DESC; return DESC;
} }
ImportFileHandle *FFmpegImportPlugin::Open(wxString filename) ImportFileHandle *FFmpegImportPlugin::Open(const wxString &filename)
{ {
FFmpegImportFileHandle *handle = new FFmpegImportFileHandle(filename); FFmpegImportFileHandle *handle = new FFmpegImportFileHandle(filename);

View File

@ -138,7 +138,7 @@ class FLACImportPlugin : public ImportPlugin
wxString GetPluginStringID() { return wxT("libflac"); } wxString GetPluginStringID() { return wxT("libflac"); }
wxString GetPluginFormatDescription(); wxString GetPluginFormatDescription();
ImportFileHandle *Open(wxString Filename); ImportFileHandle *Open(const wxString &Filename) override;
}; };
@ -289,7 +289,7 @@ wxString FLACImportPlugin::GetPluginFormatDescription()
} }
ImportFileHandle *FLACImportPlugin::Open(wxString filename) ImportFileHandle *FLACImportPlugin::Open(const wxString &filename)
{ {
// First check if it really is a FLAC file // First check if it really is a FLAC file

View File

@ -113,7 +113,7 @@ public:
wxString GetPluginStringID() { return wxT("lof"); } wxString GetPluginStringID() { return wxT("lof"); }
wxString GetPluginFormatDescription(); wxString GetPluginFormatDescription();
ImportFileHandle *Open(wxString Filename); ImportFileHandle *Open(const wxString &Filename) override;
}; };
@ -181,7 +181,7 @@ wxString LOFImportPlugin::GetPluginFormatDescription()
return DESC; return DESC;
} }
ImportFileHandle *LOFImportPlugin::Open(wxString filename) ImportFileHandle *LOFImportPlugin::Open(const wxString &filename)
{ {
// Check if it is a binary file // Check if it is a binary file
wxFile binaryFile; wxFile binaryFile;

View File

@ -25,7 +25,7 @@
#include "../NoteTrack.h" #include "../NoteTrack.h"
#include "ImportMIDI.h" #include "ImportMIDI.h"
bool ImportMIDI(wxString fName, NoteTrack * dest) bool ImportMIDI(const wxString &fName, NoteTrack * dest)
{ {
if (fName.Length() <= 4){ if (fName.Length() <= 4){
wxMessageBox( _("Could not open file ") + fName + _(": Filename too short.")); wxMessageBox( _("Could not open file ") + fName + _(": Filename too short."));

View File

@ -24,7 +24,7 @@ into a NoteTrack.
class NoteTrack; class NoteTrack;
bool ImportMIDI(wxString fName, NoteTrack * dest); bool ImportMIDI(const wxString &fName, NoteTrack * dest);
class MIDIParser { class MIDIParser {
public: public:

View File

@ -114,7 +114,7 @@ public:
wxString GetPluginStringID() { return wxT("libmad"); } wxString GetPluginStringID() { return wxT("libmad"); }
wxString GetPluginFormatDescription(); wxString GetPluginFormatDescription();
ImportFileHandle *Open(wxString Filename); ImportFileHandle *Open(const wxString &Filename) override;
}; };
class MP3ImportFileHandle : public ImportFileHandle class MP3ImportFileHandle : public ImportFileHandle
@ -176,7 +176,7 @@ wxString MP3ImportPlugin::GetPluginFormatDescription()
return DESC; return DESC;
} }
ImportFileHandle *MP3ImportPlugin::Open(wxString Filename) ImportFileHandle *MP3ImportPlugin::Open(const wxString &Filename)
{ {
wxFile *file = new wxFile(Filename); wxFile *file = new wxFile(Filename);

View File

@ -92,7 +92,7 @@ public:
wxString GetPluginStringID() { return wxT("liboggvorbis"); } wxString GetPluginStringID() { return wxT("liboggvorbis"); }
wxString GetPluginFormatDescription(); wxString GetPluginFormatDescription();
ImportFileHandle *Open(wxString Filename); ImportFileHandle *Open(const wxString &Filename) override;
}; };
@ -171,7 +171,7 @@ wxString OggImportPlugin::GetPluginFormatDescription()
return DESC; return DESC;
} }
ImportFileHandle *OggImportPlugin::Open(wxString filename) ImportFileHandle *OggImportPlugin::Open(const wxString &filename)
{ {
OggVorbis_File *vorbisFile = new OggVorbis_File; OggVorbis_File *vorbisFile = new OggVorbis_File;
wxFFile *file = new wxFFile(filename, wxT("rb")); wxFFile *file = new wxFFile(filename, wxT("rb"));

View File

@ -82,7 +82,7 @@ public:
wxString GetPluginStringID() { return wxT("libsndfile"); } wxString GetPluginStringID() { return wxT("libsndfile"); }
wxString GetPluginFormatDescription(); wxString GetPluginFormatDescription();
ImportFileHandle *Open(wxString Filename); ImportFileHandle *Open(const wxString &Filename) override;
}; };
@ -120,7 +120,7 @@ wxString PCMImportPlugin::GetPluginFormatDescription()
return DESC; return DESC;
} }
ImportFileHandle *PCMImportPlugin::Open(wxString filename) ImportFileHandle *PCMImportPlugin::Open(const wxString &filename)
{ {
SF_INFO info; SF_INFO info;
SNDFILE *file = NULL; SNDFILE *file = NULL;

View File

@ -90,7 +90,7 @@ public:
return mExtensions; return mExtensions;
} }
bool SupportsExtension(wxString extension) bool SupportsExtension(const wxString &extension)
{ {
// Case-insensitive check if extension is supported // Case-insensitive check if extension is supported
return mExtensions.Index(extension, false) != wxNOT_FOUND; return mExtensions.Index(extension, false) != wxNOT_FOUND;
@ -99,7 +99,7 @@ public:
// Open the given file, returning true if it is in a recognized // Open the given file, returning true if it is in a recognized
// format, false otherwise. This puts the importer into the open // format, false otherwise. This puts the importer into the open
// state. // state.
virtual ImportFileHandle *Open(wxString Filename) = 0; virtual ImportFileHandle *Open(const wxString &Filename) = 0;
virtual ~ImportPlugin() { } virtual ~ImportPlugin() { }
@ -178,7 +178,7 @@ protected:
class UnusableImportPlugin class UnusableImportPlugin
{ {
public: public:
UnusableImportPlugin(wxString formatName, wxArrayString extensions): UnusableImportPlugin(const wxString &formatName, wxArrayString extensions):
mFormatName(formatName), mFormatName(formatName),
mExtensions(extensions) mExtensions(extensions)
{ {
@ -189,7 +189,7 @@ public:
return mFormatName; return mFormatName;
} }
bool SupportsExtension(wxString extension) bool SupportsExtension(const wxString &extension)
{ {
return mExtensions.Index(extension, false) != wxNOT_FOUND; return mExtensions.Index(extension, false) != wxNOT_FOUND;
} }

View File

@ -93,7 +93,7 @@ class ImportRawDialog:public wxDialog {
DECLARE_EVENT_TABLE() DECLARE_EVENT_TABLE()
}; };
int ImportRaw(wxWindow *parent, wxString fileName, int ImportRaw(wxWindow *parent, const wxString &fileName,
TrackFactory *trackFactory, Track ***outTracks) TrackFactory *trackFactory, Track ***outTracks)
{ {
int encoding = 0; // Guess Format int encoding = 0; // Guess Format

View File

@ -17,7 +17,7 @@ class WaveTrack;
class DirManager; class DirManager;
class wxWindow; class wxWindow;
int ImportRaw(wxWindow *parent, wxString fileName, int ImportRaw(wxWindow *parent, const wxString &fileName,
TrackFactory *trackFactory, Track ***outTracks); TrackFactory *trackFactory, Track ***outTracks);
#endif #endif

View File

@ -138,7 +138,7 @@ bool ModulePrefs::Apply()
// static function that tells us about a module. // static function that tells us about a module.
int ModulePrefs::GetModuleStatus( wxString fname ){ int ModulePrefs::GetModuleStatus(const wxString &fname){
// Default status is NEW module, and we will ask once. // Default status is NEW module, and we will ask once.
int iStatus = kModuleNew; int iStatus = kModuleNew;
@ -152,7 +152,7 @@ int ModulePrefs::GetModuleStatus( wxString fname ){
return iStatus; return iStatus;
} }
void ModulePrefs::SetModuleStatus( wxString fname, int iStatus ){ void ModulePrefs::SetModuleStatus(const wxString &fname, int iStatus){
wxString ShortName = wxFileName( fname ).GetName(); wxString ShortName = wxFileName( fname ).GetName();
wxString PrefName = wxString( wxT("/Module/") ) + ShortName.Lower(); wxString PrefName = wxString( wxT("/Module/") ) + ShortName.Lower();
gPrefs->Write( PrefName, iStatus ); gPrefs->Write( PrefName, iStatus );

View File

@ -38,8 +38,8 @@ class ModulePrefs:public PrefsPanel
~ModulePrefs(); ~ModulePrefs();
virtual bool Apply(); virtual bool Apply();
static int GetModuleStatus( wxString fname ); static int GetModuleStatus( const wxString &fname );
static void SetModuleStatus( wxString fname, int iStatus ); static void SetModuleStatus( const wxString &fname, int iStatus );
private: private:
void GetAllModuleStatuses(); void GetAllModuleStatuses();

View File

@ -448,7 +448,7 @@ void PrefsDialog::OnOK(wxCommandEvent & WXUNUSED(event))
EndModal(true); EndModal(true);
} }
void PrefsDialog::SelectPageByName(wxString pageName) void PrefsDialog::SelectPageByName(const wxString &pageName)
{ {
if (mCategories) { if (mCategories) {
size_t n = mCategories->GetPageCount(); size_t n = mCategories->GetPageCount();

View File

@ -61,7 +61,7 @@ class PrefsDialog:public wxDialog
void OnApply(wxCommandEvent & e); void OnApply(wxCommandEvent & e);
void OnTreeKeyDown(wxTreeEvent & e); // Used to dismiss the dialog when enter is pressed with focus on tree void OnTreeKeyDown(wxTreeEvent & e); // Used to dismiss the dialog when enter is pressed with focus on tree
void SelectPageByName(wxString pageName); void SelectPageByName(const wxString &pageName);
// Accessor to help implementations of SavePreferredPage(), // Accessor to help implementations of SavePreferredPage(),
// such as by saving a preference after DoModal() returns // such as by saving a preference after DoModal() returns

View File

@ -43,7 +43,7 @@ ThemePrefs.
class PrefsPanel:public wxPanel class PrefsPanel:public wxPanel
{ {
public: public:
PrefsPanel(wxWindow * parent, wxString title) PrefsPanel(wxWindow * parent, const wxString &title)
: wxPanel(parent, wxID_ANY) : wxPanel(parent, wxID_ANY)
{ {
SetLabel(title); // Provide visual label SetLabel(title); // Provide visual label

View File

@ -342,7 +342,7 @@ static const wxPoint2DDouble disabledRightEnd[] =
// Construct customizable slider // Construct customizable slider
LWSlider::LWSlider(wxWindow * parent, LWSlider::LWSlider(wxWindow * parent,
wxString name, const wxString &name,
const wxPoint &pos, const wxPoint &pos,
const wxSize &size, const wxSize &size,
float minValue, float minValue,
@ -412,7 +412,7 @@ void LWSlider::SetStyle(int style)
// Construct predefined slider // Construct predefined slider
LWSlider::LWSlider(wxWindow *parent, LWSlider::LWSlider(wxWindow *parent,
wxString name, const wxString &name,
const wxPoint &pos, const wxPoint &pos,
const wxSize &size, const wxSize &size,
int style, int style,
@ -475,7 +475,7 @@ LWSlider::LWSlider(wxWindow *parent,
} }
void LWSlider::Init(wxWindow * parent, void LWSlider::Init(wxWindow * parent,
wxString name, const wxString &name,
const wxPoint &pos, const wxPoint &pos,
const wxSize &size, const wxSize &size,
float minValue, float minValue,
@ -1582,7 +1582,7 @@ END_EVENT_TABLE()
ASlider::ASlider( wxWindow * parent, ASlider::ASlider( wxWindow * parent,
wxWindowID id, wxWindowID id,
wxString name, const wxString &name,
const wxPoint & pos, const wxPoint & pos,
const wxSize & size, const wxSize & size,
int style, int style,

View File

@ -78,7 +78,7 @@ class LWSlider
// MM: Construct customizable slider // MM: Construct customizable slider
LWSlider(wxWindow * parent, LWSlider(wxWindow * parent,
wxString name, const wxString &name,
const wxPoint &pos, const wxPoint &pos,
const wxSize &size, const wxSize &size,
float minValue, float minValue,
@ -92,7 +92,7 @@ class LWSlider
// Construct predefined slider // Construct predefined slider
LWSlider(wxWindow * parent, LWSlider(wxWindow * parent,
wxString name, const wxString &name,
const wxPoint &pos, const wxPoint &pos,
const wxSize &size, const wxSize &size,
int style, int style,
@ -101,7 +101,7 @@ class LWSlider
int orientation = wxHORIZONTAL); // wxHORIZONTAL or wxVERTICAL. wxVERTICAL is currently only for DB_SLIDER. int orientation = wxHORIZONTAL); // wxHORIZONTAL or wxVERTICAL. wxVERTICAL is currently only for DB_SLIDER.
void Init(wxWindow * parent, void Init(wxWindow * parent,
wxString name, const wxString &name,
const wxPoint &pos, const wxPoint &pos,
const wxSize &size, const wxSize &size,
float minValue, float minValue,
@ -255,7 +255,7 @@ class ASlider :public wxPanel
public: public:
ASlider( wxWindow * parent, ASlider( wxWindow * parent,
wxWindowID id, wxWindowID id,
wxString name, const wxString &name,
const wxPoint & pos, const wxPoint & pos,
const wxSize & size, const wxSize & size,
int style = FRAC_SLIDER, int style = FRAC_SLIDER,

Some files were not shown because too many files have changed in this diff Show More