Couple of bug fixes which show up when undoing solo state. Also a few comments.
authorCarl Hetherington <carl@carlh.net>
Thu, 18 Dec 2008 18:23:33 +0000 (18:23 +0000)
committerCarl Hetherington <carl@carlh.net>
Thu, 18 Dec 2008 18:23:33 +0000 (18:23 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@4331 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/panner.cc
libs/ardour/route.cc

index 04c744b880976c9056da992e6d38f0f024c2db6a..65034aa212b70b7ddb5e5200c35eb69287d65faa 100644 (file)
@@ -78,7 +78,7 @@ StreamPanner::StreamPanner (Panner& p, Evoral::Parameter param)
        _muted = false;
 
        _control = boost::dynamic_pointer_cast<AutomationControl>( parent.control( param, true ) );
-
+       
        x = 0.5;
        y = 0.5;
        z = 0.5;
@@ -775,22 +775,24 @@ Panner::reset (uint32_t nouts, uint32_t npans)
        }
 
        if (nouts < 2) {
+               /* no need for panning with less than 2 outputs */
                goto send_changed;
        }
 
        switch (nouts) {
        case 0:
+               /* XXX: this can never happen */
                break;
 
        case 1:
+               /* XXX: this can never happen */
                fatal << _("programming error:")
                      << X_("Panner::reset() called with a single output")
                      << endmsg;
                /*NOTREACHED*/
                break;
 
-       case 2:
-               /* line */
+       case 2: // line
                outputs.push_back (Output (0, 0));
                outputs.push_back (Output (1.0, 0));
 
@@ -899,6 +901,8 @@ Panner::remove (uint32_t which)
        }
 }
 
+
+/** Remove all our StreamPanners */
 void
 Panner::clear_panners ()
 {
@@ -1060,7 +1064,7 @@ Panner::set_state (const XMLNode& node)
                                                
                                                /* note that we assume that all the stream panners
                                                   are of the same type. pretty good
-                                                  assumption, but its still an assumption.
+                                                  assumption, but it's still an assumption.
                                                */
                                                
                                                sp = pan_plugins[i].factory (*this, Evoral::Parameter(PanAutomation, 0, num_panners));
@@ -1090,7 +1094,7 @@ Panner::set_state (const XMLNode& node)
                }       
        }
 
-       reset(num_panners, outputs.size());
+       reset (outputs.size (), num_panners);
        /* don't try to do old-school automation loading if it wasn't marked as existing */
 
        if ((prop = node.property (X_("automation")))) {
index 96f26a515cbc41bfdb3e682a56e97ef107f163fe..4b96dc8a93a0750c5fd05ea320125e4e513760f1 100644 (file)
@@ -129,9 +129,7 @@ Route::~Route ()
                free ((void*)(i->first));
        }
 
-       if (_control_outs) {
-               delete _control_outs;
-       }
+       delete _control_outs;
 }
 
 void
@@ -2325,6 +2323,7 @@ Route::_set_state (const XMLNode& node, bool call_base)
                        string coutname = _name;
                        coutname += _("[control]");
 
+                       delete _control_outs;
                        _control_outs = new IO (_session, coutname);
                        _control_outs->set_state (**(child->children().begin()));