| 1 |
/********************************************************************** |
| 2 |
|
| 3 |
Audacity: A Digital Audio Editor |
| 4 |
|
| 5 |
WaveformVZoomHandle.h |
| 6 |
|
| 7 |
Paul 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 |
| 15 |
#include "WaveChannelViewConstants.h" |
| 16 |
|
| 17 |
class WaveChannel; |
| 18 |
class WaveTrack; |
| 19 |
|
| 20 |
class WaveformVZoomHandle final : public UIHandle |
| 21 |
{ |
| 22 |
WaveformVZoomHandle(const WaveformVZoomHandle&); |
| 23 |
|
| 24 |
public: |
| 25 |
explicit WaveformVZoomHandle( |
| 26 |
const std::shared_ptr<WaveChannel> &pChannel, const wxRect &rect, int y); |
| 27 |
|
| 28 |
WaveformVZoomHandle &operator=(const WaveformVZoomHandle&) = default; |
| 29 |
|
| 30 |
static void DoZoom( |
| 31 |
AudacityProject *pProject, WaveChannel &wc, |
| 32 |
WaveChannelViewConstants::ZoomActions ZoomKind, |
| 33 |
const wxRect &rect, int zoomStart, int zoomEnd, |
| 34 |
bool fixedMousePoint); |
| 35 |
|
| 36 |
~WaveformVZoomHandle() override; |
| 37 |
|
| 38 |
std::shared_ptr<const Track> FindTrack() const override; |
| 39 |
|
| 40 |
void Enter( bool forward, AudacityProject * ) override; |
| 41 |
|
| 42 |
bool HandlesRightClick() override; |
| 43 |
|
| 44 |
Result Click |
| 45 |
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override; |
| 46 |
|
| 47 |
Result Drag |
| 48 |
(const TrackPanelMouseEvent &event, AudacityProject *pProject) override; |
| 49 |
|
| 50 |
HitTestPreview Preview |
| 51 |
(const TrackPanelMouseState &state, AudacityProject *pProject) |
| 52 |
override; |
| 53 |
|
| 54 |
Result Release |
| 55 |
(const TrackPanelMouseEvent &event, AudacityProject *pProject, |
| 56 |
wxWindow *pParent) override; |
| 57 |
|
| 58 |
Result Cancel(AudacityProject *pProject) override; |
| 59 |
|
| 60 |
private: |
| 61 |
|
| 62 |
// TrackPanelDrawable implementation |
| 63 |
void Draw( |
| 64 |
TrackPanelDrawingContext &context, |
| 65 |
const wxRect &rect, unsigned iPass ) override; |
| 66 |
|
| 67 |
wxRect DrawingArea( |
| 68 |
TrackPanelDrawingContext &, |
| 69 |
const wxRect &rect, const wxRect &panelRect, unsigned iPass ) override; |
| 70 |
|
| 71 |
std::weak_ptr<WaveChannel> mpChannel; |
| 72 |
|
| 73 |
int mZoomStart{}, mZoomEnd{}; |
| 74 |
wxRect mRect{}; |
| 75 |
}; |
| 76 |
|
| 77 |
#include "WaveChannelVZoomHandle.h" // to inherit |
| 78 |
|
| 79 |
class WaveformVRulerMenuTable : public WaveChannelVRulerMenuTable |
| 80 |
{ |
| 81 |
WaveformVRulerMenuTable() |
| 82 |
: WaveChannelVRulerMenuTable{ "WaveFormVRuler" } |
| 83 |
{} |
| 84 |
virtual ~WaveformVRulerMenuTable() {} |
| 85 |
DECLARE_POPUP_MENU(WaveformVRulerMenuTable); |
| 86 |
|
| 87 |
public: |
| 88 |
static PopupMenuTable &Instance(); |
| 89 |
|
| 90 |
private: |
| 91 |
void OnWaveformScaleType(wxCommandEvent &evt); |
| 92 |
}; |
| 93 |
|
| 94 |
#endif |