aboutsummaryrefslogtreecommitdiffstats
path: root/src/client/PortModel.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2012-11-18 18:46:53 +0000
committerDavid Robillard <d@drobilla.net>2012-11-18 18:46:53 +0000
commitd358cae57b7233bf6b781686979fc4dea4d090b3 (patch)
treee60f45f73892fd62fea6caef507567c57722b5b9 /src/client/PortModel.cpp
parentc8745c6975c6173d08957c4a16bf8b95831ec05a (diff)
downloadingen-d358cae57b7233bf6b781686979fc4dea4d090b3.tar.gz
ingen-d358cae57b7233bf6b781686979fc4dea4d090b3.tar.bz2
ingen-d358cae57b7233bf6b781686979fc4dea4d090b3.zip
Fix learn for Trigger and Internal nodes.
Set value property for inputs when a notification is sent so model is consistent (and learned values are saved correctly). Don't redundantly store value atom in PortModel, just use property directly. Fix incorrect use of lv2:integer as a predicate. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@4835 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client/PortModel.cpp')
-rw-r--r--src/client/PortModel.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/client/PortModel.cpp b/src/client/PortModel.cpp
index 54db0ca1..fdef852d 100644
--- a/src/client/PortModel.cpp
+++ b/src/client/PortModel.cpp
@@ -24,14 +24,16 @@ void
PortModel::on_property(const Raul::URI& uri, const Raul::Atom& value)
{
if (uri == _uris.ingen_activity) {
+ // Don't store activity, it is transient
signal_activity().emit(value);
return;
- } else {
- if (uri == _uris.ingen_value) {
- this->value(value);
- }
}
+
ObjectModel::on_property(uri, value);
+
+ if (uri == _uris.ingen_value) {
+ signal_value_changed().emit(value);
+ }
}
bool
@@ -51,16 +53,15 @@ PortModel::port_property(const Raul::URI& uri) const
void
PortModel::set(SharedPtr<ObjectModel> model)
{
+ ObjectModel::set(model);
+
SharedPtr<PortModel> port = PtrCast<PortModel>(model);
if (port) {
_index = port->_index;
_direction = port->_direction;
- _current_val = port->_current_val;
_connections = port->_connections;
- _signal_value_changed.emit(_current_val);
+ _signal_value_changed.emit(get_property(_uris.ingen_value));
}
-
- ObjectModel::set(model);
}
} // namespace Client