summaryrefslogtreecommitdiffstats
path: root/src/gui/ingen_gui.cpp
diff options
context:
space:
mode:
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();
}