| 140 | } |
| 141 | |
| 142 | Track::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 | |
| 166 | Track::Holder TimeTrack::Cut(double t0, double t1) |
| 167 | { |
nothing calls this directly
no test coverage detected