summaryrefslogtreecommitdiffstats
path: root/src/serialisation/Serialiser.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-08-16 06:48:55 +0000
committerDavid Robillard <d@drobilla.net>2012-08-16 06:48:55 +0000
commit643635c12d3cf6485c52c946c31f2f6a25f58452 (patch)
tree39ddd4b6ebb1cd2be3e3247739c026dce44fee09 /src/serialisation/Serialiser.cpp
parent6dbae147a5c903a4205da70dfdd876a6b68a4fd8 (diff)
downloadingen-643635c12d3cf6485c52c946c31f2f6a25f58452.tar.gz
ingen-643635c12d3cf6485c52c946c31f2f6a25f58452.tar.bz2
ingen-643635c12d3cf6485c52c946c31f2f6a25f58452.zip
Fix broken lv2:default saving and save current value as the lv2:default for control inputs.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4710 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/serialisation/Serialiser.cpp')
-rw-r--r--src/serialisation/Serialiser.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp
index d71e7b15..cff178d6 100644
--- a/src/serialisation/Serialiser.cpp
+++ b/src/serialisation/Serialiser.cpp
@@ -456,6 +456,7 @@ Serialiser::Impl::serialise_port(const GraphObject* port,
Resource::Graph context,
const Sord::Node& port_id)
{
+ URIs& uris = _world.uris();
Sord::World& world = _model->world();
_model->add_statement(port_id,
@@ -463,9 +464,16 @@ Serialiser::Impl::serialise_port(const GraphObject* port,
Sord::Literal(world, port->path().symbol()));
GraphObject::Properties props = port->properties(context);
- if (context == Resource::INTERNAL) {
- props.insert(make_pair(_world.uris().lv2_default,
- _world.uris().ingen_value));
+ if (context == Resource::INTERNAL &&
+ port->has_property(uris.rdf_type, uris.lv2_ControlPort) &&
+ port->has_property(uris.rdf_type, uris.lv2_InputPort))
+ {
+ const Raul::Atom& val = port->get_property(uris.ingen_value);
+ if (val.is_valid()) {
+ props.insert(make_pair(uris.lv2_default, val));
+ } else {
+ Raul::warn("Control input has no value, lv2:default omitted.\n");
+ }
}
serialise_properties(port_id, props);