summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-02-08 02:34:23 +0000
committerDavid Robillard <d@drobilla.net>2012-02-08 02:34:23 +0000
commit6ccb5f6ca1e291d5adad58038a742caee58f959c (patch)
tree395ca79b3e7fc33cef5b6076163d382f74942afc /src
parent1564ca89c0bff4e6eb26448bdc45de9476a47655 (diff)
downloadingen-6ccb5f6ca1e291d5adad58038a742caee58f959c.tar.gz
ingen-6ccb5f6ca1e291d5adad58038a742caee58f959c.tar.bz2
ingen-6ccb5f6ca1e291d5adad58038a742caee58f959c.zip
Update for latest Atom extension.
Probably fix #802. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3976 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/server/AudioBuffer.cpp2
-rw-r--r--src/server/AudioBuffer.hpp6
-rw-r--r--src/server/BufferFactory.cpp2
-rw-r--r--src/server/ObjectBuffer.cpp8
4 files changed, 9 insertions, 9 deletions
diff --git a/src/server/AudioBuffer.cpp b/src/server/AudioBuffer.cpp
index ba02fad7..cca2f3ae 100644
--- a/src/server/AudioBuffer.cpp
+++ b/src/server/AudioBuffer.cpp
@@ -54,7 +54,7 @@ AudioBuffer::AudioBuffer(BufferFactory& bufs, PortType type, size_t size)
} else {
assert(type == PortType::AUDIO);
atom()->type = 0;//map->vector_type;
- LV2_Atom_Vector* body = (LV2_Atom_Vector*)atom()->body;
+ LV2_Atom_Vector* body = (LV2_Atom_Vector*)LV2_ATOM_BODY(atom());
body->elem_count = size / sizeof(Sample);
body->elem_type = 0;//map->float_type;
}
diff --git a/src/server/AudioBuffer.hpp b/src/server/AudioBuffer.hpp
index 5ecbcea5..4edc45c9 100644
--- a/src/server/AudioBuffer.hpp
+++ b/src/server/AudioBuffer.hpp
@@ -52,8 +52,8 @@ public:
inline Sample* data() const {
return (is_control())
- ? (Sample*)atom()->body
- : (Sample*)(atom()->body + sizeof(LV2_Atom_Vector));
+ ? (Sample*)LV2_ATOM_BODY(atom())
+ : (Sample*)LV2_ATOM_CONTENTS(LV2_Atom_Vector, atom());
}
inline SampleCount nframes() const {
@@ -73,7 +73,7 @@ public:
private:
enum State { OK, HALF_SET_CYCLE_1, HALF_SET_CYCLE_2 };
- LV2_Atom_Vector* vector() { return(LV2_Atom_Vector*)atom()->body; }
+ LV2_Atom_Vector* vector() { return (LV2_Atom_Vector*)atom(); }
State _state; ///< State of buffer for setting values next cycle
Sample _set_value; ///< Value set by set_value (for completing the set next cycle)
diff --git a/src/server/BufferFactory.cpp b/src/server/BufferFactory.cpp
index 2f6c716d..7d52ed49 100644
--- a/src/server/BufferFactory.cpp
+++ b/src/server/BufferFactory.cpp
@@ -141,7 +141,7 @@ BufferFactory::create(PortType type, size_t size)
} else if (type.is_audio()) {
AudioBuffer* ret = new AudioBuffer(*this, type, audio_buffer_size(size));
ret->atom()->type = _uris->atom_Vector.id;
- ((LV2_Atom_Vector*)ret->atom()->body)->elem_type = _uris->atom_Float32.id;
+ ((LV2_Atom_Vector*)LV2_ATOM_BODY(ret->atom()))->elem_type = _uris->atom_Float32.id;
buffer = ret;
} else if (type.is_events()) {
buffer = new EventBuffer(*this, size);
diff --git a/src/server/ObjectBuffer.cpp b/src/server/ObjectBuffer.cpp
index b3b74079..b5a96dbd 100644
--- a/src/server/ObjectBuffer.cpp
+++ b/src/server/ObjectBuffer.cpp
@@ -102,9 +102,9 @@ ObjectBuffer::port_data(PortType port_type, SampleCount offset)
case PortType::AUDIO:
switch (_type.symbol()) {
case PortType::CONTROL:
- return (float*)atom()->body;
+ return (float*)LV2_ATOM_BODY(atom());
case PortType::AUDIO:
- return (float*)((LV2_Atom_Vector*)atom()->body)->elems + offset;
+ return (float*)LV2_ATOM_CONTENTS(LV2_Atom_Vector, atom()) + offset;
default:
warn << "Audio data requested from non-audio buffer" << endl;
return NULL;
@@ -123,9 +123,9 @@ ObjectBuffer::port_data(PortType port_type, SampleCount offset) const
case PortType::AUDIO:
switch (_type.symbol()) {
case PortType::CONTROL:
- return (float*)atom()->body;
+ return (float*)LV2_ATOM_BODY(atom());
case PortType::AUDIO:
- return (float*)((LV2_Atom_Vector*)atom()->body)->elems + offset;
+ return (float*)LV2_ATOM_CONTENTS(LV2_Atom_Vector, atom()) + offset;
default:
warn << "Audio data requested from non-audio buffer" << endl;
return NULL;