From 8ec295a0f2a40086ed83e8d2ad8ad38c8125bcb4 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Thu, 10 May 2012 04:02:24 +0000 Subject: LV2URIMap => URIMap. Trim unnecessary includes. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4337 a436a847-0d15-0410-975c-d299462d15a1 --- ingen/client/ClientStore.hpp | 8 ++--- ingen/shared/AtomReader.hpp | 6 ++-- ingen/shared/AtomWriter.hpp | 6 ++-- ingen/shared/Forge.hpp | 5 +-- ingen/shared/LV2URIMap.hpp | 81 -------------------------------------------- ingen/shared/URIMap.hpp | 81 ++++++++++++++++++++++++++++++++++++++++++++ ingen/shared/URIs.hpp | 8 +++-- ingen/shared/World.hpp | 6 ++-- 8 files changed, 101 insertions(+), 100 deletions(-) delete mode 100644 ingen/shared/LV2URIMap.hpp create mode 100644 ingen/shared/URIMap.hpp (limited to 'ingen') diff --git a/ingen/client/ClientStore.hpp b/ingen/client/ClientStore.hpp index 714bdb2d..72133e34 100644 --- a/ingen/client/ClientStore.hpp +++ b/ingen/client/ClientStore.hpp @@ -21,16 +21,14 @@ #include #include +#include "ingen/Interface.hpp" +#include "ingen/client/signal.hpp" +#include "ingen/shared/Store.hpp" #include "raul/Path.hpp" #include "raul/PathTable.hpp" #include "raul/SharedPtr.hpp" #include "raul/TableImpl.hpp" -#include "ingen/Interface.hpp" -#include "ingen/client/signal.hpp" -#include "ingen/shared/LV2URIMap.hpp" -#include "ingen/shared/Store.hpp" - namespace Raul { class Atom; } namespace Ingen { diff --git a/ingen/shared/AtomReader.hpp b/ingen/shared/AtomReader.hpp index ef80a4b1..30c4a8b0 100644 --- a/ingen/shared/AtomReader.hpp +++ b/ingen/shared/AtomReader.hpp @@ -19,7 +19,6 @@ #include "ingen/Interface.hpp" #include "ingen/shared/AtomSink.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "serd/serd.h" @@ -30,12 +29,13 @@ class Forge; namespace Shared { class AtomSink; +class URIMap; /** An AtomSink that calls methods on an Interface. */ class AtomReader : public AtomSink { public: - AtomReader(LV2URIMap& map, URIs& uris, Forge& forge, Interface& iface); + AtomReader(URIMap& map, URIs& uris, Forge& forge, Interface& iface); ~AtomReader() {} void write(const LV2_Atom* msg); @@ -46,7 +46,7 @@ private: void get_props(const LV2_Atom_Object* obj, Ingen::Resource::Properties& props); - LV2URIMap& _map; + URIMap& _map; URIs& _uris; Forge& _forge; Interface& _iface; diff --git a/ingen/shared/AtomWriter.hpp b/ingen/shared/AtomWriter.hpp index 3b70bb89..32997c66 100644 --- a/ingen/shared/AtomWriter.hpp +++ b/ingen/shared/AtomWriter.hpp @@ -18,7 +18,6 @@ #define INGEN_SHARED_ATOM_WRITER_HPP #include "ingen/Interface.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/URIs.hpp" #include "lv2/lv2plug.in/ns/ext/atom/forge.h" #include "serd/serd.h" @@ -27,12 +26,13 @@ namespace Ingen { namespace Shared { class AtomSink; +class URIMap; /** An Interface that writes LV2 atoms. */ class AtomWriter : public Interface { public: - AtomWriter(LV2URIMap& map, URIs& uris, AtomSink& sink); + AtomWriter(URIMap& map, URIs& uris, AtomSink& sink); ~AtomWriter() {} Raul::URI uri() const { return "http://drobilla.net/ns/ingen#AtomWriter"; } @@ -83,7 +83,7 @@ private: void finish_msg(); int32_t next_id(); - LV2URIMap& _map; + URIMap& _map; URIs& _uris; AtomSink& _sink; SerdChunk _out; diff --git a/ingen/shared/Forge.hpp b/ingen/shared/Forge.hpp index 084ca4fb..8f7facb2 100644 --- a/ingen/shared/Forge.hpp +++ b/ingen/shared/Forge.hpp @@ -18,14 +18,15 @@ #define INGEN_FORGE_HPP #include "ingen/shared/Forge.hpp" -#include "ingen/shared/LV2URIMap.hpp" #include "raul/Atom.hpp" namespace Ingen { +namespace Shared { class URIMap; } + class Forge : public Raul::Forge { public: - explicit Forge(Shared::LV2URIMap& map); + explicit Forge(Shared::URIMap& map); std::string str(const Raul::Atom& atom); }; diff --git a/ingen/shared/LV2URIMap.hpp b/ingen/shared/LV2URIMap.hpp deleted file mode 100644 index bc6074d4..00000000 --- a/ingen/shared/LV2URIMap.hpp +++ /dev/null @@ -1,81 +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_LV2URIMAP_HPP -#define INGEN_SHARED_LV2URIMAP_HPP - -#include -#include - -#include - -#include "ingen/shared/LV2Features.hpp" -#include "lv2/lv2plug.in/ns/ext/urid/urid.h" -#include "raul/URI.hpp" - -namespace Ingen { -namespace Shared { - -/** URI to Integer Map */ -class LV2URIMap : public boost::noncopyable { -public: - LV2URIMap(LV2_URID_Map* map, LV2_URID_Unmap* unmap); - virtual ~LV2URIMap() {} - - uint32_t map_uri(const char* uri); - const char* unmap_uri(uint32_t urid); - - class Feature : public LV2Features::Feature { - public: - Feature(const char* URI, void* data) { - _feature.URI = URI; - _feature.data = data; - } - - SharedPtr feature(Shared::World*, Node*) { - return SharedPtr(&_feature, NullDeleter); - } - - private: - LV2_Feature _feature; - }; - - struct URIDMapFeature : public Feature { - URIDMapFeature(LV2URIMap* 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(LV2URIMap* 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_LV2URIMAP_HPP diff --git a/ingen/shared/URIMap.hpp b/ingen/shared/URIMap.hpp new file mode 100644 index 00000000..39f17bea --- /dev/null +++ b/ingen/shared/URIMap.hpp @@ -0,0 +1,81 @@ +/* + 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_LV2URIMAP_HPP +#define INGEN_SHARED_LV2URIMAP_HPP + +#include +#include + +#include + +#include "ingen/shared/LV2Features.hpp" +#include "lv2/lv2plug.in/ns/ext/urid/urid.h" +#include "raul/URI.hpp" + +namespace Ingen { +namespace Shared { + +/** URI to Integer Map */ +class URIMap : public boost::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); + + class Feature : public LV2Features::Feature { + public: + Feature(const char* URI, void* data) { + _feature.URI = URI; + _feature.data = data; + } + + SharedPtr feature(Shared::World*, Node*) { + 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_LV2URIMAP_HPP diff --git a/ingen/shared/URIs.hpp b/ingen/shared/URIs.hpp index 9ebdbf27..17181269 100644 --- a/ingen/shared/URIs.hpp +++ b/ingen/shared/URIs.hpp @@ -19,8 +19,8 @@ #include -#include "ingen/shared/LV2URIMap.hpp" #include "ingen/shared/Forge.hpp" +#include "lv2/lv2plug.in/ns/ext/urid/urid.h" #include "raul/Atom.hpp" #include "raul/URI.hpp" @@ -31,12 +31,14 @@ namespace Raul { namespace Ingen { namespace Shared { +class URIMap; + class URIs : public boost::noncopyable { public: - URIs(Ingen::Forge& forge, LV2URIMap* map); + URIs(Ingen::Forge& forge, URIMap* map); struct Quark : public Raul::URI { - Quark(Ingen::Forge& forge, LV2URIMap* map, const char* str); + Quark(Ingen::Forge& forge, URIMap* map, const char* str); operator LV2_URID() const { return id; } operator Raul::Atom() const { return atom; } uint32_t id; diff --git a/ingen/shared/World.hpp b/ingen/shared/World.hpp index 6279e31f..5f162a9b 100644 --- a/ingen/shared/World.hpp +++ b/ingen/shared/World.hpp @@ -46,7 +46,7 @@ namespace Shared { class LV2Features; class URIs; -class LV2URIMap; +class URIMap; class Store; /** The "world" all Ingen modules may share. @@ -102,8 +102,8 @@ public: virtual Sord::World* rdf_world(); - virtual SharedPtr uris(); - virtual SharedPtr lv2_uri_map(); + virtual SharedPtr uris(); + virtual SharedPtr uri_map(); virtual int& argc(); virtual char**& argv(); -- cgit v1.2.1