summaryrefslogtreecommitdiffstats
path: root/src/server/Buffer.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-19 20:16:46 +0000
committerDavid Robillard <d@drobilla.net>2012-03-19 20:16:46 +0000
commit254b434f0a79fea54bd963e8ff2e845a5b0cd3a6 (patch)
treeddf849fc5b64d1096846c28c1f1a742f54c3adff /src/server/Buffer.hpp
parentbc3afd8380d59c750c8f8e9bf1ed1b8d4a6826e9 (diff)
downloadingen-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/Buffer.hpp')
-rw-r--r--src/server/Buffer.hpp46
1 files changed, 22 insertions, 24 deletions
diff --git a/src/server/Buffer.hpp b/src/server/Buffer.hpp
index 0b3c9348..c2d5ac05 100644
--- a/src/server/Buffer.hpp
+++ b/src/server/Buffer.hpp
@@ -24,6 +24,7 @@
#include <boost/intrusive_ptr.hpp>
#include <boost/utility.hpp>
+#include "lv2/lv2plug.in/ns/ext/atom/atom.h"
#include "raul/AtomicInt.hpp"
#include "raul/Deletable.hpp"
#include "raul/SharedPtr.hpp"
@@ -42,32 +43,28 @@ class BufferFactory;
class Buffer : public boost::noncopyable, public Raul::Deletable
{
public:
- Buffer(BufferFactory& bufs, PortType type, size_t size)
- : _factory(bufs)
- , _type(type)
- , _size(size)
- , _next(NULL)
- , _refs(0)
- {}
+ Buffer(BufferFactory& bufs, LV2_URID type, uint32_t capacity);
- /** Clear contents and reset state */
- virtual void clear() = 0;
-
- virtual void resize(size_t size) { _size = size; }
-
- virtual void* port_data(PortType port_type, SampleCount offset=0) = 0;
- virtual const void* port_data(PortType port_type, SampleCount offset=0) const = 0;
+ virtual void clear();
+ virtual void resize(uint32_t size);
+ virtual void copy(Context& context, const Buffer* src);
+ virtual void prepare_read(Context& context) {}
+ virtual void prepare_write(Context& context);
- /** Rewind (ie reset read pointer), but leave contents unchanged */
- virtual void rewind() const {}
+ void* port_data(PortType port_type, SampleCount offset);
+ const void* port_data(PortType port_type, SampleCount offset) const;
- virtual void copy(Context& context, const Buffer* src) = 0;
+ LV2_URID type() const { return _type; }
+ uint32_t capacity() const { return _capacity; }
- virtual void prepare_read(Context& context) {}
- virtual void prepare_write(Context& context) {}
+ /// Sequence buffers only
+ bool append_event(int64_t frames,
+ uint32_t size,
+ uint32_t type,
+ const uint8_t* data);
- PortType type() const { return _type; }
- size_t size() const { return _size; }
+ LV2_Atom* atom() { return _atom; }
+ const LV2_Atom* atom() const { return _atom; }
inline void ref() { ++_refs; }
@@ -78,11 +75,12 @@ public:
protected:
BufferFactory& _factory;
- PortType _type;
- size_t _size;
+ LV2_Atom* _atom;
+ LV2_URID _type;
+ uint32_t _capacity;
friend class BufferFactory;
- virtual ~Buffer() {}
+ virtual ~Buffer();
private:
Buffer* _next; ///< Intrusive linked list for BufferFactory