summaryrefslogtreecommitdiffstats
path: root/src/AtomReader.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-24 00:57:48 +0000
committerDavid Robillard <d@drobilla.net>2014-01-24 00:57:48 +0000
commitd970641441746aacfc645176b71d7ba71af0463a (patch)
tree1b4263ce9bc271b8617a500e9272e0dc482c6fcb /src/AtomReader.cpp
parent229be04694a5b99a1e9c384a7c65452ebb30eedd (diff)
downloadingen-d970641441746aacfc645176b71d7ba71af0463a.tar.gz
ingen-d970641441746aacfc645176b71d7ba71af0463a.tar.bz2
ingen-d970641441746aacfc645176b71d7ba71af0463a.zip
Update for latest LV2 Atom Object simplifications.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5319 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/AtomReader.cpp')
-rw-r--r--src/AtomReader.cpp25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/AtomReader.cpp b/src/AtomReader.cpp
index f7b5a82a..2f3cf695 100644
--- a/src/AtomReader.cpp
+++ b/src/AtomReader.cpp
@@ -98,7 +98,7 @@ AtomReader::atom_to_path(const LV2_Atom* atom)
bool
AtomReader::is_message(URIs& uris, const LV2_Atom* msg)
{
- if (msg->type != uris.atom_Blank && msg->type != uris.atom_Resource) {
+ if (msg->type != uris.atom_Object) {
return false;
}
@@ -115,7 +115,7 @@ AtomReader::is_message(URIs& uris, const LV2_Atom* msg)
bool
AtomReader::write(const LV2_Atom* msg)
{
- if (msg->type != _uris.atom_Blank && msg->type != _uris.atom_Resource) {
+ if (msg->type != _uris.atom_Object) {
_log.warn(fmt("Unknown message type <%1%>\n")
% _map.unmap_uri(msg->type));
return false;
@@ -123,12 +123,24 @@ AtomReader::write(const LV2_Atom* msg)
const LV2_Atom_Object* obj = (const LV2_Atom_Object*)msg;
const LV2_Atom* subject = NULL;
-
- lv2_atom_object_get(obj, (LV2_URID)_uris.patch_subject, &subject, NULL);
- const char* subject_uri = atom_to_uri(subject);
+ const LV2_Atom* number = NULL;
+
+ lv2_atom_object_get(obj,
+ (LV2_URID)_uris.patch_subject, &subject,
+ (LV2_URID)_uris.patch_sequenceNumber, &number,
+ NULL);
+
+ const char* subject_uri = atom_to_uri(subject);
+ const int32_t seq_id = ((number && number->type == _uris.atom_Int)
+ ? ((const LV2_Atom_Int*)number)->body
+ : 0);
+ if (seq_id) {
+ _iface.set_response_id(seq_id);
+ } else {
+ _iface.set_response_id(-1);
+ }
if (obj->body.otype == _uris.patch_Get) {
- _iface.set_response_id(obj->body.id);
_iface.get(Raul::URI(subject_uri));
} else if (obj->body.otype == _uris.patch_Delete) {
const LV2_Atom_Object* body = NULL;
@@ -194,7 +206,6 @@ AtomReader::write(const LV2_Atom* msg)
} else {
Ingen::Resource::Properties props;
get_props(body, props);
- _iface.set_response_id(obj->body.id);
_iface.put(Raul::URI(subject_uri), props);
}
} else if (obj->body.otype == _uris.patch_Set) {