summaryrefslogtreecommitdiffstats
path: root/src/server/Notification.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-12 06:59:48 +0000
committerDavid Robillard <d@drobilla.net>2012-03-12 06:59:48 +0000
commit81e9fb3245bd461ebfee4cfa16d1792e48533f9e (patch)
treeeb1b30d79cba70dda9d832100dd7c14b08085b03 /src/server/Notification.cpp
parente9d9569271ee962c09ab66c6babed1ca5655a6c6 (diff)
downloadingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.tar.gz
ingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.tar.bz2
ingen-81e9fb3245bd461ebfee4cfa16d1792e48533f9e.zip
Centralise atom creation in forge object.
Aside from being more greppable and making realtime violations more obvious, this is a step towards using LV2 atoms internally (which needs a factory since the type numbers are dynamic). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4054 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/Notification.cpp')
-rw-r--r--src/server/Notification.cpp17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/server/Notification.cpp b/src/server/Notification.cpp
index 0d78d0b4..c9ea9d00 100644
--- a/src/server/Notification.cpp
+++ b/src/server/Notification.cpp
@@ -28,11 +28,12 @@ void
Notification::post_process(Notification& note,
Engine& engine)
{
+ Raul::Forge& forge = engine.world()->forge();
switch (note.type) {
case PORT_VALUE:
- engine.broadcaster()->set_property(
- note.port->path(),
- engine.world()->uris()->ingen_value, note.value);
+ engine.broadcaster()->set_property(note.port->path(),
+ engine.world()->uris()->ingen_value,
+ note.value);
break;
case PORT_ACTIVITY:
engine.broadcaster()->activity(note.port->path(), note.value);
@@ -43,7 +44,7 @@ Notification::post_process(Notification& note,
switch (note.binding_type) {
case ControlBindings::MIDI_CC:
dict[uris.rdf_type] = uris.midi_Controller;
- dict[uris.midi_controllerNumber] = note.value.get_int32();
+ dict[uris.midi_controllerNumber] = forge.make(note.value.get_int32());
break;
case ControlBindings::MIDI_BENDER:
dict[uris.rdf_type] = uris.midi_Bender;
@@ -53,17 +54,19 @@ Notification::post_process(Notification& note,
break;
case ControlBindings::MIDI_NOTE:
dict[uris.rdf_type] = uris.midi_NoteOn;
- dict[uris.midi_noteNumber] = note.value.get_int32();
+ dict[uris.midi_noteNumber] = note.value;
break;
case ControlBindings::MIDI_RPN: // TODO
case ControlBindings::MIDI_NRPN: // TODO
case ControlBindings::NULL_CONTROL:
break;
}
- note.port->set_property(uris.ingen_controlBinding, dict); // FIXME: thread unsafe
+ // FIXME: not thread-safe
+ const Raul::Atom dict_atom = forge.alloc(dict);
+ note.port->set_property(uris.ingen_controlBinding, dict_atom);
engine.broadcaster()->set_property(note.port->path(),
uris.ingen_controlBinding,
- dict);
+ dict_atom);
break;
}
case NIL: