summaryrefslogtreecommitdiff
path: root/libs/ardour/internal_send.cc
diff options
context:
space:
mode:
authorJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-07-09 02:00:27 +0200
committerJulien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr>2016-07-09 02:00:27 +0200
commit09c4c513351b04708a2e56e8a2f531840a0aff6a (patch)
treedf51bd86b1950d98cee2b87a843fb7d204a04e9c /libs/ardour/internal_send.cc
parent820f99d484c635ec1d33a6f589f22e88c55c491b (diff)
Make internal sends aware of non-audio data
When most internal sends are created, they are given a panner shell which is then responsible for audio dispatch. Other data types were left there without handling them at all. Ensure that all available data is sent provided the internal send has enough outgoing buffers.
Diffstat (limited to 'libs/ardour/internal_send.cc')
-rw-r--r--libs/ardour/internal_send.cc21
1 files changed, 21 insertions, 0 deletions
diff --git a/libs/ardour/internal_send.cc b/libs/ardour/internal_send.cc
index 0f7d633ba0..6a21e2b5ac 100644
--- a/libs/ardour/internal_send.cc
+++ b/libs/ardour/internal_send.cc
@@ -145,6 +145,27 @@ InternalSend::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame
if (_panshell && !_panshell->bypassed() && role() != Listen) {
_panshell->run (bufs, mixbufs, start_frame, end_frame, nframes);
+
+ /* non-audio data will not have been copied by the panner, do it now
+ * if there are more buffers available than send buffers, ignore them,
+ * if there are less, copy the last as IO::copy_to_output does. */
+
+ for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) {
+ if (*t != DataType::AUDIO) {
+ BufferSet::iterator o = mixbufs.begin(*t);
+ BufferSet::iterator i = bufs.begin(*t);
+
+ while (i != bufs.end(*t) && o != mixbufs.end(*t)) {
+ o->read_from (*i, nframes);
+ ++i;
+ ++o;
+ }
+ while (o != mixbufs.end(*t)) {
+ o->silence(nframes, 0);
+ ++o;
+ }
+ }
+ }
} else {
if (role() == Listen) {
/* We're going to the monitor bus, so discard MIDI data */