add virtual Delivery::pan_outs() so that internal sends correctly configure their...
authorPaul Davis <paul@linuxaudiosystems.com>
Wed, 10 Aug 2011 20:22:21 +0000 (20:22 +0000)
committerPaul Davis <paul@linuxaudiosystems.com>
Wed, 10 Aug 2011 20:22:21 +0000 (20:22 +0000)
git-svn-id: svn://localhost/ardour2/branches/3.0@9975 d708f5d6-7413-0410-9779-e7cbd77b26cf

libs/ardour/ardour/delivery.h
libs/ardour/ardour/internal_send.h
libs/ardour/delivery.cc
libs/ardour/internal_send.cc
libs/ardour/panner_shell.cc
libs/ardour/route.cc

index 4501e58b4b210a555379bd3f45679914254d67c8..6945f4e2803a9eb6663e49eac2c7c6a0b11a33d1 100644 (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;
index c2cf4b79901e62d5cdbd4c9ff136a3d11901707e..a185d07dfdc5fe6a6879b92745b2353aee39da09 100644 (file)
@@ -54,6 +54,7 @@ class InternalSend : public Send
        }
 
        void set_can_pan (bool yn);
+       uint32_t pan_outs () const;
 
   private:
        BufferSet mixbufs;
index 967e01187e762a3e5c8a87ea2f92bcee243fac57..75c32a03d1fb623aa444ef0e0f3b010ff43d6834 100644 (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());
index 7fe52ec617b6cee4a4b3ea5bed8cc367259c4be1..e873b73aac5d7b1574dc8f3ceedefcd2cb7a1eab 100644 (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)
 {
index c3ca2b4694ff2f3735257a0f6b3c0f19d62f2c0e..fae60c3458b36916d4b71ce6250c43ef3a5f0868 100644 (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")) {
index 136692e7118c22df9265723a81f5ede09e3e5ca5..8d1c1c8397764513d28f67def554df53b1090c51 100644 (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;
 }