mirror of
https://github.com/cookiengineer/audacity
synced 2025-05-01 08:09:41 +02: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:
parent
d335276931
commit
7a91cc8e8d
@ -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;
|
||||
|
@ -741,7 +741,7 @@ protected:
|
||||
|
||||
// These hold the controls:
|
||||
std::shared_ptr<TrackView> mpView;
|
||||
std::shared_ptr<TrackControls> mpControls;
|
||||
std::shared_ptr<CommonTrackCell> mpControls;
|
||||
};
|
||||
|
||||
class AUDACITY_DLL_API AudioTrack /* not final */ : public Track
|
||||
|
Loading…
x
Reference in New Issue
Block a user