From a854ac939a20b12932384c3074c9ce85df0b39bd Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 22 Dec 2009 16:34:14 +0000 Subject: Fix compilation. Consistent naming of module source files. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2315 a436a847-0d15-0410-975c-d299462d15a1 --- src/module/World.cpp | 7 +++++++ src/module/World.hpp | 17 +++++++++-------- 2 files changed, 16 insertions(+), 8 deletions(-) (limited to 'src/module') diff --git a/src/module/World.cpp b/src/module/World.cpp index 0bc87459..c4b1a88e 100644 --- a/src/module/World.cpp +++ b/src/module/World.cpp @@ -141,6 +141,13 @@ World::run(const std::string& mime_type, const std::string& filename) return i->second(this, filename.c_str()); } +void +World::add_interface_factory(const std::string& scheme, InterfaceFactory factory) +{ + interface_factories.insert(make_pair(scheme, factory)); +} + + } // namespace Shared } // namespace Ingen diff --git a/src/module/World.hpp b/src/module/World.hpp index e12ce5b2..59500c3e 100644 --- a/src/module/World.hpp +++ b/src/module/World.hpp @@ -44,13 +44,12 @@ class LV2Features; /** The "world" all Ingen modules may share. * - * This is required for shared access to things like Redland, so locking can - * take place centrally and the engine/gui using the same library won't - * explode horribly. + * All loaded components of Ingen, as well as things requiring shared access + * and/or locking (e.g. Redland, SLV2). * - * Hopefully at some point in the future it can allow some fun things like - * scripting bindings that play with all loaded components of - * The Ingen System(TM) and whatnot. + * Ingen modules are shared libraries which modify the World when loaded + * using World::load, e.g. loading the "ingen_serialisation" module will + * set World::serialiser and World::parser to valid objects. */ struct World { World() : conf(0) {} @@ -58,6 +57,10 @@ struct World { bool load(const char* name); void unload_all(); + typedef SharedPtr (*InterfaceFactory)( + World* world, const std::string& engine_url); + + void add_interface_factory(const std::string& scheme, InterfaceFactory factory); SharedPtr interface(const std::string& engine_url); bool run(const std::string& mime_type, const std::string& filename); @@ -80,8 +83,6 @@ private: typedef std::map< const std::string, boost::shared_ptr > Modules; Modules modules; - typedef SharedPtr (*InterfaceFactory)( - World* world, const std::string& url); typedef std::map InterfaceFactories; InterfaceFactories interface_factories; -- cgit v1.2.1