1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-06-27 09:38:39 +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
* 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.

View File

@ -81,7 +81,7 @@ void LegacyAliasBlockFile::SaveXML(XMLWriter &xmlFile)
// BuildFromXML methods should always return a BlockFile, not NULL,
// even if the result is flawed (e.g., refers to nonexistent file),
// 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 aliasFileName;

View File

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

View File

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

View File

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

View File

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

View File

@ -61,8 +61,8 @@ class Command
{
public:
virtual void Progress(double completed) = 0;
virtual void Status(wxString message) = 0;
virtual void Error(wxString message) = 0;
virtual void Status(const wxString &message) = 0;
virtual void Error(const wxString &message) = 0;
virtual ~Command() { }
virtual wxString GetName() = 0;
virtual CommandSignature &GetSignature() = 0;
@ -77,8 +77,8 @@ protected:
Command *mCommand;
public:
virtual void Progress(double completed);
virtual void Status(wxString message);
virtual void Error(wxString message);
virtual void Status(const wxString &message) override;
virtual void Error(const wxString &message) override;
DecoratedCommand(Command *cmd)
: mCommand(cmd)
@ -130,8 +130,8 @@ protected:
public:
// Convenience methods for passing messages to the output target
void Progress(double completed);
void Status(wxString status);
void Error(wxString message);
void Status(const wxString &status) override;
void Error(const wxString &message) override;
/// Constructor should not be called directly; only by a factory which
/// 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,
wxString cmdParams)
const wxString &cmdParamsArg)
{
// Stage 1: create a Command object of the right type
@ -106,7 +106,7 @@ void CommandBuilder::BuildCommand(const wxString &cmdName,
wxASSERT(type != NULL);
mCommand = type->Create(output);
mCommand->SetParameter(wxT("CommandName"), cmdName);
mCommand->SetParameter(wxT("ParamString"), cmdParams);
mCommand->SetParameter(wxT("ParamString"), cmdParamsArg);
Success(new ApplyAndSendResponse(mCommand));
return;
}
@ -117,7 +117,7 @@ void CommandBuilder::BuildCommand(const wxString &cmdName,
// Stage 2: set the parameters
ShuttleCli shuttle;
shuttle.mParams = cmdParams;
shuttle.mParams = cmdParamsArg;
shuttle.mbStoreInClient = true;
ParamValueMap::const_iterator iter;
@ -138,6 +138,8 @@ void CommandBuilder::BuildCommand(const wxString &cmdName,
// Check for unrecognised parameters
wxString cmdParams(cmdParamsArg);
while (cmdParams != wxEmptyString)
{
cmdParams.Trim(true);
@ -166,8 +168,10 @@ void CommandBuilder::BuildCommand(const wxString &cmdName,
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
// no terminator, the command is badly formed
cmdString.Trim(true); cmdString.Trim(false);

View File

@ -31,8 +31,8 @@ class CommandBuilder
void Failure(const wxString &msg = wxEmptyString);
void Success(Command *cmd);
void BuildCommand(const wxString &cmdName, wxString cmdParams);
void BuildCommand(wxString cmdString);
void BuildCommand(const wxString &cmdName, const wxString &cmdParams);
void BuildCommand(const wxString &cmdString);
public:
CommandBuilder(const wxString &cmdString);
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];
if (!entry || !entry->menu) {
@ -997,7 +997,7 @@ bool CommandManager::GetEnabled(const wxString &name)
return entry->enabled;
}
void CommandManager::Check(wxString name, bool checked)
void CommandManager::Check(const wxString &name, bool checked)
{
CommandListEntry *entry = mCommandNameHash[name];
if (!entry || !entry->menu) {
@ -1008,7 +1008,7 @@ void CommandManager::Check(wxString name, bool checked)
}
///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];
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];
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];
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];
if (!entry)
@ -1293,7 +1293,7 @@ wxString CommandManager::GetLabelFromName(wxString name)
return entry->label;
}
wxString CommandManager::GetPrefixedLabelFromName(wxString name)
wxString CommandManager::GetPrefixedLabelFromName(const wxString &name)
{
CommandListEntry *entry = mCommandNameHash[name];
if (!entry)
@ -1310,7 +1310,7 @@ wxString CommandManager::GetPrefixedLabelFromName(wxString name)
#endif
}
wxString CommandManager::GetCategoryFromName(wxString name)
wxString CommandManager::GetCategoryFromName(const wxString &name)
{
CommandListEntry *entry = mCommandNameHash[name];
if (!entry)
@ -1319,7 +1319,7 @@ wxString CommandManager::GetCategoryFromName(wxString name)
return entry->labelTop;
}
wxString CommandManager::GetKeyFromName(wxString name)
wxString CommandManager::GetKeyFromName(const wxString &name)
{
CommandListEntry *entry = mCommandNameHash[name];
if (!entry)
@ -1328,7 +1328,7 @@ wxString CommandManager::GetKeyFromName(wxString name)
return entry->key;
}
wxString CommandManager::GetDefaultKeyFromName(wxString name)
wxString CommandManager::GetDefaultKeyFromName(const wxString &name)
{
CommandListEntry *entry = mCommandNameHash[name];
if (!entry)
@ -1411,7 +1411,7 @@ void CommandManager::SetDefaultFlags(wxUint32 flags, wxUint32 mask)
mDefaultMask = mask;
}
void CommandManager::SetCommandFlags(wxString name,
void CommandManager::SetCommandFlags(const wxString &name,
wxUint32 flags, wxUint32 mask)
{
CommandListEntry *entry = mCommandNameHash[name];

View File

@ -184,7 +184,7 @@ class AUDACITY_DLL_API CommandManager: public XMLTagHandler
// For NEW items/commands
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,
wxUint32 flags, wxUint32 mask);
// 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 Enable(wxString name, bool enabled);
void Check(wxString name, bool checked);
void Modify(wxString name, wxString newLabel);
void Enable(const wxString &name, bool enabled);
void Check(const wxString &name, bool checked);
void Modify(const wxString &name, const wxString &newLabel);
//
// Modifying accelerators
//
void SetKeyFromName(wxString name, wxString key);
void SetKeyFromIndex(int i, wxString key);
void SetKeyFromName(const wxString &name, const wxString &key);
void SetKeyFromIndex(int i, const wxString &key);
//
// Executing commands
@ -231,11 +231,11 @@ class AUDACITY_DLL_API CommandManager: public XMLTagHandler
#endif
bool includeMultis);
wxString GetLabelFromName(wxString name);
wxString GetPrefixedLabelFromName(wxString name);
wxString GetCategoryFromName(wxString name);
wxString GetKeyFromName(wxString name);
wxString GetDefaultKeyFromName(wxString name);
wxString GetLabelFromName(const wxString &name);
wxString GetPrefixedLabelFromName(const wxString &name);
wxString GetCategoryFromName(const wxString &name);
wxString GetKeyFromName(const wxString &name);
wxString GetDefaultKeyFromName(const wxString &name);
bool GetEnabled(const wxString &name);

View File

@ -66,7 +66,7 @@ class CommandMessageTarget
{
public:
virtual ~CommandMessageTarget() {}
virtual void Update(wxString message) = 0;
virtual void Update(const wxString &message) = 0;
};
///
@ -93,7 +93,7 @@ class NullMessageTarget : public CommandMessageTarget
{
public:
virtual ~NullMessageTarget() {}
virtual void Update(wxString message) {}
virtual void Update(const wxString &message) override {}
};
/// Displays messages from a command in a wxMessageBox
@ -101,7 +101,7 @@ class MessageBoxTarget : public CommandMessageTarget
{
public:
virtual ~MessageBoxTarget() {}
virtual void Update(wxString message)
virtual void Update(const wxString &message) override
{
wxMessageBox(message);
}
@ -116,7 +116,7 @@ public:
StatusBarTarget(wxStatusBar &sb)
: mStatus(sb)
{}
virtual void Update(wxString message)
virtual void Update(const wxString &message) override
{
mStatus.SetStatusText(message, 0);
}
@ -135,7 +135,7 @@ public:
{
mResponseQueue.AddResponse(wxString(wxT("\n")));
}
virtual void Update(wxString message)
virtual void Update(const wxString &message) override
{
mResponseQueue.AddResponse(message);
}
@ -158,7 +158,7 @@ public:
delete m1;
delete m2;
}
virtual void Update(wxString message)
virtual void Update(const wxString &message) override
{
m1->Update(message);
m2->Update(message);
@ -220,12 +220,12 @@ public:
if (mProgressTarget)
mProgressTarget->Update(completed);
}
void Status(wxString status)
void Status(const wxString &status)
{
if (mStatusTarget)
mStatusTarget->Update(status);
}
void Error(wxString message)
void Error(const wxString &message)
{
if (mErrorTarget)
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,
int x, int y, int width, int height,
bool bg)
@ -226,7 +226,7 @@ void ScreenshotCommand::Capture(wxString filename,
::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);
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 width, height;
@ -311,7 +311,7 @@ Command *ScreenshotCommandType::Create(CommandOutputTarget *target)
return new ScreenshotCommand(*this, target);
}
wxString ScreenshotCommand::MakeFileName(wxString path, wxString basename)
wxString ScreenshotCommand::MakeFileName(const wxString &path, const wxString &basename)
{
wxFileName prefixPath;
prefixPath.AssignDir(path);

View File

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

View File

@ -75,7 +75,7 @@ bool SetProjectInfoCommand::Apply(CommandExecutionContext context)
// *********************** 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;
TrackListIterator iter(projTracks);

View File

@ -48,7 +48,7 @@ private:
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
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
void setSelected(Track *trk, bool setting) const;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -182,7 +182,7 @@ public:
wxString GetPluginFormatDescription();
///! 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
@ -292,7 +292,7 @@ wxString FFmpegImportPlugin::GetPluginFormatDescription()
return DESC;
}
ImportFileHandle *FFmpegImportPlugin::Open(wxString filename)
ImportFileHandle *FFmpegImportPlugin::Open(const wxString &filename)
{
FFmpegImportFileHandle *handle = new FFmpegImportFileHandle(filename);

View File

@ -138,7 +138,7 @@ class FLACImportPlugin : public ImportPlugin
wxString GetPluginStringID() { return wxT("libflac"); }
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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -138,7 +138,7 @@ bool ModulePrefs::Apply()
// 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.
int iStatus = kModuleNew;
@ -152,7 +152,7 @@ int ModulePrefs::GetModuleStatus( wxString fname ){
return iStatus;
}
void ModulePrefs::SetModuleStatus( wxString fname, int iStatus ){
void ModulePrefs::SetModuleStatus(const wxString &fname, int iStatus){
wxString ShortName = wxFileName( fname ).GetName();
wxString PrefName = wxString( wxT("/Module/") ) + ShortName.Lower();
gPrefs->Write( PrefName, iStatus );

View File

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

View File

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

View File

@ -61,7 +61,7 @@ class PrefsDialog:public wxDialog
void OnApply(wxCommandEvent & e);
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(),
// such as by saving a preference after DoModal() returns

View File

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

View File

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

View File

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

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