| 1 |
/********************************************************************** |
| 2 |
|
| 3 |
Audacity: A Digital Audio Editor |
| 4 |
|
| 5 |
WaveformVRulerControls.h |
| 6 |
|
| 7 |
Paul Licameli split from WaveChannelVRulerControls.h |
| 8 |
|
| 9 |
**********************************************************************/ |
| 10 |
|
| 11 |
#ifndef __AUDACITY_WAVEFORM_VRULER_CONTROLS__ |
| 12 |
#define __AUDACITY_WAVEFORM_VRULER_CONTROLS__ |
| 13 |
|
| 14 |
#include "../../../ui/ChannelVRulerControls.h" // to inherit |
| 15 |
|
| 16 |
class WaveChannel; |
| 17 |
class WaveformVZoomHandle; |
| 18 |
|
| 19 |
class WaveformVRulerControls final : public ChannelVRulerControls |
| 20 |
{ |
| 21 |
WaveformVRulerControls(const WaveformVRulerControls&) = delete; |
| 22 |
WaveformVRulerControls &operator=(const WaveformVRulerControls&) = delete; |
| 23 |
|
| 24 |
public: |
| 25 |
explicit |
| 26 |
WaveformVRulerControls(const std::shared_ptr<ChannelView> &pChannelView) |
| 27 |
: ChannelVRulerControls{ pChannelView } {} |
| 28 |
~WaveformVRulerControls() override; |
| 29 |
|
| 30 |
std::vector<UIHandlePtr> HitTest( |
| 31 |
const TrackPanelMouseState &state, |
| 32 |
const AudacityProject *) override; |
| 33 |
|
| 34 |
unsigned HandleWheelRotation( |
| 35 |
const TrackPanelMouseEvent &event, |
| 36 |
AudacityProject *pProject) override; |
| 37 |
static unsigned DoHandleWheelRotation( |
| 38 |
const TrackPanelMouseEvent &event, |
| 39 |
AudacityProject *pProject, WaveChannel &wc); |
| 40 |
|
| 41 |
std::shared_ptr<WaveChannel> FindWaveChannel(); |
| 42 |
|
| 43 |
private: |
| 44 |
// TrackPanelDrawable implementation |
| 45 |
void Draw( |
| 46 |
TrackPanelDrawingContext &context, |
| 47 |
const wxRect &rect, unsigned iPass ) override; |
| 48 |
|
| 49 |
// ChannelVRulerControls implementation |
| 50 |
void UpdateRuler( const wxRect &rect ) override; |
| 51 |
|
| 52 |
static void DoUpdateVRuler(const wxRect &rect, const WaveChannel &wc); |
| 53 |
|
| 54 |
std::weak_ptr<WaveformVZoomHandle> mVZoomHandle; |
| 55 |
}; |
| 56 |
|
| 57 |
#endif |