provide preference for scrolling-adjusts-note-velocity

This commit is contained in:
Paul Davis 2023-10-22 17:14:45 -06:00
parent b40513ff7d
commit 8f405f3657
3 changed files with 25 additions and 12 deletions

View File

@ -734,20 +734,24 @@ MidiRegionView::scroll (GdkEventScroll* ev)
hide_verbose_cursor ();
bool fine = !Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier);
Keyboard::ModifierMask mask_together(Keyboard::PrimaryModifier|Keyboard::TertiaryModifier);
bool together = Keyboard::modifier_state_contains (ev->state, mask_together);
if (UIConfiguration::instance().get_scroll_velocity_editing()) {
bool fine = !Keyboard::modifier_state_contains (ev->state, Keyboard::SecondaryModifier);
Keyboard::ModifierMask mask_together(Keyboard::PrimaryModifier|Keyboard::TertiaryModifier);
bool together = Keyboard::modifier_state_contains (ev->state, mask_together);
if (ev->direction == GDK_SCROLL_UP) {
change_velocities (true, fine, false, together);
} else if (ev->direction == GDK_SCROLL_DOWN) {
change_velocities (false, fine, false, together);
} else {
/* left, right: we don't use them */
return false;
if (ev->direction == GDK_SCROLL_UP) {
change_velocities (true, fine, false, together);
} else if (ev->direction == GDK_SCROLL_DOWN) {
change_velocities (false, fine, false, together);
} else {
/* left, right: we don't use them */
return false;
}
return true;
}
return true;
return false;
}
bool

View File

@ -3517,7 +3517,7 @@ These settings will only take effect after %1 is restarted.\n\
-1, 65536, 1, 10
));
add_option (_("MIDI"), new OptionEditorHeading (_("Selection")));
add_option (_("MIDI"), new OptionEditorHeading (_("Editing")));
add_option (_("MIDI"),
new BoolOption (
@ -3527,6 +3527,14 @@ These settings will only take effect after %1 is restarted.\n\
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_select_last_drawn_note_only)
));
add_option (_("MIDI"),
new BoolOption (
"scroll_velocity_editing",
_("Scroll wheel use when editing MIDI adjusts selected note velocity"),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_scroll_velocity_editing),
sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_scroll_velocity_editing)
));
add_option (_("MIDI"), new OptionEditorHeading (_("Audition")));
add_option (_("MIDI"),

View File

@ -162,3 +162,4 @@ UI_CONFIG_VARIABLE (bool, sandbox_all_lua_scripts, "sandbox-all-lua-scripts", fa
UI_CONFIG_VARIABLE (bool, show_on_cue_page, "show-on-cue-page", true)
UI_CONFIG_VARIABLE (uint32_t, insert_at_position, "insert-at-position", 3)
UI_CONFIG_VARIABLE (Editing::NoteNameDisplay, note_name_display, "note-name-display", Editing::Always)
UI_CONFIG_VARIABLE (bool, scroll_velocity_editing, "scroll-velocity-editing", true)