summaryrefslogtreecommitdiffstats
path: root/src/gui
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-05-24 23:29:42 +0000
committerDavid Robillard <d@drobilla.net>2011-05-24 23:29:42 +0000
commitacaab5ca7ce6869b8192de4f98c9f075fd17690e (patch)
tree731f14aa5cfb03e7f8837fe0c573b2b12ce7a8b4 /src/gui
parent881eac58c2f9bf1fcb18ef7dcda7ab025e327871 (diff)
downloadingen-acaab5ca7ce6869b8192de4f98c9f075fd17690e.tar.gz
ingen-acaab5ca7ce6869b8192de4f98c9f075fd17690e.tar.bz2
ingen-acaab5ca7ce6869b8192de4f98c9f075fd17690e.zip
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
Diffstat (limited to 'src/gui')
-rw-r--r--src/gui/App.cpp5
-rw-r--r--src/gui/App.hpp4
-rw-r--r--src/gui/ConnectWindow.cpp41
3 files changed, 10 insertions, 40 deletions
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index 9d7fffc1..f1e590cb 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -150,8 +150,7 @@ App::run()
}
void
-App::attach(SharedPtr<SigClientInterface> client,
- SharedPtr<Raul::Deletable> handle)
+App::attach(SharedPtr<SigClientInterface> client)
{
assert(!_client);
assert(!_store);
@@ -160,7 +159,6 @@ App::attach(SharedPtr<SigClientInterface> client,
_world->engine()->register_client(client.get());
_client = client;
- _handle = handle;
_store = SharedPtr<ClientStore>(new ClientStore(_world->uris(), _world->engine(), client));
_loader = SharedPtr<ThreadedLoader>(new ThreadedLoader(_world->uris(), _world->engine()));
@@ -182,7 +180,6 @@ App::detach()
_loader.reset();
_store.reset();
_client.reset();
- _handle.reset();
_world->set_engine(SharedPtr<ServerInterface>());
}
}
diff --git a/src/gui/App.hpp b/src/gui/App.hpp
index ca5c590f..96cd0152 100644
--- a/src/gui/App.hpp
+++ b/src/gui/App.hpp
@@ -74,8 +74,7 @@ public:
void error_message(const std::string& msg);
- void attach(SharedPtr<Client::SigClientInterface> client,
- SharedPtr<Raul::Deletable> handle=SharedPtr<Raul::Deletable>());
+ void attach(SharedPtr<Client::SigClientInterface> client);
void detach();
@@ -143,7 +142,6 @@ protected:
static App* _instance;
SharedPtr<Client::SigClientInterface> _client;
- SharedPtr<Raul::Deletable> _handle;
SharedPtr<Client::ClientStore> _store;
SharedPtr<ThreadedLoader> _loader;
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<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024));
- SharedPtr<Raul::Deletable> client;
- string scheme = uri.substr(0, uri.find(":"));
-
-#ifdef HAVE_LIBLO
- if (scheme == "osc.udp" || scheme == "osc.tcp")
- client = SharedPtr<OSCClientReceiver>(new OSCClientReceiver(16181, tsci));
-#endif
-#ifdef HAVE_SOUP
- if (scheme == "http")
- client = SharedPtr<HTTPClientReceiver>(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<ThreadedSigClientInterface> tsci(new ThreadedSigClientInterface(1024));
- SharedPtr<OSCClientReceiver> 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(