aboutsummaryrefslogtreecommitdiff
path: root/sherlock_nk.h
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-11-04 20:57:47 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-11-04 20:57:47 +0100
commitae914e4c6072a468792a6f93f0b8875f9be94c45 (patch)
tree1d9f94cc2154680cacd3f1ee8ed794456fea135e /sherlock_nk.h
parent41f046e9479230eda4aaf388c9c282e7b428bfe1 (diff)
downloadsherlock.lv2-ae914e4c6072a468792a6f93f0b8875f9be94c45.tar.xz
prototype nuklear ui.
Diffstat (limited to 'sherlock_nk.h')
-rw-r--r--sherlock_nk.h99
1 files changed, 99 insertions, 0 deletions
diff --git a/sherlock_nk.h b/sherlock_nk.h
new file mode 100644
index 0000000..66982c8
--- /dev/null
+++ b/sherlock_nk.h
@@ -0,0 +1,99 @@
+/*
+ * Copyright (c) 2015-2016 Hanspeter Portner (dev@open-music-kontrollers.ch)
+ *
+ * This is free software: you can redistribute it and/or modify
+ * it under the terms of the Artistic License 2.0 as published by
+ * The Perl Foundation.
+ *
+ * This source is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * Artistic License 2.0 for more details.
+ *
+ * You should have received a copy of the Artistic License 2.0
+ * along the source as a COPYING file. If not, obtain it from
+ * http://www.perlfoundation.org/artistic_license_2_0.
+ */
+
+#ifndef _SHERLOCK_NK_H
+#define _SHERLOCK_NK_H
+
+#include "nk_pugl.h"
+
+#include <osc.lv2/osc.h>
+#include <sratom/sratom.h>
+
+typedef struct _plughandle_t plughandle_t;
+typedef struct _atom_ser_t atom_ser_t;
+
+struct _atom_ser_t {
+ uint32_t size;
+ uint32_t offset;
+ union {
+ uint8_t *buf;
+ LV2_Atom *atom;
+ };
+};
+
+struct _plughandle_t {
+ LV2UI_Write_Function write_function;
+ LV2UI_Controller controller;
+
+ LV2_URID_Map *map;
+ LV2_URID_Unmap *unmap;
+ LV2_Atom_Forge forge;
+ LV2_Atom_Forge mem;
+ int32_t count;
+ bool bottom;
+ LV2_Atom_Forge_Frame frame;
+ LV2_URID event_transfer;
+ LV2_OSC_URID osc_urid;
+
+ PROPS_T(props, MAX_NPROPS);
+ struct {
+ LV2_URID count;
+ LV2_URID overwrite;
+ LV2_URID block;
+ LV2_URID follow;
+ } urid;
+ state_t state;
+ state_t stash;
+
+ nk_pugl_window_t win;
+
+ atom_ser_t ser;
+ const LV2_Atom *selected;
+ struct nk_text_edit edit;
+
+ Sratom *sratom;
+ const char *base_uri;
+};
+
+extern const char *max_items [5];
+extern const int32_t max_values [5];
+
+void
+_midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data);
+
+void
+_atom_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data);
+
+void
+_osc_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data);
+
+void
+_empty(struct nk_context *ctx);
+
+void
+_toggle(plughandle_t *handle, LV2_URID property, int32_t val, bool is_bool);
+
+void
+_clear(plughandle_t *handle);
+
+void
+_ruler(struct nk_context *ctx, float line_thickness, struct nk_color color);
+
+void
+_post_redisplay(plughandle_t *handle);
+
+#endif // _SHERLOCK_NK_H