diff options
author | David Robillard <d@drobilla.net> | 2012-04-28 04:05:11 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-04-28 04:05:11 +0000 |
commit | b255d11ae5117a6fdb35abdcef5dea2a3c0a6ee3 (patch) | |
tree | 48812cac2e4440ffd0351a64090fd9512235f8c3 /src/server | |
parent | eb3f6dc10b8b1541fa9084bea0deef7dec16d073 (diff) | |
download | ingen-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.cpp | 17 |
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), ¬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); } } |