Audacity 3.2.0
WaveChannelVZoomHandle.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5WaveChannelVZoomHandle.h
6
7Paul Licameli split from TrackPanel.cpp
8
9**********************************************************************/
10
11#ifndef __AUDACITY_WAVE_TRACK_VZOOM_HANDLE__
12#define __AUDACITY_WAVE_TRACK_VZOOM_HANDLE__
13
14class wxMouseState;
15class PopupMenuTable;
16class WaveChannel;
17class WaveTrack;
19#include "../../../../UIHandle.h"
20#include "Prefs.h"
21
23{
24 // See RefreshCode.h for bit flags:
25 using Result = unsigned;
26
27 AUDACITY_DLL_API
29
30 AUDACITY_DLL_API
31 bool IsDragZooming(int zoomStart, int zoomEnd, bool hasDragZoom);
32
33 using DoZoomFunction = void (*)(AudacityProject *pProject,
34 WaveChannel &wc,
36 const wxRect &rect, int zoomStart, int zoomEnd,
37 bool fixedMousePoint);
38
39 AUDACITY_DLL_API
41 const TrackPanelMouseEvent &event, AudacityProject *pProject,
42 int zoomStart, int &zoomEnd, bool hasDragZoom );
43
44 AUDACITY_DLL_API
46 const TrackPanelMouseEvent &event, AudacityProject *pProject,
47 wxWindow *pParent, WaveChannel &wc, const wxRect &mRect,
48 DoZoomFunction doZoom, PopupMenuTable &table,
49 int zoomStart, int zoomEnd );
50
51 AUDACITY_DLL_API
52 void DoDraw(
54 const wxRect &rect, unsigned iPass, int zoomStart, int zoomEnd, bool hasDragZoom );
55
56 AUDACITY_DLL_API
57 wxRect DoDrawingArea(
58 const wxRect &rect, const wxRect &panelRect, unsigned iPass );
59};
60
61#include "../../../../widgets/PopupMenuTable.h" // to inherit
62
63class AUDACITY_DLL_API WaveChannelVRulerMenuTable
64 : public PopupMenuTable
65 , private PrefsListener
66{
67public:
69 {
70 public:
73 wxRect rect;
74 unsigned result;
75 int yy;
77 };
78
79protected:
82 {}
83
84 void InitUserData(void *pUserData) override;
85
86protected:
87 InitMenuData *mpData {};
88
89 void OnZoom(WaveChannelViewConstants::ZoomActions iZoomCode);
90 void OnZoomFitVertical(wxCommandEvent&)
92 void OnZoomReset(wxCommandEvent&)
94 void OnZoomHalfWave(wxCommandEvent&)
96 void OnZoomInVertical(wxCommandEvent&)
98 void OnZoomOutVertical(wxCommandEvent&)
100
101 void UpdatePrefs() override;
102};
103
104enum {
110
111 // Reserve an ample block of ids for waveform scale types
114
115 // Reserve an ample block of ids for spectrum scale types
118};
119
120#endif
bool bVZoom
@ OnLastWaveformScaleID
@ OnFirstSpectrumScaleID
@ OnZoomOutVerticalID
@ OnLastSpectrumScaleID
@ OnZoomFitVerticalID
@ OnZoomHalfWaveID
@ OnFirstWaveformScaleID
@ OnZoomInVerticalID
int id
The top-level handle to an Audacity project. It serves as a source of events that other objects can b...
Definition: Project.h:90
An explicitly nonlocalized string, not meant for the user to see.
Definition: Identifier.h:22
virtual void InitUserData(void *pUserData)=0
Called before the menu items are appended.
A listener notified of changes in preferences.
Definition: Prefs.h:652
virtual void UpdatePrefs()=0
Definition: Prefs.cpp:154
void OnZoomInVertical(wxCommandEvent &)
WaveChannelVRulerMenuTable(const Identifier &id)
void OnZoomOutVertical(wxCommandEvent &)
void OnZoomReset(wxCommandEvent &)
void OnZoomFitVertical(wxCommandEvent &)
void OnZoomHalfWave(wxCommandEvent &)
A Track that contains audio waveform data.
Definition: WaveTrack.h:203
AUDACITY_DLL_API Result DoRelease(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent, WaveChannel &wc, const wxRect &mRect, DoZoomFunction doZoom, PopupMenuTable &table, int zoomStart, int zoomEnd)
AUDACITY_DLL_API bool IsDragZooming(int zoomStart, int zoomEnd, bool hasDragZoom)
AUDACITY_DLL_API HitTestPreview HitPreview(const bool bVZoom)
AUDACITY_DLL_API void DoDraw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass, int zoomStart, int zoomEnd, bool hasDragZoom)
void(*)(AudacityProject *pProject, WaveChannel &wc, WaveChannelViewConstants::ZoomActions ZoomKind, const wxRect &rect, int zoomStart, int zoomEnd, bool fixedMousePoint) DoZoomFunction
AUDACITY_DLL_API wxRect DoDrawingArea(const wxRect &rect, const wxRect &panelRect, unsigned iPass)
AUDACITY_DLL_API Result DoDrag(const TrackPanelMouseEvent &event, AudacityProject *pProject, int zoomStart, int &zoomEnd, bool hasDragZoom)
WaveChannelVZoomHandle::DoZoomFunction doZoom