summaryrefslogtreecommitdiffstats
path: root/src/engine/Buffer.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-11-16 00:30:35 +0000
committerDavid Robillard <d@drobilla.net>2009-11-16 00:30:35 +0000
commit3d89115a67a9c947a28539ffdd2399808a53279b (patch)
tree826b900de3979eed9c31aae0d3ac560d39b53460 /src/engine/Buffer.hpp
parent597fa9212f27d2448c0cdd20fbf616928c662cc1 (diff)
downloadingen-3d89115a67a9c947a28539ffdd2399808a53279b.tar.gz
ingen-3d89115a67a9c947a28539ffdd2399808a53279b.tar.bz2
ingen-3d89115a67a9c947a28539ffdd2399808a53279b.zip
Rework objects extension to have "value ports" and "message ports".
Make audio and control buffers in ingen actually object buffers (towards interop). Overhaul the hell out of ingen buffer and mixing stuff. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2266 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/Buffer.hpp')
-rw-r--r--src/engine/Buffer.hpp26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/engine/Buffer.hpp b/src/engine/Buffer.hpp
index adde37f2..f566f9b6 100644
--- a/src/engine/Buffer.hpp
+++ b/src/engine/Buffer.hpp
@@ -22,12 +22,14 @@
#include <cassert>
#include <boost/utility.hpp>
#include "raul/Deletable.hpp"
+#include "raul/SharedPtr.hpp"
#include "types.hpp"
#include "interface/DataType.hpp"
namespace Ingen {
class Context;
+class Engine;
class Buffer : public boost::noncopyable, public Raul::Deletable
{
@@ -35,42 +37,38 @@ public:
Buffer(Shared::DataType type, size_t size)
: _type(type)
, _size(size)
- , _joined_buf(NULL)
{}
- virtual ~Buffer() {}
-
- static Buffer* create(Shared::DataType type, size_t size);
-
/** Clear contents and reset state */
virtual void clear() = 0;
virtual void resize(size_t size) { _size = size; }
- virtual void* raw_data() = 0;
- virtual const void* raw_data() const = 0;
+ virtual void* port_data(Shared::DataType port_type) = 0;
+ virtual const void* port_data(Shared::DataType port_type) const = 0;
/** Rewind (ie reset read pointer), but leave contents unchanged */
virtual void rewind() const {}
virtual void copy(Context& context, const Buffer* src) = 0;
+ virtual void mix(Context& context, const Buffer* src) = 0;
virtual void prepare_read(Context& context) {}
virtual void prepare_write(Context& context) {}
- 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;
-
Shared::DataType type() const { return _type; }
size_t size() const { return _size; }
protected:
Shared::DataType _type;
size_t _size;
- Buffer* _joined_buf;
+ bool _local;
+
+ friend class BufferFactory;
+ virtual ~Buffer() {}
+
+private:
+ Buffer* _next; ///< Intrusive linked list for BufferFactory
};