aboutsummaryrefslogtreecommitdiff
path: root/sherlock_nk.h
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-11-22 22:12:03 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-11-22 22:12:03 +0100
commitb5b2db8b7c69176157bdda8bfc0bbc4d0a18b329 (patch)
tree0b0cc1df43652a3866fd2169f09f2d3ff1011d18 /sherlock_nk.h
parent8cc5248c27be2b3071361f9bbebf390052ac44f1 (diff)
downloadsherlock.lv2-b5b2db8b7c69176157bdda8bfc0bbc4d0a18b329.tar.xz
migrate to nk_list_view.
* increase efficiency * add odd-line shadowin * remove count property * redesign follow-mode
Diffstat (limited to 'sherlock_nk.h')
-rw-r--r--sherlock_nk.h47
1 files changed, 42 insertions, 5 deletions
diff --git a/sherlock_nk.h b/sherlock_nk.h
index 62b63b2..0ec23cf 100644
--- a/sherlock_nk.h
+++ b/sherlock_nk.h
@@ -23,9 +23,37 @@
#include <osc.lv2/osc.h>
#include <sratom/sratom.h>
+#define MAX_LINES 2048
+
+typedef enum _plugin_type_t plugin_type_t;
+typedef enum _item_type_t item_type_t;
+typedef struct _item_t item_t;
typedef struct _plughandle_t plughandle_t;
typedef struct _atom_ser_t atom_ser_t;
+enum _item_type_t {
+ ITEM_TYPE_NONE,
+ ITEM_TYPE_FRAME,
+ ITEM_TYPE_EVENT
+};
+
+struct _item_t {
+ item_type_t type;
+
+ union {
+ struct {
+ int64_t offset;
+ uint32_t counter;
+ int32_t nsamples;
+ } frame;
+
+ struct {
+ LV2_Atom_Event ev;
+ uint8_t body [0];
+ } event;
+ };
+};
+
struct _atom_ser_t {
uint32_t size;
uint32_t offset;
@@ -35,6 +63,12 @@ struct _atom_ser_t {
};
};
+enum _plugin_type_t {
+ SHERLOCK_ATOM_INSPECTOR,
+ SHERLOCK_MIDI_INSPECTOR,
+ SHERLOCK_OSC_INSPECTOR
+};
+
struct _plughandle_t {
LV2UI_Write_Function write_function;
LV2UI_Controller controller;
@@ -42,16 +76,12 @@ struct _plughandle_t {
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;
@@ -61,7 +91,7 @@ struct _plughandle_t {
nk_pugl_window_t win;
- atom_ser_t ser;
+ bool ttl_dirty;
const LV2_Atom *selected;
struct nk_str str;
@@ -69,6 +99,13 @@ struct _plughandle_t {
const char *base_uri;
float dy;
+
+ uint32_t counter;
+ int n_item;
+ item_t **items;
+
+ bool shadow;
+ plugin_type_t type;
};
extern const char *max_items [5];