From d154ae5b114a6a04acd17a83f6d59caa9ec1005a Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 12 Oct 2008 06:47:11 +0000 Subject: Split OSC/HTTP/JACK dependencies from ingen into separate libraries so engine library doesn't have a link time dependence on liblo/soap/libjack. Preliminary Ingen LV2 code wrapper (not functional yet). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1653 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/ConnectWindow.cpp | 27 ++++++++++++++++++++++++--- src/gui/ConnectWindow.hpp | 1 + 2 files changed, 25 insertions(+), 3 deletions(-) (limited to 'src/gui') diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index bf4d790b..906a16dc 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -28,6 +28,7 @@ #include "engine/tuning.hpp" #include "engine/Engine.hpp" #include "engine/QueuedEngineInterface.hpp" +#include "engine/Driver.hpp" #ifdef HAVE_SOUP #include "client/HTTPClientReceiver.hpp" #endif @@ -217,12 +218,30 @@ ConnectWindow::connect(bool existing) world->local_engine = SharedPtr(_new_engine(world)); } - if ( ! world->engine) - world->engine = world->local_engine->new_queued_interface(); + if ( ! world->engine) { + SharedPtr interface( + new QueuedEngineInterface(*world->local_engine, + Ingen::event_queue_size, Ingen::event_queue_size)); + world->engine = interface; + world->local_engine->set_event_source(interface); + } SharedPtr client(new SigClientInterface()); - world->local_engine->start_jack_driver(); + Ingen::Driver* (*new_driver)( + Ingen::Engine& engine, + std::string server_name, + jack_client_t* jack_client) = NULL; + + if (!world->local_engine->audio_driver()) { + bool found = _engine_jack_module->get_symbol( + "new_jack_audio_driver", (void*&)(new_driver)); + if (found) { + world->local_engine->set_driver(DataType::AUDIO, + SharedPtr(new_driver(*world->local_engine, "default", 0))); + } + } + world->local_engine->activate(1); // FIXME: parallelism App::instance().attach(client); @@ -302,6 +321,8 @@ ConnectWindow::load_widgets() cerr << "Unable to find module entry point, internal engine unavailable." << endl; _engine_module.reset(); } + + _engine_jack_module = Ingen::Shared::load_module("ingen_engine_jack"); server_toggled(); } diff --git a/src/gui/ConnectWindow.hpp b/src/gui/ConnectWindow.hpp index 73cc8c68..1635dbde 100644 --- a/src/gui/ConnectWindow.hpp +++ b/src/gui/ConnectWindow.hpp @@ -83,6 +83,7 @@ private: int _connect_stage; SharedPtr _engine_module; + SharedPtr _engine_jack_module; Ingen::Engine* (*_new_engine)(Ingen::Shared::World* world); Gtk::Image* _icon; -- cgit v1.2.1