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 WaveTrack;
18
19class WaveformVZoomHandle final : public UIHandle
20{
22
23public:
24 explicit WaveformVZoomHandle
25 (const std::shared_ptr<WaveTrack> &pTrack, const wxRect &rect, int y);
26
28
29 static void DoZoom(
30 AudacityProject *pProject, WaveTrack *pTrack,
32 const wxRect &rect, int zoomStart, int zoomEnd,
33 bool fixedMousePoint);
34
36
37 std::shared_ptr<const Channel> FindChannel() const override;
38
39 void Enter( bool forward, AudacityProject * ) override;
40
41 bool HandlesRightClick() override;
42
44 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
45
47 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
48
50 (const TrackPanelMouseState &state, AudacityProject *pProject)
51 override;
52
54 (const TrackPanelMouseEvent &event, AudacityProject *pProject,
55 wxWindow *pParent) override;
56
57 Result Cancel(AudacityProject *pProject) override;
58
59private:
60
61 // TrackPanelDrawable implementation
62 void Draw(
64 const wxRect &rect, unsigned iPass ) override;
65
66 wxRect DrawingArea(
68 const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
69
70 std::weak_ptr<WaveTrack> mpTrack;
71
73 wxRect mRect{};
74};
75
76#include "WaveChannelVZoomHandle.h" // to inherit
77
79{
81 : WaveTrackVRulerMenuTable{ "WaveFormVRuler" }
82 {}
85
86public:
87 static PopupMenuTable &Instance();
88
89private:
90 void OnWaveformScaleType(wxCommandEvent &evt);
91};
92
93#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:36
unsigned Result
Definition: UIHandle.h:39
A Track that contains audio waveform data.
Definition: WaveTrack.h:227
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::weak_ptr< WaveTrack > mpTrack
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
WaveformVZoomHandle(const WaveformVZoomHandle &)
static void DoZoom(AudacityProject *pProject, WaveTrack *pTrack, WaveChannelViewConstants::ZoomActions ZoomKind, const wxRect &rect, int zoomStart, int zoomEnd, bool fixedMousePoint)
Result Cancel(AudacityProject *pProject) override
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
std::shared_ptr< const Channel > FindChannel() const 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