summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/ObjectBuffer.cpp10
-rw-r--r--src/engine/ObjectBuffer.hpp2
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);