1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-08 20:52:09 +01:00

TrackPanelMouseEvent stores shared_ptr to cell; some handles too...

... those handles that force a simulated button-up when play interrupts drag,
and can assume that pointers to tracks remain nonNULL and part of the current
project state (not the undo history).

Also pass shared_ptr to Track into more hit test routines.
This commit is contained in:
Paul Licameli
2017-06-27 13:40:36 -04:00
parent 708d84ac22
commit b0c6a67c33
40 changed files with 166 additions and 150 deletions

View File

@@ -70,8 +70,8 @@ UIHandle::Result TrackPanelResizeHandle::Click
(const TrackPanelMouseEvent &evt, AudacityProject *pProject)
{
const wxMouseEvent &event = evt.event;
CommonTrackPanelCell *const pCell =
static_cast<CommonTrackPanelCell*>(evt.pCell);
const auto pCell =
static_cast<CommonTrackPanelCell*>(evt.pCell.get());
auto track = pCell->FindTrack().get();
if (track && dynamic_cast< TrackControls * >( pCell )) {
// Clicked under a label;