From 81e9fb3245bd461ebfee4cfa16d1792e48533f9e Mon Sep 17 00:00:00 2001 From: David Robillard Date: Mon, 12 Mar 2012 06:59:48 +0000 Subject: Centralise atom creation in forge object. Aside from being more greppable and making realtime violations more obvious, this is a step towards using LV2 atoms internally (which needs a factory since the type numbers are dynamic). git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4054 a436a847-0d15-0410-975c-d299462d15a1 --- include/ingen/Resource.hpp | 19 +------------------ include/ingen/client/PortModel.hpp | 9 ++++----- include/ingen/serialisation/Parser.hpp | 3 +++ include/ingen/shared/Configuration.hpp | 2 +- include/ingen/shared/URIs.hpp | 8 +++++++- include/ingen/shared/World.hpp | 2 ++ 6 files changed, 18 insertions(+), 25 deletions(-) (limited to 'include/ingen') diff --git a/include/ingen/Resource.hpp b/include/ingen/Resource.hpp index a287372c..56b5157a 100644 --- a/include/ingen/Resource.hpp +++ b/include/ingen/Resource.hpp @@ -75,24 +75,7 @@ public: , _ctx(ctx) {} - Property() : Raul::Atom(), _ctx(DEFAULT) {} - Property(int32_t val) : Raul::Atom(val), _ctx(DEFAULT) {} - Property(float val) : Raul::Atom(val), _ctx(DEFAULT) {} - Property(bool val) : Raul::Atom(val), _ctx(DEFAULT) {} - Property(const char* val) : Raul::Atom(val), _ctx(DEFAULT) {} - Property(const std::string& val) : Raul::Atom(val), _ctx(DEFAULT) {} - - Property(const Raul::Atom::DictValue& dict) - : Raul::Atom(dict) - , _ctx(DEFAULT) - {} - - Property(Type t, const std::string& uri) - : Raul::Atom(t, uri) - , _ctx(DEFAULT) - {} - - Graph context() const { return _ctx; } + Graph context() const { return _ctx; } void set_context(Graph ctx) { _ctx = ctx; } private: diff --git a/include/ingen/client/PortModel.hpp b/include/ingen/client/PortModel.hpp index ae4ac6d3..35e3c4ea 100644 --- a/include/ingen/client/PortModel.hpp +++ b/include/ingen/client/PortModel.hpp @@ -87,14 +87,13 @@ public: private: friend class ClientStore; - PortModel(Shared::URIs& uris, - const Raul::Path& path, - uint32_t index, - Direction dir) + PortModel(Shared::URIs& uris, + const Raul::Path& path, + uint32_t index, + Direction dir) : ObjectModel(uris, path) , _index(index) , _direction(dir) - , _current_val(0.0f) , _connections(0) {} diff --git a/include/ingen/serialisation/Parser.hpp b/include/ingen/serialisation/Parser.hpp index db4bd7b7..90e68324 100644 --- a/include/ingen/serialisation/Parser.hpp +++ b/include/ingen/serialisation/Parser.hpp @@ -79,6 +79,9 @@ public: virtual PatchRecords find_patches(Shared::World* world, SerdEnv* env, const Glib::ustring& manifest_uri); + +private: + Shared::World& _world; }; } // namespace Serialisation diff --git a/include/ingen/shared/Configuration.hpp b/include/ingen/shared/Configuration.hpp index e51bdc71..21bc5737 100644 --- a/include/ingen/shared/Configuration.hpp +++ b/include/ingen/shared/Configuration.hpp @@ -25,7 +25,7 @@ namespace Shared { class Configuration : public Raul::Configuration { public: - Configuration(); + Configuration(Raul::Forge* forge); }; } // namespace Shared diff --git a/include/ingen/shared/URIs.hpp b/include/ingen/shared/URIs.hpp index 405f1276..01464589 100644 --- a/include/ingen/shared/URIs.hpp +++ b/include/ingen/shared/URIs.hpp @@ -22,12 +22,16 @@ #include "raul/URI.hpp" +namespace Raul { + class Forge; +} + namespace Ingen { namespace Shared { class URIs : public boost::noncopyable { public: - URIs(); + URIs(Raul::Forge& forge); uint32_t map_uri(const char* uri); const char* unmap_uri(uint32_t urid); @@ -38,6 +42,8 @@ public: uint32_t id; }; + Raul::Forge& forge; + const Quark atom_Bool; const Quark atom_Float; const Quark atom_Int32; diff --git a/include/ingen/shared/World.hpp b/include/ingen/shared/World.hpp index ef67c30b..fba565e5 100644 --- a/include/ingen/shared/World.hpp +++ b/include/ingen/shared/World.hpp @@ -102,6 +102,8 @@ public: virtual Raul::Configuration* conf(); virtual void set_conf(Raul::Configuration* c); + virtual Raul::Forge& forge(); + virtual LV2Features* lv2_features(); virtual LilvWorld* lilv_world(); -- cgit v1.2.1