From 692d29dd5c57bbd226bd2bc91cfbd2329490a9bb Mon Sep 17 00:00:00 2001
From: David Robillard <d@drobilla.net>
Date: Fri, 15 Apr 2011 20:37:25 +0000
Subject: Move Shared::Module and Shared::World to shared directory.

git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3147 a436a847-0d15-0410-975c-d299462d15a1
---
 src/bindings/ingen_bindings.cpp     |   2 +-
 src/client/HTTPClientReceiver.cpp   |   3 +-
 src/client/HTTPEngineSender.cpp     |   2 +-
 src/client/NodeModel.cpp            |   2 +-
 src/client/PluginModel.hpp          |   2 +-
 src/client/ingen_client.cpp         |   4 +-
 src/engine/ControlBindings.cpp      |   2 +-
 src/engine/Engine.cpp               |   2 +-
 src/engine/HTTPClientSender.cpp     |   2 +-
 src/engine/HTTPEngineReceiver.cpp   |   2 +-
 src/engine/JackDriver.cpp           |   2 +-
 src/engine/LV2Info.cpp              |   2 +-
 src/engine/LV2Info.hpp              |   2 +-
 src/engine/NodeFactory.cpp          |   2 +-
 src/engine/NodeFactory.hpp          |   2 +-
 src/engine/PatchImpl.cpp            |   2 +-
 src/engine/events/SetPortValue.cpp  |   2 +-
 src/engine/ingen_engine.cpp         |   4 +-
 src/engine/ingen_http.cpp           |   4 +-
 src/engine/ingen_jack.cpp           |   4 +-
 src/engine/ingen_lv2.cpp            |   2 +-
 src/engine/ingen_osc.cpp            |   4 +-
 src/gui/App.cpp                     |   2 +-
 src/gui/App.hpp                     |   2 +-
 src/gui/ConnectWindow.cpp           |   4 +-
 src/gui/LoadRemotePatchWindow.cpp   |   2 +-
 src/gui/PatchCanvas.cpp             |   2 +-
 src/gui/PropertiesWindow.cpp        |   2 +-
 src/gui/ThreadedLoader.cpp          |   4 +-
 src/gui/UploadPatchWindow.cpp       |   2 +-
 src/gui/ingen_gui.cpp               |   2 +-
 src/ingen/main.cpp                  |   2 +-
 src/module/Module.hpp               |  49 ------
 src/module/World.cpp                | 302 ------------------------------------
 src/module/World.hpp                | 120 --------------
 src/module/wscript                  |  20 ---
 src/serialisation/Parser.cpp        |   2 +-
 src/serialisation/Serialiser.cpp    |   2 +-
 src/serialisation/serialisation.cpp |   4 +-
 src/shared/Module.hpp               |  49 ++++++
 src/shared/World.cpp                | 302 ++++++++++++++++++++++++++++++++++++
 src/shared/World.hpp                | 120 ++++++++++++++
 src/shared/wscript                  |   1 +
 43 files changed, 515 insertions(+), 535 deletions(-)
 delete mode 100644 src/module/Module.hpp
 delete mode 100644 src/module/World.cpp
 delete mode 100644 src/module/World.hpp
 delete mode 100644 src/module/wscript
 create mode 100644 src/shared/Module.hpp
 create mode 100644 src/shared/World.cpp
 create mode 100644 src/shared/World.hpp

(limited to 'src')

diff --git a/src/bindings/ingen_bindings.cpp b/src/bindings/ingen_bindings.cpp
index fa365571..51c61a22 100644
--- a/src/bindings/ingen_bindings.cpp
+++ b/src/bindings/ingen_bindings.cpp
@@ -2,7 +2,7 @@
 #include "raul/log.hpp"
 #include "ingen_bindings.hpp"
 #include "engine/Engine.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 
 bool
 run(Ingen::Shared::World* world, const char* filename)
diff --git a/src/client/HTTPClientReceiver.cpp b/src/client/HTTPClientReceiver.cpp
index b6f1e856..3ba334b0 100644
--- a/src/client/HTTPClientReceiver.cpp
+++ b/src/client/HTTPClientReceiver.cpp
@@ -28,8 +28,7 @@
 
 #include "raul/log.hpp"
 
-#include "module/Module.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "HTTPClientReceiver.hpp"
 
 #define LOG(s) s << "[HTTPClientReceiver] "
diff --git a/src/client/HTTPEngineSender.cpp b/src/client/HTTPEngineSender.cpp
index 84448743..c426777d 100644
--- a/src/client/HTTPEngineSender.cpp
+++ b/src/client/HTTPEngineSender.cpp
@@ -21,7 +21,7 @@
 #include "raul/log.hpp"
 #include "sord/sordmm.hpp"
 
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "HTTPEngineSender.hpp"
 #include "HTTPClientReceiver.hpp"
 
diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp
index 6850b06c..2d3f8f72 100644
--- a/src/client/NodeModel.cpp
+++ b/src/client/NodeModel.cpp
@@ -19,7 +19,7 @@
 #include <cmath>
 #include "ingen-config.h"
 #include "ingen/Port.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "shared/LV2URIMap.hpp"
 #include "NodeModel.hpp"
 
diff --git a/src/client/PluginModel.hpp b/src/client/PluginModel.hpp
index 6be9dfc4..2776954c 100644
--- a/src/client/PluginModel.hpp
+++ b/src/client/PluginModel.hpp
@@ -28,7 +28,7 @@
 #endif
 #include "ingen/EngineInterface.hpp"
 #include "ingen/Plugin.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "shared/ResourceImpl.hpp"
 
 namespace Ingen {
diff --git a/src/client/ingen_client.cpp b/src/client/ingen_client.cpp
index db98d54a..bb5198c6 100644
--- a/src/client/ingen_client.cpp
+++ b/src/client/ingen_client.cpp
@@ -17,8 +17,8 @@
 
 #include "ingen-config.h"
 #include "raul/SharedPtr.hpp"
-#include "module/Module.hpp"
-#include "module/World.hpp"
+#include "shared/Module.hpp"
+#include "shared/World.hpp"
 #ifdef HAVE_LIBLO
 #include "OSCEngineSender.hpp"
 #endif
diff --git a/src/engine/ControlBindings.cpp b/src/engine/ControlBindings.cpp
index 7b942008..c201ad30 100644
--- a/src/engine/ControlBindings.cpp
+++ b/src/engine/ControlBindings.cpp
@@ -19,7 +19,7 @@
 #include "raul/log.hpp"
 #include "raul/midi_events.h"
 #include "shared/LV2URIMap.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "events/SendPortValue.hpp"
 #include "events/SendBinding.hpp"
 #include "AudioBuffer.hpp"
diff --git a/src/engine/Engine.cpp b/src/engine/Engine.cpp
index 3979cfa9..6a3d25a6 100644
--- a/src/engine/Engine.cpp
+++ b/src/engine/Engine.cpp
@@ -26,7 +26,7 @@
 #include "ingen/EventType.hpp"
 #include "events/CreatePatch.hpp"
 #include "events/CreatePort.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "shared/LV2Features.hpp"
 #include "shared/LV2URIMap.hpp"
 #include "shared/Store.hpp"
diff --git a/src/engine/HTTPClientSender.cpp b/src/engine/HTTPClientSender.cpp
index e5633c4c..7f92144f 100644
--- a/src/engine/HTTPClientSender.cpp
+++ b/src/engine/HTTPClientSender.cpp
@@ -21,7 +21,7 @@
 #include "raul/Atom.hpp"
 #include "raul/AtomRDF.hpp"
 #include "serialisation/Serialiser.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "HTTPClientSender.hpp"
 #include "Engine.hpp"
 
diff --git a/src/engine/HTTPEngineReceiver.cpp b/src/engine/HTTPEngineReceiver.cpp
index b2678754..d24c661b 100644
--- a/src/engine/HTTPEngineReceiver.cpp
+++ b/src/engine/HTTPEngineReceiver.cpp
@@ -27,7 +27,7 @@
 #include "raul/log.hpp"
 
 #include "ingen/ClientInterface.hpp"
-#include "module/Module.hpp"
+#include "shared/Module.hpp"
 #include "serialisation/Parser.hpp"
 #include "serialisation/Serialiser.hpp"
 
diff --git a/src/engine/JackDriver.cpp b/src/engine/JackDriver.cpp
index 6b9e3f93..c807c098 100644
--- a/src/engine/JackDriver.cpp
+++ b/src/engine/JackDriver.cpp
@@ -47,7 +47,7 @@
 #include "ProcessSlave.hpp"
 #include "QueuedEvent.hpp"
 #include "ThreadManager.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "shared/LV2Features.hpp"
 #include "shared/LV2URIMap.hpp"
 #include "tuning.hpp"
diff --git a/src/engine/LV2Info.cpp b/src/engine/LV2Info.cpp
index e67c207d..ecbfe653 100644
--- a/src/engine/LV2Info.cpp
+++ b/src/engine/LV2Info.cpp
@@ -24,7 +24,7 @@
 #include "lv2/lv2plug.in/ns/ext/atom/atom.h"
 #include "lv2/lv2plug.in/ns/ext/contexts/contexts.h"
 
-#include "module/World.hpp"
+#include "shared/World.hpp"
 
 #include "LV2BlobFeature.hpp"
 #include "LV2EventFeature.hpp"
diff --git a/src/engine/LV2Info.hpp b/src/engine/LV2Info.hpp
index 386eb057..ff502265 100644
--- a/src/engine/LV2Info.hpp
+++ b/src/engine/LV2Info.hpp
@@ -26,7 +26,7 @@
 #include <map>
 #include <string>
 #include "slv2/slv2.h"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 
 namespace Ingen {
 
diff --git a/src/engine/NodeFactory.cpp b/src/engine/NodeFactory.cpp
index 266a0271..8ed1dc81 100644
--- a/src/engine/NodeFactory.cpp
+++ b/src/engine/NodeFactory.cpp
@@ -25,7 +25,7 @@
 #include "sord/sordmm.hpp"
 #include "raul/log.hpp"
 #include "ingen-config.h"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "internals/Controller.hpp"
 #include "internals/Delay.hpp"
 #include "internals/Note.hpp"
diff --git a/src/engine/NodeFactory.hpp b/src/engine/NodeFactory.hpp
index 1f53f6af..7a464e3b 100644
--- a/src/engine/NodeFactory.hpp
+++ b/src/engine/NodeFactory.hpp
@@ -25,7 +25,7 @@
 #include <glibmm/module.h>
 #include "raul/SharedPtr.hpp"
 #include "raul/URI.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "ingen-config.h"
 
 namespace Ingen {
diff --git a/src/engine/PatchImpl.cpp b/src/engine/PatchImpl.cpp
index c5f91ba5..eab1aed5 100644
--- a/src/engine/PatchImpl.cpp
+++ b/src/engine/PatchImpl.cpp
@@ -19,7 +19,7 @@
 #include <cmath>
 #include <string>
 #include "raul/log.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "shared/LV2URIMap.hpp"
 #include "ThreadManager.hpp"
 #include "NodeImpl.hpp"
diff --git a/src/engine/events/SetPortValue.cpp b/src/engine/events/SetPortValue.cpp
index fd0a9e1a..56285a60 100644
--- a/src/engine/events/SetPortValue.cpp
+++ b/src/engine/events/SetPortValue.cpp
@@ -21,7 +21,7 @@
 #include "shared/LV2URIMap.hpp"
 #include "shared/LV2Features.hpp"
 #include "shared/LV2Atom.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "AudioBuffer.hpp"
 #include "ClientBroadcaster.hpp"
 #include "ControlBindings.hpp"
diff --git a/src/engine/ingen_engine.cpp b/src/engine/ingen_engine.cpp
index 2c728603..261de803 100644
--- a/src/engine/ingen_engine.cpp
+++ b/src/engine/ingen_engine.cpp
@@ -15,8 +15,8 @@
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "module/Module.hpp"
-#include "module/World.hpp"
+#include "shared/Module.hpp"
+#include "shared/World.hpp"
 #include "Engine.hpp"
 #include "QueuedEngineInterface.hpp"
 #include "util.hpp"
diff --git a/src/engine/ingen_http.cpp b/src/engine/ingen_http.cpp
index 6eb5cd9f..333131e6 100644
--- a/src/engine/ingen_http.cpp
+++ b/src/engine/ingen_http.cpp
@@ -15,8 +15,8 @@
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "module/Module.hpp"
-#include "module/World.hpp"
+#include "shared/Module.hpp"
+#include "shared/World.hpp"
 #include "HTTPEngineReceiver.hpp"
 #include "Engine.hpp"
 #include "tuning.hpp"
diff --git a/src/engine/ingen_jack.cpp b/src/engine/ingen_jack.cpp
index 77dfff55..074208b1 100644
--- a/src/engine/ingen_jack.cpp
+++ b/src/engine/ingen_jack.cpp
@@ -15,8 +15,8 @@
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "module/Module.hpp"
-#include "module/World.hpp"
+#include "shared/Module.hpp"
+#include "shared/World.hpp"
 #include "JackDriver.hpp"
 #include "Engine.hpp"
 
diff --git a/src/engine/ingen_lv2.cpp b/src/engine/ingen_lv2.cpp
index f09540ed..1e0532b7 100644
--- a/src/engine/ingen_lv2.cpp
+++ b/src/engine/ingen_lv2.cpp
@@ -40,7 +40,7 @@
 #include "engine/QueuedEngineInterface.hpp"
 #include "engine/ThreadManager.hpp"
 #include "ingen/EngineInterface.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "serialisation/Parser.hpp"
 #include "shared/Configuration.hpp"
 #include "shared/runtime_paths.hpp"
diff --git a/src/engine/ingen_osc.cpp b/src/engine/ingen_osc.cpp
index d5cffdce..1a7df9fe 100644
--- a/src/engine/ingen_osc.cpp
+++ b/src/engine/ingen_osc.cpp
@@ -15,8 +15,8 @@
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "module/Module.hpp"
-#include "module/World.hpp"
+#include "shared/Module.hpp"
+#include "shared/World.hpp"
 #include "OSCEngineReceiver.hpp"
 #include "Engine.hpp"
 #include "tuning.hpp"
diff --git a/src/gui/App.cpp b/src/gui/App.cpp
index cd14d037..23924ded 100644
--- a/src/gui/App.cpp
+++ b/src/gui/App.cpp
@@ -27,7 +27,7 @@
 #include "raul/log.hpp"
 #include "raul/Path.hpp"
 #include "flowcanvas/Connection.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "engine/Engine.hpp"
 #include "ingen/EngineInterface.hpp"
 #include "shared/runtime_paths.hpp"
diff --git a/src/gui/App.hpp b/src/gui/App.hpp
index e81576e2..e74a6168 100644
--- a/src/gui/App.hpp
+++ b/src/gui/App.hpp
@@ -27,7 +27,7 @@
 #include <libglademm.h>
 #include "raul/SharedPtr.hpp"
 #include "raul/Deletable.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 
 namespace Ingen {
 	class Engine;
diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp
index e2872b90..a4bf3e43 100644
--- a/src/gui/ConnectWindow.cpp
+++ b/src/gui/ConnectWindow.cpp
@@ -26,8 +26,8 @@
 
 #include "ingen-config.h"
 #include "ingen/EngineInterface.hpp"
-#include "module/Module.hpp"
-#include "module/World.hpp"
+#include "shared/Module.hpp"
+#include "shared/World.hpp"
 #include "engine/Engine.hpp"
 #ifdef HAVE_SOUP
 #include "client/HTTPClientReceiver.hpp"
diff --git a/src/gui/LoadRemotePatchWindow.cpp b/src/gui/LoadRemotePatchWindow.cpp
index d3b0f456..809bea42 100644
--- a/src/gui/LoadRemotePatchWindow.cpp
+++ b/src/gui/LoadRemotePatchWindow.cpp
@@ -20,7 +20,7 @@
 #include <boost/optional/optional.hpp>
 #include "client/PatchModel.hpp"
 #include "ingen/EngineInterface.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "App.hpp"
 #include "Configuration.hpp"
 #include "LoadRemotePatchWindow.hpp"
diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp
index ce5de9d5..4df1e8dd 100644
--- a/src/gui/PatchCanvas.cpp
+++ b/src/gui/PatchCanvas.cpp
@@ -31,7 +31,7 @@
 #include "client/PatchModel.hpp"
 #include "client/NodeModel.hpp"
 #include "client/ClientStore.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "App.hpp"
 #include "PatchCanvas.hpp"
 #include "PatchWindow.hpp"
diff --git a/src/gui/PropertiesWindow.cpp b/src/gui/PropertiesWindow.cpp
index d6a7d86d..8e00f396 100644
--- a/src/gui/PropertiesWindow.cpp
+++ b/src/gui/PropertiesWindow.cpp
@@ -18,7 +18,7 @@
 #include <cassert>
 #include <string>
 #include "raul/log.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "client/NodeModel.hpp"
 #include "client/PluginModel.hpp"
 #include "App.hpp"
diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp
index e6618c51..eb8a98b6 100644
--- a/src/gui/ThreadedLoader.cpp
+++ b/src/gui/ThreadedLoader.cpp
@@ -17,8 +17,8 @@
 
 #include <string>
 #include "raul/log.hpp"
-#include "module/World.hpp"
-#include "module/Module.hpp"
+#include "shared/World.hpp"
+#include "shared/Module.hpp"
 #include "serialisation/names.hpp"
 #include "App.hpp"
 #include "ThreadedLoader.hpp"
diff --git a/src/gui/UploadPatchWindow.cpp b/src/gui/UploadPatchWindow.cpp
index bce639b9..b5a4d291 100644
--- a/src/gui/UploadPatchWindow.cpp
+++ b/src/gui/UploadPatchWindow.cpp
@@ -21,7 +21,7 @@
 #include <dirent.h>
 #include <boost/optional/optional.hpp>
 #include <curl/curl.h>
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "shared/LV2URIMap.hpp"
 #include "client/ClientStore.hpp"
 #include "ingen/EngineInterface.hpp"
diff --git a/src/gui/ingen_gui.cpp b/src/gui/ingen_gui.cpp
index 9d0e995b..aee20831 100644
--- a/src/gui/ingen_gui.cpp
+++ b/src/gui/ingen_gui.cpp
@@ -15,7 +15,7 @@
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "module/Module.hpp"
+#include "shared/Module.hpp"
 #include "App.hpp"
 
 struct IngenGUIModule : public Ingen::Shared::Module {
diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp
index 65d316b7..4d55f212 100644
--- a/src/ingen/main.cpp
+++ b/src/ingen/main.cpp
@@ -39,7 +39,7 @@
 
 #include "engine/Engine.hpp"
 #include "ingen/EngineInterface.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "serialisation/Parser.hpp"
 #include "shared/Configuration.hpp"
 #include "shared/runtime_paths.hpp"
diff --git a/src/module/Module.hpp b/src/module/Module.hpp
deleted file mode 100644
index af5732af..00000000
--- a/src/module/Module.hpp
+++ /dev/null
@@ -1,49 +0,0 @@
-/* This file is part of Ingen.
- * Copyright (C) 2007-2009 David Robillard <http://drobilla.net>
- *
- * Ingen is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef INGEN_MODULE_MODULE_HPP
-#define INGEN_MODULE_MODULE_HPP
-
-#include <glibmm/module.h>
-
-#include "raul/log.hpp"
-#include "raul/SharedPtr.hpp"
-
-namespace Ingen {
-namespace Shared {
-
-class World;
-
-/** A dynamically loaded Ingen module.
- *
- * All components of Ingen reside in one of these.
- */
-struct Module {
-	virtual ~Module() {
-		Raul::info << "[Module] Unloading " << library->get_name() << std::endl;
-	}
-
-	virtual void load(Ingen::Shared::World* world) = 0;
-
-	SharedPtr<Glib::Module> library;
-};
-
-
-} // namespace Shared
-} // namespace Ingen
-
-#endif // INGEN_MODULE_MODULE_HPP
diff --git a/src/module/World.cpp b/src/module/World.cpp
deleted file mode 100644
index 6667cb9f..00000000
--- a/src/module/World.cpp
+++ /dev/null
@@ -1,302 +0,0 @@
-/* This file is part of Ingen.
- * Copyright (C) 2007-2009 David Robillard <http://drobilla.net>
- *
- * Ingen is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#include "ingen-config.h"
-#include <boost/utility.hpp>
-#include <glibmm/module.h>
-#include <glibmm/miscutils.h>
-#include <glibmm/fileutils.h>
-#ifdef HAVE_SLV2
-#include "slv2/slv2.h"
-#endif
-#include "raul/log.hpp"
-#include "sord/sordmm.hpp"
-#include "shared/runtime_paths.hpp"
-#include "shared/LV2Features.hpp"
-#include "shared/LV2URIMap.hpp"
-#include "World.hpp"
-#include "Module.hpp"
-
-#define LOG(s) s << "[Module] "
-
-using namespace std;
-using namespace Raul;
-
-namespace Ingen {
-namespace Shared {
-
-/** Load a dynamic module from the default path.
- *
- * This will check in the directories specified in the environment variable
- * INGEN_MODULE_PATH (typical colon delimited format), then the default module
- * installation directory (ie /usr/local/lib/ingen), in that order.
- *
- * \param name The base name of the module, e.g. "ingen_serialisation"
- */
-static SharedPtr<Glib::Module>
-load_module(const string& name)
-{
-	Glib::Module* module = NULL;
-
-	// Search INGEN_MODULE_PATH first
-	bool module_path_found;
-	string module_path = Glib::getenv("INGEN_MODULE_PATH", module_path_found);
-	if (module_path_found) {
-		string dir;
-		istringstream iss(module_path);
-		while (getline(iss, dir, ':')) {
-			string filename = Shared::module_path(name, dir);
-			if (Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) {
-				module = new Glib::Module(filename, Glib::MODULE_BIND_LAZY);
-				if (*module) {
-					LOG(info) << "Loading " << filename << endl;
-					return SharedPtr<Glib::Module>(module);
-				} else {
-					delete module;
-					error << Glib::Module::get_last_error() << endl;
-				}
-			}
-		}
-	}
-
-	// Try default directory if not found
-	module = new Glib::Module(Shared::module_path(name), Glib::MODULE_BIND_LAZY);
-	
-	// FIXME: SEGV on exit without this
-	module->make_resident();
-
-	if (*module) {
-		LOG(info) << "Loading " << Shared::module_path(name) << endl;
-		return SharedPtr<Glib::Module>(module);
-	} else if (!module_path_found) {
-		LOG(error) << "Unable to find " << name
-			<< " (" << Glib::Module::get_last_error() << ")" << endl;
-		return SharedPtr<Glib::Module>();
-	} else {
-		LOG(error) << "Unable to load " << name << " from " << module_path
-			<< " (" << Glib::Module::get_last_error() << ")" << endl;
-		LOG(error) << "Is Ingen installed?" << endl;
-		return SharedPtr<Glib::Module>();
-	}
-}
-
-
-class WorldImpl : public boost::noncopyable {
-public:
-	WorldImpl(Raul::Configuration* conf, int& a_argc, char**& a_argv)
-		: argc(a_argc)
-		, argv(a_argv)
-		, conf(conf)
-		, lv2_features(NULL)
-		, rdf_world(new Sord::World())
-		, uris(new Shared::LV2URIMap())
-#ifdef HAVE_SLV2
-		, slv2_world(slv2_world_new())
-#else
-		, slv2_world(NULL)
-#endif
-	{
-#ifdef HAVE_SLV2
-		lv2_features = new Ingen::Shared::LV2Features();
-		lv2_features->add_feature(LV2_URI_MAP_URI, uris);
-		lv2_features->add_feature(LV2_URI_UNMAP_URI, uris->unmap_feature());
-		slv2_world_load_all(slv2_world);
-#endif
-
-		// Set up RDF namespaces
-		rdf_world->add_prefix("dc",      "http://purl.org/dc/elements/1.1/");
-		rdf_world->add_prefix("doap",    "http://usefulinc.com/ns/doap#");
-		rdf_world->add_prefix("ingen",   "http://drobilla.net/ns/ingen#");
-		rdf_world->add_prefix("ingenui", "http://drobilla.net/ns/ingenuity#");
-		rdf_world->add_prefix("lv2",     "http://lv2plug.in/ns/lv2core#");
-		rdf_world->add_prefix("lv2ev",   "http://lv2plug.in/ns/ext/event#");
-		rdf_world->add_prefix("ctx",     "http://lv2plug.in/ns/ext/contexts#");
-		rdf_world->add_prefix("lv2midi", "http://lv2plug.in/ns/ext/midi#");
-		rdf_world->add_prefix("midi",    "http://drobilla.net/ns/ext/midi#");
-		rdf_world->add_prefix("owl",     "http://www.w3.org/2002/07/owl#");
-		rdf_world->add_prefix("rdfs",    "http://www.w3.org/2000/01/rdf-schema#");
-		rdf_world->add_prefix("xsd",     "http://www.w3.org/2001/XMLSchema#");
-		rdf_world->add_prefix("atom",    "http://lv2plug.in/ns/ext/atom#");
-		rdf_world->add_prefix("xsd",     "http://www.w3.org/2001/XMLSchema#");
-	}
-
-	virtual ~WorldImpl()
-	{
-		local_engine.reset();
-
-		modules.clear();
-		interface_factories.clear();
-		script_runners.clear();
-
-#ifdef HAVE_SLV2
-		slv2_world_free(slv2_world);
-		slv2_world = NULL;
-#endif
-
-		delete rdf_world;
-		rdf_world = NULL;
-
-		delete lv2_features;
-		lv2_features = NULL;
-
-		uris.reset();
-	}
-
-	typedef std::map< const std::string, SharedPtr<Module> > Modules;
-	Modules modules;
-
-	typedef std::map<const std::string, World::InterfaceFactory> InterfaceFactories;
-	InterfaceFactories interface_factories;
-
-	typedef bool (*ScriptRunner)(World* world, const char* filename);
-	typedef std::map<const std::string, ScriptRunner> ScriptRunners;
-	ScriptRunners script_runners;
-
-	int&                                 argc;
-	char**&                              argv;
-	Raul::Configuration*                 conf;
-	LV2Features*                         lv2_features;
-	Sord::World*                         rdf_world;
-	SharedPtr<LV2URIMap>                 uris;
-    SharedPtr<EngineInterface>           engine;
-	SharedPtr<Engine>                    local_engine;
-    SharedPtr<Serialisation::Serialiser> serialiser;
-    SharedPtr<Serialisation::Parser>     parser;
-    SharedPtr<Store>                     store;
-    SLV2World                            slv2_world;
-	std::string                          jack_uuid;
-};
-
-
-World::World(Raul::Configuration* conf, int& argc, char**& argv)
-	: _impl(new WorldImpl(conf, argc, argv))
-{
-}
-
-
-World::~World()
-{
-	unload_all();
-	delete _impl;
-}
-
-void World::set_local_engine(SharedPtr<Engine> e)                  { _impl->local_engine = e; }
-void World::set_engine(SharedPtr<EngineInterface> e)               { _impl->engine = e; }
-void World::set_serialiser(SharedPtr<Serialisation::Serialiser> s) { _impl->serialiser = s; }
-void World::set_parser(SharedPtr<Serialisation::Parser> p)         { _impl->parser = p; }
-void World::set_store(SharedPtr<Store> s)                          { _impl->store = s; }
-void World::set_conf(Raul::Configuration* c)                       { _impl->conf = c; }
-
-int&                                 World::argc()         { return _impl->argc; }
-char**&                              World::argv()         { return _impl->argv; }
-SharedPtr<Engine>                    World::local_engine() { return _impl->local_engine; }
-SharedPtr<EngineInterface>           World::engine()       { return _impl->engine; }
-SharedPtr<Serialisation::Serialiser> World::serialiser()   { return _impl->serialiser; }
-SharedPtr<Serialisation::Parser>     World::parser()       { return _impl->parser; }
-SharedPtr<Store>                     World::store()        { return _impl->store; }
-Raul::Configuration*                 World::conf()         { return _impl->conf; }
-LV2Features*                         World::lv2_features() { return _impl->lv2_features; }
-
-#ifdef HAVE_SLV2
-SLV2World            World::slv2_world() { return _impl->slv2_world; }
-#endif
-Sord::World*         World::rdf_world() { return _impl->rdf_world; }
-SharedPtr<LV2URIMap> World::uris()      { return _impl->uris; }
-
-
-/** Load an Ingen module.
- * @return true on success, false on failure
- */
-bool
-World::load(const char* name)
-{
-	SharedPtr<Glib::Module> lib = load_module(name);
-	Ingen::Shared::Module* (*module_load)() = NULL;
-	if (lib && lib->get_symbol("ingen_module_load", (void*&)module_load)) {
-		Module* module = module_load();
-		module->library = lib;
-		module->load(this);
-		_impl->modules.insert(make_pair(string(name), module));
-		return true;
-	} else {
-		LOG(error) << "Failed to load module `" << name << "'" << endl;
-		return false;
-	}
-}
-
-
-/** Unload all loaded Ingen modules.
- */
-void
-World::unload_all()
-{
-	_impl->modules.clear();
-}
-
-
-/** Get an interface for a remote engine at @a url
- */
-SharedPtr<Ingen::Shared::EngineInterface>
-World::interface(const std::string& url)
-{
-	const string scheme = url.substr(0, url.find(":"));
-	const WorldImpl::InterfaceFactories::const_iterator i = _impl->interface_factories.find(scheme);
-	if (i == _impl->interface_factories.end()) {
-		warn << "Unknown URI scheme `" << scheme << "'" << endl;
-		return SharedPtr<Ingen::Shared::EngineInterface>();
-	}
-
-	return i->second(this, url);
-}
-
-
-/** Run a script of type @a mime_type at filename @a filename */
-bool
-World::run(const std::string& mime_type, const std::string& filename)
-{
-	const WorldImpl::ScriptRunners::const_iterator i = _impl->script_runners.find(mime_type);
-	if (i == _impl->script_runners.end()) {
-		warn << "Unknown script MIME type `" << mime_type << "'" << endl;
-		return false;
-	}
-
-	return i->second(this, filename.c_str());
-}
-
-void
-World::add_interface_factory(const std::string& scheme, InterfaceFactory factory)
-{
-	_impl->interface_factories.insert(make_pair(scheme, factory));
-}
-
-
-void
-World::set_jack_uuid(const std::string& uuid)
-{
-	_impl->jack_uuid = uuid;
-}
-
-
-std::string
-World::jack_uuid()
-{
-	return _impl->jack_uuid;
-}
-
-
-} // namespace Shared
-} // namespace Ingen
diff --git a/src/module/World.hpp b/src/module/World.hpp
deleted file mode 100644
index 29d904b2..00000000
--- a/src/module/World.hpp
+++ /dev/null
@@ -1,120 +0,0 @@
-/* This file is part of Ingen.
- * Copyright (C) 2007-2009 David Robillard <http://drobilla.net>
- *
- * Ingen is free software; you can redistribute it and/or modify it under the
- * terms of the GNU General Public License as published by the Free Software
- * Foundation; either version 2 of the License, or (at your option) any later
- * version.
- *
- * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for details.
- *
- * You should have received a copy of the GNU General Public License along
- * with this program; if not, write to the Free Software Foundation, Inc.,
- * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
- */
-
-#ifndef INGEN_MODULE_WORLD_HPP
-#define INGEN_MODULE_WORLD_HPP
-
-#include <map>
-#include <string>
-
-#include <boost/shared_ptr.hpp>
-#include <boost/utility.hpp>
-
-#include <glibmm/module.h>
-
-#include "raul/Configuration.hpp"
-#include "raul/SharedPtr.hpp"
-
-#include "ingen-config.h"
-
-#ifdef HAVE_SLV2
-typedef struct _SLV2World* SLV2World;
-#endif
-
-namespace Sord { class World; }
-
-namespace Ingen {
-
-class Engine;
-
-namespace Serialisation { class Serialiser; class Parser; }
-
-namespace Shared {
-
-class EngineInterface;
-class LV2Features;
-class LV2URIMap;
-class Store;
-class WorldImpl;
-
-
-/** The "world" all Ingen modules may share.
- *
- * All loaded components of Ingen, as well as things requiring shared access
- * and/or locking (e.g. Sord, SLV2).
- *
- * 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.
- */
-class World : public boost::noncopyable {
-public:
-	World(Raul::Configuration* conf, int& argc, char**& argv);
-	virtual ~World();
-
-	virtual bool load(const char* name);
-	virtual void unload_all();
-
-	typedef SharedPtr<Ingen::Shared::EngineInterface> (*InterfaceFactory)(
-			World* world, const std::string& engine_url);
-
-	virtual void add_interface_factory(const std::string& scheme,
-	                                   InterfaceFactory   factory);
-	
-	virtual SharedPtr<Ingen::Shared::EngineInterface> interface(
-		const std::string& engine_url);
-
-	virtual bool run(const std::string& mime_type,
-	                 const std::string& filename);
-
-	virtual void set_local_engine(SharedPtr<Engine> e);
-	virtual void set_engine(SharedPtr<EngineInterface> e);
-	virtual void set_serialiser(SharedPtr<Serialisation::Serialiser> s);
-	virtual void set_parser(SharedPtr<Serialisation::Parser> p);
-	virtual void set_store(SharedPtr<Store> s);
-
-	virtual SharedPtr<Engine>                    local_engine();
-	virtual SharedPtr<EngineInterface>           engine();
-	virtual SharedPtr<Serialisation::Serialiser> serialiser();
-	virtual SharedPtr<Serialisation::Parser>     parser();
-	virtual SharedPtr<Store>                     store();
-
-	virtual Sord::World*         rdf_world();
-	virtual SharedPtr<LV2URIMap> uris();
-
-	virtual int&    argc();
-	virtual char**& argv();
-
-	virtual Raul::Configuration* conf();
-	virtual void set_conf(Raul::Configuration* c);
-
-	virtual LV2Features* lv2_features();
-
-	virtual SLV2World slv2_world();
-
-	virtual void        set_jack_uuid(const std::string& uuid);
-	virtual std::string jack_uuid();
-
-private:
-	WorldImpl* _impl;
-};
-
-
-} // namespace Shared
-} // namespace Ingen
-
-#endif // INGEN_MODULE_WORLD_HPP
diff --git a/src/module/wscript b/src/module/wscript
deleted file mode 100644
index a904c806..00000000
--- a/src/module/wscript
+++ /dev/null
@@ -1,20 +0,0 @@
-#!/usr/bin/env python
-from waflib.extras import autowaf as autowaf
-
-def build(bld):
-	# Headers
-	bld.install_files('${INCLUDEDIR}/ingen/module', bld.path.ant_glob('*.hpp'))
-
-	obj = bld(features = 'cxx cxxshlib')
-	obj.source = '''
-		World.cpp
-	'''
-	obj.export_includes = ['.']
-	obj.includes	    = ['.', '..', '../..', '../../include']
-	obj.name	    = 'libingen_module'
-	obj.target	    = 'ingen_module'
-	obj.vnum	    = '0.0.0'
-	obj.use             = 'libingen_shared'
-	obj.install_path    = '${LIBDIR}'
-	autowaf.use_lib(bld, obj, 'GLIBMM LV2CORE SLV2 RAUL SORD')
-
diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp
index 0429b116..b81cc132 100644
--- a/src/serialisation/Parser.cpp
+++ b/src/serialisation/Parser.cpp
@@ -35,7 +35,7 @@
 #include "sord/sordmm.hpp"
 
 #include "ingen/EngineInterface.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "shared/LV2URIMap.hpp"
 
 #include "Parser.hpp"
diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp
index 0c8cc93c..a318e662 100644
--- a/src/serialisation/Serialiser.cpp
+++ b/src/serialisation/Serialiser.cpp
@@ -48,7 +48,7 @@
 #include "ingen/Patch.hpp"
 #include "ingen/Plugin.hpp"
 #include "ingen/Port.hpp"
-#include "module/World.hpp"
+#include "shared/World.hpp"
 #include "shared/LV2URIMap.hpp"
 #include "shared/ResourceImpl.hpp"
 
diff --git a/src/serialisation/serialisation.cpp b/src/serialisation/serialisation.cpp
index a8cf75bd..a14e2d84 100644
--- a/src/serialisation/serialisation.cpp
+++ b/src/serialisation/serialisation.cpp
@@ -15,8 +15,8 @@
  * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
  */
 
-#include "module/Module.hpp"
-#include "module/World.hpp"
+#include "shared/Module.hpp"
+#include "shared/World.hpp"
 
 #include "Parser.hpp"
 #include "Serialiser.hpp"
diff --git a/src/shared/Module.hpp b/src/shared/Module.hpp
new file mode 100644
index 00000000..af5732af
--- /dev/null
+++ b/src/shared/Module.hpp
@@ -0,0 +1,49 @@
+/* This file is part of Ingen.
+ * Copyright (C) 2007-2009 David Robillard <http://drobilla.net>
+ *
+ * Ingen is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef INGEN_MODULE_MODULE_HPP
+#define INGEN_MODULE_MODULE_HPP
+
+#include <glibmm/module.h>
+
+#include "raul/log.hpp"
+#include "raul/SharedPtr.hpp"
+
+namespace Ingen {
+namespace Shared {
+
+class World;
+
+/** A dynamically loaded Ingen module.
+ *
+ * All components of Ingen reside in one of these.
+ */
+struct Module {
+	virtual ~Module() {
+		Raul::info << "[Module] Unloading " << library->get_name() << std::endl;
+	}
+
+	virtual void load(Ingen::Shared::World* world) = 0;
+
+	SharedPtr<Glib::Module> library;
+};
+
+
+} // namespace Shared
+} // namespace Ingen
+
+#endif // INGEN_MODULE_MODULE_HPP
diff --git a/src/shared/World.cpp b/src/shared/World.cpp
new file mode 100644
index 00000000..6667cb9f
--- /dev/null
+++ b/src/shared/World.cpp
@@ -0,0 +1,302 @@
+/* This file is part of Ingen.
+ * Copyright (C) 2007-2009 David Robillard <http://drobilla.net>
+ *
+ * Ingen is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "ingen-config.h"
+#include <boost/utility.hpp>
+#include <glibmm/module.h>
+#include <glibmm/miscutils.h>
+#include <glibmm/fileutils.h>
+#ifdef HAVE_SLV2
+#include "slv2/slv2.h"
+#endif
+#include "raul/log.hpp"
+#include "sord/sordmm.hpp"
+#include "shared/runtime_paths.hpp"
+#include "shared/LV2Features.hpp"
+#include "shared/LV2URIMap.hpp"
+#include "World.hpp"
+#include "Module.hpp"
+
+#define LOG(s) s << "[Module] "
+
+using namespace std;
+using namespace Raul;
+
+namespace Ingen {
+namespace Shared {
+
+/** Load a dynamic module from the default path.
+ *
+ * This will check in the directories specified in the environment variable
+ * INGEN_MODULE_PATH (typical colon delimited format), then the default module
+ * installation directory (ie /usr/local/lib/ingen), in that order.
+ *
+ * \param name The base name of the module, e.g. "ingen_serialisation"
+ */
+static SharedPtr<Glib::Module>
+load_module(const string& name)
+{
+	Glib::Module* module = NULL;
+
+	// Search INGEN_MODULE_PATH first
+	bool module_path_found;
+	string module_path = Glib::getenv("INGEN_MODULE_PATH", module_path_found);
+	if (module_path_found) {
+		string dir;
+		istringstream iss(module_path);
+		while (getline(iss, dir, ':')) {
+			string filename = Shared::module_path(name, dir);
+			if (Glib::file_test(filename, Glib::FILE_TEST_EXISTS)) {
+				module = new Glib::Module(filename, Glib::MODULE_BIND_LAZY);
+				if (*module) {
+					LOG(info) << "Loading " << filename << endl;
+					return SharedPtr<Glib::Module>(module);
+				} else {
+					delete module;
+					error << Glib::Module::get_last_error() << endl;
+				}
+			}
+		}
+	}
+
+	// Try default directory if not found
+	module = new Glib::Module(Shared::module_path(name), Glib::MODULE_BIND_LAZY);
+	
+	// FIXME: SEGV on exit without this
+	module->make_resident();
+
+	if (*module) {
+		LOG(info) << "Loading " << Shared::module_path(name) << endl;
+		return SharedPtr<Glib::Module>(module);
+	} else if (!module_path_found) {
+		LOG(error) << "Unable to find " << name
+			<< " (" << Glib::Module::get_last_error() << ")" << endl;
+		return SharedPtr<Glib::Module>();
+	} else {
+		LOG(error) << "Unable to load " << name << " from " << module_path
+			<< " (" << Glib::Module::get_last_error() << ")" << endl;
+		LOG(error) << "Is Ingen installed?" << endl;
+		return SharedPtr<Glib::Module>();
+	}
+}
+
+
+class WorldImpl : public boost::noncopyable {
+public:
+	WorldImpl(Raul::Configuration* conf, int& a_argc, char**& a_argv)
+		: argc(a_argc)
+		, argv(a_argv)
+		, conf(conf)
+		, lv2_features(NULL)
+		, rdf_world(new Sord::World())
+		, uris(new Shared::LV2URIMap())
+#ifdef HAVE_SLV2
+		, slv2_world(slv2_world_new())
+#else
+		, slv2_world(NULL)
+#endif
+	{
+#ifdef HAVE_SLV2
+		lv2_features = new Ingen::Shared::LV2Features();
+		lv2_features->add_feature(LV2_URI_MAP_URI, uris);
+		lv2_features->add_feature(LV2_URI_UNMAP_URI, uris->unmap_feature());
+		slv2_world_load_all(slv2_world);
+#endif
+
+		// Set up RDF namespaces
+		rdf_world->add_prefix("dc",      "http://purl.org/dc/elements/1.1/");
+		rdf_world->add_prefix("doap",    "http://usefulinc.com/ns/doap#");
+		rdf_world->add_prefix("ingen",   "http://drobilla.net/ns/ingen#");
+		rdf_world->add_prefix("ingenui", "http://drobilla.net/ns/ingenuity#");
+		rdf_world->add_prefix("lv2",     "http://lv2plug.in/ns/lv2core#");
+		rdf_world->add_prefix("lv2ev",   "http://lv2plug.in/ns/ext/event#");
+		rdf_world->add_prefix("ctx",     "http://lv2plug.in/ns/ext/contexts#");
+		rdf_world->add_prefix("lv2midi", "http://lv2plug.in/ns/ext/midi#");
+		rdf_world->add_prefix("midi",    "http://drobilla.net/ns/ext/midi#");
+		rdf_world->add_prefix("owl",     "http://www.w3.org/2002/07/owl#");
+		rdf_world->add_prefix("rdfs",    "http://www.w3.org/2000/01/rdf-schema#");
+		rdf_world->add_prefix("xsd",     "http://www.w3.org/2001/XMLSchema#");
+		rdf_world->add_prefix("atom",    "http://lv2plug.in/ns/ext/atom#");
+		rdf_world->add_prefix("xsd",     "http://www.w3.org/2001/XMLSchema#");
+	}
+
+	virtual ~WorldImpl()
+	{
+		local_engine.reset();
+
+		modules.clear();
+		interface_factories.clear();
+		script_runners.clear();
+
+#ifdef HAVE_SLV2
+		slv2_world_free(slv2_world);
+		slv2_world = NULL;
+#endif
+
+		delete rdf_world;
+		rdf_world = NULL;
+
+		delete lv2_features;
+		lv2_features = NULL;
+
+		uris.reset();
+	}
+
+	typedef std::map< const std::string, SharedPtr<Module> > Modules;
+	Modules modules;
+
+	typedef std::map<const std::string, World::InterfaceFactory> InterfaceFactories;
+	InterfaceFactories interface_factories;
+
+	typedef bool (*ScriptRunner)(World* world, const char* filename);
+	typedef std::map<const std::string, ScriptRunner> ScriptRunners;
+	ScriptRunners script_runners;
+
+	int&                                 argc;
+	char**&                              argv;
+	Raul::Configuration*                 conf;
+	LV2Features*                         lv2_features;
+	Sord::World*                         rdf_world;
+	SharedPtr<LV2URIMap>                 uris;
+    SharedPtr<EngineInterface>           engine;
+	SharedPtr<Engine>                    local_engine;
+    SharedPtr<Serialisation::Serialiser> serialiser;
+    SharedPtr<Serialisation::Parser>     parser;
+    SharedPtr<Store>                     store;
+    SLV2World                            slv2_world;
+	std::string                          jack_uuid;
+};
+
+
+World::World(Raul::Configuration* conf, int& argc, char**& argv)
+	: _impl(new WorldImpl(conf, argc, argv))
+{
+}
+
+
+World::~World()
+{
+	unload_all();
+	delete _impl;
+}
+
+void World::set_local_engine(SharedPtr<Engine> e)                  { _impl->local_engine = e; }
+void World::set_engine(SharedPtr<EngineInterface> e)               { _impl->engine = e; }
+void World::set_serialiser(SharedPtr<Serialisation::Serialiser> s) { _impl->serialiser = s; }
+void World::set_parser(SharedPtr<Serialisation::Parser> p)         { _impl->parser = p; }
+void World::set_store(SharedPtr<Store> s)                          { _impl->store = s; }
+void World::set_conf(Raul::Configuration* c)                       { _impl->conf = c; }
+
+int&                                 World::argc()         { return _impl->argc; }
+char**&                              World::argv()         { return _impl->argv; }
+SharedPtr<Engine>                    World::local_engine() { return _impl->local_engine; }
+SharedPtr<EngineInterface>           World::engine()       { return _impl->engine; }
+SharedPtr<Serialisation::Serialiser> World::serialiser()   { return _impl->serialiser; }
+SharedPtr<Serialisation::Parser>     World::parser()       { return _impl->parser; }
+SharedPtr<Store>                     World::store()        { return _impl->store; }
+Raul::Configuration*                 World::conf()         { return _impl->conf; }
+LV2Features*                         World::lv2_features() { return _impl->lv2_features; }
+
+#ifdef HAVE_SLV2
+SLV2World            World::slv2_world() { return _impl->slv2_world; }
+#endif
+Sord::World*         World::rdf_world() { return _impl->rdf_world; }
+SharedPtr<LV2URIMap> World::uris()      { return _impl->uris; }
+
+
+/** Load an Ingen module.
+ * @return true on success, false on failure
+ */
+bool
+World::load(const char* name)
+{
+	SharedPtr<Glib::Module> lib = load_module(name);
+	Ingen::Shared::Module* (*module_load)() = NULL;
+	if (lib && lib->get_symbol("ingen_module_load", (void*&)module_load)) {
+		Module* module = module_load();
+		module->library = lib;
+		module->load(this);
+		_impl->modules.insert(make_pair(string(name), module));
+		return true;
+	} else {
+		LOG(error) << "Failed to load module `" << name << "'" << endl;
+		return false;
+	}
+}
+
+
+/** Unload all loaded Ingen modules.
+ */
+void
+World::unload_all()
+{
+	_impl->modules.clear();
+}
+
+
+/** Get an interface for a remote engine at @a url
+ */
+SharedPtr<Ingen::Shared::EngineInterface>
+World::interface(const std::string& url)
+{
+	const string scheme = url.substr(0, url.find(":"));
+	const WorldImpl::InterfaceFactories::const_iterator i = _impl->interface_factories.find(scheme);
+	if (i == _impl->interface_factories.end()) {
+		warn << "Unknown URI scheme `" << scheme << "'" << endl;
+		return SharedPtr<Ingen::Shared::EngineInterface>();
+	}
+
+	return i->second(this, url);
+}
+
+
+/** Run a script of type @a mime_type at filename @a filename */
+bool
+World::run(const std::string& mime_type, const std::string& filename)
+{
+	const WorldImpl::ScriptRunners::const_iterator i = _impl->script_runners.find(mime_type);
+	if (i == _impl->script_runners.end()) {
+		warn << "Unknown script MIME type `" << mime_type << "'" << endl;
+		return false;
+	}
+
+	return i->second(this, filename.c_str());
+}
+
+void
+World::add_interface_factory(const std::string& scheme, InterfaceFactory factory)
+{
+	_impl->interface_factories.insert(make_pair(scheme, factory));
+}
+
+
+void
+World::set_jack_uuid(const std::string& uuid)
+{
+	_impl->jack_uuid = uuid;
+}
+
+
+std::string
+World::jack_uuid()
+{
+	return _impl->jack_uuid;
+}
+
+
+} // namespace Shared
+} // namespace Ingen
diff --git a/src/shared/World.hpp b/src/shared/World.hpp
new file mode 100644
index 00000000..29d904b2
--- /dev/null
+++ b/src/shared/World.hpp
@@ -0,0 +1,120 @@
+/* This file is part of Ingen.
+ * Copyright (C) 2007-2009 David Robillard <http://drobilla.net>
+ *
+ * Ingen is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU General Public License as published by the Free Software
+ * Foundation; either version 2 of the License, or (at your option) any later
+ * version.
+ *
+ * Ingen is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef INGEN_MODULE_WORLD_HPP
+#define INGEN_MODULE_WORLD_HPP
+
+#include <map>
+#include <string>
+
+#include <boost/shared_ptr.hpp>
+#include <boost/utility.hpp>
+
+#include <glibmm/module.h>
+
+#include "raul/Configuration.hpp"
+#include "raul/SharedPtr.hpp"
+
+#include "ingen-config.h"
+
+#ifdef HAVE_SLV2
+typedef struct _SLV2World* SLV2World;
+#endif
+
+namespace Sord { class World; }
+
+namespace Ingen {
+
+class Engine;
+
+namespace Serialisation { class Serialiser; class Parser; }
+
+namespace Shared {
+
+class EngineInterface;
+class LV2Features;
+class LV2URIMap;
+class Store;
+class WorldImpl;
+
+
+/** The "world" all Ingen modules may share.
+ *
+ * All loaded components of Ingen, as well as things requiring shared access
+ * and/or locking (e.g. Sord, SLV2).
+ *
+ * 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.
+ */
+class World : public boost::noncopyable {
+public:
+	World(Raul::Configuration* conf, int& argc, char**& argv);
+	virtual ~World();
+
+	virtual bool load(const char* name);
+	virtual void unload_all();
+
+	typedef SharedPtr<Ingen::Shared::EngineInterface> (*InterfaceFactory)(
+			World* world, const std::string& engine_url);
+
+	virtual void add_interface_factory(const std::string& scheme,
+	                                   InterfaceFactory   factory);
+	
+	virtual SharedPtr<Ingen::Shared::EngineInterface> interface(
+		const std::string& engine_url);
+
+	virtual bool run(const std::string& mime_type,
+	                 const std::string& filename);
+
+	virtual void set_local_engine(SharedPtr<Engine> e);
+	virtual void set_engine(SharedPtr<EngineInterface> e);
+	virtual void set_serialiser(SharedPtr<Serialisation::Serialiser> s);
+	virtual void set_parser(SharedPtr<Serialisation::Parser> p);
+	virtual void set_store(SharedPtr<Store> s);
+
+	virtual SharedPtr<Engine>                    local_engine();
+	virtual SharedPtr<EngineInterface>           engine();
+	virtual SharedPtr<Serialisation::Serialiser> serialiser();
+	virtual SharedPtr<Serialisation::Parser>     parser();
+	virtual SharedPtr<Store>                     store();
+
+	virtual Sord::World*         rdf_world();
+	virtual SharedPtr<LV2URIMap> uris();
+
+	virtual int&    argc();
+	virtual char**& argv();
+
+	virtual Raul::Configuration* conf();
+	virtual void set_conf(Raul::Configuration* c);
+
+	virtual LV2Features* lv2_features();
+
+	virtual SLV2World slv2_world();
+
+	virtual void        set_jack_uuid(const std::string& uuid);
+	virtual std::string jack_uuid();
+
+private:
+	WorldImpl* _impl;
+};
+
+
+} // namespace Shared
+} // namespace Ingen
+
+#endif // INGEN_MODULE_WORLD_HPP
diff --git a/src/shared/wscript b/src/shared/wscript
index 811ed45e..4f03cf28 100644
--- a/src/shared/wscript
+++ b/src/shared/wscript
@@ -15,6 +15,7 @@ def build(bld):
 		LV2URIMap.cpp
 		ResourceImpl.cpp
 		Store.cpp
+		World.cpp
 		runtime_paths.cpp
 	'''
 	if bld.is_defined('HAVE_LIBLO'):
-- 
cgit v1.2.1