From 87597f85c5a69a9accd3ce2ed88f2a006173e885 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 3 Feb 2010 04:46:56 +0000 Subject: Comprehensive use of cached URIs and more advanced Value (Atom) system. Atoms (e.g. property values or port values) can now be an Atom::DICT, which maps directly to/from an RDF resource. This is now used to store control bindings as a port property, eliminating the special API. Full interned URIs used everywhere, instead of CURIEs pretending to be URIs. Avoid converting string literals to URIs all over the place. Support for binding MIDI pitch bender and MIDI channel pressure. Saving/restoring of MIDI bindings as a free side-effect of the above. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2409 a436a847-0d15-0410-975c-d299462d15a1 --- src/serialisation/Serialiser.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/serialisation/Serialiser.cpp') diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index 86264900..331cf9f2 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -153,7 +153,7 @@ Serialiser::to_string(SharedPtr object, for (GraphObject::Properties::const_iterator v = extra_rdf.begin(); v != extra_rdf.end(); ++v) { if (v->first.find(":") != string::npos) { _model->add_statement(base_rdf_node, v->first.str(), - AtomRDF::atom_to_node(_model->world(), v->second)); + AtomRDF::atom_to_node(*_model, v->second)); } else { LOG(warn) << "Not serialising extra RDF with key '" << v->first << "'" << endl; } @@ -378,7 +378,7 @@ Serialiser::serialise_plugin(const Shared::Plugin& plugin) const Redland::Node plugin_id = Redland::Resource(_model->world(), plugin.uri().str()); _model->add_statement(plugin_id, "rdf:type", - Redland::Resource(_model->world(), plugin.type_uri())); + Redland::Resource(_model->world(), plugin.type_uri().str())); } @@ -416,7 +416,7 @@ Serialiser::serialise_port(const Port* port, const Redland::Node& port_id) Redland::Resource(_model->world(), "lv2:OutputPort")); _model->add_statement(port_id, "rdf:type", - Redland::Resource(_model->world(), port->type().uri())); + Redland::Resource(_model->world(), port->type().uri().str())); if (dynamic_cast(port->graph_parent())) _model->add_statement(port_id, "rdf:instanceOf", @@ -424,7 +424,7 @@ Serialiser::serialise_port(const Port* port, const Redland::Node& port_id) if (port->is_input() && port->type() == PortType::CONTROL) _model->add_statement(port_id, "ingen:value", - AtomRDF::atom_to_node(_model->world(), port->value())); + AtomRDF::atom_to_node(*_model, port->value())); serialise_properties(port_id, &port->meta(), port->properties()); } @@ -442,16 +442,16 @@ Serialiser::serialise_port_meta(const Port* port, const Redland::Node& port_id) Redland::Resource(_model->world(), "lv2:OutputPort")); _model->add_statement(port_id, "rdf:type", - Redland::Resource(_model->world(), port->type().uri())); + Redland::Resource(_model->world(), port->type().uri().str())); _model->add_statement(port_id, "lv2:index", - AtomRDF::atom_to_node(_model->world(), Atom((int)port->index()))); + AtomRDF::atom_to_node(*_model, Atom((int)port->index()))); if (!port->get_property("lv2:default").is_valid()) { if (port->is_input()) { if (port->value().is_valid()) { _model->add_statement(port_id, "lv2:default", - AtomRDF::atom_to_node(_model->world(), Atom(port->value()))); + AtomRDF::atom_to_node(*_model, Atom(port->value()))); } else if (port->type() == PortType::CONTROL) { LOG(warn) << "Port " << port->path() << " has no lv2:default" << endl; } @@ -500,7 +500,7 @@ Serialiser::serialise_properties( if (v->second.is_valid()) { if (!meta || !meta->has_property(v->first.str(), v->second)) { const Redland::Resource key(_model->world(), v->first.str()); - const Redland::Node value(AtomRDF::atom_to_node(_model->world(), v->second)); + const Redland::Node value(AtomRDF::atom_to_node(*_model, v->second)); if (value.is_valid()) { _model->add_statement(subject, key, value); } else { -- cgit v1.2.1