From a96166710faf2447ed10194d1829db5564b0dff9 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 4 May 2007 03:59:38 +0000 Subject: Made engine, serialisation, client library, and GUI all dynamically loaded modules. Combined all executables into a single "ingen" program which can do everything. git-svn-id: http://svn.drobilla.net/lad/ingen@493 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/engine/engine.cpp | 54 ++++++++++++++++++++++++++++++++++++++++++---- 1 file changed, 50 insertions(+), 4 deletions(-) (limited to 'src/libs/engine/engine.cpp') diff --git a/src/libs/engine/engine.cpp b/src/libs/engine/engine.cpp index a2ba26da..bb482e47 100644 --- a/src/libs/engine/engine.cpp +++ b/src/libs/engine/engine.cpp @@ -15,28 +15,74 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ +#include #include "engine.h" #include "Engine.h" #include "QueuedEngineInterface.h" #include "tuning.h" +#include "util.h" namespace Ingen { +/* +void +catch_int(int) +{ + signal(SIGINT, catch_int); + signal(SIGTERM, catch_int); + + std::cout << "[Main] Ingen interrupted." << std::endl; + engine->quit(); +} +*/ Engine* new_engine() { + set_denormal_flags(); return new Engine(); } -QueuedEngineInterface* -new_queued_engine_interface(Engine& engine) +bool +launch_osc_engine(int port) { - return new QueuedEngineInterface(engine, - Ingen::event_queue_size, Ingen::event_queue_size); + char port_str[6]; + snprintf(port_str, 6, "%u", port); + const string cmd = string("ingen -e --engine-port=").append(port_str); + + if (Raul::Process::launch(cmd)) { + return true; + //return SharedPtr(new OSCEngineSender( + // string("osc.udp://localhost:").append(port_str))); + } else { + cerr << "Failed to launch engine process." << endl; + //return SharedPtr(); + return false; + } } +/* +void +run(int port) +{ + signal(SIGINT, catch_int); + signal(SIGTERM, catch_int); + + set_denormal_flags(); + + Engine* engine = new_engine(); + + engine->start_jack_driver(); + engine->start_osc_driver(port); + + engine->activate(); + + engine->main(); + + delete engine; +} +*/ } // namespace Ingen -- cgit v1.2.1