aboutsummaryrefslogtreecommitdiff
path: root/atom_inspector.c
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2019-10-09 22:23:47 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2019-10-09 22:23:47 +0200
commit92a1a1974394bd1f9187639184d08eb649a6b382 (patch)
treea0e482e78ee0b4a4876cbb2d90365ce4519c4ff2 /atom_inspector.c
parent78b7c262a19044d886ff38cd941450b4043d7070 (diff)
downloadsherlock.lv2-92a1a1974394bd1f9187639184d08eb649a6b382.tar.xz
fix filter logic and add sherlock:matchAll URI.
Diffstat (limited to 'atom_inspector.c')
-rw-r--r--atom_inspector.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/atom_inspector.c b/atom_inspector.c
index 227e398..575707e 100644
--- a/atom_inspector.c
+++ b/atom_inspector.c
@@ -34,6 +34,7 @@ struct _handle_t {
LV2_URID time_position;
LV2_URID time_frame;
+ LV2_URID sherlock_matchAll;
int64_t frame;
@@ -73,6 +74,7 @@ instantiate(const LV2_Descriptor* descriptor, double rate,
handle->time_position = handle->map->map(handle->map->handle, LV2_TIME__Position);
handle->time_frame = handle->map->map(handle->map->handle, LV2_TIME__frame);
+ handle->sherlock_matchAll = handle->map->map(handle->map->handle, SHERLOCK_URI"#matchAll");
lv2_atom_forge_init(&handle->through.forge, handle->map);
lv2_atom_forge_init(&handle->notify.forge, handle->map);
@@ -240,10 +242,18 @@ run(LV2_Handle instance, uint32_t nsamples)
LV2_ATOM_SEQUENCE_FOREACH(handle->control, ev)
{
const LV2_Atom_Object *obj = (const LV2_Atom_Object *)&ev->body;
+ bool type_matches;
- const bool type_matches = lv2_atom_forge_is_object_type(&notify->forge, obj->atom.type)
- ? (obj->body.otype == handle->state.filter)
- : (obj->atom.type == handle->state.filter);
+ if(handle->state.filter == handle->sherlock_matchAll)
+ {
+ type_matches = true;
+ }
+ else
+ {
+ type_matches = lv2_atom_forge_is_object_type(&notify->forge, obj->atom.type)
+ ? (obj->body.otype == handle->state.filter)
+ : (obj->atom.type == handle->state.filter);
+ }
if( (!handle->state.negate && type_matches)
|| (handle->state.negate && !type_matches) )