From 7b51653b367d5c3c6f73f9449ece196855886f30 Mon Sep 17 00:00:00 2001 From: Paul Licameli Date: Wed, 15 May 2019 10:44:21 -0400 Subject: [PATCH] Sequence.cpp does not depend on ODDecodeBlockFile.cpp... ... This frees Sequence.cpp from dependency cycles --- src/Sequence.cpp | 16 +--------------- src/Sequence.h | 3 --- src/WaveTrack.cpp | 11 ++++++++++- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/Sequence.cpp b/src/Sequence.cpp index 62ab3b203..48ebadc30 100644 --- a/src/Sequence.cpp +++ b/src/Sequence.cpp @@ -40,10 +40,10 @@ #include #include -#include "blockfile/ODDecodeBlockFile.h" #include "DirManager.h" #include "blockfile/SilentBlockFile.h" +#include "blockfile/SimpleBlockFile.h" #include "InconsistencyException.h" @@ -741,20 +741,6 @@ void Sequence::AppendBlock // function gets called in an inner loop. } -///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc. -unsigned int Sequence::GetODFlags() -{ - unsigned int ret = 0; - for (unsigned int i = 0; i < mBlock.size(); i++) { - const auto &file = mBlock[i].f; - if(!file->IsDataAvailable()) - ret |= (static_cast< ODDecodeBlockFile * >( &*file ))->GetDecodeType(); - else if(!file->IsSummaryAvailable()) - ret |= ODTask::eODPCMSummary; - } - return ret; -} - sampleCount Sequence::GetBlockStart(sampleCount position) const { int b = FindBlock(position); diff --git a/src/Sequence.h b/src/Sequence.h index e5cdf3f5b..bcd0d98d7 100644 --- a/src/Sequence.h +++ b/src/Sequence.h @@ -115,9 +115,6 @@ class PROFILE_DLL_API Sequence final : public XMLTagHandler{ // which supplies it with a file name void AppendBlockFile( const BlockFileFactory &factory, size_t len ); - ///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc. - unsigned int GetODFlags(); - // Append a blockfile. The blockfile pointer is then "owned" by the // sequence. This function is used by the recording log crash recovery // code, but may be useful for other purposes. The blockfile must already diff --git a/src/WaveTrack.cpp b/src/WaveTrack.cpp index 739013647..b4b5a8ed0 100644 --- a/src/WaveTrack.cpp +++ b/src/WaveTrack.cpp @@ -1599,12 +1599,21 @@ void WaveTrack::AppendCoded(const FilePath &fName, sampleCount start, } ///gets an int with OD flags so that we can determine which ODTasks should be run on this track after save/open, etc. +#include "blockfile/ODDecodeBlockFile.h" unsigned int WaveTrack::GetODFlags() const { unsigned int ret = 0; for (const auto &clip : mClips) { - ret = ret | clip->GetSequence()->GetODFlags(); + auto sequence = clip->GetSequence(); + const auto &blocks = sequence->GetBlockArray(); + for ( const auto &block : blocks ) { + const auto &file = block.f; + if(!file->IsDataAvailable()) + ret |= (static_cast< ODDecodeBlockFile * >( &*file ))->GetDecodeType(); + else if(!file->IsSummaryAvailable()) + ret |= ODTask::eODPCMSummary; + } } return ret; }