Audacity  2.2.0
NoteTrackSliderHandles.h
Go to the documentation of this file.
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 "../../../../Experimental.h"
15 
16 #ifdef EXPERIMENTAL_MIDI_OUT
17 
18 #include "../../../ui/SliderHandle.h"
19 
20 class NoteTrack;
21 class wxMouseState;
22 
23 class VelocitySliderHandle final : public SliderHandle
24 {
25  VelocitySliderHandle(const VelocitySliderHandle&) = delete;
26 
27  std::shared_ptr<NoteTrack> GetNoteTrack();
28 
29 public:
30  explicit VelocitySliderHandle
31  ( SliderFn sliderFn, const wxRect &rect,
32  const std::shared_ptr<Track> &pTrack );
33 
34  VelocitySliderHandle &operator=(const VelocitySliderHandle&) = default;
35 
36  virtual ~VelocitySliderHandle();
37 
38 protected:
39  float GetValue() override;
40  Result SetValue
41  (AudacityProject *pProject, float newValue) override;
42  Result CommitChanges
43  (const wxMouseEvent &event, AudacityProject *pProject) override;
44 
45  bool StopsOnKeystroke () override { return true; }
46 
47 public:
48  static UIHandlePtr HitTest
49  (std::weak_ptr<VelocitySliderHandle> &holder,
50  const wxMouseState &state, const wxRect &rect,
51  const std::shared_ptr<Track> &pTrack);
52 };
53 
54 #endif
55 
56 #endif
Definition: SliderHandle.h:22
virtual bool StopsOnKeystroke()
Definition: UIHandle.cpp:48
virtual Result SetValue(AudacityProject *pProject, float newValue)=0
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:161
SliderHandle & operator=(const SliderHandle &)=default
std::shared_ptr< UIHandle > UIHandlePtr
Definition: TrackPanel.h:59
virtual float GetValue()=0
virtual Result CommitChanges(const wxMouseEvent &event, AudacityProject *pProject)=0
A Track that is used for Midi notes. (Somewhat old code).