diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/engine/OSCEngineReceiver.cpp | 30 | ||||
-rw-r--r-- | src/engine/OSCEngineReceiver.hpp | 9 |
2 files changed, 35 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); |