From 692d29dd5c57bbd226bd2bc91cfbd2329490a9bb Mon Sep 17 00:00:00 2001 From: David Robillard 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/shared/World.hpp | 120 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 src/shared/World.hpp (limited to 'src/shared/World.hpp') 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 + * + * 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 + +#include + +#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 (*InterfaceFactory)( + World* world, const std::string& engine_url); + + virtual void add_interface_factory(const std::string& scheme, + InterfaceFactory factory); + + virtual SharedPtr interface( + const std::string& engine_url); + + 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 SharedPtr local_engine(); + virtual SharedPtr engine(); + virtual SharedPtr serialiser(); + virtual SharedPtr parser(); + virtual SharedPtr store(); + + 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 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 -- cgit v1.2.1