diff options
author | David Robillard <d@drobilla.net> | 2008-11-27 01:45:38 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2008-11-27 01:45:38 +0000 |
commit | ca3bd4c24b7db71b774a560dc4089321d74fee4d (patch) | |
tree | e333db8312819e9077c8b81ffbbf4a101f2d32b9 /src/ingen | |
parent | 9b9a6c9e3eb8da7eb1decd963a6c2f0e69b57ed4 (diff) | |
download | ingen-ca3bd4c24b7db71b774a560dc4089321d74fee4d.tar.gz ingen-ca3bd4c24b7db71b774a560dc4089321d74fee4d.tar.bz2 ingen-ca3bd4c24b7db71b774a560dc4089321d74fee4d.zip |
Fix orphan etc. errors for 'ingen -egl' (fix ticket #201).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1784 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/ingen')
-rw-r--r-- | src/ingen/main.cpp | 39 |
1 files changed, 22 insertions, 17 deletions
diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index 176bba29..3917f008 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -220,6 +220,24 @@ main(int argc, char** argv) } world->engine = engine_interface; + + void (*gui_run)() = NULL; + + /* Load GUI */ + bool run_gui = false; + if (args.gui_given) { + gui_module = Ingen::Shared::load_module("ingen_gui"); + void (*init)(int, char**, Ingen::Shared::World*); + + bool found = gui_module->get_symbol("init", (void*&)init); + found = found && gui_module->get_symbol("run", (void*&)gui_run); + if (found) { + run_gui = true; + init(argc, argv, world); + } else { + cerr << "Unable to find hooks in GUI module, GUI not loaded." << endl; + } + } /* Load a patch */ if (args.load_given && engine_interface) { @@ -250,7 +268,6 @@ main(int argc, char** argv) Glib::get_current_dir(), args.load_arg)); } - engine_interface->load_plugins(); parser->parse_document(world, engine_interface.get(), uri, engine_base, uri); @@ -260,21 +277,9 @@ main(int argc, char** argv) } } - - /* Run GUI */ - bool ran_gui = false; - if (args.gui_given) { - gui_module = Ingen::Shared::load_module("ingen_gui"); - void (*run)(int, char**, Ingen::Shared::World*); - bool found = gui_module->get_symbol("run", (void*&)run); - - if (found) { - ran_gui = true; - run(argc, argv, world); - } else { - cerr << "Unable to find GUI module, GUI not loaded." << endl; - } - } + /* Run GUI (if applicable) */ + if (run_gui) + gui_run(); /* Run a script */ if (args.run_given) { @@ -298,7 +303,7 @@ main(int argc, char** argv) #endif /* Listen to OSC and do our own main thing. */ - } else if (engine && !ran_gui) { + } else if (engine && !run_gui) { signal(SIGINT, catch_int); signal(SIGTERM, catch_int); engine->main(); |