Ardour  9.0-pre0-582-g084a23a80d
midi_cue_view.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2015 David Robillard <d@drobilla.net>
3  * Copyright (C) 2008-2012 Hans Baier <hansfbaier@googlemail.com>
4  * Copyright (C) 2008-2017 Paul Davis <paul@linuxaudiosystems.com>
5  * Copyright (C) 2009-2012 Carl Hetherington <carl@carlh.net>
6  * Copyright (C) 2015-2016 Tim Mayberry <mojofunk@gmail.com>
7  * Copyright (C) 2015-2017 Nick Mainsbridge <mainsbridge@gmail.com>
8  * Copyright (C) 2015-2017 Robin Gareus <robin@gareus.org>
9  *
10  * This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License along
21  * with this program; if not, write to the Free Software Foundation, Inc.,
22  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24 
25 #pragma once
26 
27 #include <map>
28 
29 #include "ardour/types.h"
30 
31 #include "midi_view.h"
32 
33 class VelocityDisplay;
35 
36 namespace ArdourCanvas {
37  class Box;
38 }
39 
40 class MidiCueView : public MidiView
41 {
42  public:
43  MidiCueView (std::shared_ptr<ARDOUR::MidiTrack> mt,
44  ArdourCanvas::Item& parent,
45  ArdourCanvas::Item& noscroll_parent,
46  EditingContext& ec,
48  uint32_t basic_color
49  );
50 
52 
53  void set_samples_per_pixel (double);
54  void set_height (double);
55 
62 
68 
70 
71  std::list<SelectableOwner*> selectable_owners();
73 
76 
79 
80  sigc::signal<void> AutomationStateChange;
81 
82  protected:
83  bool scroll (GdkEventScroll* ev);
84 
86 
87  typedef std::shared_ptr<MidiCueAutomationLine> CueAutomationLine;
88  typedef std::shared_ptr<ARDOUR::AutomationControl> CueAutomationControl;
89 
91 
93  : control (ctl), line (ln), velocity_display (nullptr), visible (vis) {}
95  : control (nullptr), line (nullptr), velocity_display (&vdisp), visible (vis) {}
96 
98 
102  bool visible;
103 
104  void hide ();
105  void show ();
106  void set_height (double);
107  };
108 
109  typedef std::map<Evoral::Parameter, AutomationDisplayState> CueAutomationMap;
110 
113 
115 
116  std::shared_ptr<Temporal::TempoMap const> tempo_map;
118 
120  void update_hit (Hit *);
121 
122  double _height;
123 
126 };
Definition: hit.h:30
void ghost_remove_note(NoteBase *)
VelocityDisplay * velocity_display
void set_active_automation(Evoral::Parameter const &)
std::map< Evoral::Parameter, AutomationDisplayState > CueAutomationMap
bool scroll(GdkEventScroll *ev)
void ghosts_view_changed()
void line_drag_click(GdkEvent *, Temporal::timepos_t const &)
bool internal_set_active_automation(Evoral::Parameter const &)
void clear_ghost_events()
void automation_leave()
void automation_entry()
ArdourCanvas::Rectangle * event_rect
MidiCueView(std::shared_ptr< ARDOUR::MidiTrack > mt, ArdourCanvas::Item &parent, ArdourCanvas::Item &noscroll_parent, EditingContext &ec, MidiViewBackground &bg, uint32_t basic_color)
void set_height(double)
bool automation_rb_click(GdkEvent *, Temporal::timepos_t const &)
void update_hit(Hit *)
CueAutomationMap automation_map
void unset_active_automation()
std::shared_ptr< MidiCueAutomationLine > CueAutomationLine
Definition: midi_cue_view.h:87
std::shared_ptr< ARDOUR::AutomationControl > CueAutomationControl
Definition: midi_cue_view.h:88
void ghosts_model_changed()
std::list< SelectableOwner * > selectable_owners()
void update_sustained(Note *)
AutomationDisplayState * active_automation
sigc::signal< void > AutomationStateChange
Definition: midi_cue_view.h:80
void ghost_add_note(NoteBase *)
MergeableLine * make_merger()
ArdourCanvas::Item * drag_group() const
bool is_active_automation(Evoral::Parameter const &) const
std::shared_ptr< Temporal::TempoMap const > tempo_map
ArdourCanvas::Rectangle * automation_group
Definition: midi_cue_view.h:85
void set_samples_per_pixel(double)
double _height
bool is_visible_automation(Evoral::Parameter const &) const
void ghost_sync_selection(NoteBase *)
void update_automation_display(Evoral::Parameter const &param, ARDOUR::SelectionOperation)
void swap_automation_channel(int)
AutomationDisplayState(CueAutomationControl ctl, CueAutomationLine ln, bool vis)
Definition: midi_cue_view.h:92
AutomationDisplayState(VelocityDisplay &vdisp, bool vis)
Definition: midi_cue_view.h:94