| 561 | } |
| 562 | |
| 563 | Track::Holder TrackList::ReplaceOne(Track &t, TrackList &&with) |
| 564 | { |
| 565 | assert(t.GetOwner().get() == this); |
| 566 | assert(!with.empty()); |
| 567 | |
| 568 | auto save = t.shared_from_this(); |
| 569 | |
| 570 | //! Move one track to the temporary list |
| 571 | auto node = t.GetNode(); |
| 572 | t.SetOwner({}, {}); |
| 573 | |
| 574 | //! Redirect the list element of this |
| 575 | const auto iter = with.ListOfTracks::begin(); |
| 576 | const auto pTrack = *iter; |
| 577 | *node = pTrack; |
| 578 | with.erase(iter); |
| 579 | pTrack->SetOwner(shared_from_this(), node); |
| 580 | pTrack->SetId(save->GetId()); |
| 581 | RecalcPositions(node); |
| 582 | DeletionEvent(save, true); |
| 583 | AdditionEvent(node); |
| 584 | return save; |
| 585 | } |
| 586 | |
| 587 | std::shared_ptr<Track> TrackList::Remove(Track &track) |
| 588 | { |
no test coverage detected