summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2009-05-28 16:22:34 +0000
committerDavid Robillard <d@drobilla.net>2009-05-28 16:22:34 +0000
commit14d9e8c55895be82a8e6dcf1455ecfb41447ad12 (patch)
tree5e86a63c75f4977feeca7b803cbb4fa1897b1176 /src/engine
parentee3bba21b4f2ea2e0e03f93bc9eded6681b9b482 (diff)
downloadingen-14d9e8c55895be82a8e6dcf1455ecfb41447ad12.tar.gz
ingen-14d9e8c55895be82a8e6dcf1455ecfb41447ad12.tar.bz2
ingen-14d9e8c55895be82a8e6dcf1455ecfb41447ad12.zip
Implement PUT over OSC.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2026 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/OSCClientSender.cpp9
-rw-r--r--src/engine/OSCEngineReceiver.cpp12
2 files changed, 17 insertions, 4 deletions
diff --git a/src/engine/OSCClientSender.cpp b/src/engine/OSCClientSender.cpp
index 5a941dc2..3d33c6ce 100644
--- a/src/engine/OSCClientSender.cpp
+++ b/src/engine/OSCClientSender.cpp
@@ -108,7 +108,14 @@ void
OSCClientSender::put(const Raul::URI& path,
const Shared::Resource::Properties& properties)
{
- cerr << "OSC CLIENT PUT " << path << endl;
+ typedef Shared::Resource::Properties::const_iterator iterator;
+ lo_message m = lo_message_new();
+ lo_message_add_string(m, path.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);
+ }
+ send_message("/ingen/put", m);
}
diff --git a/src/engine/OSCEngineReceiver.cpp b/src/engine/OSCEngineReceiver.cpp
index 6cdc4ea2..c4ec402b 100644
--- a/src/engine/OSCEngineReceiver.cpp
+++ b/src/engine/OSCEngineReceiver.cpp
@@ -22,8 +22,8 @@
#include <string>
#include <lo/lo.h>
#include "ingen-config.h"
-#include "raul/SharedPtr.hpp"
#include "raul/AtomLiblo.hpp"
+#include "raul/SharedPtr.hpp"
#include "interface/ClientInterface.hpp"
#include "ClientBroadcaster.hpp"
#include "Engine.hpp"
@@ -33,9 +33,12 @@
#include "ThreadManager.hpp"
using namespace std;
+using namespace Raul;
namespace Ingen {
+using namespace Shared;
+
/*! \page engine_osc_namespace Engine OSC Namespace Documentation
*
@@ -390,8 +393,11 @@ OSCEngineReceiver::_engine_deactivate_cb(const char* path, const char* types, lo
int
OSCEngineReceiver::_put_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg)
{
- //const char* path = &argv[1]->s;
-
+ const char* obj_path = &argv[1]->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);
return 0;
}