summaryrefslogtreecommitdiffstats
path: root/src/server/Notification.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-09-15 07:17:10 +0000
committerDavid Robillard <d@drobilla.net>2011-09-15 07:17:10 +0000
commitc7f671ff5bf9cf2559697bbc90cf3cee97cc7975 (patch)
treec9448a87cce9bfc957d32bc3b1b404cb7f0c6984 /src/server/Notification.cpp
parentba99f4ca92ea2e6cf8de51341489b0689223e1fc (diff)
downloadingen-c7f671ff5bf9cf2559697bbc90cf3cee97cc7975.tar.gz
ingen-c7f671ff5bf9cf2559697bbc90cf3cee97cc7975.tar.bz2
ingen-c7f671ff5bf9cf2559697bbc90cf3cee97cc7975.zip
Fix control bindings (MIDI learn).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3464 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/Notification.cpp')
-rw-r--r--src/server/Notification.cpp33
1 files changed, 11 insertions, 22 deletions
diff --git a/src/server/Notification.cpp b/src/server/Notification.cpp
index 652662f2..9181147f 100644
--- a/src/server/Notification.cpp
+++ b/src/server/Notification.cpp
@@ -24,37 +24,26 @@
namespace Ingen {
namespace Server {
-Notification::Notification(Type y,
- FrameTime t,
- PortImpl* p,
- const Raul::Atom& v,
- const ControlBindings::Type bt)
- : type(y)
- , binding_type(bt)
- , time(t)
- , port(p)
- , value(v)
-{}
-
void
-Notification::post_process(Engine& engine)
+Notification::post_process(Notification& note,
+ Engine& engine)
{
- switch (type) {
+ switch (note.type) {
case PORT_VALUE:
engine.broadcaster()->set_property(
- port->path(),
- engine.world()->uris()->ingen_value, value);
+ note.port->path(),
+ engine.world()->uris()->ingen_value, note.value);
break;
case PORT_ACTIVITY:
- engine.broadcaster()->activity(port->path());
+ engine.broadcaster()->activity(note.port->path());
break;
case PORT_BINDING: {
const Ingen::Shared::LV2URIMap& uris = *engine.world()->uris().get();
Raul::Atom::DictValue dict;
- switch (binding_type) {
+ switch (note.binding_type) {
case ControlBindings::MIDI_CC:
dict[uris.rdf_type] = uris.midi_Controller;
- dict[uris.midi_controllerNumber] = value.get_int32();
+ dict[uris.midi_controllerNumber] = note.value.get_int32();
break;
case ControlBindings::MIDI_BENDER:
dict[uris.rdf_type] = uris.midi_Bender;
@@ -64,15 +53,15 @@ Notification::post_process(Engine& engine)
break;
case ControlBindings::MIDI_NOTE:
dict[uris.rdf_type] = uris.midi_Note;
- dict[uris.midi_noteNumber] = value.get_int32();
+ dict[uris.midi_noteNumber] = note.value.get_int32();
break;
case ControlBindings::MIDI_RPN: // TODO
case ControlBindings::MIDI_NRPN: // TODO
case ControlBindings::NULL_CONTROL:
break;
}
- port->set_property(uris.ingen_controlBinding, dict); // FIXME: thread unsafe
- engine.broadcaster()->set_property(port->path(),
+ note.port->set_property(uris.ingen_controlBinding, dict); // FIXME: thread unsafe
+ engine.broadcaster()->set_property(note.port->path(),
uris.ingen_controlBinding,
dict);
break;