1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-15 23:44:59 +01:00

Fix crashes in repainting, and update first visible track correctly

This commit is contained in:
Paul Licameli
2017-06-26 13:40:19 -04:00
parent 30ec8a1c90
commit 2806b509e2
7 changed files with 55 additions and 47 deletions

View File

@@ -741,6 +741,7 @@ Track *SyncLockedTracksIterator::Last(bool skiplinked)
// is managing. Any other classes that may be interested in get these updates
// should use TrackList::Connect() and TrackList::Disconnect().
//
DEFINE_EVENT_TYPE(EVT_TRACKLIST_PERMUTED);
DEFINE_EVENT_TYPE(EVT_TRACKLIST_RESIZING);
DEFINE_EVENT_TYPE(EVT_TRACKLIST_DELETION);
@@ -856,6 +857,13 @@ void TrackList::RecalcPositions(TrackNodePointer node)
#endif // EXPERIMENTAL_OUTPUT_DISPLAY
}
void TrackList::PermutationEvent()
{
auto e = std::make_unique<wxCommandEvent>(EVT_TRACKLIST_PERMUTED);
// wxWidgets will own the event object
QueueEvent(e.release());
}
void TrackList::DeletionEvent()
{
auto e = std::make_unique<wxCommandEvent>(EVT_TRACKLIST_DELETION);
@@ -882,6 +890,7 @@ void TrackList::Permute(const std::vector<TrackNodePointer> &permutation)
}
auto n = begin();
RecalcPositions(n);
PermutationEvent();
}
template<typename TrackKind>
@@ -1152,6 +1161,7 @@ void TrackList::SwapNodes(TrackNodePointer s1, TrackNodePointer s2)
// Now correct the Index in the tracks, and other things
RecalcPositions(s1);
PermutationEvent();
}
bool TrackList::MoveUp(Track * t)