summaryrefslogtreecommitdiffstats
path: root/src/serialisation
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-11 01:53:31 +0000
committerDavid Robillard <d@drobilla.net>2012-03-11 01:53:31 +0000
commitd88dc1da7ed999d56bc61d86fb20d75d45846912 (patch)
tree0baae1caceb9b40e0990b6e7d646977feca5d8cb /src/serialisation
parent7bc5413b66cd60395af7f045b34b16685851b3dc (diff)
downloadingen-d88dc1da7ed999d56bc61d86fb20d75d45846912.tar.gz
ingen-d88dc1da7ed999d56bc61d86fb20d75d45846912.tar.bz2
ingen-d88dc1da7ed999d56bc61d86fb20d75d45846912.zip
Implement state save/restore when Ingen is an LV2 plugin.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4047 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/serialisation')
-rw-r--r--src/serialisation/Serialiser.cpp18
-rw-r--r--src/serialisation/serialisation.cpp2
2 files changed, 11 insertions, 9 deletions
diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp
index 6e6db3ed..1e608806 100644
--- a/src/serialisation/Serialiser.cpp
+++ b/src/serialisation/Serialiser.cpp
@@ -70,9 +70,8 @@ namespace Ingen {
namespace Serialisation {
struct Serialiser::Impl {
- Impl(Shared::World& world, SharedPtr<Shared::Store> store)
+ Impl(Shared::World& world)
: _root_path("/")
- , _store(store)
, _world(world)
{}
@@ -119,8 +118,8 @@ struct Serialiser::Impl {
};
-Serialiser::Serialiser(Shared::World& world, SharedPtr<Shared::Store> store)
- : me(new Impl(world, store))
+Serialiser::Serialiser(Shared::World& world)
+ : me(new Impl(world))
{}
Serialiser::~Serialiser()
@@ -332,8 +331,7 @@ Serialiser::serialise(SharedPtr<const GraphObject> object) throw (std::logic_err
SharedPtr<const Patch> patch = PtrCast<const Patch>(object);
if (patch) {
- const Sord::URI patch_id(me->_model->world(), "");
- me->serialise_patch(patch, patch_id);
+ me->serialise_patch(patch, me->path_rdf_node(patch->path()));
return;
}
@@ -369,6 +367,10 @@ Serialiser::Impl::serialise_patch(SharedPtr<const Patch> patch,
Sord::Curie(world, "rdf:type"),
Sord::Curie(world, "lv2:Plugin"));
+ _model->add_statement(patch_id,
+ Sord::Curie(world, "lv2:extensionData"),
+ Sord::URI(world, "http://lv2plug.in/ns/ext/state#Interface"));
+
const URIs& uris = *_world.uris().get();
// Always write a symbol (required by Ingen)
@@ -395,8 +397,8 @@ Serialiser::Impl::serialise_patch(SharedPtr<const Patch> patch,
serialise_properties(patch.get(), Resource::INTERNAL, patch_id);
- for (Store::const_iterator n = _store->children_begin(patch);
- n != _store->children_end(patch); ++n) {
+ for (Store::const_iterator n = _world.store()->children_begin(patch);
+ n != _world.store()->children_end(patch); ++n) {
if (n->first.parent() != patch->path())
continue;
diff --git a/src/serialisation/serialisation.cpp b/src/serialisation/serialisation.cpp
index 309c4271..aca47bdd 100644
--- a/src/serialisation/serialisation.cpp
+++ b/src/serialisation/serialisation.cpp
@@ -28,7 +28,7 @@ struct IngenSerialisationModule : public Shared::Module {
world->set_parser(SharedPtr<Serialisation::Parser>(
new Serialisation::Parser(*world)));
world->set_serialiser(SharedPtr<Serialisation::Serialiser>(
- new Serialisation::Serialiser(*world, world->store())));
+ new Serialisation::Serialiser(*world)));
}
};