aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHanspeter Portner <dev@open-music-kontrollers.ch>2020-10-01 19:22:53 +0200
committerHanspeter Portner <dev@open-music-kontrollers.ch>2020-10-01 19:22:53 +0200
commite23deb0254370b7e3032c719a7f5f738a1e3729b (patch)
tree425b5559319cc7ee08a1716a3b7eac8d93ae4434
parentba21e185655d2fc7237d8a5e6c9462bc701ceb45 (diff)
downloadprops.lv2-e23deb0254370b7e3032c719a7f5f738a1e3729b.tar.xz
send state:StateChanged events whenever we set sth.
-rw-r--r--VERSION2
-rw-r--r--props.h11
-rw-r--r--test/props.ttl2
-rw-r--r--test/props_test.c6
4 files changed, 19 insertions, 2 deletions
diff --git a/VERSION b/VERSION
index e670da3..eac5392 100644
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-0.1.137
+0.1.139
diff --git a/props.h b/props.h
index 0572bcb..1d1cb64 100644
--- a/props.h
+++ b/props.h
@@ -111,6 +111,8 @@ struct _props_t {
LV2_URID atom_vector;
LV2_URID atom_object;
LV2_URID atom_sequence;
+
+ LV2_URID state_StateChanged;
} urid;
void *data;
@@ -319,6 +321,13 @@ _props_patch_set(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
if(ref)
lv2_atom_forge_pop(forge, &obj_frame);
+ if(ref)
+ ref = lv2_atom_forge_frame_time(forge, frames);
+ if(ref)
+ ref = lv2_atom_forge_object(forge, &obj_frame, 0, props->urid.state_StateChanged);
+ if(ref)
+ lv2_atom_forge_pop(forge, &obj_frame);
+
return ref;
}
@@ -575,6 +584,8 @@ props_init(props_t *props, const char *subject,
props->urid.atom_object = map->map(map->handle, LV2_ATOM__Object);
props->urid.atom_sequence = map->map(map->handle, LV2_ATOM__Sequence);
+ props->urid.state_StateChanged = map->map(map->handle, LV2_STATE__StateChanged);
+
atomic_init(&props->restoring, false);
int status = 1;
diff --git a/test/props.ttl b/test/props.ttl
index 0ce45d6..cd4d107 100644
--- a/test/props.ttl
+++ b/test/props.ttl
@@ -147,6 +147,6 @@ props:test
props:statInt 4 ;
props:statFloat "0.4"^^xsd:float ;
props:statString "Hello world" ;
- props:statPath <props.ttl> ;
+ props:statPath <> ;
props:statChunk "AQIDBAUGBw=="^^xsd:base64Binary ;
] .
diff --git a/test/props_test.c b/test/props_test.c
index f028e32..69f3b3f 100644
--- a/test/props_test.c
+++ b/test/props_test.c
@@ -552,6 +552,12 @@ _test_2(handle_t *handle)
const LV2_Atom_Object *obj = (const LV2_Atom_Object *)atom;
assert(obj->body.id == 0);
+
+ if(obj->body.otype == props->urid.state_StateChanged)
+ {
+ continue;
+ }
+
assert(obj->body.otype == props->urid.patch_set);
unsigned nprops = 0;