| 1 |
/********************************************************************** |
| 2 |
|
| 3 |
Audacity: A Digital Audio Editor |
| 4 |
|
| 5 |
NoteTrackControls.h |
| 6 |
|
| 7 |
Paul Licameli split from TrackPanel.cpp |
| 8 |
|
| 9 |
**********************************************************************/ |
| 10 |
|
| 11 |
#ifndef __AUDACITY_NOTE_TRACK_CONTROLS__ |
| 12 |
#define __AUDACITY_NOTE_TRACK_CONTROLS__ |
| 13 |
|
| 14 |
#include "../../ui/PlayableTrackControls.h" // to inherit |
| 15 |
#include "Observer.h" |
| 16 |
|
| 17 |
class wxEvent; |
| 18 |
class LWSlider; |
| 19 |
class NoteTrack; |
| 20 |
class MuteButtonHandle; |
| 21 |
class SoloButtonHandle; |
| 22 |
class NoteTrackButtonHandle; |
| 23 |
class VelocitySliderHandle; |
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
///////////////////////////////f//////////////////////////////////////////////// |
| 28 |
class NoteTrackControls : public PlayableTrackControls |
| 29 |
{ |
| 30 |
NoteTrackControls(const NoteTrackControls&) = delete; |
| 31 |
NoteTrackControls &operator=(const NoteTrackControls&) = delete; |
| 32 |
|
| 33 |
std::weak_ptr<MuteButtonHandle> mMuteHandle; |
| 34 |
std::weak_ptr<SoloButtonHandle> mSoloHandle; |
| 35 |
std::weak_ptr<NoteTrackButtonHandle> mClickHandle; |
| 36 |
std::weak_ptr<VelocitySliderHandle> mVelocityHandle; |
| 37 |
|
| 38 |
public: |
| 39 |
explicit |
| 40 |
NoteTrackControls( std::shared_ptr<Track> pTrack ) |
| 41 |
: PlayableTrackControls( pTrack ) {} |
| 42 |
~NoteTrackControls(); |
| 43 |
|
| 44 |
std::vector<UIHandlePtr> HitTest |
| 45 |
(const TrackPanelMouseState &state, |
| 46 |
const AudacityProject *pProject) override; |
| 47 |
|
| 48 |
PopupMenuTable *GetMenuExtension(Track *pTrack) override; |
| 49 |
|
| 50 |
const TCPLines& GetTCPLines() const override; |
| 51 |
|
| 52 |
static unsigned DefaultNoteTrackHeight(); |
| 53 |
static void GetMidiControlsRect(const wxRect & rect, wxRect & dest); |
| 54 |
static void GetVelocityRect(const wxRect &rect, wxRect & dest); |
| 55 |
|
| 56 |
static LWSlider * VelocitySlider |
| 57 |
(const wxRect &sliderRect, const NoteTrack *t, bool captured, |
| 58 |
wxWindow *pParent); |
| 59 |
|
| 60 |
private: |
| 61 |
static void ReCreateVelocitySlider(struct ThemeChangeMessage); |
| 62 |
}; |
| 63 |
|
| 64 |
#endif |