summaryrefslogtreecommitdiffstats
path: root/src/engine/InputPort.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/InputPort.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/InputPort.hpp')
-rw-r--r--src/engine/InputPort.hpp22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/engine/InputPort.hpp b/src/engine/InputPort.hpp
index 16e25cab..21cf3372 100644
--- a/src/engine/InputPort.hpp
+++ b/src/engine/InputPort.hpp
@@ -28,8 +28,10 @@
namespace Ingen {
class ConnectionImpl;
-class OutputPort;
+class Context;
class NodeImpl;
+class OutputPort;
+class ProcessContext;
/** An input port on a Node or Patch.
@@ -53,31 +55,33 @@ public:
uint32_t poly,
Shared::PortType type,
const Raul::Atom& value,
- size_t buffer_size);
+ size_t buffer_size=0);
virtual ~InputPort() {}
typedef Raul::List< SharedPtr<ConnectionImpl> > Connections;
void add_connection(Connections::Node* c);
- Connections::Node* remove_connection(const OutputPort* src_port);
+ Connections::Node* remove_connection(ProcessContext& context, const OutputPort* src_port);
- void set_buffer_size(BufferFactory& bufs, size_t size);
- bool prepare_poly(BufferFactory& bufs, uint32_t poly);
bool apply_poly(Raul::Maid& maid, uint32_t poly);
+ void set_buffer_size(Context& context, BufferFactory& bufs, size_t size);
+
+ void get_buffers(BufferFactory& bufs, Raul::Array<BufferFactory::Ref>* buffers, uint32_t poly);
void pre_process(Context& context);
void post_process(Context& context);
- size_t num_connections() const { return _connections.size(); }
+ size_t num_connections() const { return _num_connections; } ///< Pre-process thread
+ void increment_num_connections() { ++_num_connections; }
+ void decrement_num_connections() { --_num_connections; }
bool is_input() const { return true; }
bool is_output() const { return false; }
+ bool is_silent() const;
protected:
- void connect_buffers();
- bool can_direct() const;
-
+ size_t _num_connections; ///< Pre-process thread
Connections _connections;
};