diff options
author | David Robillard <d@drobilla.net> | 2009-11-14 20:44:40 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-11-14 20:44:40 +0000 |
commit | 6ae2018e81e7e81e4906e62dc6224ad34298d9c2 (patch) | |
tree | 11286438977c4f975b5148dc93b5f4dfafabdbdc /src/engine/AudioBuffer.cpp | |
parent | cfec427867f42d7aa7bea6dfbb0736b5ce99e9e2 (diff) | |
download | ingen-6ae2018e81e7e81e4906e62dc6224ad34298d9c2.tar.gz ingen-6ae2018e81e7e81e4906e62dc6224ad34298d9c2.tar.bz2 ingen-6ae2018e81e7e81e4906e62dc6224ad34298d9c2.zip |
Object extension.
Port resize extension.
Sensible extension(s) implementation design for Ingen.
Replace string port extension support in Ingen with Object port extension.
Implement port resize extension in Ingen.
Some test plugins for this stuff.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2260 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/AudioBuffer.cpp')
-rw-r--r-- | src/engine/AudioBuffer.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/engine/AudioBuffer.cpp b/src/engine/AudioBuffer.cpp index 02ebea57..53924ae4 100644 --- a/src/engine/AudioBuffer.cpp +++ b/src/engine/AudioBuffer.cpp @@ -20,6 +20,7 @@ #include <stdlib.h> #include "ingen-config.h" #include "AudioBuffer.hpp" +#include "ProcessContext.hpp" using namespace std; @@ -211,6 +212,13 @@ AudioBuffer::copy(const Buffer* src, size_t start_sample, size_t end_sample) } +void +AudioBuffer::copy(Context& context, const Buffer* src) +{ + copy(src, context.start(), std::min(size(), src->size())); +} + + /** Accumulate a block of @a src into buffer. * * @a start_sample and @a end_sample define the inclusive range to be accumulated. @@ -268,15 +276,11 @@ AudioBuffer::unjoin() void -AudioBuffer::prepare_read(FrameTime start, SampleCount nframes) +AudioBuffer::prepare_read(Context& context) { - // FIXME: nframes parameter doesn't actually work, - // writing starts from 0 every time - assert(_size == 1 || nframes == _size); - switch (_state) { case HALF_SET_CYCLE_1: - if (start > _set_time) + if (context.start() > _set_time) _state = HALF_SET_CYCLE_2; break; case HALF_SET_CYCLE_2: |