diff options
author | Paul Davis <paul@linuxaudiosystems.com> | 2020-05-01 17:37:27 -0600 |
---|---|---|
committer | Paul Davis <paul@linuxaudiosystems.com> | 2020-05-01 17:39:13 -0600 |
commit | 575c8184826a757e0260c3268c8321ef954f9dd9 (patch) | |
tree | e1df849aa436058ebc6a5f355ec404f13b91dddd /gtk2_ardour | |
parent | 2326fb163826aeed61b24026f7c4f1f65d3ee5af (diff) |
when a MIDI region has a note selected with none previously, cancel existing MIDI region/note selection
Diffstat (limited to 'gtk2_ardour')
-rw-r--r-- | gtk2_ardour/editor.h | 1 | ||||
-rw-r--r-- | gtk2_ardour/editor_mouse.cc | 9 | ||||
-rw-r--r-- | gtk2_ardour/editor_selection.cc | 8 | ||||
-rw-r--r-- | gtk2_ardour/public_editor.h | 1 |
4 files changed, 19 insertions, 0 deletions
diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index 5381951ab7..801a7beb2d 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -269,6 +269,7 @@ public: Selection& get_cut_buffer() const { return *cut_buffer; } void set_selection (std::list<Selectable*>, Selection::Operation); + void set_selected_midi_region_view (MidiRegionView&); bool extend_selection_to_track (TimeAxisView&); diff --git a/gtk2_ardour/editor_mouse.cc b/gtk2_ardour/editor_mouse.cc index 9ed46a092b..ef5fc526f6 100644 --- a/gtk2_ardour/editor_mouse.cc +++ b/gtk2_ardour/editor_mouse.cc @@ -379,6 +379,15 @@ Editor::mouse_mode_toggled (MouseMode m) Keyboard::magic_widget_drop_focus (); } + if (was_internal && !internal_editing()) { + /* drop any selected regions so that they in turn + * redraw any selected notes. This essentially the + * opposite of ::catch_up_on_midi_selection() called + * above. + */ + get_selection().clear_regions (); + } + update_all_enter_cursors (); MouseModeChanged (); /* EMIT SIGNAL */ diff --git a/gtk2_ardour/editor_selection.cc b/gtk2_ardour/editor_selection.cc index e8326ae643..6042c10bad 100644 --- a/gtk2_ardour/editor_selection.cc +++ b/gtk2_ardour/editor_selection.cc @@ -917,6 +917,14 @@ out: } void +Editor::set_selected_midi_region_view (MidiRegionView& mrv) +{ + /* clear note selection in all currently selected MidiRegionViews */ + midi_action (&MidiRegionView::clear_note_selection); + get_selection().set (&mrv); +} + +void Editor::set_selection (std::list<Selectable*> s, Selection::Operation op) { if (s.empty()) { diff --git a/gtk2_ardour/public_editor.h b/gtk2_ardour/public_editor.h index be6f900d3d..0ad85d1a0c 100644 --- a/gtk2_ardour/public_editor.h +++ b/gtk2_ardour/public_editor.h @@ -215,6 +215,7 @@ public: virtual Selection& get_cut_buffer () const = 0; virtual void set_selection (std::list<Selectable*>, Selection::Operation) = 0; + virtual void set_selected_midi_region_view (MidiRegionView&) = 0; virtual bool extend_selection_to_track (TimeAxisView&) = 0; virtual void play_solo_selection(bool restart) = 0; |