aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2021-10-22 12:32:45 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2021-10-22 12:32:45 +0200
commit6f284bdad882037a522c120af92b96d8abf2de60 (patch)
treec1604eec72dd8f67161e95b30a9ad869177c439c
parent89ad345e211631ceb8e22c3495878b8cd4fa0818 (diff)
downloadsynthpod-6f284bdad882037a522c120af92b96d8abf2de60.tar.xz
nk: fall back to 0/1 parameter range if none given.HEADmaster
-rw-r--r--VERSION2
-rw-r--r--plugins/synthpod_common_nk.c26
2 files changed, 27 insertions, 1 deletions
diff --git a/VERSION b/VERSION
index 33c4e31f..4f9087e9 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.6485
+0.1.6489
diff --git a/plugins/synthpod_common_nk.c b/plugins/synthpod_common_nk.c
index d05a44f2..5d235e57 100644
--- a/plugins/synthpod_common_nk.c
+++ b/plugins/synthpod_common_nk.c
@@ -2054,6 +2054,19 @@ _param_fill(plughandle_t *handle, param_t *param, const LilvNode *param_node)
//FIXME
lilv_node_free(min);
}
+ else
+ {
+ if(param->range == handle->forge.Int)
+ param->min.i = 0;
+ else if(param->range == handle->forge.Bool)
+ param->min.i = false;
+ else if(param->range == handle->forge.Long)
+ param->min.h = 0;
+ else if(param->range == handle->forge.Float)
+ param->min.f = 0.f;
+ else if(param->range == handle->forge.Double)
+ param->min.d = 0.0;
+ }
LilvNode *max = lilv_world_get(handle->world, param_node, handle->node.lv2_maximum, NULL);
if(max)
@@ -2071,6 +2084,19 @@ _param_fill(plughandle_t *handle, param_t *param, const LilvNode *param_node)
//FIXME
lilv_node_free(max);
}
+ else
+ {
+ if(param->range == handle->forge.Int)
+ param->max.i = 1;
+ else if(param->range == handle->forge.Bool)
+ param->max.i = true;
+ else if(param->range == handle->forge.Long)
+ param->max.h = 1;
+ else if(param->range == handle->forge.Float)
+ param->max.f = 1.f;
+ else if(param->range == handle->forge.Double)
+ param->max.d = 1.0;
+ }
_param_update_span(handle, param);
}