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

Method GetPrev

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

Source from the content-addressed store, hash-verified

639}
640
641Track *TrackList::GetPrev(Track &t, bool linked) const
642{
643 TrackNodePointer prev;
644 auto node = t.GetNode();
645 if (!isNull(node)) {
646 // linked is true and input track second in team?
647 if (linked) {
648 prev = getPrev(node);
649 if (!isNull(prev) &&
650 !t.HasLinkedTrack() && t.GetLinkedTrack())
651 // Make it the first
652 node = prev;
653 }
654
655 prev = getPrev(node);
656 if (!isNull(prev)) {
657 // Back up once
658 node = prev;
659
660 // Back up twice sometimes when linked is true
661 if (linked) {
662 prev = getPrev(node);
663 if( !isNull(prev) &&
664 !(*node)->HasLinkedTrack() &&
665 (*node)->GetLinkedTrack())
666 node = prev;
667 }
668
669 return node->get();
670 }
671 }
672 return nullptr;
673}
674
675bool TrackList::CanMoveUp(Track &t) const
676{

Callers

nothing calls this directly

Calls 6

isNullFunction · 0.85
getPrevFunction · 0.85
GetNodeMethod · 0.80
HasLinkedTrackMethod · 0.80
GetLinkedTrackMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected