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

Method PasteInto

libraries/lib-time-track/TimeTrack.cpp:142–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

140}
141
142Track::Holder TimeTrack::PasteInto(AudacityProject &project, TrackList &list)
143 const
144{
145 // Maintain uniqueness of the time track!
146 std::shared_ptr<TimeTrack> pNewTrack;
147 if (auto pTrack = *TrackList::Get(project).Any<TimeTrack>().begin())
148 // leave list unchanged
149 pNewTrack = pTrack->SharedPointer<TimeTrack>();
150 else {
151 pNewTrack = std::make_shared<TimeTrack>();
152 list.Add(pNewTrack);
153 }
154
155 // Should come here only for .aup3 import, not for paste (because the
156 // track is skipped in cut/copy commands)
157 // And for import we agree to replace the track contents completely
158 pNewTrack->CleanState();
159 pNewTrack->Init(*this);
160 pNewTrack->Paste(0.0, *this);
161 pNewTrack->SetRangeLower(this->GetRangeLower());
162 pNewTrack->SetRangeUpper(this->GetRangeUpper());
163 return pNewTrack;
164}
165
166Track::Holder TimeTrack::Cut(double t0, double t1)
167{

Callers

nothing calls this directly

Calls 10

GetRangeLowerMethod · 0.95
GetRangeUpperMethod · 0.95
GetFunction · 0.85
CleanStateMethod · 0.80
beginMethod · 0.45
AddMethod · 0.45
InitMethod · 0.45
PasteMethod · 0.45
SetRangeLowerMethod · 0.45
SetRangeUpperMethod · 0.45

Tested by

no test coverage detected