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

Method GetLinkedTrack

libraries/lib-track/Track.cpp:198–222  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198Track *Track::GetLinkedTrack() const
199{
200 auto pList = GetOwner();
201 if (!pList)
202 return nullptr;
203
204 if (!pList->isNull(mNode)) {
205 if (HasLinkedTrack()) {
206 auto next = pList->getNext( mNode );
207 if ( !pList->isNull( next ) )
208 return next->get();
209 }
210
211 if (mNode != pList->ListOfTracks::begin()) {
212 auto prev = pList->getPrev( mNode );
213 if ( !pList->isNull( prev ) ) {
214 auto track = prev->get();
215 if (track && track->HasLinkedTrack())
216 return track;
217 }
218 }
219 }
220
221 return nullptr;
222}
223
224bool Track::HasLinkedTrack() const noexcept
225{

Callers 1

GetPrevMethod · 0.80

Calls 4

GetOwnerFunction · 0.85
isNullMethod · 0.80
HasLinkedTrackMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected