diff options
author | David Robillard <d@drobilla.net> | 2011-04-19 20:41:24 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-04-19 20:41:24 +0000 |
commit | c9683eb916ff52ab6907773360c655d776b24f23 (patch) | |
tree | 39696902060bf6b3dbba156c1d315f4e69f7ce28 /src/client | |
parent | 6ec78b5a9eb499646d7fa6ccb306378426008e9d (diff) | |
download | ingen-c9683eb916ff52ab6907773360c655d776b24f23.tar.gz ingen-c9683eb916ff52ab6907773360c655d776b24f23.tar.bz2 ingen-c9683eb916ff52ab6907773360c655d776b24f23.zip |
Make maximum UDP packet size a runtime parameter (--packet-size, -k).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3170 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/OSCEngineSender.cpp | 6 | ||||
-rw-r--r-- | src/client/OSCEngineSender.hpp | 16 | ||||
-rw-r--r-- | src/client/ingen_client.cpp | 3 |
3 files changed, 18 insertions, 7 deletions
diff --git a/src/client/OSCEngineSender.cpp b/src/client/OSCEngineSender.cpp index d2125e08..f78583f9 100644 --- a/src/client/OSCEngineSender.cpp +++ b/src/client/OSCEngineSender.cpp @@ -37,8 +37,10 @@ namespace Client { * from the most recently created server, so create the OSC listener before * this to have it all happen on the same port. Yeah, this is a big magic :/ */ -OSCEngineSender::OSCEngineSender(const URI& engine_url) - : _engine_url(engine_url) +OSCEngineSender::OSCEngineSender(const URI& engine_url, + size_t max_packet_size) + : Shared::OSCSender(max_packet_size) + , _engine_url(engine_url) , _id(0) { _address = lo_address_new_from_url(engine_url.c_str()); diff --git a/src/client/OSCEngineSender.hpp b/src/client/OSCEngineSender.hpp index e5a2fc9f..30e82c5f 100644 --- a/src/client/OSCEngineSender.hpp +++ b/src/client/OSCEngineSender.hpp @@ -18,13 +18,18 @@ #ifndef INGEN_CLIENT_OSCENGINESENDER_HPP #define INGEN_CLIENT_OSCENGINESENDER_HPP -#include <inttypes.h> +#include <stdbool.h> +#include <stddef.h> + #include <string> + #include <lo/lo.h> + #include "ingen/EngineInterface.hpp" #include "shared/OSCSender.hpp" namespace Ingen { + namespace Client { /* OSC (via liblo) interface to the engine. @@ -36,11 +41,14 @@ namespace Client { */ class OSCEngineSender : public EngineInterface, public Shared::OSCSender { public: - OSCEngineSender(const Raul::URI& engine_url); + OSCEngineSender(const Raul::URI& engine_url, + size_t max_packet_size); + ~OSCEngineSender(); - static OSCEngineSender* create(const Raul::URI& engine_url) { - return new OSCEngineSender(engine_url); + static OSCEngineSender* create(const Raul::URI& engine_url, + size_t max_packet_size) { + return new OSCEngineSender(engine_url, max_packet_size); } Raul::URI uri() const { return _engine_url; } diff --git a/src/client/ingen_client.cpp b/src/client/ingen_client.cpp index f1aa5c11..93b00e59 100644 --- a/src/client/ingen_client.cpp +++ b/src/client/ingen_client.cpp @@ -32,7 +32,8 @@ using namespace Ingen; SharedPtr<Ingen::EngineInterface> new_osc_interface(Ingen::Shared::World* world, const std::string& url) { - Client::OSCEngineSender* oes = Client::OSCEngineSender::create(url); + Client::OSCEngineSender* oes = Client::OSCEngineSender::create( + url, world->conf()->option("packet-size").get_int32()); oes->attach(rand(), true); return SharedPtr<EngineInterface>(oes); } |