forked from Sneeds-Feed-and-Seed/sneedacity
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTrackPanelResizerCell.h
53 lines (37 loc) · 1.44 KB
/
TrackPanelResizerCell.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/**********************************************************************
Sneedacity: A Digital Audio Editor
TrackPanelResizerCell.h
Paul Licameli split from TrackPanel.cpp
**********************************************************************/
#ifndef __SNEEDACITY_TRACK_PANEL_RESIZER_CELL__
#define __SNEEDACITY_TRACK_PANEL_RESIZER_CELL__
#include "ClientData.h" // to inherit
#include "tracks/ui/CommonTrackPanelCell.h" // to inherit
class Track;
class TrackPanelResizeHandle;
class TrackPanelResizerCell
: public CommonTrackPanelCell
, public std::enable_shared_from_this< TrackPanelResizerCell >
, public ClientData::Base
{
TrackPanelResizerCell(const TrackPanelResizerCell&) = delete;
TrackPanelResizerCell &operator= (const TrackPanelResizerCell&) = delete;
public:
static TrackPanelResizerCell &Get( Track &track );
static const TrackPanelResizerCell &Get( const Track &track );
explicit
TrackPanelResizerCell( const std::shared_ptr<Track> &pTrack );
std::vector<UIHandlePtr> HitTest
(const TrackPanelMouseState &, const SneedacityProject *) override;
protected:
std::shared_ptr<Track> DoFindTrack() override;
private:
// back-pointer is weak to break a cycle
std::weak_ptr<Track> mwTrack;
// TrackPanelDrawable implementation
void Draw(
TrackPanelDrawingContext &context,
const wxRect &rect, unsigned iPass ) override;
std::weak_ptr<TrackPanelResizeHandle> mResizeHandle;
};
#endif