mirror of
https://github.com/cookiengineer/audacity
synced 2025-12-20 15:41:18 +01:00
Avoid some wxString copies
This commit is contained in:
@@ -247,7 +247,7 @@ class AUDACITY_DLL_API AudacityProject final : public wxFrame,
|
||||
#endif
|
||||
void Clear();
|
||||
|
||||
wxString GetFileName() { return mFileName; }
|
||||
const wxString &GetFileName() { return mFileName; }
|
||||
bool GetDirty() { return mDirty; }
|
||||
void SetProjectTitle();
|
||||
|
||||
|
||||
@@ -48,9 +48,9 @@ bool OpenProjectCommand::Apply(CommandExecutionContext context)
|
||||
}
|
||||
else
|
||||
{
|
||||
context.GetProject()->OpenFile(fileName,addToHistory);
|
||||
context.GetProject()->OpenFile(fileName, addToHistory);
|
||||
}
|
||||
wxString newFileName = context.GetProject()->GetFileName();
|
||||
const wxString &newFileName = context.GetProject()->GetFileName();
|
||||
|
||||
// Because Open does not return a success or failure, we have to guess
|
||||
// at this point, based on whether the project file name has
|
||||
|
||||
@@ -290,8 +290,8 @@ int ODDecodeTask::GetNumFileDecoders()
|
||||
|
||||
///This should handle unicode converted to UTF-8 on mac/linux, but OD TODO:check on windows
|
||||
ODFileDecoder::ODFileDecoder(const wxString & fName)
|
||||
: mFName{ fName }
|
||||
{
|
||||
mFName = fName;
|
||||
mInited = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -120,7 +120,7 @@ public:
|
||||
///returns negative value for failure, 0 or positive value for success.
|
||||
virtual int Decode(SampleBuffer & data, sampleFormat & format, sampleCount start, sampleCount len, unsigned int channel)=0;
|
||||
|
||||
wxString GetFileName(){return mFName;}
|
||||
const wxString &GetFileName(){return mFName;}
|
||||
|
||||
bool IsInitialized();
|
||||
|
||||
@@ -131,7 +131,7 @@ protected:
|
||||
bool mInited;
|
||||
ODLock mInitedLock;
|
||||
|
||||
wxString mFName;
|
||||
const wxString mFName;
|
||||
|
||||
unsigned int mSampleRate;
|
||||
unsigned int mNumSamples;//this may depend on the channel - so TODO: we should probably let the decoder create/modify the track info directly.
|
||||
|
||||
Reference in New Issue
Block a user