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

Method DoAdd

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

Source from the content-addressed store, hash-verified

541}
542
543Track *TrackList::DoAdd(const std::shared_ptr<Track> &t, bool assignIds)
544{
545 if (!ListOfTracks::empty()) {
546 auto &pLast = *ListOfTracks::rbegin();
547 if (pLast->mLinkType != Track::LinkType::None)
548 t->CopyGroupProperties(*pLast);
549 }
550
551 push_back(t);
552
553 auto n = getPrev( getEnd() );
554
555 t->SetOwner(shared_from_this(), n);
556 if (mAssignsIds && assignIds)
557 t->SetId(TrackId{ ++sCounter });
558 RecalcPositions(n);
559 AdditionEvent(n);
560 return back().get();
561}
562
563Track::Holder TrackList::ReplaceOne(Track &t, TrackList &&with)
564{

Callers

nothing calls this directly

Calls 8

rbeginFunction · 0.85
getPrevFunction · 0.85
getEndFunction · 0.85
CopyGroupPropertiesMethod · 0.80
SetOwnerMethod · 0.80
SetIdMethod · 0.80
emptyFunction · 0.50
getMethod · 0.45

Tested by

no test coverage detected