From 40ff85e256ca9094fb75cdcbabd3442339f91ecd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 2 May 2007 23:58:28 +0000 Subject: 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 --- src/progs/ingenuity/ThreadedLoader.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src/progs/ingenuity/ThreadedLoader.cpp') diff --git a/src/progs/ingenuity/ThreadedLoader.cpp b/src/progs/ingenuity/ThreadedLoader.cpp index bf195dce..43bc76c8 100644 --- a/src/progs/ingenuity/ThreadedLoader.cpp +++ b/src/progs/ingenuity/ThreadedLoader.cpp @@ -15,24 +15,38 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "ThreadedLoader.h" #include #include #include -#include "PatchModel.h" +#include "client/PatchModel.h" +#include "module/Module.h" #include "App.h" +#include "ThreadedLoader.h" using std::cout; using std::endl; namespace Ingenuity { -ThreadedLoader::ThreadedLoader(SharedPtr engine) - : _engine(engine) +ThreadedLoader::ThreadedLoader(SharedPtr engine) + : _serialisation_module(Ingen::Shared::load_module("ingen_serialisation")) + , _engine(engine) , _deprecated_loader(engine) , _serializer(*App::instance().rdf_world()) { // FIXME: rework this so the thread is only present when it's doing something (save mem) - start(); + if (_serialisation_module) { + Loader* (*new_loader)() = NULL; + bool found = _serialisation_module->get_symbol("new_loader", (void*&)new_loader); + if (found) + _loader = SharedPtr(new_loader()); + } + + if (_loader) { + start(); + } else { + cerr << "WARNING: Failed to load ingen_serialisation module, unable to load patches." << endl;; + cerr << "If you are running from the source tree, run ingenuity_dev." << endl; + } } @@ -78,7 +92,7 @@ ThreadedLoader::load_patch(bool merge, false))); } else { _events.push_back(sigc::hide_return(sigc::bind( - sigc::ptr_fun(&Ingen::Serialisation::load), + sigc::mem_fun(_loader.get(), &Ingen::Serialisation::Loader::load), App::instance().engine(), App::instance().rdf_world(), data_base_uri, -- cgit v1.2.1