Audacity 3.2.0
SpectrumVZoomHandle.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5SpectrumVZoomHandle.h
6
7Paul Licameli split from WaveTrackVZoomHandle.h
8
9**********************************************************************/
10
11#ifndef __AUDACITY_SPECTRUM_VZOOM_HANDLE__
12#define __AUDACITY_SPECTRUM_VZOOM_HANDLE__
13
14#include "../../../../UIHandle.h" // to inherit
16
17class WaveTrack;
18
19class SpectrumVZoomHandle final : public UIHandle
20{
22
23public:
24 explicit SpectrumVZoomHandle
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<WaveTrack> GetTrack() const { return mpTrack.lock(); }
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 "WaveTrackVZoomHandle.h" // to inherit
77
79{
81 : WaveTrackVRulerMenuTable{ "SpectrumVRuler" }
82 {}
85
86public:
87 static PopupMenuTable &Instance();
88
89private:
90 void OnSpectrumScaleType(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
void OnSpectrumScaleType(wxCommandEvent &evt)
DECLARE_POPUP_MENU(SpectrumVRulerMenuTable)
static PopupMenuTable & Instance()
static void DoZoom(AudacityProject *pProject, WaveTrack *pTrack, WaveTrackViewConstants::ZoomActions ZoomKind, const wxRect &rect, int zoomStart, int zoomEnd, bool fixedMousePoint)
std::weak_ptr< WaveTrack > mpTrack
SpectrumVZoomHandle(const SpectrumVZoomHandle &)
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
bool HandlesRightClick() override
Whether the handle has any special right-button handling.
void Draw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass) override
Result Drag(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
void Enter(bool forward, AudacityProject *) override
wxRect DrawingArea(TrackPanelDrawingContext &, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override
~SpectrumVZoomHandle() override
std::shared_ptr< WaveTrack > GetTrack() const
Result Cancel(AudacityProject *pProject) override
SpectrumVZoomHandle & operator=(const SpectrumVZoomHandle &)=default
HitTestPreview Preview(const TrackPanelMouseState &state, AudacityProject *pProject) override
Short-lived drawing and event-handling object associated with a TrackPanelCell.
Definition: UIHandle.h:35
unsigned Result
Definition: UIHandle.h:38
A Track that contains audio waveform data.
Definition: WaveTrack.h:51