summaryrefslogtreecommitdiffstats
path: root/src/engine/ObjectBuffer.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-24 23:12:34 +0000
committerDavid Robillard <d@drobilla.net>2010-02-24 23:12:34 +0000
commite853d3dfcf450f6160e19f20b6b67e251c906169 (patch)
tree6b62d2d1a7f3a047f141e58caee4e5e71ac1f4de /src/engine/ObjectBuffer.cpp
parent784dc03a78dc338b45111ebdca45371dfaaa6fa9 (diff)
downloadingen-e853d3dfcf450f6160e19f20b6b67e251c906169.tar.gz
ingen-e853d3dfcf450f6160e19f20b6b67e251c906169.tar.bz2
ingen-e853d3dfcf450f6160e19f20b6b67e251c906169.zip
Add new Delay internal.
Preliminary work towards split cycles. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2485 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/ObjectBuffer.cpp')
-rw-r--r--src/engine/ObjectBuffer.cpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/engine/ObjectBuffer.cpp b/src/engine/ObjectBuffer.cpp
index c905826d..5a3462cc 100644
--- a/src/engine/ObjectBuffer.cpp
+++ b/src/engine/ObjectBuffer.cpp
@@ -102,7 +102,7 @@ ObjectBuffer::resize(size_t size)
void*
-ObjectBuffer::port_data(PortType port_type)
+ObjectBuffer::port_data(PortType port_type, SampleCount offset)
{
switch (port_type.symbol()) {
case PortType::CONTROL:
@@ -111,7 +111,7 @@ ObjectBuffer::port_data(PortType port_type)
case PortType::CONTROL:
return (float*)object()->body;
case PortType::AUDIO:
- return ((LV2_Vector_Body*)object()->body)->elems;
+ return (float*)((LV2_Vector_Body*)object()->body)->elems + offset;
default:
warn << "Audio data requested from non-audio buffer" << endl;
return NULL;
@@ -124,13 +124,21 @@ ObjectBuffer::port_data(PortType port_type)
const void*
-ObjectBuffer::port_data(PortType port_type) const
+ObjectBuffer::port_data(PortType port_type, SampleCount offset) const
{
switch (port_type.symbol()) {
case PortType::CONTROL:
- return _buf + sizeof(LV2_Object);
case PortType::AUDIO:
- return _buf + sizeof(LV2_Object) + sizeof(LV2_Vector_Body);
+ switch (_type.symbol()) {
+ case PortType::CONTROL:
+ return (float*)object()->body;
+ case PortType::AUDIO:
+ return (float*)((LV2_Vector_Body*)object()->body)->elems + offset;
+ default:
+ warn << "Audio data requested from non-audio buffer" << endl;
+ return NULL;
+ }
+ break;
default:
return _buf;
}