summaryrefslogtreecommitdiffstats
path: root/src/engine/NodeBase.hpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-02-20 21:52:36 +0000
committerDavid Robillard <d@drobilla.net>2010-02-20 21:52:36 +0000
commit46e5de590817756b21a7a5d99bd4963df343f455 (patch)
tree7d7b3b63297b24d84e5b42cc8aeb22d4212738b5 /src/engine/NodeBase.hpp
parentb96a4015ae39b5bdd9afbd82898c0168a0a8e613 (diff)
downloadingen-46e5de590817756b21a7a5d99bd4963df343f455.tar.gz
ingen-46e5de590817756b21a7a5d99bd4963df343f455.tar.bz2
ingen-46e5de590817756b21a7a5d99bd4963df343f455.zip
Heavy overhaul of buffer management and polyphony.
* Working polyphony when nodes are instantiated at desired polyphony level (dynamic still doesn't work) * Use shared silent buffer for disconnected audio inputs (save memory) * Eliminate redundant patch compiling on delete and disconnect-all events that have child events * Fix a ton of crash bugs and other issues I've since forgotten git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2468 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/NodeBase.hpp')
-rw-r--r--src/engine/NodeBase.hpp28
1 files changed, 19 insertions, 9 deletions
diff --git a/src/engine/NodeBase.hpp b/src/engine/NodeBase.hpp
index 637c8560..4b5e5a19 100644
--- a/src/engine/NodeBase.hpp
+++ b/src/engine/NodeBase.hpp
@@ -28,13 +28,16 @@
#include "raul/Semaphore.hpp"
#include "contexts.lv2/contexts.h"
#include "interface/Port.hpp"
+#include "interface/PortType.hpp"
#include "NodeImpl.hpp"
namespace Ingen {
-class PluginImpl;
-class PatchImpl;
+class Context;
class EngineStore;
+class PatchImpl;
+class PluginImpl;
+class BufferFactory;
namespace Shared { class ClientInterface; }
@@ -50,15 +53,22 @@ public:
const Raul::Symbol& symbol,
bool poly,
PatchImpl* parent,
- SampleRate rate,
- size_t buffer_size);
+ SampleRate rate);
virtual ~NodeBase();
- virtual void activate();
+ virtual void activate(BufferFactory& bufs);
virtual void deactivate();
bool activated() { return _activated; }
+ /** Flag node as polyphonic.
+ *
+ * Note this will not actually allocate voices etc., prepare_poly
+ * and apply_poly must be called after this function to truly make
+ * a node polyphonic.
+ */
+ virtual void set_polyphonic(bool p) { _polyphonic = p; }
+
virtual bool prepare_poly(BufferFactory& bufs, uint32_t poly);
virtual bool apply_poly(Raul::Maid& maid, uint32_t poly);
@@ -81,12 +91,12 @@ public:
virtual void process(ProcessContext& context) = 0;
virtual void post_process(Context& context);
- virtual void set_port_buffer(uint32_t voice, uint32_t port_num, IntrusivePtr<Buffer> buf) {}
+ virtual void set_port_buffer(uint32_t voice, uint32_t port_num, IntrusivePtr<Buffer> buf);
- virtual void set_buffer_size(BufferFactory& bufs, size_t size);
+ virtual void set_buffer_size(Context& context, BufferFactory& bufs,
+ Shared::PortType type, size_t size);
SampleRate sample_rate() const { return _srate; }
- size_t buffer_size() const { return _buffer_size; }
uint32_t num_ports() const { return _ports ? _ports->size() : 0; }
uint32_t polyphony() const { return _polyphony; }
bool traversed() const { return _traversed; }
@@ -117,9 +127,9 @@ protected:
PluginImpl* _plugin;
+ bool _polyphonic;
uint32_t _polyphony;
SampleRate _srate;
- size_t _buffer_size;
void* _valid_ports; ///< Valid port flags for message context