From e18ea188f45be0c30497e175907799daeed02cd4 Mon Sep 17 00:00:00 2001 From: Len Ovens Date: Wed, 9 Dec 2015 09:21:36 -0800 Subject: Fix Mackie control Gain while in flip mode (vpot control of gain) --- libs/ardour/route.cc | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'libs/ardour/route.cc') diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 53630d4e9c..6ee55fc26e 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -136,17 +136,14 @@ Route::init () _solo_control.reset (new SoloControllable (X_("solo"), shared_from_this ())); _mute_control.reset (new MuteControllable (X_("mute"), shared_from_this ())); _phase_control.reset (new PhaseControllable (X_("phase"), shared_from_this ())); - _group_gain_control.reset (new GroupGainControllable (X_("groupgain"), shared_from_this ())); _solo_control->set_flags (Controllable::Flag (_solo_control->flags() | Controllable::Toggle)); _mute_control->set_flags (Controllable::Flag (_mute_control->flags() | Controllable::Toggle)); _phase_control->set_flags (Controllable::Flag (_phase_control->flags() | Controllable::Toggle)); - _group_gain_control->set_flags (Controllable::Flag (_group_gain_control->flags() | Controllable::GainLike)); add_control (_solo_control); add_control (_mute_control); add_control (_phase_control); - add_control (_group_gain_control); /* panning */ @@ -177,6 +174,11 @@ Route::init () _amp.reset (new Amp (_session)); add_processor (_amp, PostFader); + // amp should exist before amp controls + _group_gain_control.reset (new GroupGainControllable (X_("groupgain"), shared_from_this ())); + _group_gain_control->set_flags (Controllable::Flag (_group_gain_control->flags() | Controllable::GainLike)); + add_control (_group_gain_control); + /* and input trim */ _trim.reset (new Amp (_session, "trim")); _trim->set_display_to_user (false); @@ -3998,6 +4000,13 @@ Route::GroupGainControllable::set_value (double val) r->set_gain ((gain_t)normalized_position, this); } +double +Route::GroupGainControllable::get_value () const +{ + boost::shared_ptr r = _route.lock (); + return 2.0 * r->gain_control()->internal_to_interface (r->gain_control()->get_value ()); +} + Route::PhaseControllable::PhaseControllable (std::string name, boost::shared_ptr r) : AutomationControl (r->session(), Evoral::Parameter (PhaseAutomation), -- cgit v1.2.3