diff options
author | David Robillard <d@drobilla.net> | 2010-02-17 18:35:23 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2010-02-17 18:35:23 +0000 |
commit | 35369ade66f8410e828316a34de539a3c235c79d (patch) | |
tree | c53a3205db5d1994d04fd86a83c6a7b8a00a2564 | |
parent | bf1d84fd0f4400a97922177646e3cac4eb8e3c31 (diff) | |
download | ingen-35369ade66f8410e828316a34de539a3c235c79d.tar.gz ingen-35369ade66f8410e828316a34de539a3c235c79d.tar.bz2 ingen-35369ade66f8410e828316a34de539a3c235c79d.zip |
Stub liblo bundle receiving support (patch on liblo-dev).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2458 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r-- | src/engine/OSCEngineReceiver.cpp | 30 | ||||
-rw-r--r-- | src/engine/OSCEngineReceiver.hpp | 9 | ||||
-rw-r--r-- | wscript | 5 |
3 files changed, 40 insertions, 4 deletions
diff --git a/src/engine/OSCEngineReceiver.cpp b/src/engine/OSCEngineReceiver.cpp index 38ef3273..4f7f0ebe 100644 --- a/src/engine/OSCEngineReceiver.cpp +++ b/src/engine/OSCEngineReceiver.cpp @@ -84,6 +84,10 @@ OSCEngineReceiver::OSCEngineReceiver(Engine& engine, size_t queue_size, uint16_t // It's important this is first and returns nonzero. lo_server_add_method(_server, NULL, NULL, set_response_address_cb, this); +#ifdef LIBLO_BUNDLES + lo_server_add_bundle_handler(_server, bundle_cb, this); +#endif + // Commands lo_server_add_method(_server, "/ping", "i", ping_cb, this); lo_server_add_method(_server, "/ping_queued", "i", ping_slow_cb, this); @@ -228,10 +232,31 @@ OSCEngineReceiver::set_response_address_cb(const char* path, const char* types, } +#ifdef LIBLO_BUNDLES +int +OSCEngineReceiver::_bundle_cb(lo_bundle_edge edge) +{ + switch (edge) { + case LO_BUNDLE_BEGIN: + info << "BUNDLE BEGIN" << endl; + break; + case LO_BUNDLE_END: + info << "BUNDLE END" << endl; + break; + } + return 0; +} +#endif + + void OSCEngineReceiver::error_cb(int num, const char* msg, const char* path) { - error << "liblo server error " << num << " for path `" << path << "' (" << msg << ")" << endl; + error << "liblo server error" << num; + if (path) { + error << " for path `" << path << "'"; + } + error << " (" << msg << ")" << endl; } @@ -582,9 +607,6 @@ OSCEngineReceiver::_set_property_cb(const char* path, const char* types, lo_arg* const char* object_path = &argv[1]->s; const char* key = &argv[2]->s; - cout << "SET PROPERTY " << object_path << " : " << key << " PENDING: " << - lo_server_events_pending(_server) << endl; - Raul::Atom value = Raul::AtomLiblo::lo_arg_to_atom(types[3], argv[3]); set_property(object_path, key, value); diff --git a/src/engine/OSCEngineReceiver.hpp b/src/engine/OSCEngineReceiver.hpp index 7279913f..168d411a 100644 --- a/src/engine/OSCEngineReceiver.hpp +++ b/src/engine/OSCEngineReceiver.hpp @@ -22,6 +22,7 @@ #include <lo/lo.h> #include "QueuedEngineInterface.hpp" #include "Request.hpp" +#include "ingen-config.h" namespace Ingen { @@ -76,6 +77,14 @@ private: ReceiveThread* _receive_thread; +#ifdef LIBLO_BUNDLES + static int bundle_cb(lo_bundle_edge edge, void* myself) { + return ((OSCEngineReceiver*)myself)->_bundle_cb(edge); + } + + int _bundle_cb(lo_bundle_edge edge); +#endif + static void error_cb(int num, const char* msg, const char* path); static int set_response_address_cb(LO_HANDLER_ARGS, void* myself); static int generic_cb(LO_HANDLER_ARGS, void* myself); @@ -28,6 +28,8 @@ def set_options(opt): help="Do not build HTTP via libsoup support, even if libsoup exists") opt.add_option('--log-debug', action='store_true', default=False, dest='log_debug', help="Print debugging output") + opt.add_option('--liblo-bundles', action='store_true', default=False, dest='liblo_bundles', + help="Use liblo bundle support (experimental, requires patched liblo)") def configure(conf): autowaf.configure(conf) @@ -75,6 +77,9 @@ def configure(conf): if Options.options.log_debug: conf.define('LOG_DEBUG', 1) + + if Options.options.liblo_bundles: + conf.define('LIBLO_BUNDLES', 1) conf.write_config_header('ingen-config.h') |