From: Paul Davis Date: Wed, 10 Aug 2011 20:22:21 +0000 (+0000) Subject: add virtual Delivery::pan_outs() so that internal sends correctly configure their... X-Git-Tag: 3.0-alpha10~24 X-Git-Url: https://main.carlh.net/gitweb/?a=commitdiff_plain;h=afdb298462cd7e6bb4ce866a1714a032c33be917;p=ardour.git add virtual Delivery::pan_outs() so that internal sends correctly configure their panner for the number of outputs on the target rather than the output of the internal send processor within the route. fixes a crash when adding internal sends git-svn-id: svn://localhost/ardour2/branches/3.0@9975 d708f5d6-7413-0410-9779-e7cbd77b26cf --- diff --git a/libs/ardour/ardour/delivery.h b/libs/ardour/ardour/delivery.h index 4501e58b4b..6945f4e280 100644 --- a/libs/ardour/ardour/delivery.h +++ b/libs/ardour/ardour/delivery.h @@ -101,6 +101,7 @@ public: void allow_pan_reset (); uint32_t pans_required() const { return _configured_input.n_audio(); } + virtual uint32_t pan_outs() const; protected: Role _role; diff --git a/libs/ardour/ardour/internal_send.h b/libs/ardour/ardour/internal_send.h index c2cf4b7990..a185d07dfd 100644 --- a/libs/ardour/ardour/internal_send.h +++ b/libs/ardour/ardour/internal_send.h @@ -54,6 +54,7 @@ class InternalSend : public Send } void set_can_pan (bool yn); + uint32_t pan_outs () const; private: BufferSet mixbufs; diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc index 967e01187e..75c32a03d1 100644 --- a/libs/ardour/delivery.cc +++ b/libs/ardour/delivery.cc @@ -375,22 +375,24 @@ Delivery::unpan () _panshell.reset (); } +uint32_t +Delivery::pan_outs () const +{ + if (_output) { + return _output->n_ports().n_audio(); + } + + return _configured_output.n_audio(); +} + void Delivery::reset_panner () { if (panners_legal) { if (!no_panner_reset) { - uint32_t ntargets; - - if (_output) { - ntargets = _output->n_ports().n_audio(); - } else { - ntargets = _configured_output.n_audio(); - } - if (_panshell) { - _panshell->configure_io (ChanCount (DataType::AUDIO, pans_required()), ChanCount (DataType::AUDIO, ntargets)); + _panshell->configure_io (ChanCount (DataType::AUDIO, pans_required()), ChanCount (DataType::AUDIO, pan_outs())); if (_role == Main) { _panshell->pannable()->set_panner (_panshell->panner()); diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc index 7fe52ec617..e873b73aac 100644 --- a/libs/ardour/internal_send.cc +++ b/libs/ardour/internal_send.cc @@ -81,6 +81,13 @@ InternalSend::use_target (boost::shared_ptr sendto) mixbufs.ensure_buffers (_send_to->internal_return()->input_streams(), _session.get_block_size()); mixbufs.set_count (_send_to->internal_return()->input_streams()); + ChanCount n = _send_to->internal_return()->input_streams (); + + if (n != _configured_output) { + _configured_output = n; + reset_panner (); + } + set_name (sendto->name()); _send_to_id = _send_to->id(); @@ -260,6 +267,22 @@ InternalSend::can_support_io_configuration (const ChanCount& in, ChanCount& out) return true; } +uint32_t +InternalSend::pan_outs () const +{ + /* the number of targets for our panner is determined by what we are + sending to, if anything. + */ + + if (_send_to) { + return _send_to->internal_return()->input_streams().n_audio(); + } + + return 1; /* zero is more accurate, but 1 is probably safer as a way to + * say "don't pan" + */ +} + bool InternalSend::configure_io (ChanCount in, ChanCount out) { diff --git a/libs/ardour/panner_shell.cc b/libs/ardour/panner_shell.cc index c3ca2b4694..fae60c3458 100644 --- a/libs/ardour/panner_shell.cc +++ b/libs/ardour/panner_shell.cc @@ -151,7 +151,7 @@ PannerShell::set_state (const XMLNode& node, int version) } _panner.reset (); - + for (niter = nlist.begin(); niter != nlist.end(); ++niter) { if ((*niter)->name() == X_("Panner")) { diff --git a/libs/ardour/route.cc b/libs/ardour/route.cc index 136692e711..8d1c1c8397 100644 --- a/libs/ardour/route.cc +++ b/libs/ardour/route.cc @@ -826,7 +826,7 @@ dump_processors(const string& name, const list >& p cerr << name << " {" << endl; for (list >::const_iterator p = procs.begin(); p != procs.end(); ++p) { - cerr << "\t" << (*p)->name() << " ID = " << (*p)->id() << endl; + cerr << "\t" << (*p)->name() << " ID = " << (*p)->id() << " @ " << (*p) << endl; } cerr << "}" << endl; }