summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/ResourceImpl.cpp17
-rw-r--r--src/shared/ResourceImpl.hpp3
2 files changed, 16 insertions, 4 deletions
diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp
index 9e403be3..ca3eaacd 100644
--- a/src/shared/ResourceImpl.cpp
+++ b/src/shared/ResourceImpl.cpp
@@ -50,8 +50,6 @@ ResourceImpl::add_property(const Raul::URI& uri, const Raul::Atom& value)
void
ResourceImpl::set_property(const Raul::URI& uri, const Raul::Atom& value)
{
- cerr << "SET PROPERTY " << uri << " = " << value << endl;
- assert(value.type() != Raul::Atom::URI || strcmp(value.get_uri(), "lv2:ControlPort"));
_properties.erase(uri);
_properties.insert(make_pair(uri, value));
}
@@ -126,10 +124,23 @@ ResourceImpl::type(
void
-ResourceImpl::merge_properties(const Properties& p)
+ResourceImpl::set_properties(const Properties& p)
{
typedef Resource::Properties::const_iterator iterator;
for (iterator i = p.begin(); i != p.end(); ++i)
+ _properties.erase(i->first);
+ for (iterator i = p.begin(); i != p.end(); ++i)
+ set_property(i->first, i->second);
+}
+
+
+void
+ResourceImpl::add_properties(const Properties& p)
+{
+ typedef Resource::Properties::const_iterator iterator;
+ for (iterator i = p.begin(); i != p.end(); ++i)
+ _properties.erase(i->first);
+ for (iterator i = p.begin(); i != p.end(); ++i)
add_property(i->first, i->second);
}
diff --git a/src/shared/ResourceImpl.hpp b/src/shared/ResourceImpl.hpp
index 1f8dbedd..118d4dbe 100644
--- a/src/shared/ResourceImpl.hpp
+++ b/src/shared/ResourceImpl.hpp
@@ -40,7 +40,8 @@ public:
const Raul::Atom& get_property(const Raul::URI& uri) const;
void set_property(const Raul::URI& uri, const Raul::Atom& value);
void add_property(const Raul::URI& uri, const Raul::Atom& value);
- void merge_properties(const Properties& p);
+ void set_properties(const Properties& p);
+ void add_properties(const Properties& p);
sigc::signal<void, const Raul::URI&, const Raul::Atom&> signal_property;