From 694b31089c8060fc6b908b146b12c0e340d004c7 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 17 Aug 2008 01:34:53 +0000 Subject: Cloooser... Bundling of OSC communication both ways (previous was just engine->client). Factor out common OSC*Sender functionality (bundling stuff). Fully type-safe and polyphony-aware port value setting/getting, from RDF through OSC through engine and back again. git-svn-id: http://svn.drobilla.net/lad/ingen@1409 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/client/OSCEngineSender.hpp | 48 ++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 27 deletions(-) (limited to 'src/libs/client/OSCEngineSender.hpp') diff --git a/src/libs/client/OSCEngineSender.hpp b/src/libs/client/OSCEngineSender.hpp index 0c317608..d32a4849 100644 --- a/src/libs/client/OSCEngineSender.hpp +++ b/src/libs/client/OSCEngineSender.hpp @@ -22,6 +22,7 @@ #include #include #include "interface/EngineInterface.hpp" +#include "shared/OSCSender.hpp" using std::string; using Ingen::Shared::EngineInterface; using Ingen::Shared::ClientInterface; @@ -37,8 +38,7 @@ namespace Client { * * \ingroup IngenClient */ -class OSCEngineSender : public EngineInterface -{ +class OSCEngineSender : public EngineInterface, public Shared::OSCSender { public: OSCEngineSender(const string& engine_url); @@ -46,7 +46,7 @@ public: string engine_url() { return _engine_url; } - inline size_t next_id() + inline int32_t next_id() { int32_t ret = (_id == -1) ? -1 : _id++; return ret; } void set_next_response_id(int32_t id) { _id = id; } @@ -56,6 +56,14 @@ public: /* *** EngineInterface implementation below here *** */ + + void enable() { _enabled = true; } + void disable() { _enabled = false; } + + void bundle_begin() { OSCSender::bundle_begin(); } + void bundle_end() { OSCSender::bundle_end(); } + void transfer_begin() { OSCSender::transfer_begin(); } + void transfer_end() { OSCSender::transfer_end(); } // Client registration void register_client(ClientInterface* client); @@ -67,10 +75,6 @@ public: void deactivate(); void quit(); - // Bundles - void bundle_begin(); - void bundle_end(); - // Object commands void new_patch(const string& path, @@ -114,27 +118,19 @@ public: void disconnect_all(const string& parent_patch_path, const string& node_path); - void set_port_value(const string& port_path, - const string& type_uri, - uint32_t data_size, - const void* data); + void set_port_value(const string& port_path, + const Raul::Atom& value); - void set_port_value(const string& port_path, - const string& type_uri, - uint32_t voice, - uint32_t data_size, - const void* data); + void set_voice_value(const string& port_path, + uint32_t voice, + const Raul::Atom& value); - void set_port_value_immediate(const string& port_path, - const string& type_uri, - uint32_t data_size, - const void* data); + void set_port_value_immediate(const string& port_path, + const Raul::Atom& value); - void set_port_value_immediate(const string& port_path, - const string& type_uri, - uint32_t voice, - uint32_t data_size, - const void* data); + void set_voice_value_immediate(const string& port_path, + uint32_t voice, + const Raul::Atom& value); void enable_port_broadcasting(const string& port_path); @@ -167,9 +163,7 @@ public: void request_all_objects(); protected: - lo_bundle _bundle; string _engine_url; - lo_address _engine_addr; int _client_port; int32_t _id; }; -- cgit v1.2.1