summaryrefslogtreecommitdiffstats
path: root/src/server/PortImpl.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-07-18 02:45:35 +0000
committerDavid Robillard <d@drobilla.net>2012-07-18 02:45:35 +0000
commit6bd13dfa606f758212a20634f0f073596f42101f (patch)
tree84b4397e7961ffe46375feb17c847bb43e76e30e /src/server/PortImpl.cpp
parent5afdd1098140b9aba15ff470356bf73b9144501a (diff)
downloadingen-6bd13dfa606f758212a20634f0f073596f42101f.tar.gz
ingen-6bd13dfa606f758212a20634f0f073596f42101f.tar.bz2
ingen-6bd13dfa606f758212a20634f0f073596f42101f.zip
Working bi-directional UI <=> plugin messaging.
Rewrite notification system to support variably sized notifications. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4548 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/PortImpl.cpp')
-rw-r--r--src/server/PortImpl.cpp28
1 files changed, 17 insertions, 11 deletions
diff --git a/src/server/PortImpl.cpp b/src/server/PortImpl.cpp
index d4fcb6c8..6920198c 100644
--- a/src/server/PortImpl.cpp
+++ b/src/server/PortImpl.cpp
@@ -15,6 +15,7 @@
*/
#include "ingen/shared/URIs.hpp"
+#include "lv2/lv2plug.in/ns/ext/atom/util.h"
#include "raul/Array.hpp"
#include "raul/Maid.hpp"
@@ -22,7 +23,6 @@
#include "BufferFactory.hpp"
#include "Engine.hpp"
#include "NodeImpl.hpp"
-#include "Notification.hpp"
#include "PortImpl.hpp"
#include "PortType.hpp"
#include "ThreadManager.hpp"
@@ -218,28 +218,33 @@ PortImpl::clear_buffers()
void
PortImpl::broadcast_value(Context& context, bool force)
{
- Shared::Forge& forge = context.engine().world()->forge();
- Notification::Type ntype = Notification::PORT_VALUE;
- Raul::Atom val;
+ Shared::Forge& forge = context.engine().world()->forge();
+ Shared::URIs& uris = context.engine().world()->uris();
+ LV2_URID key = 0;
+ Raul::Atom val;
switch (_type.symbol()) {
case PortType::UNKNOWN:
break;
case PortType::AUDIO:
- val = forge.make(((AudioBuffer*)buffer(0).get())->peak(context));
- ntype = Notification::PORT_ACTIVITY;
+ key = uris.ingen_activity;
+ val = forge.make(((AudioBuffer*)buffer(0).get())->peak(context));
break;
case PortType::CONTROL:
case PortType::CV:
+ key = uris.ingen_value;
val = forge.make(((AudioBuffer*)buffer(0).get())->value_at(0));
break;
case PortType::ATOM:
if (_buffer_type == _bufs.uris().atom_Sequence) {
LV2_Atom_Sequence* seq = (LV2_Atom_Sequence*)buffer(0)->atom();
- if (seq->atom.size > sizeof(LV2_Atom_Sequence_Body)) {
- context.notify(Notification::PORT_ACTIVITY,
- context.start(),
+ // TODO: Filter events, or only send one activity for blinkenlights
+ LV2_ATOM_SEQUENCE_FOREACH(seq, ev) {
+ context.notify(uris.ingen_activity,
+ context.start() + ev->time.frames,
this,
- forge.make(true));
+ ev->body.size,
+ ev->body.type,
+ LV2_ATOM_BODY(&ev->body));
}
}
break;
@@ -247,7 +252,8 @@ PortImpl::broadcast_value(Context& context, bool force)
if (val.is_valid() && (force || val != _last_broadcasted_value)) {
_last_broadcasted_value = val;
- context.notify(ntype, context.start(), this, val);
+ context.notify(key, context.start(), this,
+ val.size(), val.type(), val.get_body());
}
}