summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-03-11 01:47:34 +0000
committerDavid Robillard <d@drobilla.net>2012-03-11 01:47:34 +0000
commitb77cf5f715f94ec172d3e759b3c4e03761374556 (patch)
tree67f755ca1f4af6aa67620341cefad6a0d2e0e8f6
parent905fbd7d76b541c12fe500a4b8c775a64275487b (diff)
downloadingen-b77cf5f715f94ec172d3e759b3c4e03761374556.tar.gz
ingen-b77cf5f715f94ec172d3e759b3c4e03761374556.tar.bz2
ingen-b77cf5f715f94ec172d3e759b3c4e03761374556.zip
Fix UI response to property changes like port value (fix #779).
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4045 a436a847-0d15-0410-975c-d299462d15a1
-rw-r--r--include/ingen/client/ObjectModel.hpp8
-rw-r--r--include/ingen/client/PortModel.hpp5
-rw-r--r--src/client/ObjectModel.cpp16
-rw-r--r--src/client/PortModel.cpp11
-rw-r--r--src/shared/ResourceImpl.cpp12
5 files changed, 16 insertions, 36 deletions
diff --git a/include/ingen/client/ObjectModel.hpp b/include/ingen/client/ObjectModel.hpp
index 07cf8674..b426ebdc 100644
--- a/include/ingen/client/ObjectModel.hpp
+++ b/include/ingen/client/ObjectModel.hpp
@@ -59,13 +59,7 @@ public:
const Raul::Atom& get_property(const Raul::URI& key) const;
- const Raul::Atom& set_property(const Raul::URI& key,
- const Raul::Atom& value,
- Resource::Graph ctx);
-
- void add_property(const Raul::URI& key,
- const Raul::Atom& value,
- Resource::Graph ctx);
+ void on_property(const Raul::URI& uri, const Raul::Atom& value);
const Raul::Path& path() const { return _path; }
const Raul::Symbol& symbol() const { return _symbol; }
diff --git a/include/ingen/client/PortModel.hpp b/include/ingen/client/PortModel.hpp
index eadfac63..4ba1acbc 100644
--- a/include/ingen/client/PortModel.hpp
+++ b/include/ingen/client/PortModel.hpp
@@ -58,12 +58,9 @@ public:
bool has_context(const Raul::URI& context) const;
-
inline bool operator==(const PortModel& pm) const { return (path() == pm.path()); }
- const Raul::Atom& set_property(const Raul::URI& uri,
- const Raul::Atom& value,
- Resource::Graph ctx);
+ void on_property(const Raul::URI& uri, const Raul::Atom& value);
inline void value(const Raul::Atom& val) {
if (val != _current_val) {
diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp
index 81c0039b..f8137a79 100644
--- a/src/client/ObjectModel.cpp
+++ b/src/client/ObjectModel.cpp
@@ -53,21 +53,10 @@ ObjectModel::is_a(const Raul::URI& type) const
return has_property(_uris.rdf_type, type);
}
-const Raul::Atom&
-ObjectModel::set_property(const Raul::URI& key, const Raul::Atom& value,
- Resource::Graph ctx)
-{
- const Raul::Atom& my_value = ResourceImpl::set_property(key, value, ctx);
- _signal_property.emit(key, my_value);
- return my_value;
-}
-
void
-ObjectModel::add_property(const Raul::URI& key, const Raul::Atom& value,
- Resource::Graph ctx)
+ObjectModel::on_property(const Raul::URI& uri, const Raul::Atom& value)
{
- ResourceImpl::add_property(key, value, ctx);
- _signal_property.emit(key, value);
+ _signal_property.emit(uri, value);
}
const Atom&
@@ -78,7 +67,6 @@ ObjectModel::get_property(const Raul::URI& key) const
return (i != properties().end()) ? i->second : null_atom;
}
-
bool
ObjectModel::polyphonic() const
{
diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp
index 55051bf1..2fc649a7 100644
--- a/src/client/PortModel.cpp
+++ b/src/client/PortModel.cpp
@@ -22,15 +22,12 @@
namespace Ingen {
namespace Client {
-const Raul::Atom&
-PortModel::set_property(const Raul::URI& uri,
- const Raul::Atom& value,
- Resource::Graph ctx)
+void
+PortModel::on_property(const Raul::URI& uri, const Raul::Atom& value)
{
- const Raul::Atom& ret = ObjectModel::set_property(uri, value, ctx);
- if (uri == _uris.ingen_value)
+ if (uri == _uris.ingen_value) {
this->value(value);
- return ret;
+ }
}
bool
diff --git a/src/shared/ResourceImpl.cpp b/src/shared/ResourceImpl.cpp
index 6f4b713b..fb50ac54 100644
--- a/src/shared/ResourceImpl.cpp
+++ b/src/shared/ResourceImpl.cpp
@@ -38,12 +38,14 @@ ResourceImpl::add_property(const Raul::URI& uri,
if (i->second == value && i->second.context() == ctx)
return;
- _properties.insert(make_pair(uri, Property(value, ctx)));
+ const Raul::Atom& v = _properties.insert(make_pair(uri, Property(value, ctx)))->second;
+ on_property(uri, v);
}
const Raul::Atom&
-ResourceImpl::set_property(const Raul::URI& uri, const Raul::Atom& value,
- Resource::Graph ctx)
+ResourceImpl::set_property(const Raul::URI& uri,
+ const Raul::Atom& value,
+ Resource::Graph ctx)
{
// Erase existing property in this context
for (Properties::iterator i = _properties.find(uri);
@@ -57,7 +59,9 @@ ResourceImpl::set_property(const Raul::URI& uri, const Raul::Atom& value,
}
// Insert new property
- return _properties.insert(make_pair(uri, Property(value, ctx)))->second;
+ const Raul::Atom& v = _properties.insert(make_pair(uri, Property(value, ctx)))->second;
+ on_property(uri, v);
+ return v;
}
void