From 629fb50716083c71146340de97eb8651679ca9fb Mon Sep 17 00:00:00 2001 From: David Robillard Date: Tue, 31 Jul 2012 00:14:50 +0000 Subject: Merge Ingen::Shared namespace into Ingen namespace and core libingen library. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4579 a436a847-0d15-0410-975c-d299462d15a1 --- ingen/shared/AtomReader.hpp | 62 ----------------- ingen/shared/AtomSink.hpp | 42 ----------- ingen/shared/AtomWriter.hpp | 100 -------------------------- ingen/shared/Builder.hpp | 51 -------------- ingen/shared/ClashAvoider.hpp | 110 ----------------------------- ingen/shared/Configuration.hpp | 37 ---------- ingen/shared/Forge.hpp | 42 ----------- ingen/shared/LV2Features.hpp | 78 --------------------- ingen/shared/Module.hpp | 55 --------------- ingen/shared/Store.hpp | 62 ----------------- ingen/shared/URIMap.hpp | 82 ---------------------- ingen/shared/URIs.hpp | 145 -------------------------------------- ingen/shared/World.hpp | 154 ----------------------------------------- ingen/shared/runtime_paths.hpp | 35 ---------- 14 files changed, 1055 deletions(-) delete mode 100644 ingen/shared/AtomReader.hpp delete mode 100644 ingen/shared/AtomSink.hpp delete mode 100644 ingen/shared/AtomWriter.hpp delete mode 100644 ingen/shared/Builder.hpp delete mode 100644 ingen/shared/ClashAvoider.hpp delete mode 100644 ingen/shared/Configuration.hpp delete mode 100644 ingen/shared/Forge.hpp delete mode 100644 ingen/shared/LV2Features.hpp delete mode 100644 ingen/shared/Module.hpp delete mode 100644 ingen/shared/Store.hpp delete mode 100644 ingen/shared/URIMap.hpp delete mode 100644 ingen/shared/URIs.hpp delete mode 100644 ingen/shared/World.hpp delete mode 100644 ingen/shared/runtime_paths.hpp (limited to 'ingen/shared') diff --git a/ingen/shared/AtomReader.hpp b/ingen/shared/AtomReader.hpp deleted file mode 100644 index 38c89a2b..00000000 --- a/ingen/shared/AtomReader.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_ATOMREADER_HPP -#define INGEN_SHARED_ATOMREADER_HPP - -#include "ingen/Interface.hpp" -#include "ingen/shared/AtomSink.hpp" -#include "ingen/shared/URIs.hpp" -#include "serd/serd.h" - -namespace Ingen { -namespace Shared { - -class AtomSink; -class Forge; -class URIMap; - -/** An AtomSink that calls methods on an Interface. - * @ingroup IngenShared - */ -class AtomReader : public AtomSink -{ -public: - AtomReader(URIMap& map, URIs& uris, Forge& forge, Interface& iface); - ~AtomReader() {} - - static bool is_message(URIs& uris, const LV2_Atom* msg); - - bool write(const LV2_Atom* msg); - -private: - void get_atom(const LV2_Atom* in, Raul::Atom& out); - const char* atom_to_uri(const LV2_Atom* atom); - - void get_props(const LV2_Atom_Object* obj, - Ingen::Resource::Properties& props); - - URIMap& _map; - URIs& _uris; - Forge& _forge; - Interface& _iface; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_ATOMREADER_HPP - diff --git a/ingen/shared/AtomSink.hpp b/ingen/shared/AtomSink.hpp deleted file mode 100644 index f25e6548..00000000 --- a/ingen/shared/AtomSink.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_ATOMSINK_HPP -#define INGEN_SHARED_ATOMSINK_HPP - -#include "lv2/lv2plug.in/ns/ext/atom/atom.h" - -namespace Ingen { -namespace Shared { - -/** A sink for LV2 Atoms. - * @ingroup IngenShared - */ -class AtomSink { -public: - virtual ~AtomSink() {} - - /** Write an Atom to the sink. - * @return True on success. - */ - virtual bool write(const LV2_Atom* msg) = 0; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_ATOMSINK_HPP - diff --git a/ingen/shared/AtomWriter.hpp b/ingen/shared/AtomWriter.hpp deleted file mode 100644 index 7087bfd6..00000000 --- a/ingen/shared/AtomWriter.hpp +++ /dev/null @@ -1,100 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_ATOMWRITER_HPP -#define INGEN_SHARED_ATOMWRITER_HPP - -#include - -#include "ingen/Interface.hpp" -#include "ingen/shared/URIs.hpp" -#include "lv2/lv2plug.in/ns/ext/atom/forge.h" -#include "serd/serd.h" - -namespace Ingen { -namespace Shared { - -class AtomSink; -class URIMap; - -/** An Interface that writes LV2 atoms to an AtomSink. */ -class AtomWriter : public Interface -{ -public: - AtomWriter(URIMap& map, URIs& uris, AtomSink& sink); - ~AtomWriter() {} - - Raul::URI uri() const { return "http://drobilla.net/ns/ingen#AtomWriter"; } - - void bundle_begin(); - - void bundle_end(); - - void put(const Raul::URI& uri, - const Resource::Properties& properties, - Resource::Graph ctx = Resource::DEFAULT); - - void delta(const Raul::URI& uri, - const Resource::Properties& remove, - const Resource::Properties& add); - - void move(const Raul::Path& old_path, - const Raul::Path& new_path); - - void del(const Raul::URI& uri); - - void connect(const Raul::Path& tail, - const Raul::Path& head); - - void disconnect(const Raul::Path& tail, - const Raul::Path& head); - - void disconnect_all(const Raul::Path& parent_patch_path, - const Raul::Path& path); - - void set_property(const Raul::URI& subject, - const Raul::URI& predicate, - const Raul::Atom& value); - - void set_response_id(int32_t id); - - void get(const Raul::URI& uri); - - void response(int32_t id, Status status, const std::string& subject); - - void error(const std::string& msg); - -private: - void forge_uri(const Raul::URI& uri); - void forge_properties(const Resource::Properties& properties); - void forge_edge(const Raul::URI& tail, const Raul::URI& head); - - void finish_msg(); - int32_t next_id(); - - URIMap& _map; - URIs& _uris; - AtomSink& _sink; - SerdChunk _out; - LV2_Atom_Forge _forge; - int32_t _id; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_ATOMWRITER_HPP - diff --git a/ingen/shared/Builder.hpp b/ingen/shared/Builder.hpp deleted file mode 100644 index 1c57c871..00000000 --- a/ingen/shared/Builder.hpp +++ /dev/null @@ -1,51 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_BUILDER_HPP -#define INGEN_SHARED_BUILDER_HPP - -namespace Ingen { - -class Interface; -class GraphObject; - -namespace Shared { - -class URIs; - -/** Wrapper for Interface to create existing objects/models. - * - * @ingroup IngenShared - */ -class Builder -{ -public: - Builder(Shared::URIs& uris, Interface& interface); - virtual ~Builder() {} - - void build(SharedPtr object); - void connect(SharedPtr object); - -private: - Shared::URIs& _uris; - Interface& _interface; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_BUILDER_HPP - diff --git a/ingen/shared/ClashAvoider.hpp b/ingen/shared/ClashAvoider.hpp deleted file mode 100644 index e3f4faaf..00000000 --- a/ingen/shared/ClashAvoider.hpp +++ /dev/null @@ -1,110 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_CLASHAVOIDER_HPP -#define INGEN_SHARED_CLASHAVOIDER_HPP - -#include - -#include -#include - -#include "ingen/Interface.hpp" - -namespace Raul { -class Atom; -class Path; -} - -namespace Ingen { -namespace Shared { - -class Store; - -/** A wrapper for an Interface that creates objects but possibly maps - * symbol names to avoid clashes with the existing objects in a store. - * - * @ingroup IngenShared - */ -class ClashAvoider : public Interface -{ -public: - ClashAvoider(Store& store, Interface& target, Store* also_avoid=NULL) - : _store(store), _target(target), _also_avoid(also_avoid) {} - - Raul::URI uri() const { return "ingen:ClientStore"; } - - void set_target(Interface& target) { _target = target; } - - // Bundles - void bundle_begin() { _target.bundle_begin(); } - void bundle_end() { _target.bundle_end(); } - - // Object commands - - virtual void put(const Raul::URI& path, - const Resource::Properties& properties, - Resource::Graph ctx=Resource::DEFAULT); - - virtual void delta(const Raul::URI& path, - const Resource::Properties& remove, - const Resource::Properties& add); - - virtual void move(const Raul::Path& old_path, - const Raul::Path& new_path); - - virtual void connect(const Raul::Path& tail, - const Raul::Path& head); - - virtual void disconnect(const Raul::Path& tail, - const Raul::Path& head); - - virtual void disconnect_all(const Raul::Path& parent_patch_path, - const Raul::Path& path); - - virtual void set_property(const Raul::URI& subject_path, - const Raul::URI& predicate, - const Raul::Atom& value); - - virtual void del(const Raul::URI& uri); - - virtual void set_response_id(int32_t id) {} - virtual void get(const Raul::URI& uri) {} - virtual void response(int32_t id, Status status, const std::string& subject) {} - virtual void error(const std::string& msg) {} - -private: - const Raul::URI map_uri(const Raul::URI& in); - const Raul::Path map_path(const Raul::Path& in); - - Store& _store; - Interface& _target; - - Store* _also_avoid; - bool exists(const Raul::Path& path) const; - - typedef std::map Offsets; - Offsets _offsets; - - typedef std::map SymbolMap; - SymbolMap _symbol_map; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_CLASHAVOIDER_HPP - diff --git a/ingen/shared/Configuration.hpp b/ingen/shared/Configuration.hpp deleted file mode 100644 index 211184d0..00000000 --- a/ingen/shared/Configuration.hpp +++ /dev/null @@ -1,37 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_CONFIGURATION_HPP -#define INGEN_SHARED_CONFIGURATION_HPP - -#include "raul/Configuration.hpp" - -namespace Ingen { -namespace Shared { - -/** Ingen configuration (command line options). - * @ingroup IngenShared - */ -class Configuration : public Raul::Configuration { -public: - Configuration(); -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_CONFIGURATION_HPP - diff --git a/ingen/shared/Forge.hpp b/ingen/shared/Forge.hpp deleted file mode 100644 index 1d820bc0..00000000 --- a/ingen/shared/Forge.hpp +++ /dev/null @@ -1,42 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_FORGE_HPP -#define INGEN_SHARED_FORGE_HPP - -#include - -#include "raul/Atom.hpp" - -namespace Ingen { -namespace Shared { - -class URIMap; - -/** Forge for Raul Atoms. - * @ingroup IngenShared - */ -class Forge : public Raul::Forge { -public: - explicit Forge(Shared::URIMap& map); - - std::string str(const Raul::Atom& atom); -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_FORGE_HPP diff --git a/ingen/shared/LV2Features.hpp b/ingen/shared/LV2Features.hpp deleted file mode 100644 index 822df818..00000000 --- a/ingen/shared/LV2Features.hpp +++ /dev/null @@ -1,78 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_LV2FEATURES_HPP -#define INGEN_SHARED_LV2FEATURES_HPP - -#include - -#include "lv2/lv2plug.in/ns/lv2core/lv2.h" - -#include "raul/SharedPtr.hpp" -#include "raul/Noncopyable.hpp" - -namespace Ingen { - -class GraphObject; - -namespace Shared { - -class World; - -/** Features for use by LV2 plugins. - * @ingroup IngenShared - */ -class LV2Features { -public: - LV2Features(); - - class Feature { - public: - virtual ~Feature() {} - - virtual SharedPtr feature(Shared::World* world, - GraphObject* node) = 0; - }; - - class FeatureArray : public Raul::Noncopyable { - public: - typedef std::vector< SharedPtr > FeatureVector; - - explicit FeatureArray(FeatureVector& features); - - ~FeatureArray(); - - LV2_Feature** array() { return _array; } - - private: - FeatureVector _features; - LV2_Feature** _array; - }; - - void add_feature(SharedPtr feature); - - SharedPtr lv2_features(Shared::World* world, - GraphObject* node) const; - -private: - typedef std::vector< SharedPtr > Features; - Features _features; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_LV2FEATURES_HPP diff --git a/ingen/shared/Module.hpp b/ingen/shared/Module.hpp deleted file mode 100644 index 81179426..00000000 --- a/ingen/shared/Module.hpp +++ /dev/null @@ -1,55 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_MODULE_HPP -#define INGEN_SHARED_MODULE_HPP - -#include - -namespace Ingen { -namespace Shared { - -class World; - -/** A dynamically loaded Ingen module. - * - * All components of Ingen reside in one of these. - * @ingroup IngenShared - */ -struct Module { - Module() : library(NULL) {} - virtual ~Module() {} - - virtual void load(Ingen::Shared::World* world) = 0; - virtual void run(Ingen::Shared::World* world) {} - - /** Library implementing this module. - * - * This is managed by the World and not this class, since closing the library - * in this destructor could possibly reference code from the library - * afterwards and cause a segfault on exit. - */ - Glib::Module* library; - -private: - Module(const Module& noncopyable); - Module& operator=(const Module& noncopyable); -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_MODULE_HPP diff --git a/ingen/shared/Store.hpp b/ingen/shared/Store.hpp deleted file mode 100644 index af281b9a..00000000 --- a/ingen/shared/Store.hpp +++ /dev/null @@ -1,62 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_STORE_HPP -#define INGEN_SHARED_STORE_HPP - -#include - -#undef nil -#include - -#include "raul/PathTable.hpp" - -#include "ingen/GraphObject.hpp" - -namespace Ingen { -namespace Shared { - -/** Store of objects in the patch hierarchy. - * @ingroup IngenShared - */ -class Store : public Raul::PathTable< SharedPtr > { -public: - virtual ~Store() {} - - virtual void add(GraphObject* o); - - typedef Raul::Table< Raul::Path, SharedPtr > Objects; - - const_iterator children_begin(SharedPtr o) const; - const_iterator children_end(SharedPtr o) const; - - SharedPtr find_child(SharedPtr parent, - const std::string& child_name) const; - - unsigned child_name_offset(const Raul::Path& parent, - const Raul::Symbol& symbol, - bool allow_zero=true); - - Glib::RWLock& lock() { return _lock; } - -private: - Glib::RWLock _lock; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_STORE_HPP diff --git a/ingen/shared/URIMap.hpp b/ingen/shared/URIMap.hpp deleted file mode 100644 index d30b843d..00000000 --- a/ingen/shared/URIMap.hpp +++ /dev/null @@ -1,82 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_URIMAP_HPP -#define INGEN_SHARED_URIMAP_HPP - -#include -#include - -#include "ingen/shared/LV2Features.hpp" -#include "lv2/lv2plug.in/ns/ext/urid/urid.h" -#include "raul/URI.hpp" -#include "raul/Noncopyable.hpp" - -namespace Ingen { -namespace Shared { - -/** URI to integer map and implementation of LV2 URID extension. - * @ingroup IngenShared - */ -class URIMap : public Raul::Noncopyable { -public: - URIMap(LV2_URID_Map* map, LV2_URID_Unmap* unmap); - virtual ~URIMap() {} - - uint32_t map_uri(const char* uri); - const char* unmap_uri(uint32_t urid) const; - - class Feature : public LV2Features::Feature { - public: - Feature(const char* URI, void* data) { - _feature.URI = URI; - _feature.data = data; - } - - SharedPtr feature(Shared::World*, GraphObject*) { - return SharedPtr(&_feature, NullDeleter); - } - - private: - LV2_Feature _feature; - }; - - struct URIDMapFeature : public Feature { - URIDMapFeature(URIMap* map, LV2_URID_Map* urid_map); - LV2_URID map(const char* uri); - static LV2_URID default_map(LV2_URID_Map_Handle h, const char* uri); - LV2_URID_Map urid_map; - }; - - struct URIDUnmapFeature : public Feature { - URIDUnmapFeature(URIMap* map, LV2_URID_Unmap* urid_unmap); - const char* unmap(const LV2_URID urid); - static const char* default_unmap(LV2_URID_Map_Handle h, LV2_URID uri); - LV2_URID_Unmap urid_unmap; - }; - - SharedPtr urid_map_feature() { return _urid_map_feature; } - SharedPtr urid_unmap_feature() { return _urid_unmap_feature; } - -private: - SharedPtr _urid_map_feature; - SharedPtr _urid_unmap_feature; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_URIMAP_HPP diff --git a/ingen/shared/URIs.hpp b/ingen/shared/URIs.hpp deleted file mode 100644 index 9e604841..00000000 --- a/ingen/shared/URIs.hpp +++ /dev/null @@ -1,145 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_URIS_HPP -#define INGEN_SHARED_URIS_HPP - -#include "ingen/shared/Forge.hpp" -#include "lv2/lv2plug.in/ns/ext/urid/urid.h" -#include "raul/Atom.hpp" -#include "raul/Noncopyable.hpp" -#include "raul/URI.hpp" - -namespace Raul { - class Forge; -} - -namespace Ingen { -namespace Shared { - -class URIMap; - -/** Frequently used interned URIs. - * - * This class initially maps all the special URIs used throughout the code - * using the URIMap so they can be used quickly with the performance of - * integers, but still be dynamic. - * - * @ingroup IngenShared - */ -class URIs : public Raul::Noncopyable { -public: - URIs(Ingen::Shared::Forge& forge, URIMap* map); - - struct Quark : public Raul::URI { - Quark(Ingen::Shared::Forge& forge, URIMap* map, const char* str); - operator LV2_URID() const { return id; } - operator Raul::Atom() const { return atom; } - uint32_t id; - Raul::Atom atom; - }; - - Ingen::Shared::Forge& forge; - - const Quark atom_AtomPort; - const Quark atom_Blank; - const Quark atom_Bool; - const Quark atom_Chunk; - const Quark atom_Float; - const Quark atom_Int; - const Quark atom_Resource; - const Quark atom_Sequence; - const Quark atom_Sound; - const Quark atom_String; - const Quark atom_URI; - const Quark atom_URID; - const Quark atom_Vector; - const Quark atom_bufferType; - const Quark atom_eventTransfer; - const Quark atom_supports; - const Quark doap_name; - const Quark ingen_Edge; - const Quark ingen_Internal; - const Quark ingen_Node; - const Quark ingen_Patch; - const Quark ingen_activity; - const Quark ingen_broadcast; - const Quark ingen_canvasX; - const Quark ingen_canvasY; - const Quark ingen_controlBinding; - const Quark ingen_document; - const Quark ingen_enabled; - const Quark ingen_engine; - const Quark ingen_head; - const Quark ingen_incidentTo; - const Quark ingen_nil; - const Quark ingen_node; - const Quark ingen_polyphonic; - const Quark ingen_polyphony; - const Quark ingen_prototype; - const Quark ingen_sampleRate; - const Quark ingen_status; - const Quark ingen_tail; - const Quark ingen_uiEmbedded; - const Quark ingen_value; - const Quark lv2_AudioPort; - const Quark lv2_CVPort; - const Quark lv2_ControlPort; - const Quark lv2_InputPort; - const Quark lv2_OutputPort; - const Quark lv2_Plugin; - const Quark lv2_connectionOptional; - const Quark lv2_default; - const Quark lv2_index; - const Quark lv2_integer; - const Quark lv2_maximum; - const Quark lv2_minimum; - const Quark lv2_name; - const Quark lv2_portProperty; - const Quark lv2_sampleRate; - const Quark lv2_scalePoint; - const Quark lv2_symbol; - const Quark lv2_toggled; - const Quark midi_Bender; - const Quark midi_ChannelPressure; - const Quark midi_Controller; - const Quark midi_MidiEvent; - const Quark midi_NoteOn; - const Quark midi_controllerNumber; - const Quark midi_noteNumber; - const Quark patch_Delete; - const Quark patch_Get; - const Quark patch_Move; - const Quark patch_Patch; - const Quark patch_Put; - const Quark patch_Response; - const Quark patch_Set; - const Quark patch_add; - const Quark patch_body; - const Quark patch_destination; - const Quark patch_remove; - const Quark patch_request; - const Quark patch_subject; - const Quark pprops_logarithmic; - const Quark rdf_type; - const Quark rdfs_seeAlso; - const Quark wildcard; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_LV2URIMAP_HPP diff --git a/ingen/shared/World.hpp b/ingen/shared/World.hpp deleted file mode 100644 index 9ac0188b..00000000 --- a/ingen/shared/World.hpp +++ /dev/null @@ -1,154 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_WORLD_HPP -#define INGEN_SHARED_WORLD_HPP - -#include - -#include "lv2/lv2plug.in/ns/ext/urid/urid.h" -#include "raul/Noncopyable.hpp" -#include "raul/SharedPtr.hpp" - -typedef struct LilvWorldImpl LilvWorld; - -namespace Sord { class World; } - -namespace Ingen { - -class EngineBase; -class Interface; - -namespace Serialisation { -class Parser; -class Serialiser; -} - -namespace Shared { - -class Configuration; -class Forge; -class LV2Features; -class Store; -class URIMap; -class URIs; - -/** The "world" all Ingen modules share. - * - * This is the root to which all components of Ingen are connected. It - * contains all necessary shared data (including the world for libraries like - * Sord and Lilv) and holds references to components. - * - * Most functionality in Ingen is implemented in dynamically loaded modules, - * which are loaded using this interface. When loaded, those modules add - * facilities to the World which can then be used throughout the code. For - * example loading the "ingen_serialisation" module will set World::serialiser - * and World::parser to valid objects. - * - * The world is used in any process which uses the Ingen as a library, both - * client and server (e.g. the world may not actually contain an Engine, since - * it maybe running in another process or even on a different machine). - * - * @ingroup IngenShared - */ -class World : public Raul::Noncopyable { -public: - /** Construct a new Ingen world. - * @param argc Argument count (as in C main()) - * @param argv Argument vector (as in C main()) - * @param map LV2 URID map implementation, or NULL to use internal. - * @param unmap LV2 URID unmap implementation, or NULL to use internal. - */ - World(int& argc, - char**& argv, - LV2_URID_Map* map, - LV2_URID_Unmap* unmap); - - virtual ~World(); - - /** Load an Ingen module by name (e.g. "server", "gui", etc.) - * @return True on success. - */ - virtual bool load_module(const char* name); - - /** Run a loaded module (modules that "run" only, e.g. gui). - * @return True on success. - */ - virtual bool run_module(const char* name); - - /** Unload all loaded Ingen modules. */ - virtual void unload_modules(); - - /** A function to create a new remote Interface. */ - typedef SharedPtr (*InterfaceFactory)( - World* world, - const std::string& engine_url, - SharedPtr respondee); - - /** Register an InterfaceFactory (for module implementations). */ - virtual void add_interface_factory(const std::string& scheme, - InterfaceFactory factory); - - /** Return a new Interface to control a server. - * @param engine_url The URL of the possibly remote server to control. - * @param respondee The Interface that will receive responses to commands - * and broadcasts, if applicable. - */ - virtual SharedPtr new_interface( - const std::string& engine_url, - SharedPtr respondee); - - /** Run a script. */ - virtual bool run(const std::string& mime_type, - const std::string& filename); - - virtual void set_engine(SharedPtr e); - virtual void set_interface(SharedPtr e); - virtual void set_parser(SharedPtr p); - virtual void set_serialiser(SharedPtr s); - virtual void set_store(SharedPtr s); - - virtual SharedPtr engine(); - virtual SharedPtr interface(); - virtual SharedPtr parser(); - virtual SharedPtr serialiser(); - virtual SharedPtr store(); - - virtual int& argc(); - virtual char**& argv(); - virtual Configuration& conf(); - - virtual Sord::World* rdf_world(); - virtual LilvWorld* lilv_world(); - - virtual LV2Features& lv2_features(); - virtual Ingen::Shared::Forge& forge(); - virtual URIMap& uri_map(); - virtual URIs& uris(); - - virtual void set_jack_uuid(const std::string& uuid); - virtual std::string jack_uuid(); - -private: - class Impl; - - Impl* _impl; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_WORLD_HPP diff --git a/ingen/shared/runtime_paths.hpp b/ingen/shared/runtime_paths.hpp deleted file mode 100644 index 5709370b..00000000 --- a/ingen/shared/runtime_paths.hpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - This file is part of Ingen. - Copyright 2007-2012 David Robillard - - Ingen is free software: you can redistribute it and/or modify it under the - terms of the GNU Affero General Public License as published by the Free - Software Foundation, either version 3 of the License, or 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 Affero General Public License for details. - - You should have received a copy of the GNU Affero General Public License - along with Ingen. If not, see . -*/ - -#ifndef INGEN_SHARED_RUNTIME_PATHS_HPP -#define INGEN_SHARED_RUNTIME_PATHS_HPP - -#include - -namespace Ingen { -namespace Shared { - -void set_bundle_path(const char* path); -void set_bundle_path_from_code(void* function); - -std::string bundle_file_path(const std::string& name); -std::string data_file_path(const std::string& name); -std::string module_path(const std::string& name, std::string dir=""); - -} // namespace Ingen -} // namespace Shared - -#endif // INGEN_SHARED_RUNTIME_PATHS_HPP -- cgit v1.2.1