From 77a9beca75debd2d87d735fc4fe847694eee6f13 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 25 Feb 2010 20:40:13 +0000 Subject: Work on contexts and polymorphic ports. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2492 a436a847-0d15-0410-975c-d299462d15a1 --- src/serialisation/Serialiser.cpp | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/serialisation') diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index 1469afaf..8d88a21c 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -417,8 +417,10 @@ Serialiser::serialise_port(const Port* port, const Redland::Node& port_id) _model->add_statement(port_id, "rdf:type", Redland::Resource(_model->world(), "lv2:OutputPort")); - _model->add_statement(port_id, "rdf:type", - Redland::Resource(_model->world(), port->type().uri().str())); + for (Port::PortTypes::const_iterator i = port->types().begin(); + i != port->types().end(); ++i) + _model->add_statement(port_id, "rdf:type", + Redland::Resource(_model->world(), i->uri().str())); if (dynamic_cast(port->graph_parent())) _model->add_statement(port_id, "rdf:instanceOf", @@ -439,8 +441,10 @@ Serialiser::serialise_port_meta(const Port* port, const Redland::Node& port_id) _model->add_statement(port_id, "rdf:type", Redland::Resource(_model->world(), "lv2:OutputPort")); - _model->add_statement(port_id, "rdf:type", - Redland::Resource(_model->world(), port->type().uri().str())); + for (Port::PortTypes::const_iterator i = port->types().begin(); + i != port->types().end(); ++i) + _model->add_statement(port_id, "rdf:type", + Redland::Resource(_model->world(), i->uri().str())); _model->add_statement(port_id, "lv2:index", AtomRDF::atom_to_node(*_model, Atom((int)port->index()))); @@ -450,7 +454,7 @@ Serialiser::serialise_port_meta(const Port* port, const Redland::Node& port_id) if (port->value().is_valid()) { _model->add_statement(port_id, "lv2:default", AtomRDF::atom_to_node(*_model, Atom(port->value()))); - } else if (port->type() == PortType::CONTROL) { + } else if (port->is_a(PortType::CONTROL)) { LOG(warn) << "Port " << port->path() << " has no lv2:default" << endl; } } -- cgit v1.2.1