From ec9540a559c40046123a2ac4be83faf90b79fbb0 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 8 Oct 2007 17:13:34 +0000 Subject: Dynamically load Serialiser from serialisation module, make it actually work, etc. git-svn-id: http://svn.drobilla.net/lad/ingen@850 a436a847-0d15-0410-975c-d299462d15a1 --- src/libs/gui/ThreadedLoader.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'src/libs/gui/ThreadedLoader.cpp') diff --git a/src/libs/gui/ThreadedLoader.cpp b/src/libs/gui/ThreadedLoader.cpp index a1c28acf..11a2bcd7 100644 --- a/src/libs/gui/ThreadedLoader.cpp +++ b/src/libs/gui/ThreadedLoader.cpp @@ -29,17 +29,18 @@ namespace GUI { ThreadedLoader::ThreadedLoader(SharedPtr engine) - : _serialisation_module(Ingen::Shared::load_module("ingen_serialisation")) - , _engine(engine) + : _engine(engine) , _deprecated_loader(engine) - , _serializer(*App::instance().world()->rdf_world) { set_name("Loader"); // FIXME: rework this so the thread is only present when it's doing something (save mem) - if (_serialisation_module) { + if (App::instance().serialisation_module()) { Loader* (*new_loader)() = NULL; - bool found = _serialisation_module->get_symbol("new_loader", (void*&)new_loader); + + bool found = App::instance().serialisation_module()->get_symbol( + "new_loader", (void*&)new_loader); + if (found) _loader = SharedPtr(new_loader()); } @@ -47,8 +48,8 @@ ThreadedLoader::ThreadedLoader(SharedPtr engine) 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; + cerr << "WARNING: Failed to load ingen_serialisation module, load disabled." << endl; + cerr << "(If you are running from the source tree, source set_dev_environment.sh)" << endl; } } @@ -126,7 +127,7 @@ ThreadedLoader::save_patch(SharedPtr model, const string& filename) void ThreadedLoader::save_patch_event(SharedPtr model, const string& filename) { - _serializer.to_file(model, filename); + App::instance().serialiser()->to_file(model, filename); } -- cgit v1.2.1