From be655cc5af1b059de77bb4215c13f14013fc73da Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 18 Dec 2008 18:23:33 +0000 Subject: Couple of bug fixes which show up when undoing solo state. Also a few comments. git-svn-id: svn://localhost/ardour2/branches/3.0@4331 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/panner.cc | 14 +++++++++----- libs/ardour/route.cc | 5 ++--- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'libs') diff --git a/libs/ardour/panner.cc b/libs/ardour/panner.cc index 04c744b880..65034aa212 100644 --- a/libs/ardour/panner.cc +++ b/libs/ardour/panner.cc @@ -78,7 +78,7 @@ StreamPanner::StreamPanner (Panner& p, Evoral::Parameter param) _muted = false; _control = boost::dynamic_pointer_cast( 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")))) { diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 96f26a515c..4b96dc8a93 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -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())); -- cgit v1.2.3