1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-06 11:42:17 +01: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

@@ -152,10 +152,9 @@ int PCMAliasBlockFile::ReadData(samplePtr data, sampleFormat format,
/// @param newFileName The filename to copy the summary data to.
BlockFilePtr PCMAliasBlockFile::Copy(wxFileNameWrapper &&newFileName)
{
BlockFile *newBlockFile = new PCMAliasBlockFile(std::move(newFileName),
wxFileNameWrapper{mAliasedFileName}, mAliasStart,
mLen, mAliasChannel,
mMin, mMax, mRMS);
auto newBlockFile = make_blockfile<PCMAliasBlockFile>
(std::move(newFileName), wxFileNameWrapper{mAliasedFileName},
mAliasStart, mLen, mAliasChannel, mMin, mMax, mRMS);
return newBlockFile;
}
@@ -249,9 +248,9 @@ BlockFilePtr PCMAliasBlockFile::BuildFromXML(DirManager &dm, const wxChar **attr
}
}
return new PCMAliasBlockFile(std::move(summaryFileName), std::move(aliasFileName),
aliasStart, aliasLen, aliasChannel,
min, max, rms);
return make_blockfile<PCMAliasBlockFile>
(std::move(summaryFileName), std::move(aliasFileName),
aliasStart, aliasLen, aliasChannel, min, max, rms);
}
void PCMAliasBlockFile::Recover(void)