summaryrefslogtreecommitdiffstats
path: root/src/serialisation/Serialiser.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2014-01-24 04:47:33 +0000
committerDavid Robillard <d@drobilla.net>2014-01-24 04:47:33 +0000
commit2c03f2abd3d3d98a81020438ca805acded39dbab (patch)
tree92abb5ae29cbc25a0655e7aa5b6a8c07bbff6756 /src/serialisation/Serialiser.cpp
parentd970641441746aacfc645176b71d7ba71af0463a (diff)
downloadingen-2c03f2abd3d3d98a81020438ca805acded39dbab.tar.gz
ingen-2c03f2abd3d3d98a81020438ca805acded39dbab.tar.bz2
ingen-2c03f2abd3d3d98a81020438ca805acded39dbab.zip
Remove redundant and unnecessary properties from saved graphs and protocol.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@5321 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/serialisation/Serialiser.cpp')
-rw-r--r--src/serialisation/Serialiser.cpp21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp
index 425ac00f..dd1be2b4 100644
--- a/src/serialisation/Serialiser.cpp
+++ b/src/serialisation/Serialiser.cpp
@@ -433,9 +433,6 @@ Serialiser::Impl::serialise_block(SPtr<const Node> block,
_model->add_statement(block_id,
Sord::URI(_model->world(), uris.ingen_prototype),
class_id);
- _model->add_statement(block_id,
- Sord::URI(_model->world(), uris.lv2_symbol),
- Sord::Literal(_model->world(), block->path().symbol()));
const Node::Properties props = block->properties(Resource::Graph::EXTERNAL);
serialise_properties(block_id, props);
@@ -455,14 +452,20 @@ Serialiser::Impl::serialise_port(const Node* port,
Resource::Graph context,
const Sord::Node& port_id)
{
- URIs& uris = _world.uris();
- Sord::World& world = _model->world();
+ URIs& uris = _world.uris();
+ Sord::World& world = _model->world();
+ Node::Properties props = port->properties(context);
- _model->add_statement(port_id,
- Sord::URI(world, uris.lv2_symbol),
- Sord::Literal(world, port->path().symbol()));
+ if (context == Resource::Graph::INTERNAL) {
+ // Always write lv2:symbol for Graph ports (required for lv2:Plugin)
+ _model->add_statement(port_id,
+ Sord::URI(world, uris.lv2_symbol),
+ Sord::Literal(world, port->path().symbol()));
+ } else {
+ // Never write lv2:index for plugin instances (not persistent/stable)
+ props.erase(uris.lv2_index);
+ }
- Node::Properties props = port->properties(context);
if (context == Resource::Graph::INTERNAL &&
port->has_property(uris.rdf_type, uris.lv2_ControlPort) &&
port->has_property(uris.rdf_type, uris.lv2_InputPort))