From 46e5de590817756b21a7a5d99bd4963df343f455 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 20 Feb 2010 21:52:36 +0000 Subject: 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 --- src/engine/PatchImpl.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/engine/PatchImpl.hpp') diff --git a/src/engine/PatchImpl.hpp b/src/engine/PatchImpl.hpp index 54839e92..c051f76b 100644 --- a/src/engine/PatchImpl.hpp +++ b/src/engine/PatchImpl.hpp @@ -31,9 +31,10 @@ namespace Ingen { namespace Shared { class Connection; } +class CompiledPatch; class ConnectionImpl; +class Context; class Engine; -class CompiledPatch; class ProcessContext; @@ -53,17 +54,16 @@ public: uint32_t poly, PatchImpl* parent, SampleRate srate, - size_t buffer_size, uint32_t local_poly); virtual ~PatchImpl(); - void activate(); + void activate(BufferFactory& bufs); void deactivate(); void process(ProcessContext& context); - void set_buffer_size(BufferFactory& bufs, size_t size); + void set_buffer_size(Context& context, BufferFactory& bufs, Shared::PortType type, size_t size); /** Prepare for a new (internal) polyphony value. * @@ -79,7 +79,7 @@ public: * \param poly Must be < the most recent value passed to prepare_internal_poly. * \param maid Any objects no longer needed will be pushed to this */ - bool apply_internal_poly(Raul::Maid& maid, uint32_t poly); + bool apply_internal_poly(BufferFactory& bufs, Raul::Maid& maid, uint32_t poly); // Patch specific stuff not inherited from Node @@ -96,7 +96,7 @@ public: uint32_t num_ports() const; - PortImpl* create_port(BufferFactory& bufs, const std::string& name, Shared::PortType type, size_t buffer_size, bool is_output); + PortImpl* create_port(BufferFactory& bufs, const std::string& name, Shared::PortType type, size_t buffer_size, bool is_output, bool polyphonic); void add_input(Raul::List::Node* port) { _input_ports.push_back(port); } ///< Preprocesser thread void add_output(Raul::List::Node* port) { _output_ports.push_back(port); } ///< Preprocessor thread Raul::List::Node* remove_port(const std::string& name); @@ -121,7 +121,7 @@ public: void enable() { _process = true; } void disable(); - uint32_t internal_polyphony() const { return _internal_poly; } + uint32_t internal_poly() const { return _internal_poly; } private: inline void compile_recursive(NodeImpl* n, CompiledPatch* output) const; -- cgit v1.2.1