diff options
author | David Robillard <d@drobilla.net> | 2012-03-19 20:16:46 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2012-03-19 20:16:46 +0000 |
commit | 254b434f0a79fea54bd963e8ff2e845a5b0cd3a6 (patch) | |
tree | ddf849fc5b64d1096846c28c1f1a742f54c3adff /ingen | |
parent | bc3afd8380d59c750c8f8e9bf1ed1b8d4a6826e9 (diff) | |
download | ingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.tar.gz ingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.tar.bz2 ingen-254b434f0a79fea54bd963e8ff2e845a5b0cd3a6.zip |
Partially functioning communication between Ingen LV2 plugin and UI.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4078 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'ingen')
-rw-r--r-- | ingen/serialisation/Parser.hpp | 3 | ||||
-rw-r--r-- | ingen/serialisation/Serialiser.hpp | 3 | ||||
-rw-r--r-- | ingen/shared/AtomReader.hpp | 55 | ||||
-rw-r--r-- | ingen/shared/Configuration.hpp | 2 | ||||
-rw-r--r-- | ingen/shared/Forge.hpp (renamed from ingen/shared/LV2Atom.hpp) | 33 | ||||
-rw-r--r-- | ingen/shared/LV2URIMap.hpp | 26 | ||||
-rw-r--r-- | ingen/shared/ResourceImpl.hpp | 2 | ||||
-rw-r--r-- | ingen/shared/URIs.hpp | 19 | ||||
-rw-r--r-- | ingen/shared/World.hpp | 5 |
9 files changed, 86 insertions, 62 deletions
diff --git a/ingen/serialisation/Parser.hpp b/ingen/serialisation/Parser.hpp index f242108b..48fd59f0 100644 --- a/ingen/serialisation/Parser.hpp +++ b/ingen/serialisation/Parser.hpp @@ -24,9 +24,8 @@ #include <boost/optional.hpp> #include <glibmm/ustring.h> -#include "raul/Path.hpp" - #include "ingen/GraphObject.hpp" +#include "raul/Path.hpp" namespace Ingen { diff --git a/ingen/serialisation/Serialiser.hpp b/ingen/serialisation/Serialiser.hpp index 8d5805e1..f317d04c 100644 --- a/ingen/serialisation/Serialiser.hpp +++ b/ingen/serialisation/Serialiser.hpp @@ -60,8 +60,7 @@ public: const std::string& path); virtual std::string to_string(SharedPtr<const GraphObject> object, - const std::string& base_uri, - const Properties& extra_rdf); + const std::string& base_uri); virtual void start_to_string(const Raul::Path& root, const std::string& base_uri); diff --git a/ingen/shared/AtomReader.hpp b/ingen/shared/AtomReader.hpp new file mode 100644 index 00000000..76b5ff92 --- /dev/null +++ b/ingen/shared/AtomReader.hpp @@ -0,0 +1,55 @@ +/* This file is part of Ingen. + * Copyright 2012 David Robillard <http://drobilla.net> + * + * 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_ATOM_READER_HPP +#define INGEN_SHARED_ATOM_READER_HPP + +#include "ingen/Interface.hpp" +#include "ingen/shared/AtomSink.hpp" +#include "ingen/shared/LV2URIMap.hpp" +#include "ingen/shared/URIs.hpp" +#include "serd/serd.h" + +namespace Ingen { + +class Forge; + +namespace Shared { + +class AtomSink; + +/** An AtomSink that calls methods on an Interface. */ +class AtomReader : public AtomSink +{ +public: + AtomReader(LV2URIMap& map, URIs& uris, Forge& forge, Interface& iface); + ~AtomReader() {} + + void write(const LV2_Atom* msg); + +private: + LV2URIMap& _map; + URIs& _uris; + Forge& _forge; + Interface& _iface; +}; + +} // namespace Shared +} // namespace Ingen + +#endif // INGEN_SHARED_ATOM_READER_HPP + diff --git a/ingen/shared/Configuration.hpp b/ingen/shared/Configuration.hpp index 21bc5737..e51bdc71 100644 --- a/ingen/shared/Configuration.hpp +++ b/ingen/shared/Configuration.hpp @@ -25,7 +25,7 @@ namespace Shared { class Configuration : public Raul::Configuration { public: - Configuration(Raul::Forge* forge); + Configuration(); }; } // namespace Shared diff --git a/ingen/shared/LV2Atom.hpp b/ingen/shared/Forge.hpp index 0aa35889..273742c9 100644 --- a/ingen/shared/LV2Atom.hpp +++ b/ingen/shared/Forge.hpp @@ -1,5 +1,5 @@ /* This file is part of Ingen. - * Copyright 2009-2011 David Robillard <http://drobilla.net> + * Copyright 2012 David Robillard <http://drobilla.net> * * 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 @@ -15,31 +15,22 @@ * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA */ -#ifndef INGEN_SHARED_LV2ATOM_HPP -#define INGEN_SHARED_LV2ATOM_HPP +#ifndef INGEN_FORGE_HPP +#define INGEN_FORGE_HPP -#include "lv2/lv2plug.in/ns/ext/atom/atom.h" - -namespace Raul { class Atom; } +#include "ingen/shared/Forge.hpp" +#include "ingen/shared/LV2URIMap.hpp" +#include "raul/Atom.hpp" namespace Ingen { -namespace Shared { - -class URIs; - -namespace LV2Atom { - -bool to_atom(const URIs& uris, - const LV2_Atom* object, - Raul::Atom& atom); -bool from_atom(const URIs& uris, - const Raul::Atom& atom, - LV2_Atom* object); +class Forge : public Raul::Forge { +public: + Forge(Shared::LV2URIMap& map); -} // namespace LV2Atom + std::string str(const Raul::Atom& atom); +}; -} // namespace Shared } // namespace Ingen -#endif // INGEN_SHARED_LV2ATOM_HPP +#endif // INGEN_FORGE_HPP diff --git a/ingen/shared/LV2URIMap.hpp b/ingen/shared/LV2URIMap.hpp index 01bbfb7d..5375ed51 100644 --- a/ingen/shared/LV2URIMap.hpp +++ b/ingen/shared/LV2URIMap.hpp @@ -24,7 +24,6 @@ #include <boost/utility.hpp> #include "ingen/shared/LV2Features.hpp" -#include "lv2/lv2plug.in/ns/ext/uri-map/uri-map.h" #include "lv2/lv2plug.in/ns/ext/urid/urid.h" #include "raul/URI.hpp" @@ -55,11 +54,6 @@ public: LV2_Feature _feature; }; - struct URIMapFeature : public Feature { - URIMapFeature(LV2URIMap* map); - LV2_URI_Map_Feature uri_map; - }; - struct URIDMapFeature : public Feature { URIDMapFeature(LV2URIMap* map, LV2_URID_Map* urid_map); LV2_URID map(const char* uri); @@ -74,32 +68,12 @@ public: LV2_URID_Unmap urid_unmap; }; - SharedPtr<URIMapFeature> uri_map_feature() { return _uri_map_feature; } SharedPtr<URIDMapFeature> urid_map_feature() { return _urid_map_feature; } SharedPtr<URIDUnmapFeature> urid_unmap_feature() { return _urid_unmap_feature; } - 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<bool, uint32_t> event_to_global(uint16_t event_id) const; - std::pair<bool, uint16_t> 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); - - static LV2_URID urid_map(LV2_URID_Map_Handle handle, const char* uri); - static const char* urid_unmap(LV2_URID_Unmap_Handle handle, LV2_URID urid); - - typedef std::map<uint16_t, uint32_t> EventToGlobal; - typedef std::map<uint32_t, uint16_t> GlobalToEvent; - - SharedPtr<URIMapFeature> _uri_map_feature; SharedPtr<URIDMapFeature> _urid_map_feature; SharedPtr<URIDUnmapFeature> _urid_unmap_feature; - EventToGlobal _event_to_global; - GlobalToEvent _global_to_event; }; } // namespace Shared diff --git a/ingen/shared/ResourceImpl.hpp b/ingen/shared/ResourceImpl.hpp index 8069c480..fe8d3017 100644 --- a/ingen/shared/ResourceImpl.hpp +++ b/ingen/shared/ResourceImpl.hpp @@ -67,8 +67,6 @@ public: 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. diff --git a/ingen/shared/URIs.hpp b/ingen/shared/URIs.hpp index 4f95c6c7..a23b32d4 100644 --- a/ingen/shared/URIs.hpp +++ b/ingen/shared/URIs.hpp @@ -21,6 +21,8 @@ #include <boost/utility.hpp> #include "ingen/shared/LV2URIMap.hpp" +#include "ingen/shared/Forge.hpp" +#include "raul/Atom.hpp" #include "raul/URI.hpp" namespace Raul { @@ -32,23 +34,29 @@ namespace Shared { class URIs : public boost::noncopyable { public: - URIs(Raul::Forge& forge, LV2URIMap* map); + URIs(Ingen::Forge& forge, LV2URIMap* map); struct Quark : public Raul::URI { - Quark(LV2URIMap* map, const char* str); - operator LV2_URID() const { return id; } - uint32_t id; + Quark(Ingen::Forge& forge, LV2URIMap* map, const char* str); + operator LV2_URID() const { return id; } + operator Raul::Atom() const { return atom; } + uint32_t id; + Raul::Atom atom; }; - Raul::Forge& forge; + Ingen::Forge& forge; + const Quark atom_Blank; const Quark atom_Bool; const Quark atom_Float; const Quark atom_Int; const Quark atom_MessagePort; + const Quark atom_Sequence; + const Quark atom_Sound; const Quark atom_String; const Quark atom_ValuePort; const Quark atom_Vector; + const Quark atom_bufferType; const Quark atom_eventTransfer; const Quark atom_supports; const Quark ctx_audioContext; @@ -56,7 +64,6 @@ public: const Quark ctx_messageContext; const Quark cv_CVPort; const Quark doap_name; - const Quark ev_EventPort; const Quark ingen_Connection; const Quark ingen_Internal; const Quark ingen_Node; diff --git a/ingen/shared/World.hpp b/ingen/shared/World.hpp index aa308efd..114be857 100644 --- a/ingen/shared/World.hpp +++ b/ingen/shared/World.hpp @@ -23,8 +23,9 @@ #include <boost/shared_ptr.hpp> #include <boost/utility.hpp> +#include "ingen/shared/Forge.hpp" #include "lv2/lv2plug.in/ns/ext/urid/urid.h" - +#include "raul/Atom.hpp" #include "raul/Configuration.hpp" #include "raul/SharedPtr.hpp" @@ -108,7 +109,7 @@ public: virtual Raul::Configuration* conf(); virtual void set_conf(Raul::Configuration* c); - virtual Raul::Forge& forge(); + virtual Ingen::Forge& forge(); virtual LV2Features* lv2_features(); |