Audacity 3.2.0
Functions
anonymous_namespace{WaveTrack.cpp}::anonymous_namespace{WaveTrack.cpp} Namespace Reference

Functions

bool AreAligned (const WaveTrack::IntervalConstHolders &a, const WaveTrack::IntervalConstHolders &b)
 

Function Documentation

◆ AreAligned()

bool anonymous_namespace{WaveTrack.cpp}::anonymous_namespace{WaveTrack.cpp}::AreAligned ( const WaveTrack::IntervalConstHolders a,
const WaveTrack::IntervalConstHolders b 
)

Definition at line 324 of file WaveTrack.cpp.

326{
327 if (a.size() != b.size())
328 return false;
329
330 const auto compare = [](const auto &a, const auto &b) {
331 // clips are aligned if both sequence start/end
332 // points and play start/end points of the first clip match
333 // the corresponding points of the other clip
334 return a->GetPlayStartTime() == b->GetPlayStartTime() &&
335 a->GetSequenceStartTime() == b->GetSequenceStartTime() &&
336 a->GetPlayEndTime() == b->GetPlayEndTime() &&
337 a->GetSequenceEndTime() == b->GetSequenceEndTime();
338 };
339
340 return std::mismatch(a.begin(), a.end(), b.begin(), compare).first == a.end();
341}

Referenced by WaveTrack::LinkConsistencyFix(), and WaveTrack::ZipClips().

Here is the caller graph for this function: