aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2019-04-06 12:53:21 +0200
committerGravatar Hanspeter Portner <dev@open-music-kontrollers.ch>2019-04-06 12:53:21 +0200
commit75d9e62cad376fc3bda73ecb661da20a81a5a2c6 (patch)
treec21d7a3050f82867655b5355282bcc0051be481a
parent19f6fb3014b270c4893450c6447a25fcc9435ba5 (diff)
downloadsherlock.lv2-75d9e62cad376fc3bda73ecb661da20a81a5a2c6.zip
sherlock.lv2-75d9e62cad376fc3bda73ecb661da20a81a5a2c6.tar.gz
sherlock.lv2-75d9e62cad376fc3bda73ecb661da20a81a5a2c6.tar.bz2
sherlock.lv2-75d9e62cad376fc3bda73ecb661da20a81a5a2c6.tar.xz
nk: fix strobing again and OSC argument counting.
-rw-r--r--VERSION2
-rw-r--r--atom_inspector_nk.c2
-rw-r--r--midi_inspector_nk.c1
-rw-r--r--osc_inspector_nk.c10
-rw-r--r--sherlock_nk.c21
5 files changed, 24 insertions, 12 deletions
diff --git a/VERSION b/VERSION
index 03af8a3..507ccfb 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.17.233
+0.17.235
diff --git a/atom_inspector_nk.c b/atom_inspector_nk.c
index 2a70fe2..857a77c 100644
--- a/atom_inspector_nk.c
+++ b/atom_inspector_nk.c
@@ -234,6 +234,8 @@ _atom_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
nk_labelf_colored(ctx, NK_TEXT_LEFT, orange, "@%"PRIi64, itm->frame.offset);
nk_labelf_colored(ctx, NK_TEXT_CENTERED, green, "-%"PRIu32"-", itm->frame.counter);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, violet, "%"PRIi32, itm->frame.nsamples);
+
+ handle->shadow = false;
} break;
case ITEM_TYPE_EVENT:
diff --git a/midi_inspector_nk.c b/midi_inspector_nk.c
index e65a38c..5edafa9 100644
--- a/midi_inspector_nk.c
+++ b/midi_inspector_nk.c
@@ -252,7 +252,6 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
lview.end = NK_MAX(handle->n_item, 0);
lview.begin = NK_MAX(lview.end - lview.count, 0);
}
- handle->shadow = lview.begin % 2 == 0;
for(int l = lview.begin; (l < lview.end) && (l < handle->n_item); l++)
{
item_t *itm = handle->items[l];
diff --git a/osc_inspector_nk.c b/osc_inspector_nk.c
index eaaea03..533119f 100644
--- a/osc_inspector_nk.c
+++ b/osc_inspector_nk.c
@@ -153,7 +153,7 @@ _osc_argument(plughandle_t *handle, struct nk_context *ctx, const LV2_Atom *arg,
} break;
case LV2_OSC_IMPULSE:
{
- _mem_printf(&mem, "I : iimpulse");
+ _mem_printf(&mem, "I : impulse");
} break;
case LV2_OSC_INT64:
@@ -302,7 +302,7 @@ _osc_packet(plughandle_t *handle, struct nk_context *ctx, int64_t frames,
nk_layout_row(ctx, NK_DYNAMIC, widget_h, 4, ratios);
_shadow(ctx, &handle->shadow);
- if(frames > 0)
+ if(frames >= 0)
{
nk_labelf_colored(ctx, NK_TEXT_LEFT, yellow, "+%04"PRIi64, frames);
}
@@ -335,7 +335,7 @@ _osc_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data
const char *window_name = "Sherlock";
if(nk_begin(ctx, window_name, wbounds, NK_WINDOW_NO_SCROLLBAR))
{
- struct nk_panel *panel= nk_window_get_panel(ctx);
+ struct nk_panel *panel = nk_window_get_panel(ctx);
struct nk_command_buffer *canvas = nk_window_get_canvas(ctx);
const float body_h = panel->bounds.h - 4*window_padding.y - 2*widget_h;
@@ -357,7 +357,6 @@ _osc_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data
lview.end = NK_MAX(handle->n_item, 0);
lview.begin = NK_MAX(lview.end - lview.count, 0);
}
- handle->shadow = lview.begin % 2 == 0;
for(int l = lview.begin; (l < lview.end) && (l < handle->n_item); l++)
{
item_t *itm = handle->items[l];
@@ -403,7 +402,8 @@ _osc_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *data
const float n = 3;
const float r0 = 1.f / n;
- const float r1 = 0.1f / 3; const float r2 = r0 - r1;
+ const float r1 = 0.1f / 3;
+ const float r2 = r0 - r1;
const float footer [6] = {r1, r2, r1, r2, r1, r2};
nk_layout_row(ctx, NK_DYNAMIC, widget_h, 6, footer);
{
diff --git a/sherlock_nk.c b/sherlock_nk.c
index 691b22e..a47fd2d 100644
--- a/sherlock_nk.c
+++ b/sherlock_nk.c
@@ -411,9 +411,18 @@ _osc_message(plughandle_t *handle, const LV2_Atom_Object *obj)
const LV2_Atom_Tuple *args = NULL;
lv2_osc_message_get(&handle->osc_urid, obj, &path, &args);
+ bool first = true;
+
LV2_ATOM_TUPLE_FOREACH(args, arg)
{
- _append_item(handle, ITEM_TYPE_NONE, 0);
+ if(first)
+ {
+ first = false;
+ }
+ else
+ {
+ _append_item(handle, ITEM_TYPE_NONE, 0);
+ }
}
}
@@ -422,7 +431,7 @@ _osc_packet(plughandle_t *handle, const LV2_Atom_Object *obj)
{
if(lv2_osc_is_message_type(&handle->osc_urid, obj->body.otype))
{
- //_append_item(handle, ITEM_TYPE_NONE, 0);
+ _append_item(handle, ITEM_TYPE_NONE, 0);
_osc_message(handle, obj);
}
else if(lv2_osc_is_bundle_type(&handle->osc_urid, obj->body.otype))
@@ -557,8 +566,9 @@ port_event(LV2UI_Handle instance, uint32_t i, uint32_t size, uint32_t urid,
} break;
case SHERLOCK_OSC_INSPECTOR:
{
- // bundles may span over multiple lines
const LV2_Atom_Object *obj = (const LV2_Atom_Object *)&ev->body;
+
+ // bundles may span over multiple lines
if(lv2_osc_is_bundle_type(&handle->osc_urid, obj->body.otype))
{
_osc_bundle(handle, obj);
@@ -570,9 +580,10 @@ port_event(LV2UI_Handle instance, uint32_t i, uint32_t size, uint32_t urid,
} break;
case SHERLOCK_MIDI_INSPECTOR:
{
- // sysex messages may span over multiple lines
const uint8_t *msg = LV2_ATOM_BODY_CONST(&ev->body);
- if( (msg[0] == 0xf0) && (ev->body.size > 4) )
+
+ // sysex messages may span over multiple lines
+ if( (msg[0] == LV2_MIDI_MSG_SYSTEM_EXCLUSIVE) && (ev->body.size > 4) )
{
for(uint32_t j = 4; j < ev->body.size; j += 4)
_append_item(handle, ITEM_TYPE_NONE, 0); // place holder