Fix duplicate Gain+Trim AutomationLists in session file.
authorRobin Gareus <robin@gareus.org>
Wed, 21 Jun 2017 10:18:57 +0000 (12:18 +0200)
committerRobin Gareus <robin@gareus.org>
Wed, 21 Jun 2017 11:15:34 +0000 (13:15 +0200)
libs/ardour/route.cc

index f3031aa15ada88b9d835f0d3a0499fbb70bd1214..c9aafc400bac64c365d3cd6f513a250ced2384f6 100644 (file)
@@ -139,10 +139,12 @@ Route::init ()
        /* add standard controls */
 
        _gain_control.reset (new GainControl (_session, GainAutomation));
-       add_control (_gain_control);
-
        _trim_control.reset (new GainControl (_session, TrimAutomation));
-       add_control (_trim_control);
+       /* While the route has-a gain-control for consistency with Stripable and VCA
+        * ownership is handed over to the Amp Processor which manages the
+        * state of the Control and AutomationList as part of its
+        * Automatable API. -- Don't call add_control () here.
+        */
 
        _solo_control.reset (new SoloControl (_session, X_("solo"), *this, *this));
        add_control (_solo_control);
@@ -2539,9 +2541,7 @@ Route::set_state (const XMLNode& node, int version)
                                continue;
                        }
 
-                       if (control_name == _gain_control->name()) {
-                               _gain_control->set_state (*child, version);
-                       } else if (control_name == _solo_control->name()) {
+                       if (control_name == _solo_control->name()) {
                                _solo_control->set_state (*child, version);
                        } else if (control_name == _solo_safe_control->name()) {
                                _solo_safe_control->set_state (*child, version);