From 119468f621a59d86da10bedf75c4427b70f9d370 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 16 Mar 2012 03:15:41 +0000 Subject: Remove activity from interface and use set_property() instead. Move client registration stuff to Engine and remove corresponding events. Simply response ID interface. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4066 a436a847-0d15-0410-975c-d299462d15a1 --- src/osc/OSCClientReceiver.cpp | 14 -------------- src/osc/OSCClientReceiver.hpp | 1 - src/osc/OSCClientSender.cpp | 19 ------------------- src/osc/OSCClientSender.hpp | 3 --- src/osc/OSCEngineReceiver.cpp | 2 +- src/osc/OSCEngineSender.hpp | 3 +-- 6 files changed, 2 insertions(+), 40 deletions(-) (limited to 'src/osc') diff --git a/src/osc/OSCClientReceiver.cpp b/src/osc/OSCClientReceiver.cpp index a0cd58b7..a7965296 100644 --- a/src/osc/OSCClientReceiver.cpp +++ b/src/osc/OSCClientReceiver.cpp @@ -149,8 +149,6 @@ OSCClientReceiver::setup_callbacks() lo_server_thread_add_method(_st, "/connect", "ss", connection_cb, this); lo_server_thread_add_method(_st, "/disconnect", "ss", disconnection_cb, this); lo_server_thread_add_method(_st, "/set_property", NULL, set_property_cb, this); - lo_server_thread_add_method(_st, "/activity", "sT", activity_cb, this); - lo_server_thread_add_method(_st, "/activity", "sf", activity_cb, this); } /** Catches errors that aren't a direct result of a client request. @@ -268,18 +266,6 @@ OSCClientReceiver::_set_property_cb(const char* path, const char* types, lo_arg* return 0; } -int -OSCClientReceiver::_activity_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) -{ - const char* const port_path = &argv[0]->s; - - Atom value = AtomLiblo::lo_arg_to_atom(types[1], argv[1]); - - _target->activity(port_path, value); - - return 0; -} - int OSCClientReceiver::_response_cb(const char* path, const char* types, lo_arg** argv, int argc, lo_message msg) { diff --git a/src/osc/OSCClientReceiver.hpp b/src/osc/OSCClientReceiver.hpp index a04ed5f5..c3effb10 100644 --- a/src/osc/OSCClientReceiver.hpp +++ b/src/osc/OSCClientReceiver.hpp @@ -80,7 +80,6 @@ private: LO_HANDLER(OSCClientReceiver, delta_add); LO_HANDLER(OSCClientReceiver, delta_end); LO_HANDLER(OSCClientReceiver, set_property); - LO_HANDLER(OSCClientReceiver, activity); }; } // namespace Client diff --git a/src/osc/OSCClientSender.cpp b/src/osc/OSCClientSender.cpp index 1a6289f4..5a50ddf3 100644 --- a/src/osc/OSCClientSender.cpp +++ b/src/osc/OSCClientSender.cpp @@ -225,24 +225,5 @@ OSCClientSender::set_property(const URI& path, send_message("/set_property", m); } -/** @page client_osc_namespace - *

/activity

- * @arg @p path :: String - * - * @par - * Notification of "activity" (e.g. port message blinkenlights). - */ -void -OSCClientSender::activity(const Path& path, const Raul::Atom& value) -{ - if (!_enabled) - return; - - lo_message m = lo_message_new(); - lo_message_add_string(m, path.c_str()); - AtomLiblo::lo_message_add_atom(m, value); - send_message("/activity", m); -} - } // namespace Server } // namespace Ingen diff --git a/src/osc/OSCClientSender.hpp b/src/osc/OSCClientSender.hpp index 67e76fee..ffb7323b 100644 --- a/src/osc/OSCClientSender.hpp +++ b/src/osc/OSCClientSender.hpp @@ -96,9 +96,6 @@ public: const Raul::URI& predicate, const Raul::Atom& value); - virtual void activity(const Raul::Path& path, - const Raul::Atom& value); - private: Raul::URI _url; }; diff --git a/src/osc/OSCEngineReceiver.cpp b/src/osc/OSCEngineReceiver.cpp index ad505b76..b75d76a4 100644 --- a/src/osc/OSCEngineReceiver.cpp +++ b/src/osc/OSCEngineReceiver.cpp @@ -180,7 +180,7 @@ OSCEngineReceiver::set_response_address_cb(const char* path, const char* types, if (id != -1) { // TODO: Cache client ClientInterface* client = me->_engine.broadcaster()->client(url); - me->_interface->respond_to(client, id); + me->_interface->set_response_id(id); } else { me->_interface->disable_responses(); } diff --git a/src/osc/OSCEngineSender.hpp b/src/osc/OSCEngineSender.hpp index 5aeeed7b..ff74fb4a 100644 --- a/src/osc/OSCEngineSender.hpp +++ b/src/osc/OSCEngineSender.hpp @@ -54,8 +54,7 @@ public: inline int32_t next_id() { int32_t ret = (_id == -1) ? -1 : _id++; return ret; } - void respond_to(ClientInterface* client, int32_t id) { _id = id; } - void disable_responses() { _id = -1; } + void set_response_id(int32_t id) { _id = id; } void attach(int32_t ping_id, bool block); -- cgit v1.2.1