Add panners and libtimecode to library path.
[ardour.git] / libs / ardour / io.cc
index 0609726b230320fb4bcf7601c85da2d045e111e5..21afdbae5657d1be5cd266fa1139f7928ba15965 100644 (file)
@@ -96,7 +96,7 @@ IO::~IO ()
 }
 
 void
-IO::silence (nframes_t nframes)
+IO::silence (framecnt_t nframes)
 {
        /* io_lock, not taken: function must be called from Session::process() calltree */
 
@@ -159,13 +159,10 @@ IO::check_bundles (std::vector<UserBundleInfo*>& list, const PortSet& ports)
 int
 IO::disconnect (Port* our_port, string other_port, void* src)
 {
-       assert (!AudioEngine::instance()->process_lock().trylock());
-
        if (other_port.length() == 0 || our_port == 0) {
                return 0;
        }
 
-        
         {
                 Glib::Mutex::Lock lm (io_lock);
                 
@@ -192,12 +189,9 @@ IO::disconnect (Port* our_port, string other_port, void* src)
        return 0;
 }
 
-/** Caller must hold process lock */
 int
 IO::connect (Port* our_port, string other_port, void* src)
 {
-       assert (!AudioEngine::instance()->process_lock().trylock());
-       
        if (other_port.length() == 0 || our_port == 0) {
                return 0;
        }
@@ -343,8 +337,6 @@ IO::add_port (string destination, void* src, DataType type)
 int
 IO::disconnect (void* src)
 {
-       BLOCK_PROCESS_CALLBACK ();
-       
        {
                Glib::Mutex::Lock lm (io_lock);
                
@@ -455,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 ();
        }
@@ -1140,7 +1133,7 @@ IO::set_name (const string& requested_name)
 }
 
 void
-IO::set_port_latency (nframes_t nframes)
+IO::set_port_latency (framecnt_t nframes)
 {
        Glib::Mutex::Lock lm (io_lock);
 
@@ -1149,11 +1142,11 @@ IO::set_port_latency (nframes_t nframes)
        }
 }
 
-nframes_t
+framecnt_t
 IO::latency () const
 {
-       nframes_t max_latency;
-       nframes_t latency;
+       framecnt_t max_latency;
+       framecnt_t latency;
 
        max_latency = 0;
 
@@ -1528,18 +1521,16 @@ 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, nframes_t nframes)
+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
-IO::collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset)
+IO::collect_input (BufferSet& bufs, pframes_t nframes, ChanCount offset)
 {
        assert(bufs.available() >= _ports.count());
 
@@ -1567,7 +1558,7 @@ IO::collect_input (BufferSet& bufs, nframes_t nframes, ChanCount offset)
 }
 
 void
-IO::copy_to_outputs (BufferSet& bufs, DataType type, nframes_t nframes, nframes_t offset)
+IO::copy_to_outputs (BufferSet& bufs, DataType type, pframes_t nframes, framecnt_t offset)
 {
        // Copy any buffers 1:1 to outputs
 
@@ -1620,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);
+}