1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-06 03:32:09 +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

@@ -172,10 +172,10 @@ BlockFilePtr ODDecodeBlockFile::Copy(wxFileNameWrapper &&newFileName)
else
{
//Summary File might exist in this case, but it probably (99.999% of the time) won't.
newBlockFile = new ODDecodeBlockFile(std::move(newFileName),
wxFileNameWrapper{mAudioFileName}, mAliasStart,
mLen, mAliasChannel, mType,
mMin, mMax, mRMS,IsSummaryAvailable());
newBlockFile = make_blockfile<ODDecodeBlockFile>
(std::move(newFileName), wxFileNameWrapper{mAudioFileName},
mAliasStart, mLen, mAliasChannel, mType,
mMin, mMax, mRMS, IsSummaryAvailable());
//The client code will need to schedule this blockfile for OD decoding if it is going to a NEW track.
//It can do this by checking for IsDataAvailable()==false.
}
@@ -274,10 +274,9 @@ BlockFilePtr ODDecodeBlockFile::BuildFromXML(DirManager &dm, const wxChar **attr
}
}
return new ODDecodeBlockFile(std::move(summaryFileName), std::move(audioFileName),
aliasStart, aliasLen, aliasChannel,decodeType,
0,0,0, false);
return make_blockfile<ODDecodeBlockFile>
(std::move(summaryFileName), std::move(audioFileName),
aliasStart, aliasLen, aliasChannel, decodeType, 0, 0, 0, false);
}