Audacity  2.2.2
NoteTrackUI.cpp
Go to the documentation of this file.
1 /**********************************************************************
2 
3 Audacity: A Digital Audio Editor
4 
5 NoteTrackUI.cpp
6 
7 Paul Licameli split from TrackPanel.cpp
8 
9 **********************************************************************/
10 
11 #include "../../../../Audacity.h"
12 
13 #ifdef USE_MIDI
14 
15 #include "../../../../NoteTrack.h"
16 #include "NoteTrackControls.h"
18 
19 #include "../../../../HitTestResult.h"
20 #include "../../../../Project.h"
21 #include "../../../../TrackPanelMouseEvent.h"
22 #include "../../../ui/SelectHandle.h"
23 #include "StretchHandle.h"
24 
25 std::vector<UIHandlePtr> NoteTrack::DetailedHitTest
26 (const TrackPanelMouseState &WXUNUSED(state),
27  const AudacityProject *WXUNUSED(pProject), int, bool )
28 {
29  // Eligible for stretch?
30  UIHandlePtr result;
31  std::vector<UIHandlePtr> results;
32 #ifdef USE_MIDI
33 #ifdef EXPERIMENTAL_MIDI_STRETCHING
34  result = StretchHandle::HitTest(
35  mStretchHandle, state, pProject, Pointer<NoteTrack>(this) );
36  if (result)
37  results.push_back(result);
38 #endif
39 #endif
40 
41  return results;
42 }
43 
44 std::shared_ptr<TrackControls> NoteTrack::GetControls()
45 {
46  return std::make_shared<NoteTrackControls>( Pointer( this ) );
47 }
48 
49 std::shared_ptr<TrackVRulerControls> NoteTrack::GetVRulerControls()
50 {
51  return std::make_shared<NoteTrackVRulerControls>( Pointer( this ) );
52 }
53 #endif
AudacityProject provides the main window, with tools and tracks contained within it.
Definition: Project.h:176
static UIHandlePtr HitTest(std::weak_ptr< StretchHandle > &holder, const TrackPanelMouseState &state, const AudacityProject *pProject, const std::shared_ptr< NoteTrack > &pTrack)
std::shared_ptr< UIHandle > UIHandlePtr
Definition: TrackPanel.h:59