summaryrefslogtreecommitdiffstats
path: root/src/server/InputPort.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-09-23 18:11:49 +0000
committerDavid Robillard <d@drobilla.net>2011-09-23 18:11:49 +0000
commit9a99f038176a7fadc59bbeaa3d3d57f16e4abb74 (patch)
treef3c1dbb555ff095c1ba7a296009924390e60db09 /src/server/InputPort.cpp
parent650a13f7c18a4caf4387c0845b708e2c2bf1625d (diff)
downloadingen-9a99f038176a7fadc59bbeaa3d3d57f16e4abb74.tar.gz
ingen-9a99f038176a7fadc59bbeaa3d3d57f16e4abb74.tar.bz2
ingen-9a99f038176a7fadc59bbeaa3d3d57f16e4abb74.zip
Animate audio port colours based on levels.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3475 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/InputPort.cpp')
-rw-r--r--src/server/InputPort.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/server/InputPort.cpp b/src/server/InputPort.cpp
index 2f871e44..b0866fde 100644
--- a/src/server/InputPort.cpp
+++ b/src/server/InputPort.cpp
@@ -25,6 +25,7 @@
#include "ConnectionImpl.hpp"
#include "EventBuffer.hpp"
#include "NodeImpl.hpp"
+#include "Notification.hpp"
#include "OutputPort.hpp"
#include "ProcessContext.hpp"
#include "ThreadManager.hpp"
@@ -122,9 +123,8 @@ InputPort::add_connection(Connections::Node* const c)
_connections.push_back(c);
- // Automatically broadcast connected control inputs
- if (is_a(PortType::CONTROL))
- _broadcast = true;
+ // Broadcast value/activity of connected input
+ _broadcast = true;
}
/** Remove a connection. Realtime safe.
@@ -156,8 +156,15 @@ InputPort::remove_connection(ProcessContext& context, const OutputPort* src_port
}
// Turn off broadcasting if we're no longer connected
- if (is_a(PortType::CONTROL) && _connections.size() == 0)
+ if (_connections.size() == 0) {
+ if (is_a(PortType::AUDIO)) {
+ // Send an update peak of 0.0 to reset to silence
+ const Notification note = Notification::make(
+ Notification::PORT_ACTIVITY, context.start(), this, 0.0f);
+ context.event_sink().write(sizeof(note), &note);
+ }
_broadcast = false;
+ }
return connection;
}