Sweep unnecessary wxString copies: rest

This commit is contained in:
Paul Licameli 2016-02-22 21:18:11 -05:00
parent 6597575f6a
commit 9bf098c7d9
44 changed files with 108 additions and 103 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
* 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 += libname;

View File

@ -76,7 +76,7 @@ class AboutDialog:public wxDialog {
void AddCredit(wxString &&description, 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);
};

View File

@ -769,7 +769,7 @@ END_EVENT_TABLE()
// TODO: Would be nice to make this handle not opening a file with more panache.
// - Inform the user if DefaultOpenPath not set.
// - 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.
// - some rationalisation might be possible.
@ -1630,7 +1630,7 @@ bool AudacityApp::InitTempDir()
//
// 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());
mChecker = new wxSingleInstanceChecker();
@ -1868,12 +1868,12 @@ wxCmdLineParser *AudacityApp::ParseCommandLine()
}
// static
void AudacityApp::AddUniquePathToPathList(wxString path,
void AudacityApp::AddUniquePathToPathList(const wxString &pathArg,
wxArrayString &pathList)
{
wxFileName pathNorm = path;
wxFileName pathNorm = pathArg;
pathNorm.Normalize();
path = pathNorm.GetFullPath();
wxString path = pathNorm.GetFullPath();
for(unsigned int i=0; i<pathList.GetCount(); i++) {
if (wxFileName(path) == wxFileName(pathList[i]))
@ -1884,9 +1884,10 @@ void AudacityApp::AddUniquePathToPathList(wxString path,
}
// static
void AudacityApp::AddMultiPathsToPathList(wxString multiPathString,
void AudacityApp::AddMultiPathsToPathList(const wxString &multiPathStringArg,
wxArrayString &pathList)
{
wxString multiPathString(multiPathStringArg);
while (multiPathString != wxT("")) {
wxString onePath = multiPathString.BeforeFirst(wxPATH_SEP[0]);
multiPathString = multiPathString.AfterFirst(wxPATH_SEP[0]);

View File

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

View File

@ -841,7 +841,7 @@ wxString HostName(const PaDeviceInfo* info)
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 *rInfo = Pa_GetDeviceInfo(AudioIO::getRecordDevIndex(rec));
@ -2920,8 +2920,9 @@ int AudioIO::getRecordSourceIndex(PxMixer *portMixer)
}
#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 (devName.IsEmpty())
{
@ -2973,8 +2974,9 @@ int AudioIO::getPlayDevIndex(wxString devName)
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 (devName.IsEmpty())
{

View File

@ -388,7 +388,7 @@ class AUDACITY_DLL_API AudioIO {
/** \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
*
@ -475,7 +475,7 @@ private:
* and would be neater done once. If the device isn't found, return the
* 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.
*
* 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
* 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
*

View File

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

View File

@ -33,7 +33,7 @@ class BatchCommands {
void AbortBatch();
// 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 );
double GetEndTime();
bool IsMono();

View File

@ -561,12 +561,12 @@ wxString DirManager::GetDataFilesDir() const
return projFull != wxT("")? projFull: mytemp;
}
void DirManager::SetLocalTempDir(wxString path)
void DirManager::SetLocalTempDir(const wxString &path)
{
mytemp = path;
}
wxFileName DirManager::MakeBlockFilePath(wxString value){
wxFileName DirManager::MakeBlockFilePath(const wxString &value) {
wxFileName dir;
dir.AssignDir(GetDataFilesDir());
@ -596,7 +596,7 @@ wxFileName DirManager::MakeBlockFilePath(wxString value){
}
bool DirManager::AssignFile(wxFileName &fileName,
wxString value,
const wxString &value,
bool diskcheck)
{
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();
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
// locked blockfiles; this is actually harmless as the rmdir will fail
// on non-empty directories.
void DirManager::BalanceInfoDel(wxString file)
void DirManager::BalanceInfoDel(const wxString &file)
{
const wxChar *s=file.c_str();
if(s[0]==wxT('e')){
@ -887,7 +887,7 @@ BlockFile *DirManager::NewSimpleBlockFile(
}
BlockFile *DirManager::NewAliasBlockFile(
wxString aliasedFile, sampleCount aliasStart,
const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel)
{
wxFileName fileName = MakeBlockFileName();
@ -903,7 +903,7 @@ BlockFile *DirManager::NewAliasBlockFile(
}
BlockFile *DirManager::NewODAliasBlockFile(
wxString aliasedFile, sampleCount aliasStart,
const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel)
{
wxFileName fileName = MakeBlockFileName();
@ -919,7 +919,7 @@ BlockFile *DirManager::NewODAliasBlockFile(
}
BlockFile *DirManager::NewODDecodeBlockFile(
wxString aliasedFile, sampleCount aliasStart,
const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel, int decodeType)
{
wxFileName fileName = MakeBlockFileName();
@ -943,7 +943,7 @@ bool DirManager::ContainsBlockFile(BlockFile *b) const
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
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.
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
void Ref();
@ -64,19 +64,19 @@ class DirManager: public XMLTagHandler {
sampleFormat format,
bool allowDeferredWrite = false);
BlockFile *NewAliasBlockFile( wxString aliasedFile, sampleCount aliasStart,
BlockFile *NewAliasBlockFile( const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel);
BlockFile *NewODAliasBlockFile( wxString aliasedFile, sampleCount aliasStart,
BlockFile *NewODAliasBlockFile( const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel);
BlockFile *NewODDecodeBlockFile( wxString aliasedFile, sampleCount aliasStart,
BlockFile *NewODDecodeBlockFile( const wxString &aliasedFile, sampleCount aliasStart,
sampleCount aliasLen, int aliasChannel, int decodeType);
/// Returns true if the blockfile pointed to by b is contained by the DirManager
bool ContainsBlockFile(BlockFile *b) const;
/// 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,
// 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);
XMLTagHandler *HandleXMLChild(const wxChar * WXUNUSED(tag)) { return NULL; }
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
// 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;
// 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
// auto recovery is cancelled and should be retried later
@ -169,7 +169,7 @@ class DirManager: public XMLTagHandler {
private:
wxFileName MakeBlockFileName();
wxFileName MakeBlockFilePath(wxString value);
wxFileName MakeBlockFilePath(const wxString &value);
bool MoveOrCopyToNewProjectDirectory(BlockFile *f, bool copy);
@ -181,8 +181,8 @@ class DirManager: public XMLTagHandler {
DirHash dirMidPool; // available two-level dirs
DirHash dirMidFull; // full two-level dirs
void BalanceInfoDel(wxString);
void BalanceInfoAdd(wxString);
void BalanceInfoDel(const wxString&);
void BalanceInfoAdd(const wxString&);
void BalanceFileAdd(int);
int BalanceMidAdd(int, int);

View File

@ -715,7 +715,7 @@ bool FFmpegLibs::ValidLibsLoaded()
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)
FreeLibs();

View File

@ -256,7 +256,7 @@ public:
///\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
/// 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
void FreeLibs();

View File

@ -358,7 +358,7 @@ bool LabelDialog::Validate()
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
if (index < 1 || index >= (int)mTrackNames.GetCount()) {

View File

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

View File

@ -143,7 +143,7 @@ void Lyrics::AddLabels(const LabelTrack *pLT)
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();

View File

@ -105,7 +105,7 @@ class Lyrics : public wxPanel
void HandleLayout();
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.

View File

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

View File

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

View File

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

View File

@ -53,7 +53,7 @@ public:
bool Load();
void Unload();
int Dispatch(ModuleDispatchTypes type);
void * GetSymbol(wxString name);
void * GetSymbol(const wxString &name);
private:
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();
bool rslt = seq->smf_write(f.mb_str());
@ -732,7 +732,7 @@ bool NoteTrack::ExportMIDI(wxString f)
return rslt;
}
bool NoteTrack::ExportAllegro(wxString f)
bool NoteTrack::ExportAllegro(const wxString &f)
{
double offset = GetOffset();
bool in_seconds;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -2397,7 +2397,7 @@ void AudacityProject::OnOpenAudioFile(wxCommandEvent & event)
}
// 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;
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.
// 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
// occassions (e.g. stuff like "C:\PROGRA~1\AUDACI~1\PROJEC~1.AUP"). We
// convert these to long file name first.
@ -3704,7 +3706,7 @@ bool AudacityProject::Save(bool overwrite /* = true */ ,
#endif
void AudacityProject::AddImportedTracks(wxString fileName,
void AudacityProject::AddImportedTracks(const wxString &fileName,
Track **newTracks, int numTracks)
{
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.
bool AudacityProject::Import(wxString fileName, WaveTrackArray* pTrackArray /*= NULL*/)
bool AudacityProject::Import(const wxString &fileName, WaveTrackArray* pTrackArray /*= NULL*/)
{
Track **newTracks;
int numTracks;
@ -3994,8 +3996,8 @@ void AudacityProject::InitialState()
this->UpdateMixerBoard();
}
void AudacityProject::PushState(wxString desc,
wxString shortDesc,
void AudacityProject::PushState(const wxString &desc,
const wxString &shortDesc,
int flags )
{
mUndoManager.PushState(mTracks, mViewInfo.selectedRegion,
@ -4627,7 +4629,7 @@ void AudacityProject::EditClipboardByLabel( EditDestFunction action )
// TrackPanel callback method
void AudacityProject::TP_DisplayStatusMessage(wxString msg)
void AudacityProject::TP_DisplayStatusMessage(const wxString &msg)
{
mStatusBar->SetStatusText(msg, mainStatusBarField);
mLastStatusUpdateTime = ::wxGetUTCTime();
@ -4696,7 +4698,7 @@ void AudacityProject::RefreshTPTrack(Track* pTrk, bool refreshbacking /*= true*/
// TrackPanel callback method
void AudacityProject::TP_PushState(wxString desc, wxString shortDesc,
void AudacityProject::TP_PushState(const wxString &desc, const wxString &shortDesc,
int 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
* selections allowed).
*/
static wxArrayString ShowOpenDialog(wxString extraformat = wxEmptyString,
wxString extrafilter = wxEmptyString);
static wxArrayString ShowOpenDialog(const wxString &extraformat = wxEmptyString,
const wxString &extrafilter = wxEmptyString);
static bool IsAlreadyOpen(const wxString & projPathName);
static void OpenFiles(AudacityProject *proj);
void OpenFile(wxString fileName, bool addtohistory = true);
void OpenFile(const wxString &fileName, bool addtohistory = true);
bool WarnOfLegacyFile( );
// 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);
void LockAllBlocks();
void UnlockAllBlocks();
@ -394,12 +394,12 @@ class AUDACITY_DLL_API AudacityProject: public wxFrame,
// TrackPanel callback methods, overrides of TrackPanelListener
virtual void TP_DisplaySelection();
virtual void TP_DisplayStatusMessage(wxString msg);
virtual void TP_DisplayStatusMessage(const wxString &msg) override;
virtual ToolsToolBar * TP_GetToolsToolBar();
virtual void TP_PushState(wxString longDesc, wxString shortDesc,
int flags);
virtual void TP_PushState(const wxString &longDesc, const wxString &shortDesc,
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
// a crash, as it can take many seconds for large (eg. 10 track-hours) projects
virtual void TP_RedrawScrollbars();
@ -486,7 +486,7 @@ public:
static void AllProjectsDeleteLock();
static void AllProjectsDeleteUnlock();
void PushState(wxString desc, wxString shortDesc,
void PushState(const wxString &desc, const wxString &shortDesc,
int flags = PUSH_AUTOSAVE);
void RollbackState();

View File

@ -708,7 +708,7 @@ bool Sequence::InsertSilence(sampleCount s0, sampleCount len)
return bResult && ConsistencyCheck(wxT("InsertSilence"));
}
bool Sequence::AppendAlias(wxString fullPath,
bool Sequence::AppendAlias(const wxString &fullPath,
sampleCount start,
sampleCount len, int channel, bool useOD)
{
@ -728,7 +728,7 @@ bool Sequence::AppendAlias(wxString fullPath,
return true;
}
bool Sequence::AppendCoded(wxString fName, sampleCount start,
bool Sequence::AppendCoded(const wxString &fName, sampleCount start,
sampleCount len, int channel, int decodeType)
{
// 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,
XMLWriter* blockFileLog=NULL);
bool Delete(sampleCount start, sampleCount len);
bool AppendAlias(wxString fullPath,
bool AppendAlias(const wxString &fullPath,
sampleCount start,
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);
///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"));
}
bool Tags::ShowEditDialog(wxWindow *parent, wxString title, bool force)
bool Tags::ShowEditDialog(wxWindow *parent, const wxString &title, bool force)
{
if (force) {
TagsEditor dlg(parent, title, this, mEditTitle, mEditTrackNumber);
@ -639,7 +639,7 @@ BEGIN_EVENT_TABLE(TagsEditor, wxDialog)
END_EVENT_TABLE()
TagsEditor::TagsEditor(wxWindow * parent,
wxString title,
const wxString &title,
Tags * tags,
bool editTitle,
bool editTrack)

View File

@ -78,7 +78,7 @@ class AUDACITY_DLL_API Tags: public XMLTagHandler {
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 XMLTagHandler *HandleXMLChild(const wxChar *tag);
@ -126,7 +126,7 @@ class TagsEditor: public wxDialog
public:
// constructors and destructors
TagsEditor(wxWindow * parent,
wxString title,
const wxString &title,
Tags * tags,
bool editTitle,
bool editTrackNumber);

View File

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

View File

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

View File

@ -153,9 +153,9 @@ class AUDACITY_DLL_API Track: public XMLTagHandler
virtual void Merge(const Track &orig);
wxString GetName() const { return mName; }
void SetName( wxString n ) { mName = n; }
void SetName( const wxString &n ) { mName = n; }
wxString GetDefaultName() const { return mDefaultName; }
void SetDefaultName( wxString n ) { mDefaultName = n; }
void SetDefaultName( const wxString &n ) { mDefaultName = n; }
bool GetSelected() const { return mSelected; }
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.
/// 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)
{
mListener->TP_PushState(desc, shortDesc, flags);

View File

@ -457,7 +457,7 @@ protected:
virtual void MakeParentRedrawScrollbars();
// 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);
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

View File

@ -21,11 +21,11 @@ class AUDACITY_DLL_API TrackPanelListener {
virtual ~TrackPanelListener(){};
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 void TP_PushState(wxString shortDesc, wxString longDesc,
virtual void TP_PushState(const wxString &shortDesc, const wxString &longDesc,
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
// 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;
}
void UndoManager::SetLongDescription(unsigned int n, wxString desc)
void UndoManager::SetLongDescription(unsigned int n, const wxString &desc)
{
n -= 1;
@ -212,8 +212,8 @@ void UndoManager::ModifyState(TrackList * l,
void UndoManager::PushState(TrackList * l,
const SelectedRegion &selectedRegion,
wxString longDescription,
wxString shortDescription,
const wxString &longDescription,
const wxString &shortDescription,
int flags)
{
unsigned int i;

View File

@ -82,7 +82,7 @@ class AUDACITY_DLL_API UndoManager {
void PushState(TrackList * l,
const SelectedRegion &selectedRegion,
wxString longDescription, wxString shortDescription,
const wxString &longDescription, const wxString &shortDescription,
int flags = PUSH_AUTOSAVE);
void ModifyState(TrackList * l,
const SelectedRegion &selectedRegion);
@ -94,7 +94,7 @@ class AUDACITY_DLL_API UndoManager {
void GetShortDescription(unsigned int n, wxString *desc);
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 *Undo(SelectedRegion *selectedRegion);

View File

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

View File

@ -309,10 +309,10 @@ public:
/// Flush must be called after last Append
bool Flush();
bool AppendAlias(wxString fName, sampleCount start,
bool AppendAlias(const wxString &fName, sampleCount start,
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);
/// 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);
}
bool WaveTrack::AppendAlias(wxString fName, sampleCount start,
bool WaveTrack::AppendAlias(const wxString &fName, sampleCount start,
sampleCount len, int channel,bool 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)
{
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
bool Flush();
bool AppendAlias(wxString fName, sampleCount start,
bool AppendAlias(const wxString &fName, sampleCount start,
sampleCount len, int channel,bool useOD);
///for use with On-Demand decoding of compressed files.
///decodeType should be an enum from ODDecodeTask that specifies what
///Type of encoded file this is, such as eODFLAC
//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);
///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc.