diff options
author | David Robillard <d@drobilla.net> | 2012-03-19 20:16:46 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-19 20:16:46 +0000 |
commit | 254b434f0a79fea54bd963e8ff2e845a5b0cd3a6 (patch) | |
tree | ddf849fc5b64d1096846c28c1f1a742f54c3adff /src/server/AudioBuffer.hpp | |
parent | bc3afd8380d59c750c8f8e9bf1ed1b8d4a6826e9 (diff) | |
download | ingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.tar.gz ingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.tar.bz2 ingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.zip |
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
Diffstat (limited to 'src/server/AudioBuffer.hpp')
-rw-r--r-- | src/server/AudioBuffer.hpp | 15 |
1 files changed, 9 insertions, 6 deletions
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 <boost/utility.hpp> +#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 }; |