diff options
author | David Robillard <d@drobilla.net> | 2010-02-14 01:09:00 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-14 01:09:00 +0000 |
commit | 16cc07ce3c37ca663ec40c2dcea3302de69966b1 (patch) | |
tree | 295c172c6bb04c3eacb0bb4bbdc717cf94c1e7e9 /src/engine | |
parent | daf2c32722503c36b7087081e62c47716aec54bf (diff) | |
download | ingen-16cc07ce3c37ca663ec40c2dcea3302de69966b1.tar.gz ingen-16cc07ce3c37ca663ec40c2dcea3302de69966b1.tar.bz2 ingen-16cc07ce3c37ca663ec40c2dcea3302de69966b1.zip |
Correctly initialise object buffers.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2444 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r-- | src/engine/ObjectBuffer.cpp | 10 | ||||
-rw-r--r-- | src/engine/ObjectBuffer.hpp | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/src/engine/ObjectBuffer.cpp b/src/engine/ObjectBuffer.cpp index a4108ba1..2c319b34 100644 --- a/src/engine/ObjectBuffer.cpp +++ b/src/engine/ObjectBuffer.cpp @@ -55,8 +55,7 @@ ObjectBuffer::ObjectBuffer(BufferFactory& factory, size_t capacity) exit(EXIT_FAILURE); } - object()->type = 0; - object()->size = capacity; + clear(); } @@ -124,5 +123,12 @@ ObjectBuffer::port_data(PortType port_type) const } +void +ObjectBuffer::prepare_write(Context& context) +{ + _buf->size = _size - sizeof(LV2_Object); +} + + } // namespace Ingen diff --git a/src/engine/ObjectBuffer.hpp b/src/engine/ObjectBuffer.hpp index 354c6f46..85afa1cb 100644 --- a/src/engine/ObjectBuffer.hpp +++ b/src/engine/ObjectBuffer.hpp @@ -36,6 +36,8 @@ public: void* port_data(Shared::PortType port_type); const void* port_data(Shared::PortType port_type) const; + void prepare_write(Context& context); + void copy(Context& context, const Buffer* src); void resize(size_t size); |