diff options
author | David Robillard <d@drobilla.net> | 2009-05-28 01:38:34 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-05-28 01:38:34 +0000 |
commit | c9a25fcc6150290790457f837355735b513b7239 (patch) | |
tree | 0b234edf54525fe2e7883ffe6c10b5e15788065c /src/client | |
parent | 2f595631859574bfa7779ebb42f42b8590f5424c (diff) | |
download | ingen-c9a25fcc6150290790457f837355735b513b7239.tar.gz ingen-c9a25fcc6150290790457f837355735b513b7239.tar.bz2 ingen-c9a25fcc6150290790457f837355735b513b7239.zip |
Fix QNAMEs being serialised as URIs.
Remove vestigial variable stuff.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2017 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/NodeModel.cpp | 4 | ||||
-rw-r--r-- | src/client/ObjectModel.cpp | 34 | ||||
-rw-r--r-- | src/client/ObjectModel.hpp | 8 | ||||
-rw-r--r-- | src/client/PatchModel.cpp | 2 | ||||
-rw-r--r-- | src/client/PortModel.cpp | 2 |
5 files changed, 10 insertions, 40 deletions
diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp index 3f5773b0..c4ddbbaf 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/NodeModel.cpp @@ -199,8 +199,8 @@ NodeModel::port_value_range(SharedPtr<PortModel> port, float& min, float& max) c #endif // Possibly overriden - const Atom& min_atom = port->get_variable("lv2:minimum"); - const Atom& max_atom = port->get_variable("lv2:maximum"); + const Atom& min_atom = port->get_property("lv2:minimum"); + const Atom& max_atom = port->get_property("lv2:maximum"); if (min_atom.type() == Atom::FLOAT) min = min_atom.get_float(); if (max_atom.type() == Atom::FLOAT) diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index 367237c0..af0473a9 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -40,44 +40,18 @@ ObjectModel::~ObjectModel() } -/** Get a variable for this object. - * - * @return Metadata value with key @a key, empty string otherwise. - */ const Atom& -ObjectModel::get_variable(const URI& key) const -{ - static const Atom null_atom; - - Properties::const_iterator i = _variables.find(key); - if (i != _variables.end()) - return i->second; - else - return null_atom; -} - - -/** Get a variable for this object. - * - * @return Metadata value with key @a key, empty string otherwise. - */ -Atom& -ObjectModel::get_variable(URI& key) +ObjectModel::get_property(const Raul::URI& key) const { - static Atom null_atom; - - Properties::iterator i = _variables.find(key); - if (i != _variables.end()) - return i->second; - else - return null_atom; + Resource::Properties::const_iterator i = properties().find(key); + return (i != properties().end()) ? i->second : _meta.get_property(key); } bool ObjectModel::polyphonic() const { - const Raul::Atom& polyphonic = get_variable("ingen:polyphonic"); + const Raul::Atom& polyphonic = get_property("ingen:polyphonic"); return (polyphonic.is_valid() && polyphonic.get_bool()); } diff --git a/src/client/ObjectModel.hpp b/src/client/ObjectModel.hpp index 321555fd..5029f024 100644 --- a/src/client/ObjectModel.hpp +++ b/src/client/ObjectModel.hpp @@ -54,8 +54,7 @@ class ObjectModel : virtual public Ingen::Shared::GraphObject public: virtual ~ObjectModel(); - const Raul::Atom& get_variable(const Raul::URI& key) const; - Raul::Atom& get_variable(Raul::URI& key); + const Raul::Atom& get_property(const Raul::URI& key) const; virtual void set_property(const Raul::URI& key, const Raul::Atom& value) { ResourceImpl::set_property(key, value); @@ -69,8 +68,7 @@ public: Resource& meta() { return _meta; } const Resource& meta() const { return _meta; } - const Properties& variables() const { return _variables; } - Properties& variables() { return _variables; } + const Raul::URI meta_uri() const { return _meta.uri(); } const Raul::Path path() const { return _path; } const Raul::Symbol symbol() const { return _path.name(); } SharedPtr<ObjectModel> parent() const { return _parent; } @@ -100,8 +98,6 @@ protected: ResourceImpl _meta; Raul::Path _path; SharedPtr<ObjectModel> _parent; - - Properties _variables; }; diff --git a/src/client/PatchModel.cpp b/src/client/PatchModel.cpp index b64b9e50..baaa36ba 100644 --- a/src/client/PatchModel.cpp +++ b/src/client/PatchModel.cpp @@ -164,7 +164,7 @@ PatchModel::remove_connection(const Path& src_port_path, const Path& dst_port_pa bool PatchModel::enabled() const { - const Raul::Atom& enabled = get_variable("ingen:enabled"); + const Raul::Atom& enabled = get_property("ingen:enabled"); return (enabled.is_valid() && enabled.get_bool()); } diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp index 4fc6654b..9d63c863 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -24,7 +24,7 @@ namespace Client { bool PortModel::has_hint(const std::string& qname) const { - const Raul::Atom& hint = get_variable(qname); + const Raul::Atom& hint = get_property(qname); return (hint.is_valid() && hint.get_bool() > 0); } |