From 5353b8c88e3c82812e41e3411d1085e0dd481a1b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sun, 19 Oct 2008 21:36:38 +0000 Subject: Make ingen actually run again :) git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@1688 a436a847-0d15-0410-975c-d299462d15a1 --- src/engine/AudioBuffer.cpp | 3 ++- src/engine/EventBuffer.cpp | 5 +++-- src/engine/JackAudioDriver.cpp | 13 ++++++++----- src/engine/JackAudioDriver.hpp | 2 +- src/engine/wscript | 4 ---- src/gui/ConnectWindow.cpp | 9 +++++---- src/gui/GladeFactory.cpp | 1 + src/gui/wscript | 5 ++--- src/ingen/main.cpp | 13 ++++++++----- src/module/Module.cpp | 2 -- 10 files changed, 30 insertions(+), 27 deletions(-) (limited to 'src') diff --git a/src/engine/AudioBuffer.cpp b/src/engine/AudioBuffer.cpp index 5eb89855..c79d6f61 100644 --- a/src/engine/AudioBuffer.cpp +++ b/src/engine/AudioBuffer.cpp @@ -19,6 +19,7 @@ #include #include #include "AudioBuffer.hpp" +//#include "config.h" using namespace std; @@ -51,7 +52,7 @@ AudioBuffer::alloc_local_data(size_t size) const int ret = posix_memalign((void**)&_local_data, 16, size * sizeof(Sample)); #else _local_data = (Sample*)malloc(size * sizeof(Sample)); - int ret = (_local_data != NULL); + int ret = (_local_data != NULL) ? 0 : -1; #endif if (ret != 0) { cerr << "[Buffer] Failed to allocate buffer. Aborting." << endl; diff --git a/src/engine/EventBuffer.cpp b/src/engine/EventBuffer.cpp index 45ef47f0..4d499496 100644 --- a/src/engine/EventBuffer.cpp +++ b/src/engine/EventBuffer.cpp @@ -21,6 +21,7 @@ #include "EventBuffer.hpp" #include "lv2ext/lv2_event.h" #include "lv2ext/lv2_event_helpers.h" +//#include "config.h" using namespace std; @@ -44,10 +45,10 @@ EventBuffer::EventBuffer(size_t capacity) int ret = posix_memalign((void**)&_local_buf, 16, sizeof(LV2_Event_Buffer) + capacity); #else _local_buf = (LV2_Event_Buffer*)malloc(sizeof(LV2_Event_Buffer) + capacity); - int ret = (_local_buf == NULL); + int ret = (_local_buf != NULL) ? 0 : -1; #endif - if (ret) { + if (ret != 0) { cerr << "Failed to allocate event buffer. Aborting." << endl; exit(EXIT_FAILURE); } diff --git a/src/engine/JackAudioDriver.cpp b/src/engine/JackAudioDriver.cpp index 14b1f11d..23577e33 100644 --- a/src/engine/JackAudioDriver.cpp +++ b/src/engine/JackAudioDriver.cpp @@ -387,13 +387,16 @@ JackAudioDriver::_buffer_size_cb(jack_nframes_t nframes) } // namespace Ingen +extern "C" { + Ingen::JackAudioDriver* new_jack_audio_driver( - Ingen::Engine& engine, - std::string server_name, - std::string client_name, - jack_client_t* jack_client) + Ingen::Engine& engine, + const std::string server_name, + const std::string client_name, + void* jack_client) { - return new Ingen::JackAudioDriver(engine, server_name, client_name, jack_client); + return new Ingen::JackAudioDriver(engine, server_name, client_name, (jack_client_t*)jack_client); } +} diff --git a/src/engine/JackAudioDriver.hpp b/src/engine/JackAudioDriver.hpp index a0d81705..dc3f15df 100644 --- a/src/engine/JackAudioDriver.hpp +++ b/src/engine/JackAudioDriver.hpp @@ -189,7 +189,7 @@ extern "C" { Ingen::Engine& engine, std::string server_name = "", std::string client_name = "", - jack_client_t* jack_client = 0); + void* jack_client = 0); } #endif // JACKAUDIODRIVER_H diff --git a/src/engine/wscript b/src/engine/wscript index 6d62a976..1b677d3e 100644 --- a/src/engine/wscript +++ b/src/engine/wscript @@ -97,7 +97,6 @@ def build(bld): obj.name = 'libingen_engine_http' obj.target = 'ingen_engine_http' obj.inst_dir = 'lib/ingen' - obj.uselib_local = 'libingen_engine' autowaf.use_lib(bld, obj, core_libs + ' SOUP') if bld.env()['HAVE_LIBLO'] == 1: @@ -107,7 +106,6 @@ def build(bld): obj.name = 'libingen_engine_osc' obj.target = 'ingen_engine_osc' obj.inst_dir = 'lib/ingen' - obj.uselib_local = 'libingen_engine' autowaf.use_lib(bld, obj, core_libs + ' LIBLO') if bld.env()['HAVE_JACK'] == 1: @@ -117,7 +115,6 @@ def build(bld): obj.name = 'libingen_engine_jack' obj.target = 'ingen_engine_jack' obj.inst_dir = 'lib/ingen' - obj.uselib_local = 'libingen_engine' autowaf.use_lib(bld, obj, core_libs + ' JACK') # Lightweight ingen/lv2 wrapper @@ -132,7 +129,6 @@ def build(bld): obj.target = 'ingen.lv2/ingen_lv2' #obj.inst_dir = 'lib/lv2/ingen.lv2' obj.inst_var = 0 - obj.uselib_local = 'libingen_engine' core_libs = 'GLIBMM GTHREAD LV2CORE SLV2 RAUL REDLANDMM' autowaf.use_lib(bld, obj, core_libs) diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index 41d26f5b..e52e83ac 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -229,16 +229,17 @@ ConnectWindow::connect(bool existing) SharedPtr client(new SigClientInterface()); Ingen::Driver* (*new_driver)( - Ingen::Engine& engine, - std::string server_name, - jack_client_t* jack_client) = NULL; + Ingen::Engine& engine, + const std::string server_name, + const std::string client_name, + void* 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))); + SharedPtr(new_driver(*world->local_engine, "default", "", 0))); } } diff --git a/src/gui/GladeFactory.cpp b/src/gui/GladeFactory.cpp index 2b4d3ec9..81640d57 100644 --- a/src/gui/GladeFactory.cpp +++ b/src/gui/GladeFactory.cpp @@ -18,6 +18,7 @@ #include "GladeFactory.hpp" #include #include +#include "config.h" using namespace std; diff --git a/src/gui/wscript b/src/gui/wscript index 860a21a0..c8615198 100644 --- a/src/gui/wscript +++ b/src/gui/wscript @@ -43,7 +43,6 @@ def build(bld): obj.source += 'UploadPatchWindow.cpp' obj.includes = ['.', '..', '../common'] - obj.defines = 'INGEN_DATA_DIR=\\\"' + Params.g_options.datadir + '\\\"' obj.name = 'libingen_gui' obj.target = 'ingen_gui' obj.inst_dir = 'lib/ingen' @@ -65,7 +64,7 @@ def build(bld): ''') # GUI runtime files - install_files(Params.g_options.datadir, '', 'ingen_gui.glade') - install_files(Params.g_options.datadir, '', 'ingen.svg') + install_files(bld.env()['DATADIR'], 'ingen', 'ingen_gui.glade') + install_files(bld.env()['DATADIR'], 'ingen', 'ingen.svg') diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index e6f9a4ce..2f729ab9 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -192,13 +192,16 @@ main(int argc, char** argv) /* Activate the engine, if we have one */ if (engine) { Ingen::JackAudioDriver* (*new_driver)( - Ingen::Engine& engine, - std::string server_name, - std::string client_name, - jack_client_t* jack_client) = NULL; - if (engine_jack_module->get_symbol("new_jack_audio_driver", (void*&)new_driver)) + Ingen::Engine& engine, + const std::string server_name, + const std::string client_name, + void* jack_client) = NULL; + if (engine_jack_module->get_symbol("new_jack_audio_driver", (void*&)new_driver)) { engine->set_driver(DataType::AUDIO, SharedPtr(new_driver( *engine, "default", args.jack_name_arg, NULL))); + } else { + cerr << Glib::Module::get_last_error() << endl; + } engine->activate(args.parallelism_arg); } diff --git a/src/module/Module.cpp b/src/module/Module.cpp index 02808206..16aecb66 100644 --- a/src/module/Module.cpp +++ b/src/module/Module.cpp @@ -53,11 +53,9 @@ load_module(const string& name) string dir; istringstream iss(module_path); while (getline(iss, dir, ':')) { - string filename = Glib::Module::build_path(dir, name); if (Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) { module = new Glib::Module(filename, Glib::MODULE_BIND_LAZY); - if (*module) { cerr << "Loaded module \"" << name << "\" from " << filename << endl; return SharedPtr(module); -- cgit v1.2.1