From acaab5ca7ce6869b8192de4f98c9f075fd17690e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 24 May 2011 23:29:42 +0000 Subject: Remove dependence on protocol-specific client headers in GUI code. In other words, remove need for protocol-specific (and library dependent) headers to be in public headers... git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3318 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/ConnectWindow.cpp | 41 ++++++++--------------------------------- 1 file changed, 8 insertions(+), 33 deletions(-) (limited to 'src/gui/ConnectWindow.cpp') diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index b266307a..56acc52b 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -29,12 +29,6 @@ #include "shared/Module.hpp" #include "shared/World.hpp" #include "server/Engine.hpp" -#ifdef HAVE_SOUP -#include "client/HTTPClientReceiver.hpp" -#endif -#ifdef HAVE_LIBLO -#include "client/OSCClientReceiver.hpp" -#endif #include "client/ClientStore.hpp" #include "client/PatchModel.hpp" #include "client/ThreadedSigClientInterface.hpp" @@ -78,7 +72,7 @@ ConnectWindow::start(Ingen::Shared::World* world) set_connected_to(world->engine()); - connect(true); + connect(world->engine()); } void @@ -175,27 +169,10 @@ ConnectWindow::connect(bool existing) // Create client-side listener SharedPtr tsci(new ThreadedSigClientInterface(1024)); - SharedPtr client; - string scheme = uri.substr(0, uri.find(":")); - -#ifdef HAVE_LIBLO - if (scheme == "osc.udp" || scheme == "osc.tcp") - client = SharedPtr(new OSCClientReceiver(16181, tsci)); -#endif -#ifdef HAVE_SOUP - if (scheme == "http") - client = SharedPtr(new HTTPClientReceiver(world, uri, tsci)); -#endif - - if (!existing) { - world->set_engine(world->interface(uri)); - } else { - uri = world->engine()->uri().str(); - scheme = uri.substr(0, uri.find(":")); - } + world->set_engine(world->interface(uri, tsci)); - App::instance().attach(tsci, client); + App::instance().attach(tsci); App::instance().register_callbacks(); Glib::signal_timeout().connect( @@ -204,19 +181,17 @@ ConnectWindow::connect(bool existing) } else if (_mode == LAUNCH_REMOTE) { #ifdef HAVE_LIBLO int port = _port_spinbutton->get_value_as_int(); - char port_str[6]; - snprintf(port_str, 6, "%u", port); - const string cmd = string("ingen -e --engine-port=").append(port_str); + char port_str[8]; + snprintf(port_str, sizeof(port_str), "%u", port); + const string cmd = string("ingen -e -E ").append(port_str); if (Raul::Process::launch(cmd)) { const std::string engine_uri = string("osc.udp://localhost:").append(port_str); - world->set_engine(world->interface(engine_uri)); - // FIXME: static args SharedPtr tsci(new ThreadedSigClientInterface(1024)); - SharedPtr client(new OSCClientReceiver(16181, tsci)); + world->set_engine(world->interface(engine_uri, tsci)); - App::instance().attach(tsci, client); + App::instance().attach(tsci); App::instance().register_callbacks(); Glib::signal_timeout().connect( -- cgit v1.2.1