From b255d11ae5117a6fdb35abdcef5dea2a3c0a6ee3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 28 Apr 2012 04:05:11 +0000 Subject: Actually filter redundant port activity messages. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4295 a436a847-0d15-0410-975c-d299462d15a1 --- src/server/PortImpl.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src') 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), ¬e); - } - 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), ¬e); } } -- cgit v1.2.1