From 75911e8ae28f011727ce303961a1adb56643689d Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 25 Jul 2007 06:07:42 +0000 Subject: Fix running with ingen -eg. Start basic framework of an Ingen "Core" system/library (in module library for now). git-svn-id: http://svn.drobilla.net/lad/ingen@624 a436a847-0d15-0410-975c-d299462d15a1 --- src/progs/ingen/Makefile.am | 4 ++-- src/progs/ingen/main.cpp | 36 +++++++++++++----------------------- 2 files changed, 15 insertions(+), 25 deletions(-) (limited to 'src/progs') diff --git a/src/progs/ingen/Makefile.am b/src/progs/ingen/Makefile.am index 7f84191e..9226d6aa 100644 --- a/src/progs/ingen/Makefile.am +++ b/src/progs/ingen/Makefile.am @@ -1,4 +1,4 @@ -AM_CXXFLAGS = -I$(top_srcdir)/raul -I$(top_srcdir)/ingen/src/common -I$(top_srcdir)/ingen/src/libs -DINGEN_MODULE_DIR=\"$(libdir)/ingen\" @GTHREAD_CFLAGS@ @GLIBMM_CFLAGS@ +AM_CXXFLAGS = -I$(top_srcdir)/slv2 -I$(top_srcdir)/raul -I$(top_srcdir)/ingen/src/common -I$(top_srcdir)/ingen/src/libs -DINGEN_MODULE_DIR=\"$(libdir)/ingen\" @GTHREAD_CFLAGS@ @GLIBMM_CFLAGS@ MAINTAINERCLEANFILES = Makefile.in @@ -6,7 +6,7 @@ desktopfilesdir = $(datadir)/applications dist_desktopfiles_DATA = ingen.desktop bin_PROGRAMS = ingen -ingen_LDADD = @RAUL_LIBS@ @GTHREAD_LIBS@ @GLIBMM_LIBS@ ../../libs/module/libingen_module.la +ingen_LDADD = @SLV2_LIBS@ @RAUL_LIBS@ @GTHREAD_LIBS@ @GLIBMM_LIBS@ ../../libs/module/libingen_module.la ingen_DEPENDENCIES = ../../libs/module/libingen_module.la ingen_SOURCES = \ diff --git a/src/progs/ingen/main.cpp b/src/progs/ingen/main.cpp index 68c0abdc..5f4070b9 100644 --- a/src/progs/ingen/main.cpp +++ b/src/progs/ingen/main.cpp @@ -27,7 +27,7 @@ #include #include #include -#include "module/Module.hpp" +#include "module/module.h" #include "engine/Engine.hpp" #include "engine/QueuedEngineInterface.hpp" #include "serialisation/Loader.hpp" @@ -75,32 +75,20 @@ main(int argc, char** argv) Glib::thread_init(); + Ingen::Shared::World* world = Ingen::Shared::get_world(); + /* Run engine */ if (args.engine_flag) { engine_module = Ingen::Shared::load_module("ingen_engine"); if (engine_module) { - /*if (args.engine_port_given) { - bool (*launch_engine)(int) = NULL; - if ( ! module->get_symbol("launch_osc_engine", (void*&)launch_engine)) - module.reset(); - else - launch_engine(args.engine_port_arg); - - } else if (args.gui_given || args.load_given) {*/ - Engine* (*new_engine)() = NULL; - if (engine_module->get_symbol("new_engine", (void*&)new_engine)) { - engine = SharedPtr(new_engine()); - //engine->start_jack_driver(); - //engine->start_osc_driver(args.engine_port_arg); - } else { - engine_module.reset(); - } - - /*} else { - cerr << "Nonsense command line parameters, engine not loaded." << endl; - }*/ + Engine* (*new_engine)(Ingen::Shared::World* world) = NULL; + if (engine_module->get_symbol("new_engine", (void*&)new_engine)) { + engine = SharedPtr(new_engine(world)); + } else { + engine_module.reset(); + } } else { cerr << "Unable to load engine module, engine not loaded." << endl; cerr << "Try using src/set_dev_environment.sh, or setting INGEN_MODULE_PATH." << endl; @@ -194,12 +182,12 @@ main(int argc, char** argv) bool ran_gui = false; if (args.gui_given) { gui_module = Ingen::Shared::load_module("ingen_gui"); - void (*run)(int, char**, SharedPtr, SharedPtr) = NULL; + void (*run)(int, char**, Ingen::Shared::World*, SharedPtr, SharedPtr) = NULL; bool found = gui_module->get_symbol("run", (void*&)run); if (found) { ran_gui = true; - run(argc, argv, engine, engine_interface); + run(argc, argv, world, engine, engine_interface); } else { cerr << "Unable to find GUI module, GUI not loaded." << endl; cerr << "Try using src/set_dev_environment.sh, or setting INGEN_MODULE_PATH." << endl; @@ -224,6 +212,8 @@ main(int argc, char** argv) engine.reset(); } + Ingen::Shared::destroy_world(); + return 0; } -- cgit v1.2.1