MCPcopy Create free account
hub / github.com/audacity/audacity / IsSyncLockSelected

Method IsSyncLockSelected

libraries/lib-track-selection/SyncLock.cpp:80–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

78}
79
80bool SyncLock::IsSyncLockSelected(const Track &track)
81{
82 auto pList = track.GetOwner();
83 if (!pList)
84 return false;
85
86 auto p = pList->GetOwner();
87 if (!p || !SyncLockState::Get( *p ).IsSyncLocked())
88 return false;
89
90 auto &orig = PendingTracks::Get(*p).SubstituteOriginalTrack(track);
91 auto trackRange = Group(orig);
92
93 if (trackRange.size() <= 1) {
94 // Not in a sync-locked group.
95 // Return true iff selected and of a sync-lockable type.
96 return (IsSyncLockableNonSeparatorTrack(orig) ||
97 IsSeparatorTrack(orig)) && track.GetSelected();
98 }
99
100 // Return true iff any track in the group is selected.
101 return *(trackRange + &Track::IsSelected).begin();
102}
103
104bool SyncLock::IsSelectedOrSyncLockSelected(const Track &track)
105{

Callers 1

TrackCompareMethod · 0.80

Calls 8

GetFunction · 0.85
GroupFunction · 0.85
IsSeparatorTrackFunction · 0.85
IsSyncLockedMethod · 0.80
sizeMethod · 0.45
GetSelectedMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected