Audacity 3.2.0
WaveformVZoomHandle.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5WaveformVZoomHandle.h
6
7Paul Licameli split from WaveChannelVZoomHandle.h
8
9**********************************************************************/
10
11#ifndef __AUDACITY_WAVEFORM_VZOOM_HANDLE__
12#define __AUDACITY_WAVEFORM_VZOOM_HANDLE__
13
14#include "../../../../UIHandle.h" // to inherit
16
17class WaveChannel;
18class WaveTrack;
19
20class WaveformVZoomHandle final : public UIHandle
21{
23
24public:
25 explicit WaveformVZoomHandle(
26 const std::shared_ptr<WaveChannel> &pChannel, const wxRect &rect, int y);
27
29
30 static void DoZoom(
31 AudacityProject *pProject, WaveChannel &wc,
33 const wxRect &rect, int zoomStart, int zoomEnd,
34 bool fixedMousePoint);
35
37
38 std::shared_ptr<const Track> FindTrack() const override;
39
40 void Enter( bool forward, AudacityProject * ) override;
41
42 bool HandlesRightClick() override;
43
45 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
46
48 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
49
51 (const TrackPanelMouseState &state, AudacityProject *pProject)
52 override;
53
55 (const TrackPanelMouseEvent &event, AudacityProject *pProject,
56 wxWindow *pParent) override;
57
58 Result Cancel(AudacityProject *pProject) override;
59
60private:
61
62 // TrackPanelDrawable implementation
63 void Draw(
65 const wxRect &rect, unsigned iPass ) override;
66
67 wxRect DrawingArea(
69 const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
70
71 std::weak_ptr<WaveChannel> mpChannel;
72
74 wxRect mRect{};
75};
76
77#include "WaveChannelVZoomHandle.h" // to inherit
78
80{
82 : WaveChannelVRulerMenuTable{ "WaveFormVRuler" }
83 {}
86
87public:
88 static PopupMenuTable &Instance();
89
90private:
91 void OnWaveformScaleType(wxCommandEvent &evt);
92};
93
94#endif
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Definition: UIHandle.h:37
unsigned Result
Definition: UIHandle.h:40
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
void OnWaveformScaleType(wxCommandEvent &evt)
static PopupMenuTable & Instance()
DECLARE_POPUP_MENU(WaveformVRulerMenuTable)
void Enter(bool forward, AudacityProject *) override
~WaveformVZoomHandle() override
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
wxRect DrawingArea(TrackPanelDrawingContext &, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override
std::shared_ptr< const Track > FindTrack() const override
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
std::weak_ptr< WaveChannel > mpChannel
static void DoZoom(AudacityProject *pProject, WaveChannel &wc, WaveChannelViewConstants::ZoomActions ZoomKind, const wxRect &rect, int zoomStart, int zoomEnd, bool fixedMousePoint)
WaveformVZoomHandle(const WaveformVZoomHandle &)
Result Cancel(AudacityProject *pProject) override
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
WaveformVZoomHandle & operator=(const WaveformVZoomHandle &)=default
bool HandlesRightClick() override
Whether the handle has any special right-button handling.
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override