mirror of
https://github.com/cookiengineer/audacity
synced 2026-02-07 20:22:13 +01:00
Don't copy wxFileName often, it's not lightweight! Use wxFileNameWrapper...
... which is a new class that defines moves.
This commit is contained in:
committed by
Paul Licameli
parent
b0ef9c4e82
commit
b6fdffbab2
@@ -20,14 +20,14 @@
|
||||
#include "../FileFormats.h"
|
||||
#include "../Internat.h"
|
||||
|
||||
LegacyAliasBlockFile::LegacyAliasBlockFile(wxFileName fileName,
|
||||
wxFileName aliasedFileName,
|
||||
LegacyAliasBlockFile::LegacyAliasBlockFile(wxFileNameWrapper &&fileName,
|
||||
wxFileNameWrapper &&aliasedFileName,
|
||||
sampleCount aliasStart,
|
||||
sampleCount aliasLen,
|
||||
int aliasChannel,
|
||||
sampleCount summaryLen,
|
||||
bool noRMS)
|
||||
: PCMAliasBlockFile(fileName, aliasedFileName, aliasStart, aliasLen,
|
||||
: PCMAliasBlockFile(std::move(fileName), std::move(aliasedFileName), aliasStart, aliasLen,
|
||||
aliasChannel, 0.0, 0.0, 0.0)
|
||||
{
|
||||
sampleFormat format;
|
||||
@@ -37,7 +37,7 @@ LegacyAliasBlockFile::LegacyAliasBlockFile(wxFileName fileName,
|
||||
else
|
||||
format = floatSample;
|
||||
|
||||
ComputeLegacySummaryInfo(fileName,
|
||||
ComputeLegacySummaryInfo(mFileName,
|
||||
summaryLen, format,
|
||||
&mSummaryInfo, noRMS, FALSE,
|
||||
&mMin, &mMax, &mRMS);
|
||||
@@ -51,11 +51,11 @@ LegacyAliasBlockFile::~LegacyAliasBlockFile()
|
||||
/// the summary data to a NEW file.
|
||||
///
|
||||
/// @param newFileName The filename to copy the summary data to.
|
||||
BlockFile *LegacyAliasBlockFile::Copy(wxFileName newFileName)
|
||||
BlockFile *LegacyAliasBlockFile::Copy(wxFileNameWrapper &&newFileName)
|
||||
{
|
||||
BlockFile *newBlockFile =
|
||||
new LegacyAliasBlockFile(newFileName,
|
||||
mAliasedFileName, mAliasStart,
|
||||
new LegacyAliasBlockFile(std::move(newFileName),
|
||||
wxFileNameWrapper{mAliasedFileName}, mAliasStart,
|
||||
mLen, mAliasChannel,
|
||||
mSummaryInfo.totalSummaryBytes,
|
||||
mSummaryInfo.fields < 3);
|
||||
@@ -85,8 +85,8 @@ void LegacyAliasBlockFile::SaveXML(XMLWriter &xmlFile)
|
||||
// as testing will be done in DirManager::ProjectFSCK().
|
||||
BlockFile *LegacyAliasBlockFile::BuildFromXML(const wxString &projDir, const wxChar **attrs)
|
||||
{
|
||||
wxFileName summaryFileName;
|
||||
wxFileName aliasFileName;
|
||||
wxFileNameWrapper summaryFileName;
|
||||
wxFileNameWrapper aliasFileName;
|
||||
int aliasStart=0, aliasLen=0, aliasChannel=0;
|
||||
int summaryLen=0;
|
||||
bool noRMS = false;
|
||||
@@ -133,7 +133,7 @@ BlockFile *LegacyAliasBlockFile::BuildFromXML(const wxString &projDir, const wxC
|
||||
}
|
||||
}
|
||||
|
||||
return new LegacyAliasBlockFile(summaryFileName, aliasFileName,
|
||||
return new LegacyAliasBlockFile(std::move(summaryFileName), std::move(aliasFileName),
|
||||
aliasStart, aliasLen, aliasChannel,
|
||||
summaryLen, noRMS);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user