summaryrefslogtreecommitdiffstats
path: root/src/shared/ResourceImpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/ResourceImpl.cpp')
-rw-r--r--src/shared/ResourceImpl.cpp17
1 files changed, 14 insertions, 3 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);
}