summaryrefslogtreecommitdiffstats
path: root/src/server
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-04-28 04:05:11 +0000
committerDavid Robillard <d@drobilla.net>2012-04-28 04:05:11 +0000
commitb255d11ae5117a6fdb35abdcef5dea2a3c0a6ee3 (patch)
tree48812cac2e4440ffd0351a64090fd9512235f8c3 /src/server
parenteb3f6dc10b8b1541fa9084bea0deef7dec16d073 (diff)
downloadingen-b255d11ae5117a6fdb35abdcef5dea2a3c0a6ee3.tar.gz
ingen-b255d11ae5117a6fdb35abdcef5dea2a3c0a6ee3.tar.bz2
ingen-b255d11ae5117a6fdb35abdcef5dea2a3c0a6ee3.zip
Actually filter redundant port activity messages.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4295 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server')
-rw-r--r--src/server/PortImpl.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index 7dcbf060..051ecc8e 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -218,19 +218,16 @@ PortImpl::clear_buffers()
void
PortImpl::broadcast_value(Context& context, bool force)
{
- Ingen::Forge& forge = context.engine().world()->forge();
- Raul::Atom val;
+ Ingen::Forge& forge = context.engine().world()->forge();
+ Notification::Type ntype = Notification::PORT_VALUE;
+ Raul::Atom val;
switch (_type.symbol()) {
case PortType::UNKNOWN:
break;
case PortType::AUDIO:
- val = forge.make(((AudioBuffer*)buffer(0).get())->peak(context));
- if (force || val != _last_broadcasted_value) {
- const Notification note = Notification::make(
- Notification::PORT_ACTIVITY, context.start(), this, val);
- context.event_sink().write(sizeof(note), &note);
- }
- return;
+ val = forge.make(((AudioBuffer*)buffer(0).get())->peak(context));
+ ntype = Notification::PORT_ACTIVITY;
+ break;
case PortType::CONTROL:
case PortType::CV:
val = forge.make(((AudioBuffer*)buffer(0).get())->value_at(0));
@@ -250,7 +247,7 @@ PortImpl::broadcast_value(Context& context, bool force)
if (val.is_valid() && (force || val != _last_broadcasted_value)) {
_last_broadcasted_value = val;
const Notification note = Notification::make(
- Notification::PORT_VALUE, context.start(), this, val);
+ ntype, context.start(), this, val);
context.event_sink().write(sizeof(note), &note);
}
}