Ardour  8.12
midi_region_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 #ifndef __gtk_ardour_midi_region_view_h__
26 #define __gtk_ardour_midi_region_view_h__
27 
28 #include <string>
29 #include <vector>
30 #include <stdint.h>
31 
32 #include "pbd/signals.h"
33 
34 #include "ardour/midi_model.h"
35 #include "ardour/types.h"
36 
37 #include "editing.h"
38 #include "region_view.h"
39 #include "midi_time_axis.h"
40 #include "time_axis_view_item.h"
41 #include "automation_line.h"
42 #include "enums.h"
43 
44 namespace ARDOUR {
45  class MidiRegion;
46  class MidiModel;
47  class Filter;
48 };
49 
50 namespace MIDI {
51  namespace Name {
52  struct PatchPrimaryKey;
53  };
54 };
55 
56 class SysEx;
57 class Note;
58 class Hit;
59 class MidiTimeAxisView;
60 class NoteBase;
61 class GhostRegion;
64 class MidiCutBuffer;
65 class MidiListEditor;
66 class EditNoteDialog;
67 class PatchChange;
68 class ItemCounts;
69 class CursorContext;
71 
72 class MidiRegionView : public RegionView
73 {
74 public:
77 
80  std::shared_ptr<ARDOUR::MidiRegion> r,
81  double samples_per_pixel,
82  uint32_t basic_color);
83 
86  std::shared_ptr<ARDOUR::MidiRegion> r,
87  double samples_per_pixel,
88  uint32_t basic_color,
89  bool recording,
91 
92 
94  MidiRegionView (const MidiRegionView& other, std::shared_ptr<ARDOUR::MidiRegion>);
95 
97 
98  void init (bool wfd);
99 
100  void set_selected (bool yn);
101 
102  const std::shared_ptr<ARDOUR::MidiRegion> midi_region() const;
103 
104  inline MidiTimeAxisView* midi_view() const
105  { return dynamic_cast<MidiTimeAxisView*>(&trackview); }
106 
108  { return midi_view()->midi_view(); }
109 
110  void step_add_note (uint8_t channel, uint8_t number, uint8_t velocity,
113  void set_height (double);
114  void apply_note_range(uint8_t lowest, uint8_t highest, bool force=false);
115 
116  inline ARDOUR::ColorMode color_mode() const { return midi_view()->color_mode(); }
117 
118  uint32_t get_fill_color() const;
119  void color_handler ();
120 
125 
127 
128  NoteBase* add_note(const std::shared_ptr<NoteType> note, bool visible);
129 
132  void paste_internal (Temporal::timepos_t const & pos, unsigned paste_count, float times, const MidiCutBuffer&);
133 
135 
142  void get_patch_key_at (Temporal::Beats time, uint8_t channel, MIDI::Name::PatchPrimaryKey& key) const;
143 
147 
152  void change_patch_change (PatchChange& old_patch, const MIDI::Name::PatchPrimaryKey& new_patch);
154 
159 
161 
168  void step_patch (PatchChange& patch, bool bank, int delta);
169 
173 
177 
178  void begin_write();
179  void end_write();
181 
182  void begin_drag_edit (std::string const & why);
183  void end_drag_edit ();
184 
185  void display_model(std::shared_ptr<ARDOUR::MidiModel> model);
186  std::shared_ptr<ARDOUR::MidiModel> model() const { return _model; }
187 
188  /* note_diff commands should start here; this initiates an undo record */
189  void start_note_diff_command (std::string name = "midi edit");
190 
193  void note_diff_add_note (const std::shared_ptr<NoteType> note, bool selected, bool show_velocity = false);
195 
196  /* note_diff commands should be completed with one of these calls; they may (or may not) commit the undo record */
197  void apply_note_diff (bool as_subcommand = false, bool was_copy = false);
199 
201  void note_left(NoteBase* ev);
204  void sysex_entered (SysEx* p);
205  void sysex_left (SysEx* p);
206  void note_mouse_position (float xfraction, float yfraction, bool can_set_cursor=true);
208  void note_selected(NoteBase* ev, bool add, bool extend=false);
211  void delete_note (std::shared_ptr<NoteType>);
212  size_t selection_size() { return _selection.size(); }
218 
220  void move_selection(Temporal::timecnt_t const & dx, double dy, double cumulative_dy);
221  void note_dropped (NoteBase* ev, Temporal::timecnt_t const & d_qn, int8_t d_note, bool copy);
223  void move_copies(Temporal::timecnt_t const & dx_qn, double dy, double cumulative_dy);
224 
225  void select_notes (std::list<Evoral::event_id_t>, bool allow_audition);
226  void select_matching_notes (uint8_t notenum, uint16_t channel_mask, bool add, bool extend);
227  void toggle_matching_notes (uint8_t notenum, uint16_t channel_mask);
228 
235  bool note_in_region_range(const std::shared_ptr<NoteType> note, bool& visible) const;
236  /* Test if a note is withing this region's time range. Return true if so */
237  bool note_in_region_time_range(const std::shared_ptr<NoteType> note) const;
238 
241 
244 
249  void begin_resizing(bool at_front);
250 
251  void update_resizing (NoteBase* primary, bool at_front, double delta_x, bool relative, double snap_delta, bool with_snap);
252  void finish_resizing (NoteBase* primary, bool at_front, double delat_x, bool relative, double snap_delta, bool with_snap);
253  void abort_resizing ();
254 
258  void change_channel(uint8_t channel);
259 
260  enum MouseState {
267  };
268 
269  MouseState mouse_state() const { return _mouse_state; }
270 
271  struct NoteResizeData {
274  };
275 
281  double snap_to_pixel(double x, bool ensure_snap = false);
282 
289  Temporal::timecnt_t snap_pixel_to_time (double x, bool ensure_snap = false);
290 
293  void change_note_lengths (bool, bool, Temporal::Beats beats, bool start, bool end);
294  void change_velocities (bool up, bool fine, bool allow_smush, bool all_together);
295  void set_velocity (NoteBase* primary, int velocity);
296  bool set_velocity_for_notes (std::vector<NoteBase*>& notes, int velocity);
297  bool set_velocities_for_notes (std::vector<NoteBase*>& notes, std::vector<int>& velocities);
298  void transpose (bool up, bool fine, bool allow_smush);
299  void nudge_notes (bool forward, bool fine);
300  void channel_edit ();
301  void velocity_edit ();
302 
304 
305  typedef std::set<NoteBase*> Selection;
306  Selection const & selection () const {
307  return _selection;
308  }
309 
310  void selection_as_notelist (Notes& selected, bool allow_all_if_none_selected = false);
311 
314 
317 
325  void create_note_at (Temporal::timepos_t const & t, double y, Temporal::Beats length, uint32_t state, bool shift_snap);
326 
331 
333 
336 
337  void show_verbose_cursor_for_new_note_value(std::shared_ptr<NoteType> current_note, uint8_t new_note) const;
338 
339  protected:
341 
342  void set_flags (XMLNode *);
343  void store_flags ();
344 
346 
347  void parameter_changed (std::string const & p);
348  void _redisplay (bool view_only);
349 
350  protected:
351  friend class Editor;
352 
355 
356  void move_note_starts_earlier_fine () { change_note_lengths (true, false, Temporal::Beats(), true, false); }
357  void move_note_starts_earlier () { change_note_lengths (false, false, Temporal::Beats(), true, false); }
358  void move_note_ends_later_fine () { change_note_lengths (true, false, Temporal::Beats(), false, true); }
359  void move_note_ends_later () { change_note_lengths (false, false, Temporal::Beats(), false, true); }
360  void move_note_starts_later_fine () { change_note_lengths (true, true, Temporal::Beats(), true, false); }
361  void move_note_starts_later () { change_note_lengths (false, true, Temporal::Beats(), true, false); }
362  void move_note_ends_earlier_fine () { change_note_lengths (true, true, Temporal::Beats(), false, true); }
363  void move_note_ends_earlier () { change_note_lengths (false, true, Temporal::Beats(), false, true); }
364 
365  void select_next_note () { goto_next_note (false); }
369 
370  void increase_note_velocity () { change_velocities (true, false, false, false); }
371  void increase_note_velocity_fine () { change_velocities (true, true, false, false); }
372  void increase_note_velocity_smush () { change_velocities (true, false, true, false); }
373  void increase_note_velocity_together () { change_velocities (true, false, false, true); }
374  void increase_note_velocity_fine_smush () { change_velocities (true, true, true, false); }
375  void increase_note_velocity_fine_together () { change_velocities (true, true, false, true); }
376  void increase_note_velocity_smush_together () { change_velocities (true, false, true, true); }
377  void increase_note_velocity_fine_smush_together () { change_velocities (true, true, true, true); }
378 
379  void decrease_note_velocity () { change_velocities (false, false, false, false); }
380  void decrease_note_velocity_fine () { change_velocities (false, true, false, false); }
381  void decrease_note_velocity_smush () { change_velocities (false, false, true, false); }
382  void decrease_note_velocity_together () { change_velocities (false, false, false, true); }
383  void decrease_note_velocity_fine_smush () { change_velocities (false, true, true, false); }
384  void decrease_note_velocity_fine_together () { change_velocities (false, true, false, true); }
385  void decrease_note_velocity_smush_together () { change_velocities (false, false, true, true); }
386  void decrease_note_velocity_fine_smush_together () { change_velocities (false, true, true, true); }
387 
388  void transpose_up_octave () { transpose (true, false, false); }
389  void transpose_up_octave_smush () { transpose (true, false, true); }
390  void transpose_up_tone () { transpose (true, true, false); }
391  void transpose_up_tone_smush () { transpose (true, true, true); }
392 
393  void transpose_down_octave () { transpose (false, false, false); }
394  void transpose_down_octave_smush () { transpose (false, false, true); }
395  void transpose_down_tone () { transpose (false, true, false); }
396  void transpose_down_tone_smush () { transpose (false, true, true); }
397 
398  void nudge_notes_later () { nudge_notes (true, false); }
399  void nudge_notes_later_fine () { nudge_notes (true, true); }
400  void nudge_notes_earlier () { nudge_notes (false, false); }
401  void nudge_notes_earlier_fine () { nudge_notes (false, true); }
402 
404 
405  private:
406 
409  friend class NoteDrag;
410  friend class NoteCreateDrag;
411  friend class HitCreateDrag;
412  friend class MidiGhostRegion;
413 
414  friend class EditNoteDialog;
415 
419  void play_midi_note (std::shared_ptr<NoteType> note);
420  void start_playing_midi_note (std::shared_ptr<NoteType> note);
421  void start_playing_midi_chord (std::vector<std::shared_ptr<NoteType> > notes);
422 
426 
427  void clear_events ();
428 
431 
436 
437  void change_note_channel (NoteBase *, int8_t, bool relative=false);
438  void change_note_velocity(NoteBase* ev, int8_t vel, bool relative=false);
439  uint8_t change_note_note(NoteBase* ev, int8_t note, bool relative=false);
440  void change_note_time(NoteBase* ev, ARDOUR::MidiModel::TimeType, bool relative=false);
443  ARDOUR::MidiModel::TimeType end_delta);
444 
445  void update_drag_selection (Temporal::timepos_t const & start, Temporal::timepos_t const & end, double y0, double y1, bool extend);
446  void update_vertical_drag_selection (double last_y, double y, bool extend);
447 
450 
451  std::string get_note_name (std::shared_ptr<NoteType> note, uint8_t note_value) const;
452 
453  void show_verbose_cursor (std::string const &, double, double) const;
454  void show_verbose_cursor (std::shared_ptr<NoteType>) const;
455 
458 
461 
462  typedef boost::unordered_map<std::shared_ptr<NoteType>, NoteBase*> Events;
463  typedef boost::unordered_map<ARDOUR::MidiModel::PatchChangePtr, std::shared_ptr<PatchChange> > PatchChanges;
464  typedef boost::unordered_map<ARDOUR::MidiModel::constSysExPtr, std::shared_ptr<SysEx> > SysExes;
465  typedef std::vector<NoteBase*> CopyDragEvents;
466 
467  std::shared_ptr<ARDOUR::MidiModel> _model;
482 
485 
488 
490 
493  std::set< std::shared_ptr<NoteType> > _marked_for_selection;
494 
496  std::set<Evoral::event_id_t> _pending_note_selection;
497 
500  std::set< std::shared_ptr<NoteType> > _marked_for_velocity;
501 
502  std::vector<NoteResizeData *> _resize_data;
503 
506 
507  NoteBase* find_canvas_note (std::shared_ptr<NoteType>);
509  Events::iterator _optimization_iterator;
510 
513 
514  friend class VelocityGhostRegion;
515  void sync_velocity_drag (double factor);
516 
517  void update_note (NoteBase*, bool update_ghost_regions = true);
518  void update_sustained (Note *, bool update_ghost_regions = true);
519  void update_hit (Hit *, bool update_ghost_regions = true);
520 
521  void create_ghost_note (double, double, uint32_t state);
522  void update_ghost_note (double, double, uint32_t state);
523 
526 
527  void snap_changed ();
529 
538 
539  void drop_down_keys ();
540  void maybe_select_by_position (GdkEventButton* ev, double x, double y);
541  void get_events (Events& e, Evoral::Sequence<Temporal::Beats>::NoteOperator op, uint8_t val, int chan_mask = 0);
542 
544 
546  void data_recorded (std::weak_ptr<ARDOUR::MidiSource>);
547 
550 
552 
555  void enter_internal (uint32_t state);
556  void leave_internal ();
558 
560 
563  bool _entered;
566 
568 
571 
573 
574  std::shared_ptr<CursorContext> _press_cursor_ctx;
575 
577  uint16_t get_selected_channels () const;
578 
579  inline double contents_height() const { return (_height - TimeAxisViewItem::NAME_HIGHLIGHT_SIZE - 2); }
580  inline double contents_note_range () const { return (double)(_current_range_max - _current_range_min + 1); }
581  inline double note_height() const { return contents_height() / contents_note_range(); }
582 
583  double note_to_y (uint8_t note) const;
584  uint8_t y_to_note (double y) const;
585 
587  void update_sysexes ();
588  void view_changed ();
589  void model_changed ();
590 
592 
593  struct SplitInfo {
596  int note;
597  int channel;
598  int velocity;
600 
601  SplitInfo (Temporal::Beats const & t, Temporal::Beats const & l, int n, int c, int v, int ov)
602  : time (t)
603  , base_len (l)
604  , note (n)
605  , channel (c)
606  , velocity (v)
607  , off_velocity (ov) {}
608  };
609  std::vector<SplitInfo> split_info;
610 
611  uint32_t split_tuple;
613 
616 
620  void join_notes ();
621  void join_notes_on_channel (int channel);
622 
624 };
625 
626 
627 #endif /* __gtk_ardour_midi_region_view_h__ */
Definition: editor.h:158
std::shared_ptr< PatchChange< Temporal::Beats > > PatchChangePtr
Definition: Sequence.h:205
std::multiset< NotePtr, EarlierNoteComparator > Notes
Definition: Sequence.h:157
std::shared_ptr< Event< Temporal::Beats > > SysExPtr
Definition: Sequence.h:192
Definition: Filter.h:21
Definition: hit.h:31
std::vector< SplitInfo > split_info
void show_verbose_cursor(std::shared_ptr< NoteType >) const
void abort_note_diff()
void increase_note_velocity_smush_together()
Temporal::Beats _step_edit_cursor_position
const std::shared_ptr< ARDOUR::MidiRegion > midi_region() const
void nudge_notes(bool forward, bool fine)
void clear_selection()
void set_flags(XMLNode *)
void note_left(NoteBase *ev)
void step_add_note(uint8_t channel, uint8_t number, uint8_t velocity, Temporal::Beats pos, Temporal::Beats len)
void select_notes(std::list< Evoral::event_id_t >, bool allow_audition)
void display_patch_changes()
void get_patch_key_at(Temporal::Beats time, uint8_t channel, MIDI::Name::PatchPrimaryKey &key) const
void increase_note_velocity_smush()
void increase_note_velocity_fine_together()
void transpose_up_tone_smush()
uint8_t get_velocity_for_add(ARDOUR::MidiModel::TimeType time) const
void decrease_note_velocity_fine_together()
MidiRegionView(ArdourCanvas::Container *parent, RouteTimeAxisView &tv, std::shared_ptr< ARDOUR::MidiRegion > r, double samples_per_pixel, uint32_t basic_color, bool recording, Visibility visibility)
void decrease_note_velocity()
void transpose_up_octave_smush()
PBD::ScopedConnection _channel_mode_changed_connection
void start_playing_midi_note(std::shared_ptr< NoteType > note)
void set_step_edit_cursor_width(Temporal::Beats beats)
std::vector< NoteResizeData * > _resize_data
void delete_patch_change(PatchChange *)
void invert_note_selection()
void change_note_lengths(bool, bool, Temporal::Beats beats, bool start, bool end)
GhostRegion * add_ghost(TimeAxisView &)
NoteBase * channel_selector_scoped_note()
uint16_t get_selected_channels() const
void increase_note_velocity_fine_smush_together()
void store_flags()
void note_deleted(NoteBase *)
bool paste(Temporal::timepos_t const &pos, const ::Selection &selection, PasteContext &ctx)
void note_mouse_position(float xfraction, float yfraction, bool can_set_cursor=true)
void leave_internal()
NoteBase * _ghost_note
Temporal::Beats _step_edit_cursor_width
void increase_note_velocity_together()
bool _select_all_notes_after_add
MouseState mouse_state() const
void note_selected(NoteBase *ev, bool add, bool extend=false)
uint8_t y_to_note(double y) const
void set_height(double)
void transpose_down_tone()
void move_note_starts_earlier()
void change_note_velocity(NoteBase *ev, int8_t vel, bool relative=false)
void decrease_note_velocity_smush()
std::set< NoteBase * > Selection
void transpose(bool up, bool fine, bool allow_smush)
void _redisplay(bool view_only)
void enter_internal(uint32_t state)
void unique_select(NoteBase *ev)
NoteBase * add_note(const std::shared_ptr< NoteType > note, bool visible)
double note_to_y(uint8_t note) const
void connect_to_diskstream()
NoteBase * copy_selection(NoteBase *primary)
void transpose_down_octave()
bool enter_notify(GdkEventCrossing *)
void goto_next_note(bool add_to_selection)
void color_handler()
void end_drag_edit()
uint8_t get_channel_for_add(ARDOUR::MidiModel::TimeType time) const
void move_note_ends_later()
void begin_resizing(bool at_front)
void update_resizing(NoteBase *primary, bool at_front, double delta_x, bool relative, double snap_delta, bool with_snap)
void extend_active_notes()
void add_canvas_patch_change(ARDOUR::MidiModel::PatchChangePtr patch)
std::vector< NoteBase * > CopyDragEvents
void increase_note_velocity_fine_smush()
void move_patch_change(PatchChange &, Temporal::Beats)
void transpose_down_octave_smush()
void change_note_time(NoteBase *ev, ARDOUR::MidiModel::TimeType, bool relative=false)
void parameter_changed(std::string const &p)
MidiStreamView * midi_stream_view() const
void trim_front_ending()
void move_selection(Temporal::timecnt_t const &dx, double dy, double cumulative_dy)
void note_entered(NoteBase *ev)
Temporal::timecnt_t snap_pixel_to_time(double x, bool ensure_snap=false)
void split_notes_more()
std::shared_ptr< PatchChange > find_canvas_patch_change(ARDOUR::MidiModel::PatchChangePtr p)
void sync_velocity_drag(double factor)
void decrease_note_velocity_together()
void cut_copy_clear(Editing::CutCopyOp)
void select_all_notes()
void get_events(Events &e, Evoral::Sequence< Temporal::Beats >::NoteOperator op, uint8_t val, int chan_mask=0)
void start_playing_midi_chord(std::vector< std::shared_ptr< NoteType > > notes)
void apply_note_range(uint8_t lowest, uint8_t highest, bool force=false)
std::shared_ptr< ARDOUR::MidiModel > model() const
void create_note_at(Temporal::timepos_t const &t, double y, Temporal::Beats length, uint32_t state, bool shift_snap)
void model_changed()
void move_note_ends_later_fine()
void delete_selection()
void trim_front_starting()
void nudge_notes_earlier()
void create_ghost_note(double, double, uint32_t state)
MidiTimeAxisView * midi_view() const
ArdourCanvas::Rectangle * _step_edit_cursor
void region_resized(const PBD::PropertyChange &)
MidiRegionView(const MidiRegionView &other)
NoteBase * find_canvas_note(Evoral::event_id_t id)
samplecnt_t _last_display_zoom
void view_changed()
void begin_drag_edit(std::string const &why)
void update_vertical_drag_selection(double last_y, double y, bool extend)
void selection_as_notelist(Notes &selected, bool allow_all_if_none_selected=false)
void midi_channel_mode_changed()
Temporal::Beats get_grid_beats(Temporal::timepos_t const &pos) const
void change_velocities(bool up, bool fine, bool allow_smush, bool all_together)
double get_end_position_pixels()
ARDOUR::MidiModel::NoteDiffCommand * _note_diff_command
void display_sysexes()
void move_step_edit_cursor(Temporal::Beats pos)
std::shared_ptr< SysEx > find_canvas_sys_ex(ARDOUR::MidiModel::SysExPtr s)
void abort_resizing()
double contents_note_range() const
bool motion(GdkEventMotion *)
bool note_in_region_range(const std::shared_ptr< NoteType > note, bool &visible) const
bool key_release(GdkEventKey *)
bool note_in_region_time_range(const std::shared_ptr< NoteType > note) const
void maybe_select_by_position(GdkEventButton *ev, double x, double y)
double get_position_pixels()
void change_note_channel(NoteBase *, int8_t, bool relative=false)
void note_diff_add_note(const std::shared_ptr< NoteType > note, bool selected, bool show_velocity=false)
void apply_note_diff(bool as_subcommand=false, bool was_copy=false)
uint32_t get_fill_color() const
void patch_left(PatchChange *)
void add_patch_change(Temporal::timecnt_t const &, Evoral::PatchChange< Temporal::Beats > const &)
void transpose_up_octave()
double contents_height() const
void start_note_splitting()
void quantize_selected_notes()
void move_note_starts_earlier_fine()
void add_to_selection(NoteBase *)
Gtkmm2ext::Color _patch_change_outline
void split_notes_grid()
void update_sysexes()
void clear_selection_internal()
void add_select_next_note()
void show_verbose_cursor_for_new_note_value(std::shared_ptr< NoteType > current_note, uint8_t new_note) const
void note_diff_add_change(NoteBase *ev, ARDOUR::MidiModel::NoteDiffCommand::Property, uint8_t val)
std::set< std::shared_ptr< NoteType > > _marked_for_velocity
bool scroll(GdkEventScroll *)
void update_hit(Hit *, bool update_ghost_regions=true)
void note_deselected(NoteBase *ev)
void remove_ghost_note()
void clear_note_selection()
void delete_note(std::shared_ptr< NoteType >)
void drop_down_keys()
uint8_t _current_range_max
void display_patch_changes_on_channel(uint8_t, bool, PatchChanges &)
void end_note_splitting()
void finish_resizing(NoteBase *primary, bool at_front, double delat_x, bool relative, double snap_delta, bool with_snap)
void paste_internal(Temporal::timepos_t const &pos, unsigned paste_count, float times, const MidiCutBuffer &)
std::set< Evoral::event_id_t > _pending_note_selection
void add_split_notes()
void clear_events()
void decrease_note_velocity_fine_smush()
void start_note_diff_command(std::string name="midi edit")
void trim_note(NoteBase *ev, ARDOUR::MidiModel::TimeType start_delta, ARDOUR::MidiModel::TimeType end_delta)
ARDOUR::ColorMode color_mode() const
std::shared_ptr< ARDOUR::MidiModel > _model
void sync_ghost_selection(NoteBase *)
void update_note(NoteBase *, bool update_ghost_regions=true)
void extend_note_selection()
void note_dropped(NoteBase *ev, Temporal::timecnt_t const &d_qn, int8_t d_note, bool copy)
void increase_note_velocity()
bool leave_notify(GdkEventCrossing *)
bool button_press(GdkEventButton *)
void set_selected(bool yn)
void extend_selection()
bool set_velocity_for_notes(std::vector< NoteBase * > &notes, int velocity)
bool button_release(GdkEventButton *)
void nudge_notes_earlier_fine()
MidiCutBuffer * selection_as_cut_buffer() const
void change_patch_change(PatchChange &old_patch, const MIDI::Name::PatchPrimaryKey &new_patch)
void select_matching_notes(uint8_t notenum, uint16_t channel_mask, bool add, bool extend)
void mouse_mode_changed()
void init(bool wfd)
uint8_t _current_range_min
void note_diff_remove_note(NoteBase *ev)
Events::iterator _optimization_iterator
MouseState _mouse_state
void remove_from_selection(NoteBase *)
void select_range(Temporal::timepos_t const &start, Temporal::timepos_t const &end)
Evoral::Note< Temporal::Beats > NoteType
Selection _selection
void play_midi_note(std::shared_ptr< NoteType > note)
void transpose_down_tone_smush()
void show_step_edit_cursor(Temporal::Beats pos)
void change_note_length(NoteBase *, ARDOUR::MidiModel::TimeType)
void select_previous_note()
double snap_to_pixel(double x, bool ensure_snap=false)
void update_sustained(Note *, bool update_ghost_regions=true)
void step_sustain(Temporal::Beats beats)
void set_channel_selector_scoped_note(NoteBase *note)
PBD::ScopedConnection _instrument_changed_connection
void snap_changed()
PBD::ScopedConnection snap_changed_connection
NoteBase * _channel_selection_scoped_note
void sysex_left(SysEx *p)
NoteBase * _entered_note
PatchChanges _patch_changes
CopyDragEvents _copy_drag_events
void toggle_matching_notes(uint8_t notenum, uint16_t channel_mask)
PBD::ScopedConnection _mouse_mode_connection
void step_patch(PatchChange &patch, bool bank, int delta)
boost::unordered_map< ARDOUR::MidiModel::constSysExPtr, std::shared_ptr< SysEx > > SysExes
bool key_press(GdkEventKey *)
Evoral::Sequence< Temporal::Beats >::Notes Notes
void delete_sysex(SysEx *)
bool canvas_group_event(GdkEvent *ev)
void duplicate_selection()
void begin_write()
void move_note_ends_earlier()
void move_note_starts_later()
MidiListEditor * _list_editor
void display_model(std::shared_ptr< ARDOUR::MidiModel > model)
void update_ghost_note(double, double, uint32_t state)
ARDOUR::InstrumentInfo & instrument_info() const
bool note_canvas_event(GdkEvent *ev)
void edit_patch_change(PatchChange *)
MIDI::Name::PatchPrimaryKey patch_change_to_patch_key(ARDOUR::MidiModel::PatchChangePtr)
MidiRegionView(const MidiRegionView &other, std::shared_ptr< ARDOUR::MidiRegion >)
boost::unordered_map< ARDOUR::MidiModel::PatchChangePtr, std::shared_ptr< PatchChange > > PatchChanges
void move_note_ends_earlier_fine()
void increase_note_velocity_fine()
void velocity_edit()
void update_patch_changes()
void decrease_note_velocity_smush_together()
bool set_velocities_for_notes(std::vector< NoteBase * > &notes, std::vector< int > &velocities)
PBD::ScopedConnection content_connection
ARDOUR::ChannelMode get_channel_mode() const
void show_verbose_cursor(std::string const &, double, double) const
ArdourCanvas::Container * _note_group
uint8_t change_note_note(NoteBase *ev, int8_t note, bool relative=false)
void update_drag_selection(Temporal::timepos_t const &start, Temporal::timepos_t const &end, double y0, double y1, bool extend)
void show_list_editor()
Temporal::Beats get_draw_length_beats(Temporal::timepos_t const &pos) const
void set_velocity(NoteBase *primary, int velocity)
void goto_previous_note(bool add_to_selection)
void move_note_starts_later_fine()
void hide_step_edit_cursor()
void add_select_previous_note()
boost::unordered_map< std::shared_ptr< NoteType >, NoteBase * > Events
void patch_entered(PatchChange *)
void hide_verbose_cursor()
Selection const & selection() const
std::set< std::shared_ptr< NoteType > > _marked_for_selection
void sysex_entered(SysEx *p)
Gtkmm2ext::Color _patch_change_fill
void move_copies(Temporal::timecnt_t const &dx_qn, double dy, double cumulative_dy)
double note_height() const
std::shared_ptr< CursorContext > _press_cursor_ctx
void change_patch_change(ARDOUR::MidiModel::PatchChangePtr, Evoral::PatchChange< Temporal::Beats > const &)
void reset_width_dependent_items(double pixel_width)
size_t selection_size()
void decrease_note_velocity_fine_smush_together()
std::string get_note_name(std::shared_ptr< NoteType > note, uint8_t note_value) const
MidiRegionView(ArdourCanvas::Container *parent, RouteTimeAxisView &tv, std::shared_ptr< ARDOUR::MidiRegion > r, double samples_per_pixel, uint32_t basic_color)
void join_notes_on_channel(int channel)
Temporal::Beats earliest_in_selection()
void invert_selection()
void note_diff_add_change(NoteBase *ev, ARDOUR::MidiModel::NoteDiffCommand::Property, Temporal::Beats val)
void nudge_notes_later_fine()
void change_channel(uint8_t channel)
NoteBase * find_canvas_note(std::shared_ptr< NoteType >)
void data_recorded(std::weak_ptr< ARDOUR::MidiSource >)
void channel_edit()
void instrument_settings_changed()
void decrease_note_velocity_fine()
void split_notes_less()
ARDOUR::ColorMode color_mode() const
MidiStreamView * midi_view()
virtual bool selected() const
Definition: sys_ex.h:27
static double NAME_HIGHLIGHT_SIZE
TimeAxisView & trackview
Definition: xml++.h:114
GtkImageIconNameData name
Definition: gtkimage.h:6
PBD::PropertyDescriptor< timecnt_t > length
PBD::PropertyDescriptor< timepos_t > start
Temporal::samplecnt_t samplecnt_t
CutCopyOp
Definition: editing.h:229
int32_t event_id_t
void add(const Gtk::StockItem &item)
uint32_t Color
Definition: colors.h:33
int pixel_width(const std::string &str, const Pango::FontDescription &font)
DebugBits Selection
ArdourCanvas::Rectangle * resize_rect
SplitInfo(Temporal::Beats const &t, Temporal::Beats const &l, int n, int c, int v, int ov)