From eb3f6dc10b8b1541fa9084bea0deef7dec16d073 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 28 Apr 2012 02:36:39 +0000 Subject: Implement set_property via atom interface (working blinkenlights). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4294 a436a847-0d15-0410-975c-d299462d15a1 --- src/shared/AtomReader.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/shared') diff --git a/src/shared/AtomReader.cpp b/src/shared/AtomReader.cpp index 99a09b44..6925d478 100644 --- a/src/shared/AtomReader.cpp +++ b/src/shared/AtomReader.cpp @@ -140,6 +140,22 @@ AtomReader::write(const LV2_Atom* msg) _iface.set_response_id(obj->body.id); _iface.put(subject_uri, props); } + } else if (obj->body.otype == _uris.patch_Set) { + const LV2_Atom_Object* body = NULL; + lv2_atom_object_get(obj, (LV2_URID)_uris.patch_body, &body, 0); + if (!body) { + Raul::warn << "Set message has no body" << std::endl; + return; + } else if (!subject_uri) { + Raul::warn << "Set message has no subject" << std::endl; + return; + } + + LV2_ATOM_OBJECT_FOREACH(body, p) { + Raul::Atom val; + get_uri(&p->value, val); + _iface.set_property(subject_uri, _map.unmap_uri(p->key), val); + } } else if (obj->body.otype == _uris.patch_Patch) { if (!subject_uri) { Raul::warn << "Put message has no subject" << std::endl; -- cgit v1.2.1