diff --git a/gtk2_ardour/editor_drag.cc b/gtk2_ardour/editor_drag.cc index 1280256f0f..7f53a1733d 100644 --- a/gtk2_ardour/editor_drag.cc +++ b/gtk2_ardour/editor_drag.cc @@ -6872,6 +6872,9 @@ NoteCreateDrag::finished (GdkEvent* ev, bool had_movement) Beats length = max (Beats (0, 1), (_note[0].distance (_note[1]).abs ().beats ())); /* create_note_at() implements UNDO for us */ + if (UIConfiguration::instance().get_select_last_drawn_note_only()) { + _region_view->clear_note_selection (); + } _region_view->create_note_at (timepos_t (start), _drag_rect->y0 (), length, ev->button.state, false); } diff --git a/gtk2_ardour/midi_region_view.h b/gtk2_ardour/midi_region_view.h index b61443f767..14065da87b 100644 --- a/gtk2_ardour/midi_region_view.h +++ b/gtk2_ardour/midi_region_view.h @@ -332,6 +332,7 @@ public: ARDOUR::InstrumentInfo& instrument_info() const; void note_deleted (NoteBase*); + void clear_note_selection (); void show_verbose_cursor_for_new_note_value(std::shared_ptr current_note, uint8_t new_note) const; @@ -349,7 +350,6 @@ public: protected: friend class Editor; - void clear_note_selection (); void invert_note_selection (); void extend_note_selection (); diff --git a/gtk2_ardour/rc_option_editor.cc b/gtk2_ardour/rc_option_editor.cc index 13037e0b21..8080057475 100644 --- a/gtk2_ardour/rc_option_editor.cc +++ b/gtk2_ardour/rc_option_editor.cc @@ -3517,6 +3517,16 @@ 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 BoolOption ( + "select-last-drawn-note-only", + _("When drawing new notes, select only the last drawn note"), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::get_select_last_drawn_note_only), + sigc::mem_fun (UIConfiguration::instance(), &UIConfiguration::set_select_last_drawn_note_only) + )); + add_option (_("MIDI"), new OptionEditorHeading (_("Audition"))); add_option (_("MIDI"), diff --git a/gtk2_ardour/ui_config_vars.h b/gtk2_ardour/ui_config_vars.h index 63823526da..34d6e207db 100644 --- a/gtk2_ardour/ui_config_vars.h +++ b/gtk2_ardour/ui_config_vars.h @@ -64,6 +64,7 @@ UI_CONFIG_VARIABLE (ARDOUR::WaveformShape, waveform_shape, "waveform-shape", Tra UI_CONFIG_VARIABLE (bool, update_editor_during_summary_drag, "update-editor-during-summary-drag", true) UI_CONFIG_VARIABLE (bool, never_display_periodic_midi, "never-display-periodic-midi", true) UI_CONFIG_VARIABLE (bool, sound_midi_notes, "sound-midi-notes", true) +UI_CONFIG_VARIABLE (bool, select_last_drawn_note_only, "select-last-drawn-note-only", true) UI_CONFIG_VARIABLE (bool, show_plugin_scan_window, "show-plugin-scan-window", false) UI_CONFIG_VARIABLE (bool, show_manager_if_plugins_are_missing, "show-manager-if-plugins-are-missing", true) UI_CONFIG_VARIABLE (bool, show_zoom_tools, "show-zoom-tools", true)