summaryrefslogtreecommitdiffstats
path: root/src/libs/serialisation
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2007-10-10 05:45:04 +0000
committerDavid Robillard <d@drobilla.net>2007-10-10 05:45:04 +0000
commitc7f3a28390e651e03a68b664086351788a6a2d73 (patch)
treee4e7037981a876c8e6c69414f6662b0682995212 /src/libs/serialisation
parent670bf40134c1aa7c1ff175ff8acd9dbed7b9ab41 (diff)
downloadingen-c7f3a28390e651e03a68b664086351788a6a2d73.tar.gz
ingen-c7f3a28390e651e03a68b664086351788a6a2d73.tar.bz2
ingen-c7f3a28390e651e03a68b664086351788a6a2d73.zip
Fix recursive patch problems (all objects recursively appearing as direct child of root).
Use slightly more human friendly names for blank nodes in patch files. Fix memory management semantics of engine side objects (fix crash on subpatch delete). Make Raul::Table a boost::noncopyable; related changes trickled down from that. git-svn-id: http://svn.drobilla.net/lad/ingen@865 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/serialisation')
-rw-r--r--src/libs/serialisation/Loader.cpp13
-rw-r--r--src/libs/serialisation/Serialiser.cpp6
2 files changed, 11 insertions, 8 deletions
diff --git a/src/libs/serialisation/Loader.cpp b/src/libs/serialisation/Loader.cpp
index fb6f1e7c..e1eb3aa6 100644
--- a/src/libs/serialisation/Loader.cpp
+++ b/src/libs/serialisation/Loader.cpp
@@ -47,7 +47,7 @@ Loader::load(SharedPtr<EngineInterface> engine,
boost::optional<Path> parent,
string patch_name,
Glib::ustring patch_uri,
- GraphObject::Variables data)
+ GraphObject::Variables data)
{
setlocale(LC_NUMERIC, "C");
@@ -62,8 +62,7 @@ Loader::load(SharedPtr<EngineInterface> engine,
else
patch_uri = string("<") + patch_uri + ">";
- cerr << "[Loader] Loading " << patch_uri << " from " << document_uri
- << " under " << (string)(parent ? (string)parent.get() : "no parent") << endl;
+ cout << "[Loader] Loading " << patch_uri;
size_t patch_poly = 1;
@@ -108,12 +107,12 @@ Loader::load(SharedPtr<EngineInterface> engine,
patch_name = (*results.begin())["name"].to_string();
}
- Path patch_path = ( parent ? (parent.get().base() + patch_name) : Path("/") );
- //cerr << "************ PATCH: name=" << patch_name << ", path=" << patch_path
- // << ", poly = " << patch_poly << endl;
+ const Path patch_path = ( parent ? (parent.get().base() + patch_name) : Path("/") );
+
+ cout << " as " << patch_path << endl;
+
engine->create_patch(patch_path, patch_poly);
-
/* Load (plugin) nodes */
RDF::Query query(*rdf_world, Glib::ustring(
diff --git a/src/libs/serialisation/Serialiser.cpp b/src/libs/serialisation/Serialiser.cpp
index 83920d28..e3d33094 100644
--- a/src/libs/serialisation/Serialiser.cpp
+++ b/src/libs/serialisation/Serialiser.cpp
@@ -154,7 +154,7 @@ Serialiser::path_to_node_id(const Path& path)
assert(i->second.get_node());
return i->second;
} else {
- RDF::Node id = _world.blank_id();
+ RDF::Node id = _world.blank_id(path.name());
assert(id);
_node_map[path] = id;
return id;
@@ -286,6 +286,10 @@ Serialiser::serialise_patch(SharedPtr<Shared::Patch> patch)
serialise_variables(patch_id, patch->variables());
for (GraphObject::const_iterator n = patch->children_begin(); n != patch->children_end(); ++n) {
+
+ if (n->second->graph_parent() != patch.get())
+ continue;
+
SharedPtr<Shared::Patch> patch = PtrCast<Shared::Patch>(n->second);
SharedPtr<Shared::Node> node = PtrCast<Shared::Node>(n->second);
if (patch) {