Audacity 3.2.0
WaveTrackVZoomHandle.h
Go to the documentation of this file.
1/**********************************************************************
2
3Audacity: A Digital Audio Editor
4
5WaveTrackVZoomHandle.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 WaveTrack;
18#include "../../../../UIHandle.h"
19#include "Prefs.h"
20
22{
23 // See RefreshCode.h for bit flags:
24 using Result = unsigned;
25
26 AUDACITY_DLL_API
27 HitTestPreview HitPreview(const wxMouseState &state);
28
29 AUDACITY_DLL_API
30 bool IsDragZooming(int zoomStart, int zoomEnd);
31
32 using DoZoomFunction = void (*)( AudacityProject *pProject,
33 WaveTrack *pTrack,
35 const wxRect &rect, int zoomStart, int zoomEnd,
36 bool fixedMousePoint);
37
38 AUDACITY_DLL_API
40 const TrackPanelMouseEvent &event, AudacityProject *pProject,
41 int zoomStart, int &zoomEnd );
42
43 AUDACITY_DLL_API
45 const TrackPanelMouseEvent &event, AudacityProject *pProject,
46 wxWindow *pParent, WaveTrack *pTrack, const wxRect &mRect,
47 DoZoomFunction doZoom, PopupMenuTable &table,
48 int zoomStart, int zoomEnd );
49
50 AUDACITY_DLL_API
51 void DoDraw(
53 const wxRect &rect, unsigned iPass, int zoomStart, int zoomEnd );
54
55 AUDACITY_DLL_API
56 wxRect DoDrawingArea(
57 const wxRect &rect, const wxRect &panelRect, unsigned iPass );
58};
59
60#include "../../../../widgets/PopupMenuTable.h" // to inherit
61
62class AUDACITY_DLL_API WaveTrackVRulerMenuTable
63 : public PopupMenuTable
64 , private PrefsListener
65{
66public:
68 {
69 public:
72 wxRect rect;
73 unsigned result;
74 int yy;
76 };
77
78protected:
81 {}
82
83 void InitUserData(void *pUserData) override;
84
85protected:
86 InitMenuData *mpData {};
87
88 void OnZoom( WaveTrackViewConstants::ZoomActions iZoomCode );
89 void OnZoomFitVertical(wxCommandEvent&)
91 void OnZoomReset(wxCommandEvent&)
93 void OnZoomDiv2Vertical(wxCommandEvent&)
95 void OnZoomTimes2Vertical(wxCommandEvent&)
97 void OnZoomHalfWave(wxCommandEvent&)
99 void OnZoomInVertical(wxCommandEvent&)
101 void OnZoomOutVertical(wxCommandEvent&)
103
104 void UpdatePrefs() override;
105};
106
107enum {
115
116 // Reserve an ample block of ids for waveform scale types
119
120 // Reserve an ample block of ids for spectrum scale types
123};
124
125#endif
int id
@ OnLastWaveformScaleID
@ OnZoomTimes2ID
@ OnFirstSpectrumScaleID
@ OnZoomOutVerticalID
@ OnLastSpectrumScaleID
@ OnZoomDiv2ID
@ OnZoomFitVerticalID
@ OnZoomHalfWaveID
@ OnFirstWaveformScaleID
@ OnZoomInVerticalID
@ OnZoomResetID
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:556
A Track that contains audio waveform data.
Definition: WaveTrack.h:57
void OnZoomHalfWave(wxCommandEvent &)
void OnZoomFitVertical(wxCommandEvent &)
void OnZoomOutVertical(wxCommandEvent &)
WaveTrackVRulerMenuTable(const Identifier &id)
void OnZoomReset(wxCommandEvent &)
void OnZoomTimes2Vertical(wxCommandEvent &)
void OnZoomDiv2Vertical(wxCommandEvent &)
void OnZoomInVertical(wxCommandEvent &)
AUDACITY_DLL_API void UpdatePrefs(wxWindow *pParent)
AUDACITY_DLL_API HitTestPreview HitPreview(const wxMouseState &state)
AUDACITY_DLL_API void DoDraw(TrackPanelDrawingContext &context, const wxRect &rect, unsigned iPass, int zoomStart, int zoomEnd)
AUDACITY_DLL_API Result DoRelease(const TrackPanelMouseEvent &event, AudacityProject *pProject, wxWindow *pParent, WaveTrack *pTrack, const wxRect &mRect, DoZoomFunction doZoom, PopupMenuTable &table, int zoomStart, int zoomEnd)
AUDACITY_DLL_API wxRect DoDrawingArea(const wxRect &rect, const wxRect &panelRect, unsigned iPass)
AUDACITY_DLL_API bool IsDragZooming(int zoomStart, int zoomEnd)
AUDACITY_DLL_API Result DoDrag(const TrackPanelMouseEvent &event, AudacityProject *pProject, int zoomStart, int &zoomEnd)
void(*)(AudacityProject *pProject, WaveTrack *pTrack, WaveTrackViewConstants::ZoomActions ZoomKind, const wxRect &rect, int zoomStart, int zoomEnd, bool fixedMousePoint) DoZoomFunction
WaveTrackVZoomHandle::DoZoomFunction doZoom