summaryrefslogtreecommitdiff
path: root/libs/ardour
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-03-26 00:40:51 +0100
committerRobin Gareus <robin@gareus.org>2016-03-26 00:40:51 +0100
commit0954efffd3a1d642be313aed9b5b7070eb307a9c (patch)
tree8ff57f420d943497006f20e484dae304d41f7e02 /libs/ardour
parent6d735dafe2ff8596b5ca096e06e9badd4c57fdf7 (diff)
add "no-inplace" buffers.
When allowing to cross-connect plugin-ports, inplace processing can no longer be used. We need a complete set of independent input and output buffers. Since scratch and silent buffers are used by the various plugin implementations we cannot re-use them in the PluginInsert. Besides we need a complete BufferSet which can hold both: ins + outs.
Diffstat (limited to 'libs/ardour')
-rw-r--r--libs/ardour/ardour/process_thread.h1
-rw-r--r--libs/ardour/ardour/session.h3
-rw-r--r--libs/ardour/ardour/thread_buffers.h1
-rw-r--r--libs/ardour/process_thread.cc19
-rw-r--r--libs/ardour/session.cc6
-rw-r--r--libs/ardour/thread_buffers.cc2
6 files changed, 31 insertions, 1 deletions
diff --git a/libs/ardour/ardour/process_thread.h b/libs/ardour/ardour/process_thread.h
index ee2e522378..cd1087f2a4 100644
--- a/libs/ardour/ardour/process_thread.h
+++ b/libs/ardour/ardour/process_thread.h
@@ -47,6 +47,7 @@ public:
static BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
static BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO, bool silence = false);
+ static BufferSet& get_noinplace_buffers (ChanCount count = ChanCount::ZERO);
static BufferSet& get_route_buffers (ChanCount count = ChanCount::ZERO, bool silence = false);
static BufferSet& get_mix_buffers (ChanCount count = ChanCount::ZERO);
static gain_t* gain_automation_buffer ();
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index 9e0cf6ec08..49b9d7c45e 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -236,7 +236,8 @@ class LIBARDOUR_API Session : public PBD::StatefulDestructible, public PBD::Scop
void process (pframes_t nframes);
BufferSet& get_silent_buffers (ChanCount count = ChanCount::ZERO);
- BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO, bool silence = true );
+ BufferSet& get_noinplace_buffers (ChanCount count = ChanCount::ZERO);
+ BufferSet& get_scratch_buffers (ChanCount count = ChanCount::ZERO, bool silence = true);
BufferSet& get_route_buffers (ChanCount count = ChanCount::ZERO, bool silence = true);
BufferSet& get_mix_buffers (ChanCount count = ChanCount::ZERO);
diff --git a/libs/ardour/ardour/thread_buffers.h b/libs/ardour/ardour/thread_buffers.h
index f018ee4c22..598d8f3947 100644
--- a/libs/ardour/ardour/thread_buffers.h
+++ b/libs/ardour/ardour/thread_buffers.h
@@ -39,6 +39,7 @@ public:
BufferSet* silent_buffers;
BufferSet* scratch_buffers;
+ BufferSet* noinplace_buffers;
BufferSet* route_buffers;
BufferSet* mix_buffers;
gain_t* gain_automation_buffer;
diff --git a/libs/ardour/process_thread.cc b/libs/ardour/process_thread.cc
index cf48c50c70..efcc47fee3 100644
--- a/libs/ardour/process_thread.cc
+++ b/libs/ardour/process_thread.cc
@@ -117,6 +117,25 @@ ProcessThread::get_scratch_buffers (ChanCount count, bool silence)
}
BufferSet&
+ProcessThread::get_noinplace_buffers (ChanCount count)
+{
+ ThreadBuffers* tb = _private_thread_buffers.get();
+ assert (tb);
+
+ BufferSet* sb = tb->noinplace_buffers;
+ assert (sb);
+
+ if (count != ChanCount::ZERO) {
+ assert(sb->available() >= count);
+ sb->set_count (count);
+ } else {
+ sb->set_count (sb->available());
+ }
+
+ return *sb;
+}
+
+BufferSet&
ProcessThread::get_route_buffers (ChanCount count, bool silence)
{
ThreadBuffers* tb = _private_thread_buffers.get();
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index d668fb46e7..edae568645 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -5939,6 +5939,12 @@ Session::get_scratch_buffers (ChanCount count, bool silence)
}
BufferSet&
+Session::get_noinplace_buffers (ChanCount count)
+{
+ return ProcessThread::get_noinplace_buffers (count);
+}
+
+BufferSet&
Session::get_route_buffers (ChanCount count, bool silence)
{
return ProcessThread::get_route_buffers (count, silence);
diff --git a/libs/ardour/thread_buffers.cc b/libs/ardour/thread_buffers.cc
index 2336ee50bc..36ffbb70da 100644
--- a/libs/ardour/thread_buffers.cc
+++ b/libs/ardour/thread_buffers.cc
@@ -30,6 +30,7 @@ using namespace std;
ThreadBuffers::ThreadBuffers ()
: silent_buffers (new BufferSet)
, scratch_buffers (new BufferSet)
+ , noinplace_buffers (new BufferSet)
, route_buffers (new BufferSet)
, mix_buffers (new BufferSet)
, gain_automation_buffer (0)
@@ -71,6 +72,7 @@ ThreadBuffers::ensure_buffers (ChanCount howmany, size_t custom)
}
scratch_buffers->ensure_buffers (*t, count, size);
+ noinplace_buffers->ensure_buffers (*t, count + count, size); // in + out
mix_buffers->ensure_buffers (*t, count, size);
silent_buffers->ensure_buffers (*t, count, size);
route_buffers->ensure_buffers (*t, count, size);