From 6ccb5f6ca1e291d5adad58038a742caee58f959c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 8 Feb 2012 02:34:23 +0000 Subject: Update for latest Atom extension. Probably fix #802. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3976 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/AudioBuffer.cpp | 2 +- src/server/AudioBuffer.hpp | 6 +++--- src/server/BufferFactory.cpp | 2 +- src/server/ObjectBuffer.cpp | 8 ++++---- 4 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') 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; -- cgit v1.2.1