| 1 |
/********************************************************************** |
| 2 |
|
| 3 |
Audacity: A Digital Audio Editor |
| 4 |
|
| 5 |
NoteTrackSliderHandles.h |
| 6 |
|
| 7 |
Paul Licameli split from TrackPanel.cpp |
| 8 |
|
| 9 |
**********************************************************************/ |
| 10 |
|
| 11 |
#ifndef __AUDACITY_NOTE_TRACK_SLIDER_HANDLES__ |
| 12 |
#define __AUDACITY_NOTE_TRACK_SLIDER_HANDLES__ |
| 13 |
|
| 14 |
#include "../../../ui/SliderHandle.h" |
| 15 |
|
| 16 |
class NoteTrack; |
| 17 |
class wxMouseState; |
| 18 |
|
| 19 |
class VelocitySliderHandle final : public SliderHandle |
| 20 |
{ |
| 21 |
VelocitySliderHandle(const VelocitySliderHandle&) = delete; |
| 22 |
|
| 23 |
std::shared_ptr<NoteTrack> GetNoteTrack() const; |
| 24 |
|
| 25 |
public: |
| 26 |
explicit VelocitySliderHandle |
| 27 |
( SliderFn sliderFn, const wxRect &rect, |
| 28 |
const std::shared_ptr<Track> &pTrack ); |
| 29 |
|
| 30 |
VelocitySliderHandle &operator=(const VelocitySliderHandle&) = default; |
| 31 |
|
| 32 |
virtual ~VelocitySliderHandle(); |
| 33 |
|
| 34 |
protected: |
| 35 |
float GetValue() override; |
| 36 |
Result SetValue |
| 37 |
(AudacityProject *pProject, float newValue) override; |
| 38 |
Result CommitChanges |
| 39 |
(const wxMouseEvent &event, AudacityProject *pProject) override; |
| 40 |
|
| 41 |
TranslatableString Tip( |
| 42 |
const wxMouseState &state, AudacityProject &) const override; |
| 43 |
|
| 44 |
bool StopsOnKeystroke () override { return true; } |
| 45 |
|
| 46 |
public: |
| 47 |
static UIHandlePtr HitTest |
| 48 |
(std::weak_ptr<VelocitySliderHandle> &holder, |
| 49 |
const wxMouseState &state, const wxRect &rect, |
| 50 |
const std::shared_ptr<Track> &pTrack); |
| 51 |
}; |
| 52 |
|
| 53 |
#endif |