13
0

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
This commit is contained in:
Paul Davis 2011-08-10 20:22:21 +00:00
parent 98934548a2
commit afdb298462
6 changed files with 38 additions and 11 deletions

View File

@ -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;

View File

@ -54,6 +54,7 @@ class InternalSend : public Send
}
void set_can_pan (bool yn);
uint32_t pan_outs () const;
private:
BufferSet mixbufs;

View File

@ -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());

View File

@ -81,6 +81,13 @@ InternalSend::use_target (boost::shared_ptr<Route> 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)
{

View File

@ -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")) {

View File

@ -826,7 +826,7 @@ dump_processors(const string& name, const list<boost::shared_ptr<Processor> >& p
cerr << name << " {" << endl;
for (list<boost::shared_ptr<Processor> >::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;
}