From 0852032e858d127da7a4734adc3fcb56e7c00554 Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Sun, 17 Apr 2022 23:23:45 -0600 Subject: [PATCH] midi note editing: adjust scroll modifiers and allow range expansion as well as scroll --- gtk2_ardour/midi_region_view.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/midi_region_view.cc b/gtk2_ardour/midi_region_view.cc index 10aff5e3a7..4096140648 100644 --- a/gtk2_ardour/midi_region_view.cc +++ b/gtk2_ardour/midi_region_view.cc @@ -681,18 +681,19 @@ MidiRegionView::scroll (GdkEventScroll* ev) } if (_selection.empty()) { - int step = (Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier) ? 1 : 12); + const int step = Keyboard::modifier_state_equals (ev->state, Keyboard::TertiaryModifier) ? 12 : 1; + const bool just_one_edge = Keyboard::modifier_state_equals (ev->state, Keyboard::PrimaryModifier); switch (ev->direction) { case GDK_SCROLL_UP: if (midi_stream_view()->highest_note() < 127 - step) { - midi_stream_view()->apply_note_range (midi_stream_view()->lowest_note() + step, midi_stream_view()->highest_note() + step, true); + midi_stream_view()->apply_note_range (midi_stream_view()->lowest_note() + (just_one_edge ? 0 : step), midi_stream_view()->highest_note() + step, true); } return true; case GDK_SCROLL_DOWN: if (midi_stream_view()->lowest_note() >= step) { - midi_stream_view()->apply_note_range (midi_stream_view()->lowest_note() - step, midi_stream_view()->highest_note() - step, true); + midi_stream_view()->apply_note_range (midi_stream_view()->lowest_note() - step, midi_stream_view()->highest_note() - (just_one_edge ? 0 : step), true); } return true;