summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2008-11-16 06:27:22 +0000
committerDavid Robillard <d@drobilla.net>2008-11-16 06:27:22 +0000
commit18a76e65f5a40c2dd8f01050ab41390b8a74ce01 (patch)
tree99f4397e176330592b4a05e3ba01049b991dcfbe /src/engine
parent0fd3c583e032a3cd5af877902d4561a45179a232 (diff)
downloadingen-18a76e65f5a40c2dd8f01050ab41390b8a74ce01.tar.gz
ingen-18a76e65f5a40c2dd8f01050ab41390b8a74ce01.tar.bz2
ingen-18a76e65f5a40c2dd8f01050ab41390b8a74ce01.zip
Monitoring deletion and variable setting (e.g. moving stuff on the canvas) via HTTP.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1723 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/HTTPClientSender.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/src/engine/HTTPClientSender.cpp b/src/engine/HTTPClientSender.cpp
index 413dfe7f..652bc1a7 100644
--- a/src/engine/HTTPClientSender.cpp
+++ b/src/engine/HTTPClientSender.cpp
@@ -17,6 +17,7 @@
#include <string>
#include "raul/Atom.hpp"
+#include "raul/AtomRDF.hpp"
#include "serialisation/Serialiser.hpp"
#include "module/World.hpp"
#include "HTTPClientSender.hpp"
@@ -69,8 +70,7 @@ void
HTTPClientSender::destroy(const std::string& path)
{
assert(path != "/");
-
- //send("/ingen/destroyed", "s", path.c_str(), LO_ARGS_END);
+ send_chunk(string("<").append(path).append("> a <http://www.w3.org/2002/07/owl#Nothing> ."));
}
@@ -78,7 +78,6 @@ void
HTTPClientSender::patch_cleared(const std::string& patch_path)
{
send_chunk(string("<").append(patch_path).append("> ingen:empty true ."));
- //send("/ingen/patch_cleared", "s", patch_path.c_str(), LO_ARGS_END);
}
@@ -99,11 +98,17 @@ HTTPClientSender::disconnect(const std::string& src_path, const std::string& dst
void
HTTPClientSender::set_variable(const std::string& path, const std::string& key, const Atom& value)
{
- /*lo_message m = lo_message_new();
- lo_message_add_string(m, path.c_str());
- lo_message_add_string(m, key.c_str());
- Raul::AtomLiblo::lo_message_add_atom(m, value);
- send_message("/ingen/set_variable", m);*/
+ Redland::Node node = AtomRDF::atom_to_node(*_engine.world()->rdf_world, value);
+
+ string msg = string(
+ "@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .\n"
+ "@prefix ingenuity: <http://drobilla.net/ns/ingenuity#> .\n"
+ "@prefix lv2var: <http://lv2plug.in/ns/ext/instance-var#> .\n\n<").append(
+ path).append("> lv2var:variable [\n"
+ "rdf:predicate ").append(key).append(" ;\n"
+ "rdf:value ").append(node.to_string()).append("\n] .\n");
+
+ send_chunk(msg);
}