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 WaveChannelVZoomHandle.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 WaveChannel;
18class WaveTrack;
19
20class SpectrumVZoomHandle final : public UIHandle
21{
23
24public:
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 std::shared_ptr<WaveChannel> FindWaveChannel();
40
41 void Enter(bool forward, AudacityProject*) override;
42
43 bool HandlesRightClick() override;
44
46 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
47
49 (const TrackPanelMouseEvent &event, AudacityProject *pProject) override;
50
52 (const TrackPanelMouseState &state, AudacityProject *pProject)
53 override;
54
56 (const TrackPanelMouseEvent &event, AudacityProject *pProject,
57 wxWindow *pParent) override;
58
59 Result Cancel(AudacityProject *pProject) override;
60
61private:
62
63 // TrackPanelDrawable implementation
64 void Draw(
66 const wxRect &rect, unsigned iPass ) override;
67
68 wxRect DrawingArea(
70 const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override;
71
72 std::weak_ptr<WaveChannel> mpChannel;
73
75 wxRect mRect{};
76};
77
78#include "WaveChannelVZoomHandle.h" // to inherit
79
81{
83 : WaveChannelVRulerMenuTable{ "SpectrumVRuler" }
84 {}
87
88public:
89 static PopupMenuTable &Instance();
90
91private:
92 void OnSpectrumScaleType(wxCommandEvent &evt);
93};
94
95#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, WaveChannel &wc, WaveChannelViewConstants::ZoomActions ZoomKind, const wxRect &rect, int zoomStart, int zoomEnd, bool fixedMousePoint)
SpectrumVZoomHandle(const SpectrumVZoomHandle &)
Result Release(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent) override
std::shared_ptr< WaveChannel > FindWaveChannel()
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
std::shared_ptr< const Track > FindTrack() const override
Result Click(const TrackPanelMouseEvent &event, AudacityProject *pProject) override
std::weak_ptr< WaveChannel > mpChannel
void Enter(bool forward, AudacityProject *) override
wxRect DrawingArea(TrackPanelDrawingContext &, const wxRect &rect, const wxRect &panelRect, unsigned iPass) override
~SpectrumVZoomHandle() override
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:37
unsigned Result
Definition: UIHandle.h:40
A Track that contains audio waveform data.
Definition: WaveTrack.h:203