diff --git a/gtk2_ardour/mixer_strip.cc b/gtk2_ardour/mixer_strip.cc index 1b0c82975c..343ddf99b6 100644 --- a/gtk2_ardour/mixer_strip.cc +++ b/gtk2_ardour/mixer_strip.cc @@ -268,6 +268,8 @@ MixerStrip::init () trim_control.set_tooltip_prefix (_("Trim: ")); trim_control.set_name ("trim knob"); trim_control.set_no_show_all (true); + trim_control.StartGesture.connect(sigc::mem_fun(*this, &MixerStrip::trim_start_touch)); + trim_control.StopGesture.connect(sigc::mem_fun(*this, &MixerStrip::trim_end_touch)); input_button_box.pack_start (trim_control, false, false); global_vpacker.set_border_width (1); @@ -497,6 +499,24 @@ MixerStrip::update_trim_control () } } +void +MixerStrip::trim_start_touch () +{ + assert (_route && _session); + if (route()->trim() && route()->trim()->active() && route()->n_inputs().n_audio() > 0) { + route()->trim()->gain_control ()->start_touch (_session->transport_frame()); + } +} + +void +MixerStrip::trim_end_touch () +{ + assert (_route && _session); + if (route()->trim() && route()->trim()->active() && route()->n_inputs().n_audio() > 0) { + route()->trim()->gain_control ()->stop_touch (_session->transport_frame()); + } +} + void MixerStrip::set_route (boost::shared_ptr rt) { diff --git a/gtk2_ardour/mixer_strip.h b/gtk2_ardour/mixer_strip.h index 531c0daf5c..d9979d0989 100644 --- a/gtk2_ardour/mixer_strip.h +++ b/gtk2_ardour/mixer_strip.h @@ -216,6 +216,9 @@ private: ArdourWidgets::ArdourButton _comment_button; ArdourWidgets::ArdourKnob trim_control; + void trim_start_touch (); + void trim_end_touch (); + void setup_comment_button (); ArdourWidgets::ArdourButton group_button;