diff options
-rw-r--r-- | src/libs/engine/Engine.cpp | 12 | ||||
-rw-r--r-- | src/progs/ingen/main.cpp | 18 |
2 files changed, 10 insertions, 20 deletions
diff --git a/src/libs/engine/Engine.cpp b/src/libs/engine/Engine.cpp index 6b98566d..f0950844 100644 --- a/src/libs/engine/Engine.cpp +++ b/src/libs/engine/Engine.cpp @@ -166,11 +166,13 @@ Engine::start_jack_driver() void Engine::start_osc_driver(int port) { - if ( ! _event_source) - _event_source = SharedPtr<EventSource>(new OSCEngineReceiver( - *this, pre_processor_queue_size, port)); - else - cerr << "[Engine::start_osc_driver] Event source already running" << endl; + if (_event_source) { + cerr << "WARNING: Replacing event source" << endl; + _event_source.reset(); + } + + _event_source = SharedPtr<EventSource>(new OSCEngineReceiver( + *this, pre_processor_queue_size, port)); } diff --git a/src/progs/ingen/main.cpp b/src/progs/ingen/main.cpp index 23609ee2..483fe7ef 100644 --- a/src/progs/ingen/main.cpp +++ b/src/progs/ingen/main.cpp @@ -104,7 +104,7 @@ main(int argc, char** argv) engine = SharedPtr<Engine>(new_engine(world)); world->local_engine = engine; /* Load queued (direct in-process) engine interface */ - if (!args.connect_given) { + if (!args.connect_given && args.gui_given) { engine_interface = engine->new_queued_interface(); world->engine = engine_interface; } @@ -116,8 +116,6 @@ main(int argc, char** argv) } } - bool use_osc = false; - /* Load client library */ if (args.connect_given || args.load_given) { client_module = Ingen::Shared::load_module("ingen_client"); @@ -126,16 +124,11 @@ main(int argc, char** argv) } /* Connect to remote engine */ - if (args.connect_given || (args.load_given && !engine_interface)) { + if (client_module && (args.connect_given || (args.load_given && !engine_interface))) { SharedPtr<Shared::EngineInterface> (*new_osc_interface)(const std::string&) = NULL; - bool found = false; - if (client_module) - found = client_module->get_symbol("new_osc_interface", (void*&)new_osc_interface); - - if (client_module && found) { + if (client_module->get_symbol("new_osc_interface", (void*&)new_osc_interface)) { engine_interface = new_osc_interface(args.connect_arg); - use_osc = true; } else { cerr << "Unable to load ingen_client module, aborting." << endl; return -1; @@ -144,12 +137,7 @@ main(int argc, char** argv) if (engine && engine_interface) { - - if (use_osc) - engine->start_osc_driver(args.engine_port_arg); - engine->start_jack_driver(); - engine->activate(args.parallelism_arg); } |