summaryrefslogtreecommitdiffstats
path: root/src/libs
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-01-06 21:55:17 +0000
committerDavid Robillard <d@drobilla.net>2008-01-06 21:55:17 +0000
commit2781019b326871319c20d617621e40449a6aee92 (patch)
tree9419e4b5bbac57851824a1bee466480768c3f7e5 /src/libs
parent25f644708b620fa39a622119f63f396c23849ae9 (diff)
downloadingen-2781019b326871319c20d617621e40449a6aee92.tar.gz
ingen-2781019b326871319c20d617621e40449a6aee92.tar.bz2
ingen-2781019b326871319c20d617621e40449a6aee92.zip
Remove raul dependency on liblo and redlandmm.
git-svn-id: http://svn.drobilla.net/lad/ingen@1025 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/libs')
-rw-r--r--src/libs/serialisation/Loader.cpp7
-rw-r--r--src/libs/serialisation/Serialiser.cpp19
2 files changed, 15 insertions, 11 deletions
diff --git a/src/libs/serialisation/Loader.cpp b/src/libs/serialisation/Loader.cpp
index ecab622a..39613a64 100644
--- a/src/libs/serialisation/Loader.cpp
+++ b/src/libs/serialisation/Loader.cpp
@@ -23,6 +23,7 @@
#include <redlandmm/Query.hpp>
#include <raul/TableImpl.hpp>
#include <raul/Atom.hpp>
+#include <raul/AtomRDF.hpp>
#include "interface/EngineInterface.hpp"
#include "Loader.hpp"
@@ -154,7 +155,7 @@ Loader::load(SharedPtr<EngineInterface> engine,
Redland::Node val_node = (*i)["varval"];
if (key != "")
- engine->set_variable(node_path, key, Atom(val_node));
+ engine->set_variable(node_path, key, AtomRDF::node_to_atom(val_node));
}
rdf_world->mutex().unlock();
@@ -255,7 +256,7 @@ Loader::load(SharedPtr<EngineInterface> engine,
const Redland::Node var_val_node = (*i)["varval"];
if (key != "")
- engine->set_variable(patch_path.base() + name, key, Atom(var_val_node));
+ engine->set_variable(patch_path.base() + name, key, AtomRDF::node_to_atom(var_val_node));
}
created.clear();
@@ -359,7 +360,7 @@ Loader::load(SharedPtr<EngineInterface> engine,
Redland::Node val_node = (*i)["varval"];
if (key != "")
- engine->set_variable(patch_path, key, Atom(val_node));
+ engine->set_variable(patch_path, key, AtomRDF::node_to_atom(val_node));
}
diff --git a/src/libs/serialisation/Serialiser.cpp b/src/libs/serialisation/Serialiser.cpp
index c4a740a9..71d64015 100644
--- a/src/libs/serialisation/Serialiser.cpp
+++ b/src/libs/serialisation/Serialiser.cpp
@@ -28,6 +28,7 @@
#include <utility> // pair, make_pair
#include <vector>
#include <raul/Atom.hpp>
+#include <raul/AtomRDF.hpp>
#include <raul/Path.hpp>
#include <raul/TableImpl.hpp>
#include <redlandmm/Model.hpp>
@@ -79,7 +80,8 @@ Serialiser::to_string(SharedPtr<GraphObject> object,
Redland::Node base_rdf_node(_model->world(), Redland::Node::RESOURCE, base_uri);
for (GraphObject::Variables::const_iterator v = extra_rdf.begin(); v != extra_rdf.end(); ++v) {
if (v->first.find(":") != string::npos) {
- _model->add_statement(base_rdf_node, v->first, v->second.to_rdf_node(_model->world()));
+ _model->add_statement(base_rdf_node, v->first,
+ AtomRDF::atom_to_node(_model->world(), v->second));
} else {
cerr << "Warning: not serialising extra RDF with key '" << v->first << "'" << endl;
}
@@ -288,12 +290,12 @@ Serialiser::serialise_patch(SharedPtr<Shared::Patch> patch)
_model->add_statement(
patch_id,
"ingen:polyphony",
- Atom((int)patch->internal_polyphony()).to_rdf_node(_model->world()));
+ AtomRDF::atom_to_node(_model->world(), Atom((int)patch->internal_polyphony())));
_model->add_statement(
patch_id,
"ingen:enabled",
- Atom(patch->enabled()).to_rdf_node(_model->world()));
+ AtomRDF::atom_to_node(_model->world(), Atom((bool)patch->enabled())));
serialise_variables(patch_id, patch->variables());
@@ -356,7 +358,7 @@ Serialiser::serialise_node(SharedPtr<Shared::Node> node, const Redland::Node& no
_model->add_statement(
node_id,
"ingen:name",
- Atom(node->path().name()).to_rdf_node(_model->world()));
+ Redland::Node(_model->world(), Redland::Node::LITERAL, node->path().name()));
_model->add_statement(
node_id,
@@ -366,7 +368,7 @@ Serialiser::serialise_node(SharedPtr<Shared::Node> node, const Redland::Node& no
_model->add_statement(
node_id,
"ingen:polyphonic",
- Atom(node->polyphonic()).to_rdf_node(_model->world()));
+ AtomRDF::atom_to_node(_model->world(), Atom(node->polyphonic())));
//serialise_plugin(node->plugin());
@@ -397,14 +399,14 @@ Serialiser::serialise_port(const Port* port, const Redland::Node& port_id)
Redland::Node(_model->world(), Redland::Node::RESOURCE, "ingen:OutputPort"));
_model->add_statement(port_id, "ingen:name",
- Atom(port->path().name().c_str()).to_rdf_node(_model->world()));
+ Redland::Node(_model->world(), Redland::Node::LITERAL, port->path().name()));
_model->add_statement(port_id, "rdf:type",
Redland::Node(_model->world(), Redland::Node::RESOURCE, port->type().uri()));
if (port->type() == DataType::CONTROL && port->is_input())
_model->add_statement(port_id, "ingen:value",
- Atom(port->value()).to_rdf_node(_model->world()));
+ AtomRDF::atom_to_node(_model->world(), Atom(port->value())));
serialise_variables(port_id, port->variables());
}
@@ -432,7 +434,8 @@ Serialiser::serialise_variables(Redland::Node subject, const GraphObject::Variab
const Redland::Node key(_model->world(), Redland::Node::RESOURCE, v->first);
_model->add_statement(subject, "ingen:variable", var_id);
_model->add_statement(var_id, "ingen:key", key);
- _model->add_statement(var_id, "ingen:value", v->second.to_rdf_node(_model->world()));
+ _model->add_statement(var_id, "ingen:value",
+ AtomRDF::atom_to_node(_model->world(), v->second));
} else {
cerr << "Warning: not serialising variable with key '" << v->first << "'" << endl;
}