From efe47ea54e71b359dde85c0f272e7fc3934b85e3 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 21 Oct 2011 16:30:17 +0000 Subject: Move World.hpp and Module.hpp to public include directory. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3560 a436a847-0d15-0410-975c-d299462d15a1 --- include/ingen/client/PluginModel.hpp | 2 +- include/ingen/shared/Module.hpp | 46 ++++++++++++++ include/ingen/shared/World.hpp | 120 +++++++++++++++++++++++++++++++++++ src/bindings/ingen_bindings.cpp | 2 +- src/client/HTTPClientReceiver.cpp | 2 +- src/client/HTTPEngineSender.cpp | 2 +- src/client/NodeModel.cpp | 2 +- src/client/ingen_client.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/serialisation/Parser.cpp | 2 +- src/serialisation/Serialiser.cpp | 2 +- src/serialisation/serialisation.cpp | 4 +- src/server/Context.hpp | 2 +- src/server/ControlBindings.cpp | 2 +- src/server/Engine.cpp | 2 +- src/server/HTTPClientSender.cpp | 2 +- src/server/HTTPEngineReceiver.cpp | 2 +- src/server/JackDriver.cpp | 2 +- src/server/LV2Info.cpp | 2 +- src/server/LV2Info.hpp | 2 +- src/server/NodeFactory.cpp | 2 +- src/server/NodeFactory.hpp | 2 +- src/server/PatchImpl.cpp | 2 +- src/server/events/SetPortValue.cpp | 2 +- src/server/ingen_engine.cpp | 4 +- src/server/ingen_http.cpp | 4 +- src/server/ingen_jack.cpp | 4 +- src/server/ingen_lv2.cpp | 2 +- src/server/ingen_osc.cpp | 4 +- src/shared/Module.hpp | 46 -------------- src/shared/World.cpp | 4 +- src/shared/World.hpp | 120 ----------------------------------- 41 files changed, 212 insertions(+), 212 deletions(-) create mode 100644 include/ingen/shared/Module.hpp create mode 100644 include/ingen/shared/World.hpp delete mode 100644 src/shared/Module.hpp delete mode 100644 src/shared/World.hpp diff --git a/include/ingen/client/PluginModel.hpp b/include/ingen/client/PluginModel.hpp index 28a64578..8eb53b74 100644 --- a/include/ingen/client/PluginModel.hpp +++ b/include/ingen/client/PluginModel.hpp @@ -27,7 +27,7 @@ #include "ingen/ServerInterface.hpp" #include "ingen/client/signal.hpp" #include "shared/ResourceImpl.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" namespace Ingen { diff --git a/include/ingen/shared/Module.hpp b/include/ingen/shared/Module.hpp new file mode 100644 index 00000000..f972a999 --- /dev/null +++ b/include/ingen/shared/Module.hpp @@ -0,0 +1,46 @@ +/* This file is part of Ingen. + * Copyright 2007-2011 David Robillard + * + * 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_SHARED_MODULE_HPP +#define INGEN_SHARED_MODULE_HPP + +#include + +#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(); + + virtual void load(Ingen::Shared::World* world) = 0; + virtual void run(Ingen::Shared::World* world) {} + + SharedPtr library; +}; + +} // namespace Shared +} // namespace Ingen + +#endif // INGEN_SHARED_MODULE_HPP diff --git a/include/ingen/shared/World.hpp b/include/ingen/shared/World.hpp new file mode 100644 index 00000000..4f0a00c2 --- /dev/null +++ b/include/ingen/shared/World.hpp @@ -0,0 +1,120 @@ +/* This file is part of Ingen. + * Copyright 2007-2011 David Robillard + * + * 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 + +#include +#include + +#include "raul/Configuration.hpp" +#include "raul/SharedPtr.hpp" + +typedef struct LilvWorldImpl LilvWorld; + +namespace Sord { class World; } + +namespace Ingen { + +class EngineBase; +class ClientInterface; +class ServerInterface; + +namespace Serialisation { class Serialiser; class Parser; } + +namespace Shared { + +class LV2Features; +class LV2URIMap; +class Store; + +/** 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, Lilv). + * + * 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_module(const char* name); + virtual bool run_module(const char* name); + + virtual void unload_modules(); + + typedef SharedPtr (*InterfaceFactory)( + World* world, + const std::string& engine_url, + SharedPtr respond_to); + + virtual void add_interface_factory(const std::string& scheme, + InterfaceFactory factory); + + virtual SharedPtr interface( + const std::string& engine_url, + SharedPtr respond_to); + + virtual bool run(const std::string& mime_type, + const std::string& filename); + + virtual void set_local_engine(SharedPtr e); + virtual void set_engine(SharedPtr e); + virtual void set_serialiser(SharedPtr s); + virtual void set_parser(SharedPtr p); + virtual void set_store(SharedPtr s); + virtual void set_client(SharedPtr c); + + virtual SharedPtr local_engine(); + virtual SharedPtr engine(); + virtual SharedPtr serialiser(); + virtual SharedPtr parser(); + virtual SharedPtr store(); + virtual SharedPtr client(); + + virtual Sord::World* rdf_world(); + virtual SharedPtr uris(); + + virtual int& argc(); + virtual char**& argv(); + + virtual Raul::Configuration* conf(); + virtual void set_conf(Raul::Configuration* c); + + virtual LV2Features* lv2_features(); + + virtual LilvWorld* lilv_world(); + + virtual void set_jack_uuid(const std::string& uuid); + virtual std::string jack_uuid(); + +private: + class Pimpl; + + Pimpl* _impl; +}; + +} // namespace Shared +} // namespace Ingen + +#endif // INGEN_MODULE_WORLD_HPP diff --git a/src/bindings/ingen_bindings.cpp b/src/bindings/ingen_bindings.cpp index 2e5b753d..c094ebc2 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 "server/Engine.hpp" -#include "shared/World.hpp" +#include "ingen/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 ce4c2384..b009dbf0 100644 --- a/src/client/HTTPClientReceiver.cpp +++ b/src/client/HTTPClientReceiver.cpp @@ -28,7 +28,7 @@ #include "raul/log.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "HTTPClientReceiver.hpp" #define LOG(s) s << "[HTTPClientReceiver] " diff --git a/src/client/HTTPEngineSender.cpp b/src/client/HTTPEngineSender.cpp index 6dfa34c6..43a3d44c 100644 --- a/src/client/HTTPEngineSender.cpp +++ b/src/client/HTTPEngineSender.cpp @@ -21,7 +21,7 @@ #include "raul/log.hpp" #include "sord/sordmm.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "HTTPEngineSender.hpp" #include "HTTPClientReceiver.hpp" diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp index 09350448..62a562e8 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/NodeModel.cpp @@ -19,7 +19,7 @@ #include #include "ingen/Port.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "shared/LV2URIMap.hpp" #include "ingen/client/NodeModel.hpp" diff --git a/src/client/ingen_client.cpp b/src/client/ingen_client.cpp index db32b117..03056f65 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 "shared/Module.hpp" -#include "shared/World.hpp" +#include "ingen/shared/Module.hpp" +#include "ingen/shared/World.hpp" #ifdef HAVE_LIBLO #include "OSCClientReceiver.hpp" #include "OSCEngineSender.hpp" diff --git a/src/gui/App.cpp b/src/gui/App.cpp index 1063ec39..bddcec2c 100644 --- a/src/gui/App.cpp +++ b/src/gui/App.cpp @@ -37,7 +37,7 @@ #include "server/Engine.hpp" #include "shared/LV2URIMap.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "App.hpp" #include "Configuration.hpp" diff --git a/src/gui/App.hpp b/src/gui/App.hpp index 2f26716f..174aad1c 100644 --- a/src/gui/App.hpp +++ b/src/gui/App.hpp @@ -29,7 +29,7 @@ #include "raul/SharedPtr.hpp" #include "raul/Deletable.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" namespace Ingen { class ClientInterface; diff --git a/src/gui/ConnectWindow.cpp b/src/gui/ConnectWindow.cpp index 04cd9bc0..760869d2 100644 --- a/src/gui/ConnectWindow.cpp +++ b/src/gui/ConnectWindow.cpp @@ -26,8 +26,8 @@ #include "ingen-config.h" #include "ingen/ServerInterface.hpp" -#include "shared/Module.hpp" -#include "shared/World.hpp" +#include "ingen/shared/Module.hpp" +#include "ingen/shared/World.hpp" #include "server/Engine.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/client/PatchModel.hpp" diff --git a/src/gui/LoadRemotePatchWindow.cpp b/src/gui/LoadRemotePatchWindow.cpp index 10689bd3..1bfafc50 100644 --- a/src/gui/LoadRemotePatchWindow.cpp +++ b/src/gui/LoadRemotePatchWindow.cpp @@ -20,7 +20,7 @@ #include #include "ingen/client/PatchModel.hpp" #include "ingen/ServerInterface.hpp" -#include "shared/World.hpp" +#include "ingen/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 dba64490..a0440ade 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -31,7 +31,7 @@ #include "ingen/client/PatchModel.hpp" #include "ingen/client/NodeModel.hpp" #include "ingen/client/ClientStore.hpp" -#include "shared/World.hpp" +#include "ingen/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 dea0e78f..1f6a2ca7 100644 --- a/src/gui/PropertiesWindow.cpp +++ b/src/gui/PropertiesWindow.cpp @@ -18,7 +18,7 @@ #include #include #include "raul/log.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "ingen/client/NodeModel.hpp" #include "ingen/client/PluginModel.hpp" #include "App.hpp" diff --git a/src/gui/ThreadedLoader.cpp b/src/gui/ThreadedLoader.cpp index e4dbb303..22a311e9 100644 --- a/src/gui/ThreadedLoader.cpp +++ b/src/gui/ThreadedLoader.cpp @@ -17,8 +17,8 @@ #include #include "raul/log.hpp" -#include "shared/World.hpp" -#include "shared/Module.hpp" +#include "ingen/shared/World.hpp" +#include "ingen/shared/Module.hpp" #include "App.hpp" #include "ThreadedLoader.hpp" #include "ingen/client/PatchModel.hpp" diff --git a/src/gui/UploadPatchWindow.cpp b/src/gui/UploadPatchWindow.cpp index 0c02f411..79b54a10 100644 --- a/src/gui/UploadPatchWindow.cpp +++ b/src/gui/UploadPatchWindow.cpp @@ -21,7 +21,7 @@ #include #include #include -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "shared/LV2URIMap.hpp" #include "ingen/client/ClientStore.hpp" #include "ingen/ServerInterface.hpp" diff --git a/src/gui/ingen_gui.cpp b/src/gui/ingen_gui.cpp index 88d27b39..2ab86894 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 "shared/Module.hpp" +#include "ingen/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 688a75ec..cb76f778 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -43,7 +43,7 @@ #include "ingen/ServerInterface.hpp" #include "ingen/serialisation/Parser.hpp" #include "ingen/shared/Configuration.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "ingen/shared/runtime_paths.hpp" #include "ingen/client/ThreadedSigClientInterface.hpp" #ifdef WITH_BINDINGS diff --git a/src/serialisation/Parser.cpp b/src/serialisation/Parser.cpp index 92577294..ef7c9d8f 100644 --- a/src/serialisation/Parser.cpp +++ b/src/serialisation/Parser.cpp @@ -35,7 +35,7 @@ #include "sord/sordmm.hpp" #include "ingen/ServerInterface.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "shared/LV2URIMap.hpp" #include "ingen/serialisation/Parser.hpp" diff --git a/src/serialisation/Serialiser.cpp b/src/serialisation/Serialiser.cpp index f216028e..698e8f4b 100644 --- a/src/serialisation/Serialiser.cpp +++ b/src/serialisation/Serialiser.cpp @@ -53,7 +53,7 @@ #include "shared/LV2URIMap.hpp" #include "shared/ResourceImpl.hpp" #include "shared/Store.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "ingen/serialisation/Serialiser.hpp" diff --git a/src/serialisation/serialisation.cpp b/src/serialisation/serialisation.cpp index af6a9a6d..309c4271 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 "shared/Module.hpp" -#include "shared/World.hpp" +#include "ingen/shared/Module.hpp" +#include "ingen/shared/World.hpp" #include "ingen/serialisation/Parser.hpp" #include "ingen/serialisation/Serialiser.hpp" diff --git a/src/server/Context.hpp b/src/server/Context.hpp index 8cbe90f0..e4c692dd 100644 --- a/src/server/Context.hpp +++ b/src/server/Context.hpp @@ -20,7 +20,7 @@ #include "raul/RingBuffer.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "Engine.hpp" #include "types.hpp" diff --git a/src/server/ControlBindings.cpp b/src/server/ControlBindings.cpp index 39db7de1..77c1fdf7 100644 --- a/src/server/ControlBindings.cpp +++ b/src/server/ControlBindings.cpp @@ -19,7 +19,7 @@ #include "raul/log.hpp" #include "raul/midi_events.h" #include "shared/LV2URIMap.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "AudioBuffer.hpp" #include "ControlBindings.hpp" diff --git a/src/server/Engine.cpp b/src/server/Engine.cpp index 9ba52c88..bf5946ce 100644 --- a/src/server/Engine.cpp +++ b/src/server/Engine.cpp @@ -26,7 +26,7 @@ #include "ingen/EventType.hpp" #include "events/CreatePatch.hpp" #include "events/CreatePort.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "shared/LV2Features.hpp" #include "shared/LV2URIMap.hpp" #include "shared/Store.hpp" diff --git a/src/server/HTTPClientSender.cpp b/src/server/HTTPClientSender.cpp index 990b28e5..85a291a5 100644 --- a/src/server/HTTPClientSender.cpp +++ b/src/server/HTTPClientSender.cpp @@ -21,7 +21,7 @@ #include "raul/Atom.hpp" #include "raul/AtomRDF.hpp" #include "ingen/serialisation/Serialiser.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "HTTPClientSender.hpp" #include "Engine.hpp" diff --git a/src/server/HTTPEngineReceiver.cpp b/src/server/HTTPEngineReceiver.cpp index ef0e1ee3..855cb486 100644 --- a/src/server/HTTPEngineReceiver.cpp +++ b/src/server/HTTPEngineReceiver.cpp @@ -27,7 +27,7 @@ #include "raul/log.hpp" #include "ingen/ClientInterface.hpp" -#include "shared/Module.hpp" +#include "ingen/shared/Module.hpp" #include "ingen/serialisation/Parser.hpp" #include "ingen/serialisation/Serialiser.hpp" diff --git a/src/server/JackDriver.cpp b/src/server/JackDriver.cpp index 2e2f7c0c..7a36bf1e 100644 --- a/src/server/JackDriver.cpp +++ b/src/server/JackDriver.cpp @@ -47,7 +47,7 @@ #include "ProcessSlave.hpp" #include "QueuedEvent.hpp" #include "ThreadManager.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "shared/LV2Features.hpp" #include "shared/LV2URIMap.hpp" #include "util.hpp" diff --git a/src/server/LV2Info.cpp b/src/server/LV2Info.cpp index 83c77ace..1ff351b6 100644 --- a/src/server/LV2Info.cpp +++ b/src/server/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 "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "shared/LV2Features.hpp" #include "LV2EventFeature.hpp" diff --git a/src/server/LV2Info.hpp b/src/server/LV2Info.hpp index f40cde2c..b32eb594 100644 --- a/src/server/LV2Info.hpp +++ b/src/server/LV2Info.hpp @@ -22,7 +22,7 @@ #include #include "lilv/lilv.h" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" namespace Ingen { diff --git a/src/server/NodeFactory.cpp b/src/server/NodeFactory.cpp index 408576e0..cb1e1ec3 100644 --- a/src/server/NodeFactory.cpp +++ b/src/server/NodeFactory.cpp @@ -31,7 +31,7 @@ #include "internals/Delay.hpp" #include "internals/Note.hpp" #include "internals/Trigger.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "Engine.hpp" #include "InternalPlugin.hpp" diff --git a/src/server/NodeFactory.hpp b/src/server/NodeFactory.hpp index b3aff687..69379d1a 100644 --- a/src/server/NodeFactory.hpp +++ b/src/server/NodeFactory.hpp @@ -23,7 +23,7 @@ #include "raul/SharedPtr.hpp" #include "raul/URI.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" namespace Ingen { namespace Server { diff --git a/src/server/PatchImpl.cpp b/src/server/PatchImpl.cpp index 51ac89af..cf50ee2a 100644 --- a/src/server/PatchImpl.cpp +++ b/src/server/PatchImpl.cpp @@ -32,7 +32,7 @@ #include "ProcessSlave.hpp" #include "ThreadManager.hpp" #include "shared/LV2URIMap.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" using namespace std; using namespace Raul; diff --git a/src/server/events/SetPortValue.cpp b/src/server/events/SetPortValue.cpp index d71a504a..7c3adb7e 100644 --- a/src/server/events/SetPortValue.cpp +++ b/src/server/events/SetPortValue.cpp @@ -21,7 +21,7 @@ #include "shared/LV2URIMap.hpp" #include "shared/LV2Features.hpp" #include "ingen/shared/LV2Atom.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "AudioBuffer.hpp" #include "ClientBroadcaster.hpp" #include "ControlBindings.hpp" diff --git a/src/server/ingen_engine.cpp b/src/server/ingen_engine.cpp index a0cda60c..b7b28575 100644 --- a/src/server/ingen_engine.cpp +++ b/src/server/ingen_engine.cpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "shared/Module.hpp" -#include "shared/World.hpp" +#include "ingen/shared/Module.hpp" +#include "ingen/shared/World.hpp" #include "Engine.hpp" #include "QueuedEngineInterface.hpp" #include "util.hpp" diff --git a/src/server/ingen_http.cpp b/src/server/ingen_http.cpp index d205b175..dabd7360 100644 --- a/src/server/ingen_http.cpp +++ b/src/server/ingen_http.cpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "shared/Module.hpp" -#include "shared/World.hpp" +#include "ingen/shared/Module.hpp" +#include "ingen/shared/World.hpp" #include "HTTPEngineReceiver.hpp" #include "Engine.hpp" diff --git a/src/server/ingen_jack.cpp b/src/server/ingen_jack.cpp index ff760f1c..73098e4c 100644 --- a/src/server/ingen_jack.cpp +++ b/src/server/ingen_jack.cpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "shared/Module.hpp" -#include "shared/World.hpp" +#include "ingen/shared/Module.hpp" +#include "ingen/shared/World.hpp" #include "JackDriver.hpp" #include "Engine.hpp" diff --git a/src/server/ingen_lv2.cpp b/src/server/ingen_lv2.cpp index d61b2f40..af13680d 100644 --- a/src/server/ingen_lv2.cpp +++ b/src/server/ingen_lv2.cpp @@ -41,7 +41,7 @@ #include "server/QueuedEngineInterface.hpp" #include "server/ThreadManager.hpp" #include "ingen/ServerInterface.hpp" -#include "shared/World.hpp" +#include "ingen/shared/World.hpp" #include "ingen/serialisation/Parser.hpp" #include "ingen/shared/Configuration.hpp" #include "ingen/shared/runtime_paths.hpp" diff --git a/src/server/ingen_osc.cpp b/src/server/ingen_osc.cpp index f10481e5..5b0ba285 100644 --- a/src/server/ingen_osc.cpp +++ b/src/server/ingen_osc.cpp @@ -15,8 +15,8 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#include "shared/Module.hpp" -#include "shared/World.hpp" +#include "ingen/shared/Module.hpp" +#include "ingen/shared/World.hpp" #include "OSCEngineReceiver.hpp" #include "Engine.hpp" diff --git a/src/shared/Module.hpp b/src/shared/Module.hpp deleted file mode 100644 index f972a999..00000000 --- a/src/shared/Module.hpp +++ /dev/null @@ -1,46 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2007-2011 David Robillard - * - * 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_SHARED_MODULE_HPP -#define INGEN_SHARED_MODULE_HPP - -#include - -#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(); - - virtual void load(Ingen::Shared::World* world) = 0; - virtual void run(Ingen::Shared::World* world) {} - - SharedPtr library; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_MODULE_HPP diff --git a/src/shared/World.cpp b/src/shared/World.cpp index 19e85a15..92d7a03f 100644 --- a/src/shared/World.cpp +++ b/src/shared/World.cpp @@ -26,11 +26,11 @@ #include "sord/sordmm.hpp" #include "ingen/EngineBase.hpp" +#include "ingen/shared/Module.hpp" +#include "ingen/shared/World.hpp" #include "ingen/shared/runtime_paths.hpp" #include "shared/LV2Features.hpp" #include "shared/LV2URIMap.hpp" -#include "World.hpp" -#include "Module.hpp" #define LOG(s) s << "[Module] " diff --git a/src/shared/World.hpp b/src/shared/World.hpp deleted file mode 100644 index 4f0a00c2..00000000 --- a/src/shared/World.hpp +++ /dev/null @@ -1,120 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2007-2011 David Robillard - * - * 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 - -#include -#include - -#include "raul/Configuration.hpp" -#include "raul/SharedPtr.hpp" - -typedef struct LilvWorldImpl LilvWorld; - -namespace Sord { class World; } - -namespace Ingen { - -class EngineBase; -class ClientInterface; -class ServerInterface; - -namespace Serialisation { class Serialiser; class Parser; } - -namespace Shared { - -class LV2Features; -class LV2URIMap; -class Store; - -/** 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, Lilv). - * - * 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_module(const char* name); - virtual bool run_module(const char* name); - - virtual void unload_modules(); - - typedef SharedPtr (*InterfaceFactory)( - World* world, - const std::string& engine_url, - SharedPtr respond_to); - - virtual void add_interface_factory(const std::string& scheme, - InterfaceFactory factory); - - virtual SharedPtr interface( - const std::string& engine_url, - SharedPtr respond_to); - - virtual bool run(const std::string& mime_type, - const std::string& filename); - - virtual void set_local_engine(SharedPtr e); - virtual void set_engine(SharedPtr e); - virtual void set_serialiser(SharedPtr s); - virtual void set_parser(SharedPtr p); - virtual void set_store(SharedPtr s); - virtual void set_client(SharedPtr c); - - virtual SharedPtr local_engine(); - virtual SharedPtr engine(); - virtual SharedPtr serialiser(); - virtual SharedPtr parser(); - virtual SharedPtr store(); - virtual SharedPtr client(); - - virtual Sord::World* rdf_world(); - virtual SharedPtr uris(); - - virtual int& argc(); - virtual char**& argv(); - - virtual Raul::Configuration* conf(); - virtual void set_conf(Raul::Configuration* c); - - virtual LV2Features* lv2_features(); - - virtual LilvWorld* lilv_world(); - - virtual void set_jack_uuid(const std::string& uuid); - virtual std::string jack_uuid(); - -private: - class Pimpl; - - Pimpl* _impl; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_MODULE_WORLD_HPP -- cgit v1.2.1