From 19045ab92aa7e996971584a0dc8780d1d58b498b Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 19 Dec 2009 21:37:50 +0000 Subject: New ingen module (library, not e.g. LV2 plugin) design. Much cleaner interface and general usage of Ingen as a library. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2314 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/ThreadedLoader.cpp | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) (limited to 'src/gui/ThreadedLoader.cpp') diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp index 1a2a209e..ae5c995f 100644 --- a/src/gui/ThreadedLoader.cpp +++ b/src/gui/ThreadedLoader.cpp @@ -19,6 +19,7 @@ #include #include "module/World.hpp" #include "module/Module.hpp" +#include "module/ingen_module.hpp" #include "App.hpp" #include "ThreadedLoader.hpp" #include "client/PatchModel.hpp" @@ -46,24 +47,12 @@ ThreadedLoader::ThreadedLoader(SharedPtr engine) SharedPtr ThreadedLoader::parser() { - if (_parser) - return _parser; + Ingen::Shared::World* world = ingen_get_world(); - World* world = App::instance().world(); - if (!world->serialisation_module) - world->serialisation_module = Ingen::Shared::load_module("ingen_serialisation"); + if (!world->parser) + world->load("ingen_serialisation"); - if (world->serialisation_module) { - Parser* (*new_parser)() = NULL; - - bool found = App::instance().world()->serialisation_module->get_symbol( - "new_parser", (void*&)new_parser); - - if (found) - _parser = SharedPtr(new_parser()); - } - - return _parser; + return world->parser; } @@ -90,6 +79,8 @@ ThreadedLoader::load_patch(bool merge, { _mutex.lock(); + Ingen::Shared::World* world = ingen_get_world(); + Glib::ustring engine_base = ""; if (engine_parent) { if (merge) @@ -110,7 +101,7 @@ ThreadedLoader::load_patch(bool merge, false))); } else { _events.push_back(sigc::hide_return(sigc::bind( - sigc::mem_fun(_parser.get(), &Ingen::Serialisation::Parser::parse_document), + sigc::mem_fun(world->parser.get(), &Ingen::Serialisation::Parser::parse_document), App::instance().world(), App::instance().world()->engine.get(), document_uri, -- cgit v1.2.1