diff options
author | Robin Gareus <robin@gareus.org> | 2019-08-12 04:49:31 +0200 |
---|---|---|
committer | Robin Gareus <robin@gareus.org> | 2019-08-12 04:49:31 +0200 |
commit | 875c66458d7e809c7e96dfd6031214343264b318 (patch) | |
tree | 1554a390de7bfa8ea4744c4414c6dbe5da105fa0 /gtk2_ardour/midi_time_axis.cc | |
parent | 128623e7fb25f0fde32aa5dd40c9e7d2233e4762 (diff) |
Fix middle-click note selection
Diffstat (limited to 'gtk2_ardour/midi_time_axis.cc')
-rw-r--r-- | gtk2_ardour/midi_time_axis.cc | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/gtk2_ardour/midi_time_axis.cc b/gtk2_ardour/midi_time_axis.cc index 1ea54f2a18..9ddcb5422a 100644 --- a/gtk2_ardour/midi_time_axis.cc +++ b/gtk2_ardour/midi_time_axis.cc @@ -1360,13 +1360,19 @@ MidiTimeAxisView::set_note_selection (uint8_t note) _editor.begin_reversible_selection_op (X_("Set Note Selection")); + /* set_note_selection_region_view() will not work with multiple regions, + * as each individual `foreach` call will clear prior selection. + * Use clear_midi_notes() and add_note_selection_region_view() instead. */ + + _editor.get_selection().clear_midi_notes(); + if (_view->num_selected_regionviews() == 0) { _view->foreach_regionview ( - sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::set_note_selection_region_view), + sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::add_note_selection_region_view), note, chn_mask)); } else { _view->foreach_selected_regionview ( - sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::set_note_selection_region_view), + sigc::bind (sigc::mem_fun (*this, &MidiTimeAxisView::add_note_selection_region_view), note, chn_mask)); } |