aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-23 10:08:34 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-03-23 10:08:34 +0100
commiteeb9547fe5c6b61ca9b31877b26d07a6af0f05c2 (patch)
tree0d2edea01e316443fd2d1b8916a3d7f3026812a8
parent3f65c340c0867e1cebf833c72d886d8f9c6a96b1 (diff)
downloadvm.lv2-eeb9547fe5c6b61ca9b31877b26d07a6af0f05c2.tar.xz
implement program manipulation buttons.
-rw-r--r--VERSION2
-rw-r--r--vm_ui.c24
2 files changed, 19 insertions, 7 deletions
diff --git a/VERSION b/VERSION
index 9ff3725..d297b44 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.2881
+0.1.2885
diff --git a/vm_ui.c b/vm_ui.c
index 6b38d4d..a507a19 100644
--- a/vm_ui.c
+++ b/vm_ui.c
@@ -336,23 +336,35 @@ _expose(struct nk_context *ctx, struct nk_rect wbounds, void *data)
}
else
{
- if(nk_button_label(ctx, "+"))
+ if(nk_button_label(ctx, "+")) // insert cmd
{
- //FIXME insert line
+ for(unsigned j = ITEMS_MAX - 1; j > i; j--)
+ handle->cmds[j] = handle->cmds[j - 1];
+
+ cmd->type = COMMAND_OPCODE;
+ cmd->i32 = 0;
+ sync = true;
}
- if(nk_button_label(ctx, "-"))
+ if(nk_button_label(ctx, "-")) // remove cmd
{
- //FIXME remove line
+ for(unsigned j = i; j < ITEMS_MAX - 1; j++)
+ handle->cmds[j] = handle->cmds[j + 1];
+
+ sync = true;
}
if(i == 0)
{
nk_spacing(ctx, 1);
}
- else if(nk_button_label(ctx, "^"))
+ else if(nk_button_label(ctx, "^")) // swap cmd with one above
{
- //FIXME swap line
+ const vm_command_t tmp = handle->cmds[i];
+ handle->cmds[i] = handle->cmds[i - 1];
+ handle->cmds[i - 1] = tmp;
+
+ sync = true;
}
}