diff options
author | David Robillard <d@drobilla.net> | 2007-10-13 20:35:29 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-10-13 20:35:29 +0000 |
commit | cf63c971c2a8ee8cc2ddcddb52ce8135cd29619b (patch) | |
tree | caea057e24a2d498b8fc88a44867891e1ec3766c /src/libs/engine/Buffer.hpp | |
parent | 4d440f54870cd3934a49bab1ae98fad3f13f00d4 (diff) | |
download | ingen-cf63c971c2a8ee8cc2ddcddb52ce8135cd29619b.tar.gz ingen-cf63c971c2a8ee8cc2ddcddb52ce8135cd29619b.tar.bz2 ingen-cf63c971c2a8ee8cc2ddcddb52ce8135cd29619b.zip |
Fix sub-patch MIDI I/O.
Make buffer 'joining' (zero-copy connections) significantly less retarded.
git-svn-id: http://svn.drobilla.net/lad/ingen@882 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/Buffer.hpp')
-rw-r--r-- | src/libs/engine/Buffer.hpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/libs/engine/Buffer.hpp b/src/libs/engine/Buffer.hpp index d18270f5..30180064 100644 --- a/src/libs/engine/Buffer.hpp +++ b/src/libs/engine/Buffer.hpp @@ -34,12 +34,14 @@ public: Buffer(Shared::DataType type, size_t size) : _type(type) , _size(size) + , _joined_buf(NULL) {} /** Clear contents and reset state */ virtual void clear() = 0; - virtual void* raw_data() const = 0; + virtual void* raw_data() = 0; + virtual const void* raw_data() const = 0; /** Rewing (ie reset read pointer), but leave contents unchanged */ virtual void rewind() const = 0; @@ -47,7 +49,9 @@ public: virtual void prepare_read(SampleCount nframes) = 0; virtual void prepare_write(SampleCount nframes) = 0; - virtual bool is_joined_to(Buffer* buf) const = 0; + bool is_joined() const { return (_joined_buf != NULL); } + Buffer* joined_buffer() const { return _joined_buf; } + virtual bool join(Buffer* buf) = 0; virtual void unjoin() = 0; @@ -61,6 +65,7 @@ public: protected: Shared::DataType _type; size_t _size; + Buffer* _joined_buf; }; |