diff options
author | David Robillard <d@drobilla.net> | 2007-05-02 23:58:28 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2007-05-02 23:58:28 +0000 |
commit | 40ff85e256ca9094fb75cdcbabd3442339f91ecd (patch) | |
tree | bc2c23a9802110f14836fc87413e08be1b7b7266 /src/progs/server/main.cpp | |
parent | 10e23868c8199335ebd360afb62911174075658c (diff) | |
download | ingen-40ff85e256ca9094fb75cdcbabd3442339f91ecd.tar.gz ingen-40ff85e256ca9094fb75cdcbabd3442339f91ecd.tar.bz2 ingen-40ff85e256ca9094fb75cdcbabd3442339f91ecd.zip |
Added svn:ignore property to everything.
Made engine and patch loader separate dynamically loaded modules.
No more monolithic ingenuity (module loaded at runtime).
git-svn-id: http://svn.drobilla.net/lad/ingen@491 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/progs/server/main.cpp')
-rw-r--r-- | src/progs/server/main.cpp | 41 |
1 files changed, 25 insertions, 16 deletions
diff --git a/src/progs/server/main.cpp b/src/progs/server/main.cpp index ea9b37d8..e92b635f 100644 --- a/src/progs/server/main.cpp +++ b/src/progs/server/main.cpp @@ -19,19 +19,18 @@ #include <cstddef> #include <signal.h> #include "config.h" -#include "util.h" -#include "cmdline.h" -#include "tuning.h" -#include "Engine.h" -#include "JackAudioDriver.h" -#include "OSCEngineReceiver.h" +#include "module/Module.h" +#include "engine/util.h" +#include "engine/Engine.h" +#include "engine/EventSource.h" #ifdef HAVE_LASH -#include "LashDriver.h" +#include "engine/LashDriver.h" #endif #ifdef BUILD_IN_PROCESS_ENGINE #include <jack/jack.h> #include <jack/intclient.h> #endif +#include "cmdline.h" using std::cout; using std::endl; using std::cerr; using namespace Ingen; @@ -139,18 +138,28 @@ main(int argc, char** argv) set_denormal_flags(); - engine = SharedPtr<Engine>(new Engine()); + SharedPtr<Glib::Module> module = Ingen::Shared::load_module("ingen_engine"); + + if (!module) { + cerr << "Aborting. If you are running from the source tree, run ingen_dev." << endl; + return -1; + } - std::string jack_name - = (args_info.jack_server_given) ? args_info.jack_server_arg : ""; + Engine* (*new_engine)() = NULL; + + bool found = module->get_symbol("new_engine", (void*&)new_engine); + + if (!found) { + cerr << "Unable to find module entry point, exiting." << endl; + return -1; + } - SharedPtr<AudioDriver> audio_driver( - new JackAudioDriver(*engine.get(), jack_name) ); + SharedPtr<Engine> engine(new_engine()); - SharedPtr<EventSource> event_source(new OSCEngineReceiver( - engine, pre_processor_queue_size, args_info.port_arg )); + engine->start_jack_driver(); + engine->start_osc_driver(args_info.port_arg); - engine->activate(audio_driver, event_source); + engine->activate(); #ifdef HAVE_LASH lash_driver = new LashDriver(engine, lash_args); @@ -158,7 +167,7 @@ main(int argc, char** argv) engine->main(); - event_source->deactivate(); + engine->event_source()->deactivate(); #ifdef HAVE_LASH delete lash_driver; |