Commit 06e0a48d authored by Hanspeter Portner's avatar Hanspeter Portner

nk: fixes for updated ser_atom, rename white.

parent 8f988948
Pipeline #16791505 (#) passed with stages
in 4 minutes and 16 seconds
......@@ -21,7 +21,7 @@
#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
#include "nk_pugl/nk_pugl.h"
extern const struct nk_color white;
extern const struct nk_color cwhite;
extern const struct nk_color gray;
extern const struct nk_color yellow;
extern const struct nk_color magenta;
......
......@@ -25,7 +25,7 @@
#define one 0xbb
#define two 0x66
#define non 0x0
const struct nk_color white = {.r = one, .g = one, .b = one, .a = ful};
const struct nk_color cwhite = {.r = one, .g = one, .b = one, .a = ful};
const struct nk_color gray = {.r = two, .g = two, .b = two, .a = ful};
const struct nk_color yellow = {.r = one, .g = one, .b = non, .a = ful};
const struct nk_color magenta = {.r = one, .g = two, .b = one, .a = ful};
......@@ -173,7 +173,7 @@ ttl_lex(void *data, const char *utf8, int len)
case TK_NONE:
case TK_WHITESPACE:
col1 = white;
col1 = cwhite;
break;
case TK_RAW:
......
......@@ -301,7 +301,7 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
for(unsigned i=0, ptr=0; i<to; i++, ptr+=3)
sprintf(&tmp[ptr], "%02"PRIX8" ", msg[i]);
tmp[to*3 - 1] = '\0';
nk_label_colored(ctx, tmp, NK_TEXT_LEFT, white);
nk_label_colored(ctx, tmp, NK_TEXT_LEFT, cwhite);
nk_layout_row_push(ctx, 0.2);
nk_label_colored(ctx, command_str, NK_TEXT_LEFT, magenta);
......@@ -315,21 +315,21 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
case LV2_MIDI_MSG_NOTE_PRESSURE:
{
nk_layout_row_push(ctx, 0.1);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "Ch:%02"PRIu8,
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "Ch:%02"PRIu8,
(msg[0] & 0x0f) + 1);
nk_layout_row_push(ctx, 0.2);
int8_t octave;
const char *key = _note(msg[1], &octave);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "%s%+"PRIi8, key, octave);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "%s%+"PRIi8, key, octave);
nk_layout_row_push(ctx, 0.1);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "%"PRIu8, msg[2]);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "%"PRIu8, msg[2]);
} break;
case LV2_MIDI_MSG_CONTROLLER:
{
nk_layout_row_push(ctx, 0.1);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "Ch:%02"PRIu8,
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "Ch:%02"PRIu8,
(msg[0] & 0x0f) + 1);
const midi_msg_t *controller_msg = _search_controller(msg[1]);
......@@ -337,21 +337,21 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
? controller_msg->key
: "Unknown";
nk_layout_row_push(ctx, 0.2);
nk_label_colored(ctx, controller_str, NK_TEXT_RIGHT, white);
nk_label_colored(ctx, controller_str, NK_TEXT_RIGHT, cwhite);
nk_layout_row_push(ctx, 0.1);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "%"PRIu8, msg[2]);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "%"PRIu8, msg[2]);
} break;
case LV2_MIDI_MSG_PGM_CHANGE:
// fall-through
case LV2_MIDI_MSG_CHANNEL_PRESSURE:
{
nk_layout_row_push(ctx, 0.1);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "Ch:%02"PRIu8,
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "Ch:%02"PRIu8,
(msg[0] & 0x0f) + 1);
nk_layout_row_push(ctx, 0.2);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "%"PRIu8, msg[1]);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "%"PRIu8, msg[1]);
nk_layout_row_push(ctx, 0.1);
_empty(ctx);
......@@ -361,11 +361,11 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
const int16_t bender = (((int16_t)msg[2] << 7) | msg[1]) - 0x2000;
nk_layout_row_push(ctx, 0.1);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "Ch:%02"PRIu8,
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "Ch:%02"PRIu8,
(msg[0] & 0x0f) + 1);
nk_layout_row_push(ctx, 0.2);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "%"PRIi16, bender);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "%"PRIi16, bender);
nk_layout_row_push(ctx, 0.1);
_empty(ctx);
......@@ -383,10 +383,10 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
? timecode_msg->key
: "Unknown";
nk_layout_row_push(ctx, 0.2);
nk_label_colored(ctx, timecode_str, NK_TEXT_RIGHT, white);
nk_label_colored(ctx, timecode_str, NK_TEXT_RIGHT, cwhite);
nk_layout_row_push(ctx, 0.1);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "%"PRIu8, msg_val);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "%"PRIu8, msg_val);
} break;
case LV2_MIDI_MSG_SONG_POS:
{
......@@ -396,7 +396,7 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
_empty(ctx);
nk_layout_row_push(ctx, 0.2);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "%"PRIu16, song_pos);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "%"PRIu16, song_pos);
nk_layout_row_push(ctx, 0.1);
_empty(ctx);
......@@ -407,7 +407,7 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
_empty(ctx);
nk_layout_row_push(ctx, 0.2);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, white, "%"PRIu8, msg[1]);
nk_labelf_colored(ctx, NK_TEXT_RIGHT, cwhite, "%"PRIu8, msg[1]);
nk_layout_row_push(ctx, 0.1);
_empty(ctx);
......@@ -458,7 +458,7 @@ _midi_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
for(unsigned i=0, ptr=0; i<to; i++, ptr+=3)
sprintf(&tmp[ptr], "%02"PRIX8" ", msg[j+i]);
tmp[to*3 - 1] = '\0';
nk_label_colored(ctx, tmp, NK_TEXT_LEFT, white);
nk_label_colored(ctx, tmp, NK_TEXT_LEFT, cwhite);
nk_layout_row_push(ctx, 0.2);
_empty(ctx);
......
......@@ -220,7 +220,7 @@ _osc_message(plughandle_t *handle, struct nk_context *ctx, const LV2_Atom_Object
nk_layout_row_push(ctx, 0.5);
if(mem.buf)
{
nk_label_colored(ctx, mem.buf, NK_TEXT_LEFT, white);
nk_label_colored(ctx, mem.buf, NK_TEXT_LEFT, cwhite);
free(mem.buf);
}
else
......@@ -260,7 +260,7 @@ _osc_bundle(plughandle_t *handle, struct nk_context *ctx, const LV2_Atom_Object
_osc_timetag(&mem, &tt);
if(mem.buf)
{
nk_label_colored(ctx, mem.buf, NK_TEXT_LEFT, white);
nk_label_colored(ctx, mem.buf, NK_TEXT_LEFT, cwhite);
free(mem.buf);
}
else
......
......@@ -45,8 +45,8 @@ _discover(plughandle_t *handle)
lv2_atom_forge_object(&handle->forge, &frame, 0, handle->props.urid.patch_get);
lv2_atom_forge_pop(&handle->forge, &frame);
handle->write_function(handle->controller, 0, lv2_atom_total_size(ser.buf),
handle->event_transfer, ser.buf);
handle->write_function(handle->controller, 0, lv2_atom_total_size(ser_atom_get(&ser)),
handle->event_transfer, ser_atom_get(&ser));
ser_atom_deinit(&ser);
}
......@@ -74,8 +74,8 @@ _toggle(plughandle_t *handle, LV2_URID property, int32_t val, bool is_bool)
lv2_atom_forge_pop(&handle->forge, &frame);
handle->write_function(handle->controller, 0, lv2_atom_total_size(ser.buf),
handle->event_transfer, ser.buf);
handle->write_function(handle->controller, 0, lv2_atom_total_size(ser_atom_get(&ser)),
handle->event_transfer, ser_atom_get(&ser));
ser_atom_deinit(&ser);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment