summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2011-08-10 20:22:21 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2011-08-10 20:22:21 +0000
commitafdb298462cd7e6bb4ce866a1714a032c33be917 (patch)
tree4c56fca2e1868c204f9da49f6707af214d0860b8 /libs/ardour
parent98934548a2a5a1476e8b48cd7544d45119d21167 (diff)
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
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/delivery.h1
-rw-r--r--libs/ardour/ardour/internal_send.h1
-rw-r--r--libs/ardour/delivery.cc20
-rw-r--r--libs/ardour/internal_send.cc23
-rw-r--r--libs/ardour/panner_shell.cc2
-rw-r--r--libs/ardour/route.cc2
6 files changed, 38 insertions, 11 deletions
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<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)
{
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<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;
}