summaryrefslogtreecommitdiffstats
path: root/src/engine/LV2Node.cpp
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2010-01-29 07:58:13 +0000
committerDavid Robillard <d@drobilla.net>2010-01-29 07:58:13 +0000
commitf02ac2f82a0342c3e548a81950734b4bce383b7d (patch)
tree06a51f5be2d41bdd8a52f1a6f8888f5f4d3db5f5 /src/engine/LV2Node.cpp
parent96613df7830699dbbfb5c2d9fe3ebdb0598e6aca (diff)
downloadingen-f02ac2f82a0342c3e548a81950734b4bce383b7d.tar.gz
ingen-f02ac2f82a0342c3e548a81950734b4bce383b7d.tar.bz2
ingen-f02ac2f82a0342c3e548a81950734b4bce383b7d.zip
Improved/quicker/easier handling of control port ranges.
* Add "Set minimum to current value", "Set maximum to current value", and "Reset range" to control port context menu. * Only serialise properties (e.g. lv2:minimum) if they differ from the meta object's (prototype's, e.g. plugin) value. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2395 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/engine/LV2Node.cpp')
-rw-r--r--src/engine/LV2Node.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/engine/LV2Node.cpp b/src/engine/LV2Node.cpp
index 003a6284..574a4eeb 100644
--- a/src/engine/LV2Node.cpp
+++ b/src/engine/LV2Node.cpp
@@ -280,8 +280,14 @@ LV2Node::instantiate(BufferFactory& bufs)
if (direction == INPUT && data_type == PortType::CONTROL) {
((AudioBuffer*)port->buffer(0).get())->set_value(val.get_float(), 0, 0);
- port->set_property("lv2:minimum", min_values[j]);
- port->set_property("lv2:maximum", max_values[j]);
+ if (!isnan(min_values[j])) {
+ port->meta().set_property("lv2:minimum", min_values[j]);
+ port->set_property("lv2:minimum", min_values[j]);
+ }
+ if (!isnan(max_values[j])) {
+ port->meta().set_property("lv2:maximum", max_values[j]);
+ port->set_property("lv2:maximum", max_values[j]);
+ }
}
SLV2Values contexts = slv2_port_get_value(plug, id, context_pred);