1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-04-04 13:27:39 +02:00

Hide the use of new in factory functions for BlockFiles

This commit is contained in:
Paul Licameli
2016-08-13 12:59:19 -04:00
parent 2ede67be96
commit e7b4d935a5
10 changed files with 66 additions and 64 deletions

View File

@@ -328,7 +328,8 @@ BlockFilePtr LegacyBlockFile::BuildFromXML(const wxString &projDir, const wxChar
}
}
return new LegacyBlockFile(std::move(fileName), format, summaryLen, len, noRMS);
return make_blockfile<LegacyBlockFile>
(std::move(fileName), format, summaryLen, len, noRMS);
}
/// Create a copy of this BlockFile, but using a different disk file.
@@ -336,11 +337,10 @@ BlockFilePtr LegacyBlockFile::BuildFromXML(const wxString &projDir, const wxChar
/// @param newFileName The name of the NEW file to use.
BlockFilePtr LegacyBlockFile::Copy(wxFileNameWrapper &&newFileName)
{
return new LegacyBlockFile(std::move(newFileName),
mFormat,
mSummaryInfo.totalSummaryBytes,
mLen,
mSummaryInfo.fields < 3);
return make_blockfile<LegacyBlockFile>
(std::move(newFileName),
mFormat, mSummaryInfo.totalSummaryBytes,
mLen, mSummaryInfo.fields < 3);
}
wxLongLong LegacyBlockFile::GetSpaceUsage() const