From 3500ef73d4f668897df248a11bd631e11180045c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 21 Oct 2011 19:54:57 +0000 Subject: Move more headers to shared include directory. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3566 a436a847-0d15-0410-975c-d299462d15a1 --- src/shared/Builder.cpp | 2 +- src/shared/ClashAvoider.cpp | 3 +- src/shared/LV2Atom.cpp | 5 ++- src/shared/LV2Features.cpp | 4 +-- src/shared/LV2Features.hpp | 77 --------------------------------------- src/shared/LV2URIMap.cpp | 6 ++-- src/shared/LV2URIMap.hpp | 71 ------------------------------------ src/shared/ResourceImpl.cpp | 4 +-- src/shared/ResourceImpl.hpp | 87 --------------------------------------------- src/shared/Store.cpp | 2 +- src/shared/Store.hpp | 59 ------------------------------ src/shared/World.cpp | 4 +-- 12 files changed, 13 insertions(+), 311 deletions(-) delete mode 100644 src/shared/LV2Features.hpp delete mode 100644 src/shared/LV2URIMap.hpp delete mode 100644 src/shared/ResourceImpl.hpp delete mode 100644 src/shared/Store.hpp (limited to 'src/shared') diff --git a/src/shared/Builder.cpp b/src/shared/Builder.cpp index 83c2eafc..fff40f3f 100644 --- a/src/shared/Builder.cpp +++ b/src/shared/Builder.cpp @@ -25,7 +25,7 @@ #include "ingen/Plugin.hpp" #include "ingen/Port.hpp" #include "ingen/shared/Builder.hpp" -#include "shared/LV2URIMap.hpp" +#include "ingen/shared/LV2URIMap.hpp" using namespace std; using namespace Raul; diff --git a/src/shared/ClashAvoider.cpp b/src/shared/ClashAvoider.cpp index b9135951..9e8ea973 100644 --- a/src/shared/ClashAvoider.cpp +++ b/src/shared/ClashAvoider.cpp @@ -21,8 +21,7 @@ #include "raul/log.hpp" #include "ingen/shared/ClashAvoider.hpp" - -#include "Store.hpp" +#include "ingen/shared/Store.hpp" using namespace std; using namespace Raul; diff --git a/src/shared/LV2Atom.cpp b/src/shared/LV2Atom.cpp index 3381b90b..25e169e0 100644 --- a/src/shared/LV2Atom.cpp +++ b/src/shared/LV2Atom.cpp @@ -16,14 +16,13 @@ */ #include "ingen/shared/LV2Atom.hpp" +#include "ingen/shared/LV2Features.hpp" +#include "ingen/shared/LV2URIMap.hpp" #include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "lv2/lv2plug.in/ns/ext/uri-map/uri-map.h" #include "raul/Atom.hpp" #include "raul/log.hpp" -#include "LV2Features.hpp" -#include "LV2URIMap.hpp" - using namespace std; using namespace Raul; diff --git a/src/shared/LV2Features.cpp b/src/shared/LV2Features.cpp index ea5cdd8a..753c0969 100644 --- a/src/shared/LV2Features.cpp +++ b/src/shared/LV2Features.cpp @@ -17,8 +17,8 @@ #include -#include "LV2Features.hpp" -#include "LV2URIMap.hpp" +#include "ingen/shared/LV2Features.hpp" +#include "ingen/shared/LV2URIMap.hpp" using namespace std; diff --git a/src/shared/LV2Features.hpp b/src/shared/LV2Features.hpp deleted file mode 100644 index f33cc605..00000000 --- a/src/shared/LV2Features.hpp +++ /dev/null @@ -1,77 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2008-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_LV2FEATURES_HPP -#define INGEN_SHARED_LV2FEATURES_HPP - -#include - -#include "lv2/lv2plug.in/ns/lv2core/lv2.h" - -#include "raul/SharedPtr.hpp" - -namespace Ingen { - -class Node; - -namespace Shared { - -class World; - -/** Stuff that may need to be passed to an LV2 plugin (i.e. LV2 features). - */ -class LV2Features { -public: - LV2Features(); - - class Feature { - public: - virtual ~Feature() {} - - virtual SharedPtr feature(Shared::World* world, - Node* node) = 0; - }; - - class FeatureArray { - 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, - Node* node) const; - -private: - typedef std::vector< SharedPtr > Features; - Features _features; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_LV2FEATURES_HPP diff --git a/src/shared/LV2URIMap.cpp b/src/shared/LV2URIMap.cpp index 78d22b70..f87fdfce 100644 --- a/src/shared/LV2URIMap.cpp +++ b/src/shared/LV2URIMap.cpp @@ -24,12 +24,10 @@ #include -#include "raul/log.hpp" - +#include "ingen/shared/LV2URIMap.hpp" #include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "lv2/lv2plug.in/ns/ext/event/event.h" - -#include "LV2URIMap.hpp" +#include "raul/log.hpp" using namespace std; using namespace Raul; diff --git a/src/shared/LV2URIMap.hpp b/src/shared/LV2URIMap.hpp deleted file mode 100644 index 4fd50e92..00000000 --- a/src/shared/LV2URIMap.hpp +++ /dev/null @@ -1,71 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2008-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_LV2URIMAP_HPP -#define INGEN_SHARED_LV2URIMAP_HPP - -#include -#include - -#include - -#include "ingen/shared/URIs.hpp" -#include "lv2/lv2plug.in/ns/ext/uri-map/uri-map.h" -#include "raul/URI.hpp" - -#include "LV2Features.hpp" - -namespace Ingen { -namespace Shared { - -/** Implementation of the LV2 URI Map extension - */ -class LV2URIMap : public boost::noncopyable, public LV2Features::Feature { -public: - LV2URIMap(URIs& uris); - - SharedPtr feature(Shared::World*, Node*) { - return SharedPtr(&uri_map_feature, NullDeleter); - } - - virtual uint32_t uri_to_id(const char* map, const char* uri); - virtual const char* id_to_uri(const char* map, uint32_t id); - - std::pair event_to_global(uint16_t event_id) const; - std::pair global_to_event(uint32_t global_id) const; - -private: - static uint32_t uri_map_uri_to_id(LV2_URI_Map_Callback_Data callback_data, - const char* map, - const char* uri); - - LV2_Feature uri_map_feature; - LV2_URI_Map_Feature uri_map_feature_data; - - typedef std::map EventToGlobal; - typedef std::map GlobalToEvent; - - EventToGlobal _event_to_global; - GlobalToEvent _global_to_event; - - URIs& _uris; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_LV2URIMAP_HPP diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp index 1f9662f3..6f4b713b 100644 --- a/src/shared/ResourceImpl.cpp +++ b/src/shared/ResourceImpl.cpp @@ -17,8 +17,8 @@ #include "raul/log.hpp" #include "raul/Atom.hpp" -#include "shared/LV2URIMap.hpp" -#include "ResourceImpl.hpp" +#include "ingen/shared/LV2URIMap.hpp" +#include "ingen/shared/ResourceImpl.hpp" using namespace std; using namespace Raul; diff --git a/src/shared/ResourceImpl.hpp b/src/shared/ResourceImpl.hpp deleted file mode 100644 index 13f1bd8f..00000000 --- a/src/shared/ResourceImpl.hpp +++ /dev/null @@ -1,87 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2008-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_RESOURCEIMPL_HPP -#define INGEN_SHARED_RESOURCEIMPL_HPP - -#include "raul/URI.hpp" -#include "raul/SharedPtr.hpp" - -#include "ingen/Resource.hpp" - -namespace Ingen { -namespace Shared { - -class URIs; - -class ResourceImpl : virtual public Resource -{ -public: - ResourceImpl(URIs& uris, const Raul::URI& uri) - : _uris(uris) - , _uri(uri) - {} - - URIs& uris() const { return _uris; } - - virtual void set_uri(const Raul::URI& uri) { _uri = uri; } - virtual const Raul::URI& uri() const { return _uri; } - - const Properties& properties() const { return _properties; } - Properties& properties() { return _properties; } - - Properties properties(Resource::Graph ctx) const; - - const Raul::Atom& get_property(const Raul::URI& uri) const; - const Raul::Atom& set_property(const Raul::URI& uri, const Raul::Atom& value, - Resource::Graph ctx=Resource::DEFAULT); - void remove_property(const Raul::URI& uri, const Raul::Atom& value); - bool has_property(const Raul::URI& uri, const Raul::Atom& value) const; - void add_property(const Raul::URI& uri, const Raul::Atom& value, - Graph ctx=DEFAULT); - void set_properties(const Properties& p); - void add_properties(const Properties& p); - void remove_properties(const Properties& p); - - void dump(std::ostream& os) const; - - /** Get the ingen type from a set of Properties. - * If some coherent ingen type is found, true is returned and the appropriate - * output parameter set to true. Otherwise false is returned. - */ - static bool type(const URIs& uris, - const Properties& properties, - bool& patch, - bool& node, - bool& port, - bool& is_output); - -protected: - const Raul::Atom& set_property(const Raul::URI& uri, const Raul::Atom& value) const; - - URIs& _uris; - -private: - Raul::URI _uri; - mutable Properties _properties; -}; - -} // namespace Shared -} // namespace Ingen - -#endif // INGEN_SHARED_RESOURCEIMPL_HPP - diff --git a/src/shared/Store.cpp b/src/shared/Store.cpp index 62c7f824..dd685c96 100644 --- a/src/shared/Store.cpp +++ b/src/shared/Store.cpp @@ -21,7 +21,7 @@ #include "raul/TableImpl.hpp" #include "ingen/Node.hpp" #include "ingen/Port.hpp" -#include "Store.hpp" +#include "ingen/shared/Store.hpp" using namespace std; using namespace Raul; diff --git a/src/shared/Store.hpp b/src/shared/Store.hpp deleted file mode 100644 index cc78e946..00000000 --- a/src/shared/Store.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/* This file is part of Ingen. - * Copyright 2008-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_STORE_HPP -#define INGEN_SHARED_STORE_HPP - -#include - -#include - -#include "raul/PathTable.hpp" - -#include "ingen/GraphObject.hpp" - -namespace Ingen { -namespace Shared { - -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/src/shared/World.cpp b/src/shared/World.cpp index 4f6b279b..9aa17d4f 100644 --- a/src/shared/World.cpp +++ b/src/shared/World.cpp @@ -29,8 +29,8 @@ #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 "ingen/shared/LV2Features.hpp" +#include "ingen/shared/LV2URIMap.hpp" #define LOG(s) s << "[Module] " -- cgit v1.2.1