From c7d2497e2badd3fabd29fe3b1c55978f276bbbf9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 17 Oct 2011 20:35:55 +0000 Subject: Discard MIDI when sending to the monitor bus. Fixes #4372. git-svn-id: svn://localhost/ardour2/branches/3.0@10212 d708f5d6-7413-0410-9779-e7cbd77b26cf --- libs/ardour/buffer_set.cc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'libs/ardour/buffer_set.cc') diff --git a/libs/ardour/buffer_set.cc b/libs/ardour/buffer_set.cc index 6061d360f9..663b5e8ca0 100644 --- a/libs/ardour/buffer_set.cc +++ b/libs/ardour/buffer_set.cc @@ -383,6 +383,21 @@ BufferSet::VSTBuffer::push_back (Evoral::MIDIEvent const & ev) #endif /* VST_SUPPORT */ +/** Copy buffers of one type from `in' to this BufferSet */ +void +BufferSet::read_from (const BufferSet& in, framecnt_t nframes, DataType type) +{ + assert (available().get (type) >= in.count().get (type)); + + BufferSet::iterator o = begin (type); + for (BufferSet::const_iterator i = in.begin (type); i != in.end (type); ++i, ++o) { + o->read_from (*i, nframes); + } + + _count.set (type, in.count().get (type)); +} + +/** Copy buffers of all types from `in' to this BufferSet */ void BufferSet::read_from (const BufferSet& in, framecnt_t nframes) { @@ -390,13 +405,8 @@ BufferSet::read_from (const BufferSet& in, framecnt_t nframes) // Copy all buffers 1:1 for (DataType::iterator t = DataType::begin(); t != DataType::end(); ++t) { - BufferSet::iterator o = begin(*t); - for (BufferSet::const_iterator i = in.begin(*t); i != in.end(*t); ++i, ++o) { - o->read_from (*i, nframes); - } + read_from (in, nframes, *t); } - - set_count(in.count()); } void -- cgit v1.2.3