Ardour  9.0-pre0-822-g12e3bc5c20
pianoroll_midi_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 
41 {
42  public:
43  PianorollMidiView (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 
71 
73 
74  std::list<SelectableOwner*> selectable_owners();
76 
77  bool automation_rb_click (GdkEvent*, Temporal::timepos_t const &);
78  bool velocity_rb_click (GdkEvent*, Temporal::timepos_t const &);
79  void line_drag_click (GdkEvent*, Temporal::timepos_t const &);
80 
83 
85  void clear_selection ();
86 
87  sigc::signal<void> AutomationStateChange;
88 
89  protected:
90  bool scroll (GdkEventScroll* ev);
91 
93 
94  typedef std::shared_ptr<PianorollAutomationLine> CueAutomationLine;
95  typedef std::shared_ptr<ARDOUR::AutomationControl> CueAutomationControl;
96 
98 
100  : control (ctl), line (ln), velocity_display (nullptr), visible (vis) {}
102  : control (nullptr), line (nullptr), velocity_display (&vdisp), visible (vis) {}
103 
105 
109  bool visible;
110 
111  void hide ();
112  void show ();
113  void set_height (double);
114  };
115 
116  typedef std::map<Evoral::Parameter, AutomationDisplayState> CueAutomationMap;
117 
120 
122 
123  std::shared_ptr<Temporal::TempoMap const> tempo_map;
125 
127  void update_hit (Hit *);
128 
129  double _height;
130 
133 
134  bool midi_canvas_group_event (GdkEvent*);
136 
138 };
Definition: hit.h:30
sigc::signal< void > AutomationStateChange
void line_drag_click(GdkEvent *, Temporal::timepos_t const &)
PianorollMidiView(std::shared_ptr< ARDOUR::MidiTrack > mt, ArdourCanvas::Item &parent, ArdourCanvas::Item &noscroll_parent, EditingContext &ec, MidiViewBackground &bg, uint32_t basic_color)
AutomationLine * active_automation_line() const
void set_active_automation(Evoral::Parameter const &)
bool midi_canvas_group_event(GdkEvent *)
bool automation_rb_click(GdkEvent *, Temporal::timepos_t const &)
void ghost_remove_note(NoteBase *)
ArdourCanvas::Duple automation_group_position() const
void update_hit(Hit *)
ArdourCanvas::Item * drag_group() const
void set_height(double)
std::list< SelectableOwner * > selectable_owners()
std::shared_ptr< ARDOUR::AutomationControl > CueAutomationControl
void ghost_sync_selection(NoteBase *)
std::shared_ptr< Temporal::TempoMap const > tempo_map
void set_samples_per_pixel(double)
bool velocity_rb_click(GdkEvent *, Temporal::timepos_t const &)
VelocityDisplay * velocity_display
Gtkmm2ext::Color line_color_for(Evoral::Parameter const &)
void ghosts_model_changed()
void update_sustained(Note *)
bool internal_set_active_automation(Evoral::Parameter const &)
MergeableLine * make_merger()
void point_selection_changed()
void reset_width_dependent_items(double pixel_width)
void update_automation_display(Evoral::Parameter const &param, ARDOUR::SelectionOperation)
std::map< Evoral::Parameter, AutomationDisplayState > CueAutomationMap
ArdourCanvas::Rectangle * automation_group
bool is_visible_automation(Evoral::Parameter const &) const
void swap_automation_channel(int)
AutomationDisplayState * active_automation
void unset_active_automation()
ArdourCanvas::Rectangle * event_rect
std::shared_ptr< PianorollAutomationLine > CueAutomationLine
void ghost_add_note(NoteBase *)
void ghosts_view_changed()
bool scroll(GdkEventScroll *ev)
bool is_active_automation(Evoral::Parameter const &) const
CueAutomationMap automation_map
void clear_ghost_events()
uint32_t Color
Definition: colors.h:33
int pixel_width(const std::string &str, const Pango::FontDescription &font)
AutomationDisplayState(VelocityDisplay &vdisp, bool vis)
AutomationDisplayState(CueAutomationControl ctl, CueAutomationLine ln, bool vis)