summaryrefslogtreecommitdiffstats
path: root/src/gui/ingen_gui.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2018-01-21 00:41:34 +0100
committerDavid Robillard <d@drobilla.net>2018-01-21 01:05:26 +0100
commitee32624cd2b473e299e822ed10b58ca408698e4b (patch)
treef922c16385018df140c34a4280315357ed9f06b8 /src/gui/ingen_gui.cpp
parentd356d1854a01a09bda32185647a8bd01b09df3d3 (diff)
downloadingen-ee32624cd2b473e299e822ed10b58ca408698e4b.tar.gz
ingen-ee32624cd2b473e299e822ed10b58ca408698e4b.tar.bz2
ingen-ee32624cd2b473e299e822ed10b58ca408698e4b.zip
Remove glib dependency from engine and core library
Diffstat (limited to 'src/gui/ingen_gui.cpp')
-rw-r--r--src/gui/ingen_gui.cpp19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gui/ingen_gui.cpp b/src/gui/ingen_gui.cpp
index 097de5cf..83e41a7e 100644
--- a/src/gui/ingen_gui.cpp
+++ b/src/gui/ingen_gui.cpp
@@ -1,6 +1,6 @@
/*
This file is part of Ingen.
- Copyright 2007-2015 David Robillard <http://drobilla.net/>
+ Copyright 2007-2018 David Robillard <http://drobilla.net/>
Ingen is free software: you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License as published by the Free
@@ -14,7 +14,10 @@
along with Ingen. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "ingen/Configuration.hpp"
#include "ingen/Module.hpp"
+#include "ingen/client/ThreadedSigClientInterface.hpp"
+
#include "App.hpp"
namespace Ingen {
@@ -22,8 +25,22 @@ namespace GUI {
struct GUIModule : public Module {
void load(World* world) {
+ using Client::SigClientInterface;
+ using Client::ThreadedSigClientInterface;
+
+ std::string uri = world->conf().option("connect").ptr<char>();
+ if (!world->interface()) {
+ SPtr<SigClientInterface> client(new ThreadedSigClientInterface());
+ world->set_interface(world->new_interface(URI(uri), client));
+ } else if (!dynamic_ptr_cast<Client::SigClientInterface>(
+ world->interface()->respondee())) {
+ SPtr<SigClientInterface> client(new ThreadedSigClientInterface());
+ world->interface()->set_respondee(client);
+ }
+
app = GUI::App::create(world);
}
+
void run(World* world) {
app->run();
}