summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-19 22:36:30 +0000
committerDavid Robillard <d@drobilla.net>2011-05-19 22:36:30 +0000
commitddaaa0e19ce196eba68e88165a483cf62478895b (patch)
treee9cffa134702ec1ea3bf4fba98c8e8f283667d5f /src
parent9c48078b76cadfb8afd4aeffdf6e97b0b133ef57 (diff)
downloadingen-ddaaa0e19ce196eba68e88165a483cf62478895b.tar.gz
ingen-ddaaa0e19ce196eba68e88165a483cf62478895b.tar.bz2
ingen-ddaaa0e19ce196eba68e88165a483cf62478895b.zip
Convey put context parameter via OSC.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3287 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src')
-rw-r--r--src/client/OSCClientReceiver.cpp8
-rw-r--r--src/client/OSCEngineSender.cpp1
-rw-r--r--src/server/OSCClientSender.cpp1
-rw-r--r--src/server/OSCEngineReceiver.cpp9
4 files changed, 13 insertions, 6 deletions
diff --git a/src/client/OSCClientReceiver.cpp b/src/client/OSCClientReceiver.cpp
index f854b3fb..33e2d050 100644
--- a/src/client/OSCClientReceiver.cpp
+++ b/src/client/OSCClientReceiver.cpp
@@ -173,10 +173,12 @@ int
OSCClientReceiver::_put_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg)
{
const char* obj_path = &argv[0]->s;
+ const char* ctx = &argv[1]->s;
Resource::Properties prop;
- for (int i = 1; i < argc-1; i += 2)
- prop.insert(make_pair(&argv[i]->s, AtomLiblo::lo_arg_to_atom(types[i+1], argv[i+1])));
- _target->put(obj_path, prop);
+ for (int i = 2; i < argc-1; i += 2)
+ prop.insert(make_pair(&argv[i]->s,
+ AtomLiblo::lo_arg_to_atom(types[i+1], argv[i+1])));
+ _target->put(obj_path, prop, Resource::uri_to_graph(ctx));
return 0;
}
diff --git a/src/client/OSCEngineSender.cpp b/src/client/OSCEngineSender.cpp
index 49b20df1..4147c831 100644
--- a/src/client/OSCEngineSender.cpp
+++ b/src/client/OSCEngineSender.cpp
@@ -109,6 +109,7 @@ OSCEngineSender::put(const Raul::URI& path,
lo_message m = lo_message_new();
lo_message_add_int32(m, next_id());
lo_message_add_string(m, path.c_str());
+ lo_message_add_string(m, Resource::graph_to_uri(ctx).c_str());
for (iterator i = properties.begin(); i != properties.end(); ++i) {
lo_message_add_string(m, i->first.c_str());
Raul::AtomLiblo::lo_message_add_atom(m, i->second);
diff --git a/src/server/OSCClientSender.cpp b/src/server/OSCClientSender.cpp
index 5095eeef..ad2e179c 100644
--- a/src/server/OSCClientSender.cpp
+++ b/src/server/OSCClientSender.cpp
@@ -118,6 +118,7 @@ OSCClientSender::put(const Raul::URI& path,
typedef Resource::Properties::const_iterator iterator;
lo_message m = lo_message_new();
lo_message_add_string(m, path.c_str());
+ lo_message_add_string(m, Resource::graph_to_uri(ctx).c_str());
for (iterator i = properties.begin(); i != properties.end(); ++i) {
lo_message_add_string(m, i->first.c_str());
Raul::AtomLiblo::lo_message_add_atom(m, i->second);
diff --git a/src/server/OSCEngineReceiver.cpp b/src/server/OSCEngineReceiver.cpp
index 08f8074e..d7f2e46b 100644
--- a/src/server/OSCEngineReceiver.cpp
+++ b/src/server/OSCEngineReceiver.cpp
@@ -332,6 +332,7 @@ OSCEngineReceiver::_get_cb(const char* path, const char* types, lo_arg** argv, i
* <h2>/put</h2>
* @arg @p response-id :: Integer
* @arg @p path :: String
+ * @arg @p context :: URI String
* @arg @p predicate :: URI String
* @arg @p value
* @arg @p ...
@@ -343,10 +344,12 @@ int
OSCEngineReceiver::_put_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg)
{
const char* obj_path = &argv[1]->s;
+ const char* ctx = &argv[2]->s;
Resource::Properties prop;
- for (int i = 2; i < argc-1; i += 2)
- prop.insert(make_pair(&argv[i]->s, AtomLiblo::lo_arg_to_atom(types[i+1], argv[i+1])));
- put(obj_path, prop);
+ for (int i = 3; i < argc-1; i += 2)
+ prop.insert(make_pair(&argv[i]->s,
+ AtomLiblo::lo_arg_to_atom(types[i+1], argv[i+1])));
+ put(obj_path, prop, Resource::uri_to_graph(ctx));
return 0;
}