aboutsummaryrefslogtreecommitdiff
path: root/atom_inspector_nk.c
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2016-11-27 14:20:42 +0100
committerHanspeter Portner <dev@open-music-kontrollers.ch>2016-11-27 14:20:42 +0100
commit4f3079ac642924b3f9c3bcf3c774cba95a1914ca (patch)
treee5acdcb98444258a9a038c2068bb4a302887a895 /atom_inspector_nk.c
parent99ed049721302715d4c689114d63d37cff655f02 (diff)
downloadsherlock.lv2-4f3079ac642924b3f9c3bcf3c774cba95a1914ca.tar.xz
show otype or id instead of type of atom objects.
Diffstat (limited to 'atom_inspector_nk.c')
-rw-r--r--atom_inspector_nk.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/atom_inspector_nk.c b/atom_inspector_nk.c
index 29e80d5..07b1a9e 100644
--- a/atom_inspector_nk.c
+++ b/atom_inspector_nk.c
@@ -155,7 +155,22 @@ _atom_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
LV2_Atom_Event *ev = &itm->event.ev;
const LV2_Atom *body = &ev->body;
const int64_t frames = ev->time.frames;
- const char *uri = handle->unmap->unmap(handle->unmap->handle, body->type);
+ const char *uri = NULL;
+ if(lv2_atom_forge_is_object_type(&handle->forge, body->type))
+ {
+ const LV2_Atom_Object *obj = (const LV2_Atom_Object *)body;
+
+ if(obj->body.otype)
+ uri = handle->unmap->unmap(handle->unmap->handle, obj->body.otype);
+ else if(obj->body.id)
+ uri = handle->unmap->unmap(handle->unmap->handle, obj->body.id);
+ else
+ uri = "Unknown";
+ }
+ else // not an object
+ {
+ uri = handle->unmap->unmap(handle->unmap->handle, body->type);
+ }
nk_layout_row_begin(ctx, NK_DYNAMIC, widget_h, 3);
{