diff options
author | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-07-09 01:07:16 +0200 |
---|---|---|
committer | Julien "_FrnchFrgg_" RIVAUD <frnchfrgg@free.fr> | 2016-07-09 01:21:27 +0200 |
commit | 820f99d484c635ec1d33a6f589f22e88c55c491b (patch) | |
tree | d8d58fa1ae3f8eedfc4aa03e6a084a489ae13652 /libs/ardour/delivery.cc | |
parent | d6534eb143dbd9308d0ed1985c6d00ad50c9dec8 (diff) |
Make Delivery::run more Datatype-agnostic
Note that checking the number of output ports is not needed because
IO::copy_to_outputs() will stop if there are less ports of the right
type than buffers (or even none).
Diffstat (limited to 'libs/ardour/delivery.cc')
-rw-r--r-- | libs/ardour/delivery.cc | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/libs/ardour/delivery.cc b/libs/ardour/delivery.cc index 565a6740fd..89719e4259 100644 --- a/libs/ardour/delivery.cc +++ b/libs/ardour/delivery.cc @@ -297,22 +297,28 @@ Delivery::run (BufferSet& bufs, framepos_t start_frame, framepos_t end_frame, do _panshell->run (bufs, output_buffers(), start_frame, end_frame, nframes); - // MIDI data will not have been delivered by the panner + // non-audio data will not have been delivered by the panner - if (bufs.count().n_midi() > 0 && ports.count().n_midi () > 0) { - _output->copy_to_outputs (bufs, DataType::MIDI, nframes, ports.port(0)->port_offset()); + for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { + if (*t != DataType::AUDIO && bufs.count().get(*t) > 0) { + _output->copy_to_outputs (bufs, *t, nframes, ports.port(0)->port_offset()); + } } } else { // Do a 1:1 copy of data to output ports - if (bufs.count().n_audio() > 0 && ports.count().n_audio () > 0) { + // audio is handled separately because we use 0 for the offset + // XXX how does this interact with Port::increment_global_port_buffer_offset ? + if (bufs.count().n_audio() > 0) { _output->copy_to_outputs (bufs, DataType::AUDIO, nframes, 0); } - if (bufs.count().n_midi() > 0 && ports.count().n_midi () > 0) { - _output->copy_to_outputs (bufs, DataType::MIDI, nframes, ports.port(0)->port_offset()); + for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { + if (*t != DataType::AUDIO && bufs.count().get(*t) > 0) { + _output->copy_to_outputs (bufs, *t, nframes, ports.port(0)->port_offset()); + } } } |