diff options
author | David Robillard <d@drobilla.net> | 2008-08-18 23:59:18 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-18 23:59:18 +0000 |
commit | 3acc63156da8146d609e3c6b7d0326b224b46be6 (patch) | |
tree | 602b37eb30fba44556a96c05c8b1fe37d05262df /src/libs/serialisation/Serialiser.cpp | |
parent | e001689a6b3692cf7a73b8f5d3f664d560097e13 (diff) | |
download | ingen-3acc63156da8146d609e3c6b7d0326b224b46be6.tar.gz ingen-3acc63156da8146d609e3c6b7d0326b224b46be6.tar.bz2 ingen-3acc63156da8146d609e3c6b7d0326b224b46be6.zip |
Remove pointless predicates that are duplicates of exist well-known ones.
Move patch files closer to LV2.
git-svn-id: http://svn.drobilla.net/lad/ingen@1437 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/serialisation/Serialiser.cpp')
-rw-r--r-- | src/libs/serialisation/Serialiser.cpp | 23 |
1 files changed, 16 insertions, 7 deletions
diff --git a/src/libs/serialisation/Serialiser.cpp b/src/libs/serialisation/Serialiser.cpp index 5f4c0cbf..2f0d9877 100644 --- a/src/libs/serialisation/Serialiser.cpp +++ b/src/libs/serialisation/Serialiser.cpp @@ -302,9 +302,15 @@ Serialiser::serialise_patch(SharedPtr<Shared::Patch> patch) "rdf:type", Redland::Node(_model->world(), Redland::Node::RESOURCE, "http://drobilla.net/ns/ingen#Patch")); - if (patch->path() != "/") { + GraphObject::Variables::const_iterator s = patch->variables().find("lv2:symbol"); + // If symbol is stored as a variable, write that + if (s != patch->variables().end()) { + _model->add_statement(patch_id, "lv2:symbol", + Redland::Node(_model->world(), Redland::Node::LITERAL, s->second.get_string())); + // Otherwise take the one from our path (if possible) + } else if (patch->path() != "/") { _model->add_statement( - patch_id, "ingen:symbol", + patch_id, "lv2:symbol", Redland::Node(_model->world(), Redland::Node::LITERAL, patch->path().name())); } @@ -379,7 +385,7 @@ Serialiser::serialise_node(SharedPtr<Shared::Node> node, const Redland::Node& no _model->add_statement( node_id, - "ingen:symbol", + "lv2:symbol", Redland::Node(_model->world(), Redland::Node::LITERAL, node->path().name())); _model->add_statement( @@ -419,8 +425,11 @@ Serialiser::serialise_port(const Port* port, const Redland::Node& port_id) else _model->add_statement(port_id, "rdf:type", Redland::Node(_model->world(), Redland::Node::RESOURCE, "ingen:OutputPort")); + + _model->add_statement(port_id, "lv2:index", + AtomRDF::atom_to_node(_model->world(), Atom((int)port->index()))); - _model->add_statement(port_id, "ingen:symbol", + _model->add_statement(port_id, "lv2:symbol", Redland::Node(_model->world(), Redland::Node::LITERAL, port->path().name())); _model->add_statement(port_id, "rdf:type", @@ -471,9 +480,9 @@ Serialiser::serialise_variables(Redland::Node subject, const GraphObject::Variab const Redland::Node key(_model->world(), Redland::Node::RESOURCE, v->first); const Redland::Node value = AtomRDF::atom_to_node(_model->world(), v->second); if (value) { - _model->add_statement(subject, "ingen:variable", var_id); - _model->add_statement(var_id, "ingen:key", key); - _model->add_statement(var_id, "ingen:value", value); + _model->add_statement(subject, "lv2var:variable", var_id); + _model->add_statement(var_id, "rdf:predicate", key); + _model->add_statement(var_id, "rdf:value", value); } else { cerr << "Warning: can not serialise value: key '" << v->first << "', type " << (int)v->second.type() << endl; |