From 06c34ee30b63d0cfd8c7ae77adc637f9da9a84dd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 12 Jan 2014 02:46:46 +0000 Subject: Combine port buffers and set state into a single voice object. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5309 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/events/Connect.cpp | 8 ++++---- src/server/events/Connect.hpp | 24 ++++++++++++------------ src/server/events/Disconnect.cpp | 16 ++++++++-------- src/server/events/Disconnect.hpp | 10 +++++----- 4 files changed, 29 insertions(+), 29 deletions(-) (limited to 'src/server/events') diff --git a/src/server/events/Connect.cpp b/src/server/events/Connect.cpp index 75659452..13faabd4 100644 --- a/src/server/events/Connect.cpp +++ b/src/server/events/Connect.cpp @@ -46,7 +46,7 @@ Connect::Connect(Engine& engine, , _graph(NULL) , _head(NULL) , _compiled_graph(NULL) - , _buffers(NULL) + , _voices(NULL) {} bool @@ -129,9 +129,9 @@ Connect::pre_process() _head->inherit_neighbour(tail_output, _head_remove, _head_add); } - _buffers = new Raul::Array(_head->poly()); + _voices = new Raul::Array(_head->poly()); _head->get_buffers(*_engine.buffer_factory(), - _buffers, + _voices, _head->poly(), false); @@ -147,7 +147,7 @@ Connect::execute(ProcessContext& context) { if (_status == Status::SUCCESS) { _head->add_arc(context, _arc.get()); - _engine.maid()->dispose(_head->set_buffers(context, _buffers)); + _engine.maid()->dispose(_head->set_voices(context, _voices)); _head->connect_buffers(); _graph->set_compiled_graph(_compiled_graph); } diff --git a/src/server/events/Connect.hpp b/src/server/events/Connect.hpp index d5e58a99..0750fbdc 100644 --- a/src/server/events/Connect.hpp +++ b/src/server/events/Connect.hpp @@ -20,8 +20,8 @@ #include "raul/Path.hpp" #include "Event.hpp" +#include "PortImpl.hpp" #include "types.hpp" -#include "BufferRef.hpp" namespace Raul { template class Array; @@ -57,17 +57,17 @@ public: void post_process(); private: - const Raul::Path _tail_path; - const Raul::Path _head_path; - GraphImpl* _graph; - InputPort* _head; - CompiledGraph* _compiled_graph; - SPtr _arc; - Raul::Array* _buffers; - Resource::Properties _tail_remove; - Resource::Properties _tail_add; - Resource::Properties _head_remove; - Resource::Properties _head_add; + const Raul::Path _tail_path; + const Raul::Path _head_path; + GraphImpl* _graph; + InputPort* _head; + CompiledGraph* _compiled_graph; + SPtr _arc; + Raul::Array* _voices; + Resource::Properties _tail_remove; + Resource::Properties _tail_add; + Resource::Properties _head_remove; + Resource::Properties _head_add; }; } // namespace Events diff --git a/src/server/events/Disconnect.cpp b/src/server/events/Disconnect.cpp index a9b30a60..3ea94796 100644 --- a/src/server/events/Disconnect.cpp +++ b/src/server/events/Disconnect.cpp @@ -62,7 +62,7 @@ Disconnect::Impl::Impl(Engine& e, , _src_output_port(s) , _dst_input_port(d) , _arc(graph->remove_arc(_src_output_port, _dst_input_port)) - , _buffers(NULL) + , _voices(NULL) { ThreadManager::assert_thread(THREAD_PRE_PROCESS); @@ -88,21 +88,21 @@ Disconnect::Impl::Impl(Engine& e, _dst_input_port->decrement_num_arcs(); if (_dst_input_port->num_arcs() == 0) { - _buffers = new Raul::Array(_dst_input_port->poly()); + _voices = new Raul::Array(_dst_input_port->poly()); _dst_input_port->get_buffers(*_engine.buffer_factory(), - _buffers, + _voices, _dst_input_port->poly(), false); const bool is_control = _dst_input_port->is_a(PortType::CONTROL) || _dst_input_port->is_a(PortType::CV); const float value = is_control ? _dst_input_port->value().get() : 0; - for (uint32_t i = 0; i < _buffers->size(); ++i) { + for (uint32_t i = 0; i < _voices->size(); ++i) { if (is_control) { - Buffer* buf = _buffers->at(i).get(); + Buffer* buf = _voices->at(i).buffer.get(); buf->set_block(value, 0, buf->nframes()); } else { - _buffers->at(i)->clear(); + _voices->at(i).buffer->clear(); } } } @@ -179,8 +179,8 @@ Disconnect::Impl::execute(ProcessContext& context, bool set_dst_buffers) } if (set_dst_buffers) { - if (_buffers) { - _engine.maid()->dispose(_dst_input_port->set_buffers(context, _buffers)); + if (_voices) { + _engine.maid()->dispose(_dst_input_port->set_voices(context, _voices)); } else { _dst_input_port->setup_buffers(*_engine.buffer_factory(), _dst_input_port->poly(), diff --git a/src/server/events/Disconnect.hpp b/src/server/events/Disconnect.hpp index de176d34..058104f6 100644 --- a/src/server/events/Disconnect.hpp +++ b/src/server/events/Disconnect.hpp @@ -68,11 +68,11 @@ public: inline InputPort* head() { return _dst_input_port; } private: - Engine& _engine; - OutputPort* _src_output_port; - InputPort* _dst_input_port; - SPtr _arc; - Raul::Array* _buffers; + Engine& _engine; + OutputPort* _src_output_port; + InputPort* _dst_input_port; + SPtr _arc; + Raul::Array* _voices; }; private: -- cgit v1.2.1