1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-02-23 14:41:27 +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

@@ -15,6 +15,7 @@ class wxMouseEvent;
class wxRect;
class wxSize;
class TrackPanelCell;
#include "MemoryX.h"
// Augment a mouse event with information about which track panel cell and
// sub-rectangle was hit.
@@ -22,7 +23,7 @@ struct TrackPanelMouseEvent
{
TrackPanelMouseEvent
( wxMouseEvent &event_, const wxRect &rect_, const wxSize &whole_,
TrackPanelCell *pCell_ )
const std::shared_ptr<TrackPanelCell> &pCell_ )
: event{ event_ }
, rect{ rect_ }
, whole{ whole_ }
@@ -34,7 +35,7 @@ struct TrackPanelMouseEvent
wxMouseEvent &event;
const wxRect &rect;
const wxSize &whole;
TrackPanelCell *pCell; // may be NULL
std::shared_ptr<TrackPanelCell> pCell; // may be NULL
double steps; // for mouse wheel rotation
};