From 254b434f0a79fea54bd963e8ff2e845a5b0cd3a6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 19 Mar 2012 20:16:46 +0000 Subject: Partially functioning communication between Ingen LV2 plugin and UI. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4078 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/AudioBuffer.hpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src/server/AudioBuffer.hpp') diff --git a/src/server/AudioBuffer.hpp b/src/server/AudioBuffer.hpp index 262b03c1..eda5c3a3 100644 --- a/src/server/AudioBuffer.hpp +++ b/src/server/AudioBuffer.hpp @@ -24,8 +24,11 @@ #include +#include "ingen/shared/URIs.hpp" + +#include "Buffer.hpp" +#include "BufferFactory.hpp" #include "Context.hpp" -#include "ObjectBuffer.hpp" #include "types.hpp" using namespace std; @@ -33,10 +36,10 @@ using namespace std; namespace Ingen { namespace Server { -class AudioBuffer : public ObjectBuffer +class AudioBuffer : public Buffer { public: - AudioBuffer(BufferFactory& bufs, PortType type, size_t capacity); + AudioBuffer(BufferFactory& bufs, LV2_URID type, uint32_t size); void clear(); @@ -48,7 +51,7 @@ public: float peak(Context& context) const; - inline bool is_control() const { return _type.symbol() == PortType::CONTROL; } + inline bool is_control() const { return _type == _factory.uris().atom_Float; } inline Sample* data() const { return (is_control()) @@ -59,7 +62,7 @@ public: inline SampleCount nframes() const { return (is_control()) ? 1 - : (_size - sizeof(LV2_Atom_Vector)) / sizeof(Sample); + : (_capacity - sizeof(LV2_Atom_Vector)) / sizeof(Sample); } inline Sample& value_at(size_t offset) const @@ -68,7 +71,7 @@ public: void prepare_read(Context& context); void prepare_write(Context& context) {} - void resize(size_t size); + void resize(uint32_t size); private: enum State { OK, HALF_SET_CYCLE_1, HALF_SET_CYCLE_2 }; -- cgit v1.2.1