summaryrefslogtreecommitdiffstats
path: root/src/server/Buffer.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-17 20:32:37 +0000
committerDavid Robillard <d@drobilla.net>2012-07-17 20:32:37 +0000
commitc94231abbc601652e73423ec6e43a1e241024a17 (patch)
tree6bc1d781750fbf44d3d3a81b927a1741372caad2 /src/server/Buffer.cpp
parent2c62287e2e9de5a09ed8a734e21e301a80a7b160 (diff)
downloadingen-c94231abbc601652e73423ec6e43a1e241024a17.tar.gz
ingen-c94231abbc601652e73423ec6e43a1e241024a17.tar.bz2
ingen-c94231abbc601652e73423ec6e43a1e241024a17.zip
Implement worker extension correctly (for one voice only).
Woring sequence port I/O for LV2 nodes. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4543 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/Buffer.cpp')
-rw-r--r--src/server/Buffer.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/server/Buffer.cpp b/src/server/Buffer.cpp
index 85fe727c..5438b4ce 100644
--- a/src/server/Buffer.cpp
+++ b/src/server/Buffer.cpp
@@ -43,12 +43,6 @@ Buffer::Buffer(BufferFactory& bufs, LV2_URID type, uint32_t capacity)
, _next(NULL)
, _refs(0)
{
- if (capacity > UINT32_MAX) {
- Raul::error << "Event buffer size " << capacity << " too large, aborting."
- << std::endl;
- throw std::bad_alloc();
- }
-
#ifdef HAVE_POSIX_MEMALIGN
int ret = posix_memalign((void**)&_atom, 16, capacity);
#else
@@ -56,7 +50,7 @@ Buffer::Buffer(BufferFactory& bufs, LV2_URID type, uint32_t capacity)
int ret = (_atom != NULL) ? 0 : -1;
#endif
- if (ret != 0) {
+ if (ret) {
Raul::error << "Failed to allocate event buffer." << std::endl;
throw std::bad_alloc();
}
@@ -144,6 +138,15 @@ Buffer::prepare_write(Context& context)
}
}
+void
+Buffer::prepare_output_write(Context& context)
+{
+ if (_type == _factory.uris().atom_Sequence) {
+ _atom->type = (LV2_URID)_factory.uris().atom_Chunk;
+ _atom->size = _capacity - sizeof(LV2_Atom_Sequence);
+ }
+}
+
bool
Buffer::append_event(int64_t frames,
uint32_t size,