Respond to MMC even when synced to JACK. Fixes #3700.
[ardour.git] / libs / ardour / io.cc
index ced4508d7ac26316bc606eef3d77aa551841a2ae..21afdbae5657d1be5cd266fa1139f7928ba15965 100644 (file)
@@ -162,7 +162,7 @@ IO::disconnect (Port* our_port, string other_port, void* src)
        if (other_port.length() == 0 || our_port == 0) {
                return 0;
        }
-        
+
         {
                 Glib::Mutex::Lock lm (io_lock);
                 
@@ -447,6 +447,7 @@ IO::ensure_ports (ChanCount count, bool clear, void* src)
                change.after = _ports.count ();
                change.type = IOChange::ConfigurationChanged;
                this->changed (change, src); /* EMIT SIGNAL */
+               _buffers.attach_buffers (_ports);
                setup_bundle ();
                _session.set_dirty ();
        }
@@ -1522,12 +1523,10 @@ IO::connected_to (boost::shared_ptr<const IO> other) const
 void
 IO::process_input (boost::shared_ptr<Processor> proc, framepos_t start_frame, framepos_t end_frame, pframes_t nframes)
 {
-       BufferSet bufs;
-
        /* don't read the data into new buffers - just use the port buffers directly */
 
-       bufs.attach_buffers (_ports, nframes, 0);
-       proc->run (bufs, start_frame, end_frame, nframes, true);
+       _buffers.get_jack_port_addresses (_ports, nframes, 0);
+       proc->run (_buffers, start_frame, end_frame, nframes, true);
 }
 
 void
@@ -1612,3 +1611,10 @@ IO::physically_connected () const
 
         return false;
 }
+
+bool
+IO::has_port (Port* p) const
+{
+       Glib::Mutex::Lock lm (io_lock);
+       return _ports.contains (p);
+}