summaryrefslogtreecommitdiffstats
path: root/src/libs/engine/InputPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-01 05:27:41 +0000
committerDavid Robillard <d@drobilla.net>2007-10-01 05:27:41 +0000
commita47220df59c076eaa717710dc2ffc6614bee268c (patch)
treebea9dd981dd6a8ca90bb27c77bb976997be31f2d /src/libs/engine/InputPort.cpp
parent344cdcbd4f2bc7a9203b4e98da2ac349581e521a (diff)
downloadingen-a47220df59c076eaa717710dc2ffc6614bee268c.tar.gz
ingen-a47220df59c076eaa717710dc2ffc6614bee268c.tar.bz2
ingen-a47220df59c076eaa717710dc2ffc6614bee268c.zip
Blink MIDI ports on message transmission.
git-svn-id: http://svn.drobilla.net/lad/ingen@794 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/engine/InputPort.cpp')
-rw-r--r--src/libs/engine/InputPort.cpp22
1 files changed, 6 insertions, 16 deletions
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<Connection*>* 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)