From 9d0d8e17852fcf903a3e3d5d62c6d7e0c13081ea Mon Sep 17 00:00:00 2001 From: Ben Loftis Date: Wed, 1 Dec 2021 08:06:30 -0600 Subject: [PATCH] Selection: Region Operations in a Slot need a RegionView proxy (ToDo) --- gtk2_ardour/editor.cc | 9 ++++++--- gtk2_ardour/selection.cc | 7 +++++++ gtk2_ardour/selection.h | 6 ++++++ 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index eada177c58..fc8d1a71bb 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -5309,9 +5309,8 @@ Editor::get_regions_from_selection_and_mouse (timepos_t const & pos) return regions; } -/** Start with regions that are selected, or the entered regionview if none are selected. - * Then add equivalent regions on tracks in the same active edit-enabled route group as any - * of the regions that we started with. +/** Start with the selected Region(s) or TriggerSlot + * if neither is found, try using the entered_regionview (region under the mouse). */ RegionSelection @@ -5319,6 +5318,10 @@ Editor::get_regions_from_selection_and_entered () const { RegionSelection regions = selection->regions; + if (regions.empty() && !selection->triggers.empty()) { + regions = selection->trigger_regionview_proxy(); + } + if (regions.empty() && entered_regionview) { regions.add (entered_regionview); } diff --git a/gtk2_ardour/selection.cc b/gtk2_ardour/selection.cc index e866e77664..1d1c486756 100644 --- a/gtk2_ardour/selection.cc +++ b/gtk2_ardour/selection.cc @@ -232,6 +232,13 @@ Selection::clear_triggers (bool with_signal) } } +RegionSelection +Selection::trigger_regionview_proxy () const +{ + RegionSelection rs; + return rs; +} + void Selection::toggle (boost::shared_ptr pl) { diff --git a/gtk2_ardour/selection.h b/gtk2_ardour/selection.h index 710e37221b..fce253547f 100644 --- a/gtk2_ardour/selection.h +++ b/gtk2_ardour/selection.h @@ -131,6 +131,12 @@ public: bool selected (ControlPoint*) const; bool selected (TriggerEntry*) const; + /* ToDo: some region operations (midi quantize, audio reverse) expect + * a RegionSelection (a list of regionviews). We're likely going to + * need a region_view + time_axis_view proxy, and this will get it. + */ + RegionSelection trigger_regionview_proxy () const; + void set (std::list const &); void add (std::list const &); void toggle (std::list const &);