From d7ed491f75c2c1b2b81a55f09a7e8e4328c3d30c Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 26 Jul 2023 13:39:05 -0600 Subject: [PATCH] gain controls: tenatively use new "use selection" feature --- gtk2_ardour/gain_meter.cc | 11 +++++++++++ gtk2_ardour/gain_meter.h | 3 +++ 2 files changed, 14 insertions(+) diff --git a/gtk2_ardour/gain_meter.cc b/gtk2_ardour/gain_meter.cc index 135309d712..ea1b2fdc07 100644 --- a/gtk2_ardour/gain_meter.cc +++ b/gtk2_ardour/gain_meter.cc @@ -34,6 +34,7 @@ #include #include "ardour/amp.h" +#include "ardour/control_group.h" #include "ardour/logmeter.h" #include "ardour/route_group.h" #include "ardour/session_route.h" @@ -754,6 +755,12 @@ GainMeterBase::meter_point_clicked (MeterPoint mp) void GainMeterBase::amp_start_touch (int state) { + if (state & Keyboard::UseSelectionModifier) { + _touch_control_group.reset (new GainControlGroup ()); + _touch_control_group->fill_from_selection (_control->session().selection()); + _touch_control_group->push (_control); + } + _control->start_touch (timepos_t (_control->session().transport_sample())); } @@ -761,6 +768,10 @@ void GainMeterBase::amp_stop_touch (int state) { _control->stop_touch (timepos_t (_control->session().transport_sample())); + if (_touch_control_group) { + _touch_control_group->pop (_control); + _touch_control_group.reset (); + } effective_gain_display (); } diff --git a/gtk2_ardour/gain_meter.h b/gtk2_ardour/gain_meter.h index bc7789ffc0..852743edaa 100644 --- a/gtk2_ardour/gain_meter.h +++ b/gtk2_ardour/gain_meter.h @@ -55,6 +55,7 @@ namespace ARDOUR { class IO; + class ControlGroup; class GainControl; class Session; class Route; @@ -189,6 +190,8 @@ protected: void amp_stop_touch (int); void amp_start_touch (int); + std::shared_ptr _touch_control_group; + void set_route_group_meter_point (ARDOUR::Route&, ARDOUR::MeterPoint); void set_meter_point (ARDOUR::Route&, ARDOUR::MeterPoint); gint meter_press (GdkEventButton*);