From 52e49500bb78974d43bdfd30b2ec9b2a4522dd25 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 26 Feb 2010 01:39:16 +0000 Subject: Perform all mixing for an audio input in a single mix operation (instead of a two step polyphony mixdown (by connections) and connections mixdown (by ports)). Speed up and inline AudioBuffer::accumulate, to speed up mix(). Remove local buffer from Connection (always mix into destination InputPort's buffers). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2494 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/AudioBuffer.cpp | 26 -------------------------- 1 file changed, 26 deletions(-) (limited to 'src/engine/AudioBuffer.cpp') diff --git a/src/engine/AudioBuffer.cpp b/src/engine/AudioBuffer.cpp index 145df559..e29fa5c4 100644 --- a/src/engine/AudioBuffer.cpp +++ b/src/engine/AudioBuffer.cpp @@ -194,32 +194,6 @@ AudioBuffer::copy(Context& context, const Buffer* src) } -/** Accumulate a block of @a src into buffer. - * - * @a start_sample and @a end_sample define the inclusive range to be accumulated. - * This function only adds the same range in one buffer to another. - */ -void -AudioBuffer::accumulate(Context& context, const AudioBuffer* const src) -{ - Sample* const buf = data(); - const Sample* const src_buf = src->data(); - - const size_t frames = std::min(nframes(), src->nframes()); - assert(frames != 0); - - // Mix initial portions - SampleCount i = 0; - for (; i < frames; ++i) - buf[i] += src_buf[i]; - - // Extend/Mix the final sample of src if it is shorter - const Sample last = src_buf[i - 1]; - while (i < nframes()) - buf[i++] += last; -} - - void AudioBuffer::prepare_read(Context& context) { -- cgit v1.2.1