diff options
author | David Robillard <d@drobilla.net> | 2011-09-14 22:49:22 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2011-09-14 22:49:22 +0000 |
commit | 728f510e8c542db2907dcd439a9ab99d07282220 (patch) | |
tree | 6aa01740b1def7a1fa0a32e22fef929bdc231a62 /src/client | |
parent | e18380569bdbe1926be7540f3e2f9ebdf49a8e70 (diff) | |
download | ingen-728f510e8c542db2907dcd439a9ab99d07282220.tar.gz ingen-728f510e8c542db2907dcd439a9ab99d07282220.tar.bz2 ingen-728f510e8c542db2907dcd439a9ab99d07282220.zip |
Support lv2:sampleRate controls (mostly) correctly.
Fix initial control port values (was always 0.0).
Fix numeric values in control window.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3460 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/client')
-rw-r--r-- | src/client/ClientStore.cpp | 4 | ||||
-rw-r--r-- | src/client/NodeModel.cpp | 15 | ||||
-rw-r--r-- | src/client/ObjectModel.cpp | 6 | ||||
-rw-r--r-- | src/client/PortModel.cpp | 4 |
4 files changed, 23 insertions, 6 deletions
diff --git a/src/client/ClientStore.cpp b/src/client/ClientStore.cpp index 2d7f0a4b..e1ebd97c 100644 --- a/src/client/ClientStore.cpp +++ b/src/client/ClientStore.cpp @@ -401,6 +401,10 @@ ClientStore::delta(const URI& uri, void ClientStore::set_property(const URI& subject_uri, const URI& predicate, const Atom& value) { + if (subject_uri == _uris->ingen_engine) { + LOG(info) << "Engine property " << predicate << " = " << value << endl; + return; + } SharedPtr<Resource> subject = _resource(subject_uri); if (subject) { subject->set_property(predicate, value); diff --git a/src/client/NodeModel.cpp b/src/client/NodeModel.cpp index 73ee5a5a..09350448 100644 --- a/src/client/NodeModel.cpp +++ b/src/client/NodeModel.cpp @@ -165,7 +165,7 @@ NodeModel::port(uint32_t index) const void NodeModel::default_port_value_range(SharedPtr<const PortModel> port, - float& min, float& max) const + float& min, float& max, uint32_t srate) const { // Default control values min = 0.0; @@ -186,10 +186,16 @@ NodeModel::default_port_value_range(SharedPtr<const PortModel> port, if (!std::isnan(_max_values[port->index()])) max = _max_values[port->index()]; } + + if (port->port_property(_uris.lv2_sampleRate)) { + min *= srate; + max *= srate; + } } void -NodeModel::port_value_range(SharedPtr<const PortModel> port, float& min, float& max) const +NodeModel::port_value_range(SharedPtr<const PortModel> port, + float& min, float& max, uint32_t srate) const { assert(port->parent().get() == this); @@ -205,6 +211,11 @@ NodeModel::port_value_range(SharedPtr<const PortModel> port, float& min, float& if (max <= min) max = min + 1.0; + + if (port->port_property(_uris.lv2_sampleRate)) { + min *= srate; + max *= srate; + } } std::string diff --git a/src/client/ObjectModel.cpp b/src/client/ObjectModel.cpp index 69b40154..03b21247 100644 --- a/src/client/ObjectModel.cpp +++ b/src/client/ObjectModel.cpp @@ -50,8 +50,9 @@ ObjectModel::~ObjectModel() Raul::Atom& ObjectModel::set_property(const Raul::URI& key, const Raul::Atom& value) { - _signal_property.emit(key, value); - return ResourceImpl::set_property(key, value); + Raul::Atom& my_value = ResourceImpl::set_property(key, value); + _signal_property.emit(key, my_value); + return my_value; } void @@ -69,6 +70,7 @@ 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 50731ef0..be6d74a5 100644 --- a/src/client/PortModel.cpp +++ b/src/client/PortModel.cpp @@ -39,9 +39,9 @@ PortModel::supports(const Raul::URI& value_type) const } bool -PortModel::port_property(const std::string& uri) const +PortModel::port_property(const Raul::URI& uri) const { - return has_property(_uris.lv2_portProperty, Raul::URI(uri)); + return has_property(_uris.lv2_portProperty, uri); } void |