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*);