aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2017-08-04 15:48:49 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2017-08-04 15:48:49 +0200
commit013732710cb14928366b67adcd35ec6ddc26e6f1 (patch)
tree3329b69f22ab47918f341191506a457ad8cf7f42
parentd9ee7bc124c2ccd3a5bf64e457d85dfd7f3ed74e (diff)
downloadsherlock.lv2-013732710cb14928366b67adcd35ec6ddc26e6f1.tar.xz
add toggle to ignore time events.
-rw-r--r--VERSION2
-rw-r--r--atom_inspector.c7
-rw-r--r--atom_inspector_nk.c9
-rw-r--r--sherlock.h8
-rw-r--r--sherlock.ttl36
-rw-r--r--sherlock_nk.c1
-rw-r--r--sherlock_nk.h1
7 files changed, 44 insertions, 20 deletions
diff --git a/VERSION b/VERSION
index 295821b..06c60fb 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.15.31
+0.15.33
diff --git a/atom_inspector.c b/atom_inspector.c
index 12cfb4d..6e7e56f 100644
--- a/atom_inspector.c
+++ b/atom_inspector.c
@@ -159,7 +159,12 @@ run(LV2_Handle instance, uint32_t nsamples)
// only serialize filtered events to UI
LV2_ATOM_SEQUENCE_FOREACH(handle->control, ev)
{
- if(true) //FIXME do filtering here
+ const LV2_Atom_Object *obj = (const LV2_Atom_Object *)&ev->body;
+
+ const bool is_time = lv2_atom_forge_is_object_type(&notify->forge, obj->atom.type)
+ && (obj->body.otype == handle->time_position);
+
+ if(!(!handle->state.time && is_time))
{
has_event = true;
if(notify->ref)
diff --git a/atom_inspector_nk.c b/atom_inspector_nk.c
index 00d937c..6a555af 100644
--- a/atom_inspector_nk.c
+++ b/atom_inspector_nk.c
@@ -297,7 +297,7 @@ _atom_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
nk_list_view_end(&lview);
}
- nk_layout_row_dynamic(ctx, widget_h, 4);
+ nk_layout_row_dynamic(ctx, widget_h, 5);
{
const int32_t state_overwrite = nk_check_label(ctx, "overwrite", handle->state.overwrite);
if(state_overwrite != handle->state.overwrite)
@@ -329,6 +329,13 @@ _atom_inspector_expose(struct nk_context *ctx, struct nk_rect wbounds, void *dat
handle->ttl_dirty = true;
sratom_set_pretty_numbers(handle->sratom, handle->state.pretty);
}
+
+ const int32_t state_time = nk_check_label(ctx, "time", handle->state.time);
+ if(state_time != handle->state.time)
+ {
+ handle->state.time = state_time;
+ _toggle(handle, handle->urid.time, handle->state.time, true);
+ }
}
const bool max_reached = handle->n_item >= MAX_LINES;
diff --git a/sherlock.h b/sherlock.h
index 03e4ca3..709d3e5 100644
--- a/sherlock.h
+++ b/sherlock.h
@@ -63,6 +63,7 @@ struct _state_t {
int32_t block;
int32_t follow;
int32_t pretty;
+ int32_t time;
};
struct _craft_t {
@@ -75,7 +76,7 @@ struct _craft_t {
};
};
-#define MAX_NPROPS 4
+#define MAX_NPROPS 5
static const props_def_t defs [MAX_NPROPS] = {
{
@@ -97,6 +98,11 @@ static const props_def_t defs [MAX_NPROPS] = {
.property = SHERLOCK_URI"#pretty",
.offset = offsetof(state_t, pretty),
.type = LV2_ATOM__Bool,
+ },
+ {
+ .property = SHERLOCK_URI"#time",
+ .offset = offsetof(state_t, time),
+ .type = LV2_ATOM__Bool,
}
};
diff --git a/sherlock.ttl b/sherlock.ttl
index 24ea9f0..6a1dee5 100644
--- a/sherlock.ttl
+++ b/sherlock.ttl
@@ -76,7 +76,13 @@ sherlock:follow
sherlock:pretty
a lv2:Parameter ;
rdfs:label "Pretty" ;
- rdfs:comment "Enable pretty printing" ;
+ rdfs:comment "Toggle whether to pretty print or not" ;
+ rdfs:range atom:Bool .
+
+sherlock:time
+ a lv2:Parameter ;
+ rdfs:label "Time" ;
+ rdfs:comment "Toggle whether to show time events or not" ;
rdfs:range atom:Bool .
# Atom Inspector Plugin
@@ -131,16 +137,18 @@ sherlock:atom_inspector
] ;
patch:writable
- sherlock:overwrite,
+ sherlock:overwrite ,
sherlock:block ,
sherlock:follow ,
- sherlock:pretty ;
+ sherlock:pretty ,
+ sherlock:time ;
state:state [
- sherlock:overwrite false ;
+ sherlock:overwrite true ;
sherlock:block false ;
- sherlock:follow false ;
- sherlock:pretty false ;
+ sherlock:follow true ;
+ sherlock:pretty true ;
+ sherlock:time false ;
] .
# MIDI Inspector Plugin
@@ -191,14 +199,12 @@ sherlock:midi_inspector
patch:writable
sherlock:overwrite ,
sherlock:block ,
- sherlock:follow ,
- sherlock:pretty ;
+ sherlock:follow ;
state:state [
- sherlock:overwrite false ;
+ sherlock:overwrite true ;
sherlock:block false ;
- sherlock:follow false ;
- sherlock:pretty false ;
+ sherlock:follow true ;
] .
# OSC Inspector Plugin
@@ -249,12 +255,10 @@ sherlock:osc_inspector
patch:writable
sherlock:overwrite ,
sherlock:block ,
- sherlock:follow ,
- sherlock:pretty ;
+ sherlock:follow ;
state:state [
- sherlock:overwrite false ;
+ sherlock:overwrite true ;
sherlock:block false ;
- sherlock:follow false ;
- sherlock:pretty false ;
+ sherlock:follow true ;
] .
diff --git a/sherlock_nk.c b/sherlock_nk.c
index bbd6993..e3280df 100644
--- a/sherlock_nk.c
+++ b/sherlock_nk.c
@@ -277,6 +277,7 @@ instantiate(const LV2UI_Descriptor *descriptor, const char *plugin_uri,
handle->urid.block = props_map(&handle->props, defs[1].property);;
handle->urid.follow = props_map(&handle->props, defs[2].property);;
handle->urid.pretty = props_map(&handle->props, defs[3].property);;
+ handle->urid.time = props_map(&handle->props, defs[4].property);;
nk_pugl_config_t *cfg = &handle->win.cfg;
cfg->height = 700;
diff --git a/sherlock_nk.h b/sherlock_nk.h
index 4ac43cc..34b8efc 100644
--- a/sherlock_nk.h
+++ b/sherlock_nk.h
@@ -86,6 +86,7 @@ struct _plughandle_t {
LV2_URID block;
LV2_URID follow;
LV2_URID pretty;
+ LV2_URID time;
} urid;
state_t state;
state_t stash;