From a47220df59c076eaa717710dc2ffc6614bee268c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 1 Oct 2007 05:27:41 +0000 Subject: Blink MIDI ports on message transmission. git-svn-id: http://svn.drobilla.net/lad/ingen@794 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/InputPort.cpp | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) (limited to 'src/libs/engine/InputPort.cpp') diff --git a/src/libs/engine/InputPort.cpp b/src/libs/engine/InputPort.cpp index 16a1c86a..bb3e57ce 100644 --- a/src/libs/engine/InputPort.cpp +++ b/src/libs/engine/InputPort.cpp @@ -33,7 +33,6 @@ namespace Ingen { InputPort::InputPort(Node* parent, const string& name, uint32_t index, uint32_t poly, DataType type, size_t buffer_size) : Port(parent, name, index, poly, type, buffer_size) - , _last_reported_value(0.0f) // default? { } @@ -78,11 +77,9 @@ InputPort::add_connection(Raul::ListNode* const c) Port::connect_buffers(); } - // Automatically monitor connected control inputs - if (_type == DataType::FLOAT && _buffer_size == 1) { - cerr << path() << " monitor enable" << endl; - _monitor = true; - } + // Automatically broadcast connected control inputs + if (_type == DataType::FLOAT && _buffer_size == 1) + _broadcast = true; } @@ -124,9 +121,9 @@ InputPort::remove_connection(const OutputPort* src_port) if (modify_buffers) Port::connect_buffers(); - // Turn off monitoring if we're not connected any more (FIXME: not quite right..) + // Turn off broadcasting if we're not connected any more (FIXME: not quite right..) if (_type == DataType::FLOAT && _buffer_size == 1 && _connections.size() == 0) - _monitor = false; + _broadcast = false; return connection; } @@ -220,14 +217,7 @@ InputPort::pre_process(ProcessContext& context) void InputPort::post_process(ProcessContext& context) { - if (_monitor && _type == DataType::FLOAT && _buffer_size == 1) { - const Sample value = ((AudioBuffer*)(*_buffers)[0])->value_at(0); - if (value != _last_reported_value) { - const SendPortValueEvent ev(context.engine(), context.start(), this, false, 0, value); - context.event_sink().write(sizeof(ev), &ev); - _last_reported_value = value; - } - } + broadcast(context); // Prepare for next cycle for (uint32_t i=0; i < _poly; ++i) -- cgit v1.2.1