mirror of
https://github.com/cookiengineer/audacity
synced 2025-11-23 17:30:17 +01:00
Applying pending changed tracks causes adoption of cell objects...
... This will simplify the updating of pending tracks when state is moved into the view cell object. No copies of those fields will then be needed.
This commit is contained in:
@@ -1124,8 +1124,13 @@ std::shared_ptr<Track>
|
||||
TrackList::RegisterPendingChangedTrack( Updater updater, Track *src )
|
||||
{
|
||||
std::shared_ptr<Track> pTrack;
|
||||
if (src)
|
||||
pTrack = src->Duplicate();
|
||||
if (src) {
|
||||
pTrack = src->Clone(); // not duplicate
|
||||
// Share the satellites with the original, though they do not point back
|
||||
// to the pending track
|
||||
pTrack->mpView = src->mpView;
|
||||
pTrack->mpControls = src->mpControls;
|
||||
}
|
||||
|
||||
if (pTrack) {
|
||||
mUpdaters.push_back( updater );
|
||||
@@ -1211,6 +1216,10 @@ bool TrackList::ApplyPendingTracks()
|
||||
|
||||
for (auto &pendingTrack : updates) {
|
||||
if (pendingTrack) {
|
||||
if (pendingTrack->mpView)
|
||||
pendingTrack->mpView->Reparent( pendingTrack );
|
||||
if (pendingTrack->mpControls)
|
||||
pendingTrack->mpControls->Reparent( pendingTrack );
|
||||
auto src = FindById( pendingTrack->GetId() );
|
||||
if (src)
|
||||
this->Replace(src, pendingTrack), result = true;
|
||||
|
||||
Reference in New Issue
Block a user