aboutsummaryrefslogtreecommitdiffstats
path: root/src
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
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')
-rw-r--r--src/gui/ingen_gui.cpp19
-rw-r--r--src/gui/wscript4
-rw-r--r--src/ingen/ingen.cpp38
-rw-r--r--src/server/wscript2
-rw-r--r--src/wscript2
5 files changed, 44 insertions, 21 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();
}
diff --git a/src/gui/wscript b/src/gui/wscript
index 3c804d05..160afc03 100644
--- a/src/gui/wscript
+++ b/src/gui/wscript
@@ -9,6 +9,10 @@ def options(ctx):
help='use light coloured theme')
def configure(conf):
+ autowaf.check_pkg(conf, 'glibmm-2.4', uselib_store='GLIBMM',
+ atleast_version='2.14.0', mandatory=False)
+ autowaf.check_pkg(conf, 'gthread-2.0', uselib_store='GTHREAD',
+ atleast_version='2.14.0', mandatory=False)
autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='GTKMM',
atleast_version='2.12.0', mandatory=False)
autowaf.check_pkg(conf, 'gtkmm-2.4', uselib_store='NEW_GTKMM',
diff --git a/src/ingen/ingen.cpp b/src/ingen/ingen.cpp
index dfad1bb1..d812d862 100644
--- a/src/ingen/ingen.cpp
+++ b/src/ingen/ingen.cpp
@@ -22,8 +22,6 @@
#include <memory>
#include <string>
-#include <glibmm/thread.h>
-
#include "raul/Path.hpp"
#include "ingen_config.h"
@@ -34,7 +32,6 @@
#include "ingen/Log.hpp"
#include "ingen/Parser.hpp"
#include "ingen/World.hpp"
-#include "ingen/client/ThreadedSigClientInterface.hpp"
#include "ingen/paths.hpp"
#include "ingen/runtime_paths.hpp"
#include "ingen/types.hpp"
@@ -45,6 +42,12 @@
using namespace std;
using namespace Ingen;
+class DummyInterface : public Interface
+{
+ URI uri() const override { return URI("ingen:dummy"); }
+ void message(const Message& msg) override {}
+};
+
unique_ptr<Ingen::World> world;
static void
@@ -111,7 +114,6 @@ main(int argc, char** argv)
}
// Run engine
- SPtr<Interface> engine_interface;
if (conf.option("engine").get<int32_t>()) {
if (world->conf().option("threads").get<int32_t>() < 1) {
cerr << "ingen: error: threads must be > 0" << endl;
@@ -122,33 +124,33 @@ main(int argc, char** argv)
ingen_try(bool(world->engine()), "Unable to create engine");
world->engine()->listen();
-
- engine_interface = world->interface();
}
- // If we don't have a local engine interface (for GUI), use network
- if (!engine_interface) {
- ingen_try(world->load_module("client"), "Failed to load client module");
#ifdef HAVE_SOCKET
- Client::SocketClient::register_factories(world.get());
+ Client::SocketClient::register_factories(world.get());
#endif
+
+ // Load GUI if requested
+ if (conf.option("gui").get<int32_t>()) {
+ ingen_try(world->load_module("client"), "Failed to load client module");
+ ingen_try(world->load_module("gui"), "Failed to load GUI module");
+ }
+
+ // If we don't have a local engine interface (from the GUI), use network
+ SPtr<Interface> engine_interface(world->interface());
+ SPtr<Interface> dummy_client(new DummyInterface());
+ if (!engine_interface) {
const char* const uri = conf.option("connect").ptr<char>();
ingen_try(URI::is_valid(uri),
(fmt("Invalid URI <%1%>") % uri).str().c_str());
- SPtr<Interface> client(new Client::ThreadedSigClientInterface());
- engine_interface = world->new_interface(URI(uri), client);
+ engine_interface = world->new_interface(URI(uri), dummy_client);
if (!engine_interface && !conf.option("gui").get<int32_t>()) {
cerr << (fmt("ingen: error: Failed to connect to `%1%'\n") % uri);
return EXIT_FAILURE;
}
- }
- world->set_interface(engine_interface);
-
- // Load GUI if requested
- if (conf.option("gui").get<int32_t>()) {
- ingen_try(world->load_module("gui"), "Failed to load GUI module");
+ world->set_interface(engine_interface);
}
// Activate the engine, if we have one
diff --git a/src/server/wscript b/src/server/wscript
index c19168f2..8d1ec90d 100644
--- a/src/server/wscript
+++ b/src/server/wscript
@@ -63,7 +63,7 @@ def build(bld):
use = 'libingen libingen_socket',
cxxflags = bld.env.PTHREAD_CFLAGS + bld.env.INGEN_TEST_CXXFLAGS,
linkflags = bld.env.PTHREAD_LINKFLAGS + bld.env.INGEN_TEST_LINKFLAGS)
- core_libs = 'GLIBMM LV2 LILV RAUL SERD SORD'
+ core_libs = 'LV2 LILV RAUL SERD SORD'
autowaf.use_lib(bld, obj, core_libs)
if bld.env.HAVE_JACK:
diff --git a/src/wscript b/src/wscript
index 2fe39652..07379b83 100644
--- a/src/wscript
+++ b/src/wscript
@@ -43,4 +43,4 @@ def build(bld):
lib = lib,
cxxflags = bld.env.PTHREAD_CFLAGS + bld.env.INGEN_TEST_CXXFLAGS,
linkflags = bld.env.PTHREAD_LINKFLAGS + bld.env.INGEN_TEST_LINKFLAGS)
- autowaf.use_lib(bld, obj, 'GLIBMM LV2 LILV RAUL SERD SORD SRATOM')
+ autowaf.use_lib(bld, obj, 'LV2 LILV RAUL SERD SORD SRATOM')