summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/Port.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-09-18 15:13:05 +0000
committerDavid Robillard <d@drobilla.net>2007-09-18 15:13:05 +0000
commitcbc7847a12e57176c5bafa9baa007de6865745c7 (patch)
tree0ca368a06c025c3898682b1bfa18fbb048e45b9b /src/libs/engine/Port.hpp
parent33f66f46c1f1e9774e5b59a9637d2bfabd700394 (diff)
downloadingen-cbc7847a12e57176c5bafa9baa007de6865745c7.tar.gz
ingen-cbc7847a12e57176c5bafa9baa007de6865745c7.tar.bz2
ingen-cbc7847a12e57176c5bafa9baa007de6865745c7.zip
Work on dynamic polyphony.
git-svn-id: http://svn.drobilla.net/lad/ingen@720 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/Port.hpp')
-rw-r--r--src/libs/engine/Port.hpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/libs/engine/Port.hpp b/src/libs/engine/Port.hpp
index 2899915f..5b1c86b2 100644
--- a/src/libs/engine/Port.hpp
+++ b/src/libs/engine/Port.hpp
@@ -25,6 +25,8 @@
#include "GraphObject.hpp"
#include "DataType.hpp"
+namespace Raul { class Maid; }
+
namespace Ingen {
class Node;
@@ -46,8 +48,22 @@ public:
/** A port's parent is always a node, so static cast should be safe */
Node* parent_node() const { return (Node*)_parent; }
+
+ /** Prepare for a new (external) polyphony value.
+ *
+ * Preprocessor thread, poly is actually applied by apply_poly.
+ */
+ virtual void prepare_poly(uint32_t poly);
+
+ /** Apply a new polyphony value.
+ *
+ * Audio thread.
+ *
+ * \param poly Must be < the most recent value passed to prepare_poly.
+ */
+ virtual void apply_poly(Raul::Maid& maid, uint32_t poly);
- Buffer* buffer(uint32_t voice) const { return _buffers.at(voice); }
+ Buffer* buffer(uint32_t voice) const { return _buffers->at(voice); }
/** Called once per process cycle */
virtual void pre_process(SampleCount nframes, FrameTime start, FrameTime end) = 0;
@@ -82,7 +98,11 @@ protected:
size_t _buffer_size;
bool _fixed_buffers;
- Raul::Array<Buffer*> _buffers;
+ Raul::Array<Buffer*>* _buffers;
+
+ // Dynamic polyphony
+ uint32_t _prepared_poly;
+ Raul::Array<Buffer*>* _prepared_buffers;
};