Audacity  2.2.0
NoteTrackVZoomHandle.h
Go to the documentation of this file.
1 /**********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 NoteTrackVZoomHandle.h
6 
7 Paul Licameli split from TrackPanel.cpp
8 
9 **********************************************************************/
10 
11 #ifndef __AUDACITY_NOTE_TRACK_VZOOM_HANDLE__
12 #define __AUDACITY_NOTE_TRACK_VZOOM_HANDLE__
13 
14 class wxMouseState;
15 class NoteTrack;
16 
17 #include "../../../../MemoryX.h"
18 #include "../../../../UIHandle.h"
19 #include <wx/gdicmn.h>
20 
22 {
24  static HitTestPreview HitPreview(const wxMouseState &state);
25 
26 public:
27  explicit NoteTrackVZoomHandle
28  (const std::shared_ptr<NoteTrack> &pTrack, const wxRect &rect, int y);
29 
31 
32  static UIHandlePtr HitTest
33  (std::weak_ptr<NoteTrackVZoomHandle> &holder,
34  const wxMouseState &state,
35  const std::shared_ptr<NoteTrack> &pTrack, const wxRect &rect);
36 
37  virtual ~NoteTrackVZoomHandle();
38 
39  std::shared_ptr<NoteTrack> GetTrack() const { return mpTrack.lock(); }
40 
41  void Enter(bool forward) override;
42 
44  (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
45 
46  Result Drag
47  (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
48 
50  (const TrackPanelMouseState &state, const AudacityProject *pProject)
51  override;
52 
54  (const TrackPanelMouseEvent &event, AudacityProject *pProject,
55  wxWindow *pParent) override;
56 
57  Result Cancel(AudacityProject *pProject) override;
58 
59  void DrawExtras
60  (DrawingPass pass,
61  wxDC * dc, const wxRegion &updateRegion, const wxRect &panelRect)
62  override;
63 
64 private:
65  std::weak_ptr<NoteTrack> mpTrack;
66 
68  wxRect mRect;
69 };
70 
71 #endif
void Enter(bool forward) override
Definition: NoteTrackVZoomHandle.cpp:45
static HitTestPreview HitPreview(const wxMouseState &state)
Definition: NoteTrackVZoomHandle.cpp:52
NoteTrackVZoomHandle(const NoteTrackVZoomHandle &)
static UIHandlePtr HitTest(std::weak_ptr< NoteTrackVZoomHandle > &holder, const wxMouseState &state, const std::shared_ptr< NoteTrack > &pTrack, const wxRect &rect)
Definition: NoteTrackVZoomHandle.cpp:68
int mZoomStart
Definition: NoteTrackVZoomHandle.h:67
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
Definition: NoteTrackVZoomHandle.cpp:119
Definition: TrackPanelMouseEvent.h:27
std::weak_ptr< NoteTrack > mpTrack
Definition: NoteTrackVZoomHandle.h:65
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:161
unsigned Result
Definition: UIHandle.h:37
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: NoteTrackVZoomHandle.cpp:95
int mZoomEnd
Definition: NoteTrackVZoomHandle.h:67
Result Cancel(AudacityProject *pProject) override
Definition: NoteTrackVZoomHandle.cpp:151
std::shared_ptr< NoteTrack > GetTrack() const
Definition: NoteTrackVZoomHandle.h:39
wxRect mRect
Definition: NoteTrackVZoomHandle.h:68
std::shared_ptr< UIHandle > UIHandlePtr
Definition: TrackPanel.h:59
HitTestPreview Preview(const TrackPanelMouseState &state, const AudacityProject *pProject) override
Definition: NoteTrackVZoomHandle.cpp:113
void DrawExtras(DrawingPass pass, wxDC *dc, const wxRegion &updateRegion, const wxRect &panelRect) override
Definition: NoteTrackVZoomHandle.cpp:159
virtual ~NoteTrackVZoomHandle()
Definition: NoteTrackVZoomHandle.cpp:81
Definition: UIHandle.h:33
Definition: NoteTrackVZoomHandle.h:21
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Definition: NoteTrackVZoomHandle.cpp:86
Definition: HitTestResult.h:19
DrawingPass
Definition: UIHandle.h:43
Definition: TrackPanelMouseEvent.h:45
NoteTrackVZoomHandle & operator=(const NoteTrackVZoomHandle &)=default
A Track that is used for Midi notes. (Somewhat old code).