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 326 of file WaveTrack.cpp.

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

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

Here is the caller graph for this function: