diff options
author | David Robillard <d@drobilla.net> | 2008-08-15 23:34:41 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-08-15 23:34:41 +0000 |
commit | ab2aa4d4922ab1a62b7a43013d09b2d9d144b3c5 (patch) | |
tree | 9e235f0c3b7a355e3cc661720359cd3d9eb18fb9 /src/libs/serialisation | |
parent | 4d5a589570a65d508170c59b4c738b441e216a93 (diff) | |
download | ingen-ab2aa4d4922ab1a62b7a43013d09b2d9d144b3c5.tar.gz ingen-ab2aa4d4922ab1a62b7a43013d09b2d9d144b3c5.tar.bz2 ingen-ab2aa4d4922ab1a62b7a43013d09b2d9d144b3c5.zip |
Push serialiser down into core ('world').
HTTP access to patches (serialised on demand).
git-svn-id: http://svn.drobilla.net/lad/ingen@1393 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs/serialisation')
-rw-r--r-- | src/libs/serialisation/Serialiser.cpp | 10 | ||||
-rw-r--r-- | src/libs/serialisation/Serialiser.hpp | 19 | ||||
-rw-r--r-- | src/libs/serialisation/serialisation.cpp | 2 |
3 files changed, 19 insertions, 12 deletions
diff --git a/src/libs/serialisation/Serialiser.cpp b/src/libs/serialisation/Serialiser.cpp index 5deb17e9..1caac5b0 100644 --- a/src/libs/serialisation/Serialiser.cpp +++ b/src/libs/serialisation/Serialiser.cpp @@ -34,6 +34,7 @@ #include <redlandmm/Model.hpp> #include <redlandmm/Node.hpp> #include <redlandmm/World.hpp> +#include "module/World.hpp" #include "interface/EngineInterface.hpp" #include "interface/Plugin.hpp" #include "interface/Patch.hpp" @@ -52,8 +53,9 @@ namespace Ingen { namespace Serialisation { -Serialiser::Serialiser(Redland::World& world) - : _world(world) +Serialiser::Serialiser(Shared::World& world) + : _store(world.store) + , _world(*world.rdf_world) { } @@ -296,7 +298,9 @@ 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) { + //for (GraphObject::const_iterator n = patch->children_begin(); n != patch->children_end(); ++n) { + for (GraphObject::const_iterator n = _store->children_begin(patch); + n != _store->children_end(patch); ++n) { if (n->second->graph_parent() != patch.get()) continue; diff --git a/src/libs/serialisation/Serialiser.hpp b/src/libs/serialisation/Serialiser.hpp index 26439bdf..51d89cab 100644 --- a/src/libs/serialisation/Serialiser.hpp +++ b/src/libs/serialisation/Serialiser.hpp @@ -29,6 +29,7 @@ #include <redlandmm/World.hpp> #include <redlandmm/Model.hpp> #include "interface/GraphObject.hpp" +#include "interface/Store.hpp" using namespace Raul; using namespace Ingen::Shared; @@ -42,6 +43,7 @@ namespace Shared { class Node; class Port; class Connection; + class World; } namespace Serialisation { @@ -54,9 +56,9 @@ namespace Serialisation { class Serialiser { public: - Serialiser(Redland::World& world); + Serialiser(Shared::World& world); - void to_file(SharedPtr<GraphObject> object, const std::string& filename); + void to_file(SharedPtr<GraphObject> object, const std::string& filename); std::string to_string(SharedPtr<GraphObject> object, const std::string& base_uri, @@ -88,12 +90,13 @@ private: typedef std::map<Raul::Path, Redland::Node> NodeMap; - SharedPtr<GraphObject> _root_object; - Mode _mode; - NodeMap _node_map; - std::string _base_uri; - Redland::World& _world; - Redland::Model* _model; + SharedPtr<GraphObject> _root_object; + SharedPtr<Shared::Store> _store; + Mode _mode; + NodeMap _node_map; + std::string _base_uri; + Redland::World& _world; + Redland::Model* _model; }; diff --git a/src/libs/serialisation/serialisation.cpp b/src/libs/serialisation/serialisation.cpp index 5da28529..49b8d465 100644 --- a/src/libs/serialisation/serialisation.cpp +++ b/src/libs/serialisation/serialisation.cpp @@ -36,7 +36,7 @@ Ingen::Serialisation::Serialiser* new_serialiser(Ingen::Shared::World* world) { assert(world->rdf_world); - return new Serialiser(*world->rdf_world); + return new Serialiser(*world); } |