aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-23 18:46:15 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-23 18:46:15 +0100
commit4c0318dce003356ebdea5055174d6cf83a6c4f58 (patch)
tree5123b1fe2c02fd3c4095661931c5f065a2d846f4
parent02de8e72284619db9d9529380710458420518fa4 (diff)
downloadvm.lv2-4c0318dce003356ebdea5055174d6cf83a6c4f58.tar.xz
gcc fixes. vm:atom writer fixes.
-rw-r--r--VERSION2
-rw-r--r--vm_ui.c29
2 files changed, 25 insertions, 6 deletions
diff --git a/VERSION b/VERSION
index 85de855..e0e9303 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.2891
+0.1.2893
diff --git a/vm_ui.c b/vm_ui.c
index 407eefd..538dba5 100644
--- a/vm_ui.c
+++ b/vm_ui.c
@@ -257,10 +257,10 @@ _draw_plot(struct nk_context *ctx, const float *vals)
}
}
-static const int dBFS6_min = -54;
-static const int dBFS6_max = 6;
-static const int dBFS6_rng = dBFS6_max - dBFS6_min;
-static const int dBFS6_div = 2;
+#define dBFS6_min -54
+#define dBFS6_max 6
+#define dBFS6_div 2
+#define dBFS6_rng (dBFS6_max - dBFS6_min)
static const float mx1 = (float)(dBFS6_rng - 2*dBFS6_max) / dBFS6_rng;
static const float mx2 = (float)(2*dBFS6_max) / dBFS6_rng;
@@ -402,7 +402,26 @@ _expose(struct nk_context *ctx, struct nk_rect wbounds, void *data)
const float old_val = handle->in0[i];
nk_property_float(ctx, input_labels[i], VM_MIN, &handle->in0[i], VM_MAX, stp, fpp);
if(old_val != handle->in0[i])
- handle->writer(handle->controller, i + 2, sizeof(float), 0, &handle->in0[i]);
+ {
+ if(handle->vm_plug == VM_PLUG_ATOM)
+ {
+ const LV2_Atom_Float flt = {
+ .atom = {
+ .size = sizeof(float),
+ .type = handle->forge.Float
+ },
+ .body = handle->in0[i]
+ };
+
+ handle->writer(handle->controller, i + 2,
+ lv2_atom_total_size(&flt.atom), handle->atom_eventTransfer, &flt);
+ }
+ else // CONTROL, CV
+ {
+ handle->writer(handle->controller, i + 2,
+ sizeof(float), 0, &handle->in0[i]);
+ }
+ }
}
else if(handle->vm_plug == VM_PLUG_AUDIO)
{