aboutsummaryrefslogtreecommitdiff
path: root/vm.c
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-21 20:51:07 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-21 20:51:07 +0100
commitd0f3a9ac228f5798a045f75376817b43666939bd (patch)
tree324f4540c6fd7413777a75611a447412e6790107 /vm.c
parentf3d77a9c079754914ebe1ccdfc58d0df953be8b8 (diff)
downloadvm.lv2-d0f3a9ac228f5798a045f75376817b43666939bd.tar.xz
plot control values.
Diffstat (limited to 'vm.c')
-rw-r--r--vm.c31
1 files changed, 29 insertions, 2 deletions
diff --git a/vm.c b/vm.c
index da5adf4..1fd989e 100644
--- a/vm.c
+++ b/vm.c
@@ -69,6 +69,8 @@ struct _plughandle_t {
bool needs_sync;
bool uses_time;
+ int64_t off;
+
command_t cmds [ITEMS_MAX];
timely_t timely;
@@ -661,13 +663,38 @@ run(LV2_Handle instance, uint32_t nsamples)
handle->needs_recalc = false;
}
+ //FIXME handle also inputs
+ for(unsigned i = 0; i < CTRL_MAX; i++)
+ {
+ if(*handle->out[i] != handle->out0[i])
+ {
+ *handle->out[i] = handle->out0[i];;
+
+ LV2_Atom_Forge_Frame tup_frame;
+ if(handle->ref)
+ handle->ref = lv2_atom_forge_frame_time(&handle->forge, nsamples - 1);
+ if(handle->ref)
+ handle->ref = lv2_atom_forge_tuple(&handle->forge, &tup_frame);
+ if(handle->ref)
+ handle->ref = lv2_atom_forge_int(&handle->forge, i + 10);
+ if(handle->ref)
+ handle->ref = lv2_atom_forge_float(&handle->forge, handle->out0[i]);
+ if(handle->ref)
+ lv2_atom_forge_pop(&handle->forge, &tup_frame);
+ }
+ }
+
+ if(handle->ref)
+ handle->ref = lv2_atom_forge_frame_time(&handle->forge, nsamples - 1);
+ if(handle->ref)
+ handle->ref = lv2_atom_forge_long(&handle->forge, handle->off);
+
if(handle->ref)
lv2_atom_forge_pop(&handle->forge, &frame);
else
lv2_atom_sequence_clear(handle->notify);
- for(unsigned i = 0; i < CTRL_MAX; i++)
- *handle->out[i] = handle->out0[i];;
+ handle->off += nsamples;
}
static void