diff options
author | David Robillard <d@drobilla.net> | 2011-10-21 22:29:51 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-10-21 22:29:51 +0000 |
commit | 20b765b8befa32eed913e16d68f03a65459a605d (patch) | |
tree | 955dda8e59707c7dc0149288b31187d071518ce4 /src/server/OSCEngineReceiver.cpp | |
parent | e928751490386d4ec028a3314ebc89cdd25ea45d (diff) | |
download | ingen-20b765b8befa32eed913e16d68f03a65459a605d.tar.gz ingen-20b765b8befa32eed913e16d68f03a65459a605d.tar.bz2 ingen-20b765b8befa32eed913e16d68f03a65459a605d.zip |
Make engine receivers depend only on ServerInterface.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3572 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/server/OSCEngineReceiver.cpp')
-rw-r--r-- | src/server/OSCEngineReceiver.cpp | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/src/server/OSCEngineReceiver.cpp b/src/server/OSCEngineReceiver.cpp index 3151255c..6c462d7a 100644 --- a/src/server/OSCEngineReceiver.cpp +++ b/src/server/OSCEngineReceiver.cpp @@ -57,9 +57,9 @@ namespace Server { * See the "Client OSC Namespace Documentation" for details.</p> */ -OSCEngineReceiver::OSCEngineReceiver(Engine& engine, - SharedPtr<ServerInterfaceImpl> interface, - uint16_t port) +OSCEngineReceiver::OSCEngineReceiver(Engine& engine, + SharedPtr<ServerInterface> interface, + uint16_t port) : _engine(engine) , _interface(interface) , _server(NULL) @@ -190,19 +190,10 @@ OSCEngineReceiver::set_response_address_cb(const char* path, const char* types, const lo_address addr = lo_message_get_source(msg); char* const url = lo_address_get_url(addr); - const SharedPtr<Request> r = me->_interface->request(); - - /* Different address than last time, have to do a lookup */ - if (!r || !r->client() || strcmp(url, r->client()->uri().c_str())) { - ClientInterface* client = me->_engine.broadcaster()->client(url); - Request* req = (client) - ? new Request(client, id) - : new Request(); - me->_interface->set_request(SharedPtr<Request>(req)); - } - if (id != -1) { - me->_interface->set_next_response_id(id); + // TODO: Cache client + ClientInterface* client = me->_engine.broadcaster()->client(url); + me->_interface->respond_to(client, id); } else { me->_interface->disable_responses(); } |