summaryrefslogtreecommitdiffstats
path: root/src/Serialiser.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Serialiser.cpp')
-rw-r--r--src/Serialiser.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/Serialiser.cpp b/src/Serialiser.cpp
index 6c70ca8b..518f0bea 100644
--- a/src/Serialiser.cpp
+++ b/src/Serialiser.cpp
@@ -303,12 +303,14 @@ Serialiser::serialise(SPtr<const Node> object) throw (std::logic_error)
if (!me->_model)
throw std::logic_error("serialise called without serialisation in progress");
- if (object->graph_type() == Node::GraphType::GRAPH) {
+ const URIs& uris = me->_world.uris();
+ if (object->has_property(uris.rdf_type, uris.ingen_Graph)) {
me->serialise_graph(object, me->path_rdf_node(object->path()));
- } else if (object->graph_type() == Node::GraphType::BLOCK) {
+ } else if (object->has_property(uris.rdf_type, uris.ingen_Block)) {
const Sord::URI plugin_id(me->_model->world(), object->plugin()->uri());
me->serialise_block(object, plugin_id, me->path_rdf_node(object->path()));
- } else if (object->graph_type() == Node::GraphType::PORT) {
+ } else if (object->has_property(uris.rdf_type, uris.lv2_InputPort) ||
+ object->has_property(uris.rdf_type, uris.lv2_OutputPort)) {
me->serialise_port(object.get(),
Resource::Graph::DEFAULT,
me->path_rdf_node(object->path()));
@@ -359,7 +361,7 @@ Serialiser::Impl::serialise_graph(SPtr<const Node> graph,
if (n->first.parent() != graph->path())
continue;
- if (n->second->graph_type() == Node::GraphType::GRAPH) {
+ if (n->second->has_property(uris.rdf_type, uris.ingen_Graph)) {
SPtr<Node> subgraph = n->second;
SerdURI base_uri;
@@ -392,7 +394,7 @@ Serialiser::Impl::serialise_graph(SPtr<const Node> graph,
Sord::URI(world, uris.ingen_block),
block_id);
serialise_block(subgraph, subgraph_id, block_id);
- } else if (n->second->graph_type() == Node::GraphType::BLOCK) {
+ } else if (n->second->has_property(uris.rdf_type, uris.ingen_Block)) {
SPtr<const Node> block = n->second;
const Sord::URI class_id(world, block->plugin()->uri());