1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-17 08:01:12 +02:00

make_movable -> std::make_unique

This commit is contained in:
Paul Licameli
2018-04-16 13:31:17 -04:00
parent 7a0475e39f
commit b8a8712ba0
35 changed files with 97 additions and 97 deletions

View File

@@ -37,7 +37,7 @@ ODComputeSummaryTask::ODComputeSummaryTask()
movable_ptr<ODTask> ODComputeSummaryTask::Clone() const
{
auto clone = make_movable<ODComputeSummaryTask>();
auto clone = std::make_unique<ODComputeSummaryTask>();
clone->mDemandSample = GetDemandSample();
// This std::move is needed to "upcast" the pointer type
return std::move(clone);

View File

@@ -142,7 +142,7 @@ ODDecodeFFmpegTask::~ODDecodeFFmpegTask()
movable_ptr<ODTask> ODDecodeFFmpegTask::Clone() const
{
auto clone = make_movable<ODDecodeFFmpegTask>(mScs, Streams{ mChannels }, mContext, mStreamIndex);
auto clone = std::make_unique<ODDecodeFFmpegTask>(mScs, Streams{ mChannels }, mContext, mStreamIndex);
clone->mDemandSample=GetDemandSample();
//the decoders and blockfiles should not be copied. They are created as the task runs.
@@ -157,7 +157,7 @@ ODFileDecoder* ODDecodeFFmpegTask::CreateFileDecoder(const wxString & fileName)
{
// Open the file for import
auto decoder =
make_movable<ODFFmpegDecoder>(fileName, mScs, ODDecodeFFmpegTask::Streams{ mChannels },
std::make_unique<ODFFmpegDecoder>(fileName, mScs, ODDecodeFFmpegTask::Streams{ mChannels },
mContext, mStreamIndex);
mDecoders.push_back(std::move(decoder));
@@ -394,7 +394,7 @@ int ODFFmpegDecoder::Decode(SampleBuffer & data, sampleFormat & format, sampleCo
// Is there a proof size_t will not overflow size_t?
// Result is surely nonnegative.
auto amt = (actualDecodeStart - start).as_size_t();
auto cache = make_movable<FFMpegDecodeCache>();
auto cache = std::make_unique<FFMpegDecodeCache>();
//wxPrintf("skipping/zeroing %i samples. - now:%llu (%f), last:%llu, lastlen:%lu, start %llu, len %lu\n",amt,actualDecodeStart, actualDecodeStartdouble, mCurrentPos, mCurrentLen, start, len);
@@ -607,7 +607,7 @@ int ODFFmpegDecoder::DecodeFrame(streamContext *sc, bool flushing)
//TODO- consider growing/unioning a few cache buffers like WaveCache does.
//however we can't use wavecache as it isn't going to handle our stereo interleaved part, and isn't for samples
//However if other ODDecode tasks need this, we should do a NEW class for caching.
auto cache = make_movable<FFMpegDecodeCache>();
auto cache = std::make_unique<FFMpegDecodeCache>();
//len is number of samples per channel
// wxASSERT(sc->m_stream->codec->channels > 0);
cache->numChannels = std::max<unsigned>(0, sc->m_stream->codec->channels);

View File

@@ -35,7 +35,7 @@ ODDecodeFlacTask::~ODDecodeFlacTask()
movable_ptr<ODTask> ODDecodeFlacTask::Clone() const
{
auto clone = make_movable<ODDecodeFlacTask>();
auto clone = std::make_unique<ODDecodeFlacTask>();
clone->mDemandSample = GetDemandSample();
//the decoders and blockfiles should not be copied. They are created as the task runs.
@@ -304,7 +304,7 @@ ODFileDecoder* ODDecodeFlacTask::CreateFileDecoder(const wxString & fileName)
}
// Open the file for import
auto decoder = std::make_movable<ODFlacDecoder>(fileName);
auto decoder = std::std::make_unique<ODFlacDecoder>(fileName);
*/
/*
bool success = decoder->Init();
@@ -313,7 +313,7 @@ ODFileDecoder* ODDecodeFlacTask::CreateFileDecoder(const wxString & fileName)
}
*/
// Open the file for import
auto decoder = make_movable<ODFlacDecoder>(fileName);
auto decoder = std::make_unique<ODFlacDecoder>(fileName);
mDecoders.push_back(std::move(decoder));
return mDecoders.back().get();

View File

@@ -168,7 +168,7 @@ void ODManager::AddNewTask(movable_ptr<ODTask> &&mtask, bool lockMutex)
{
//Make a NEW one, add it to the local track queue, and to the immediate running task list,
//since this task is definitely at the head
auto newqueue = make_movable<ODWaveTrackTaskQueue>();
auto newqueue = std::make_unique<ODWaveTrackTaskQueue>();
newqueue->AddTask(std::move(mtask));
mQueues.push_back(std::move(newqueue));
if(lockMutex)