~hp/pianoteq_utils.lv2

6fff888b84c19d0adfc54f07605b70aa8b7332a7 — Hanspeter Portner 3 years ago 27834e8
Squashed 'props.lv2/' changes from 37ba758..e23deb0

e23deb0 send state:StateChanged events whenever we set sth.
ba21e18 notify downstream (e.g. UI) about changes params.
29bf482 gitlab-ci: add aarch64 build target.
6dc933c allow to set patch:readable, e.g. for uis.

git-subtree-dir: props.lv2
git-subtree-split: e23deb0254370b7e3032c719a7f5f738a1e3729b
5 files changed, 32 insertions(+), 4 deletions(-)

M .gitlab-ci.yml
M VERSION
M props.h
M test/props.ttl
M test/props_test.c
M .gitlab-ci.yml => .gitlab-ci.yml +3 -0
@@ 52,6 52,9 @@ i686-linux-gnu:
arm-linux-gnueabihf:
  <<: *arm_linux_definition

aarch64-linux-gnu:
  <<: *arm_linux_definition

x86_64-w64-mingw32:
  <<: *universal_w64_definition


M VERSION => VERSION +1 -1
@@ 1,1 1,1 @@
0.1.131
0.1.139

M props.h => props.h +21 -2
@@ 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;


@@ 729,11 740,15 @@ props_advance(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
		}

		props_impl_t *impl = _props_impl_get(props, property->body);
		if(impl && (impl->access == props->urid.patch_writable) )
		if(impl)
		{
			_props_impl_set(props, impl, value->type, value->size,
				LV2_ATOM_BODY_CONST(value));

			// send on (e.g. to UI)
			if(*ref && !impl->def->hidden)
				*ref = _props_patch_set(props, forge, frames, impl, sequence_num);

			const props_def_t *def = impl->def;
			if(def->event_cb)
				def->event_cb(props->data, frames, impl);


@@ 795,11 810,15 @@ props_advance(props_t *props, LV2_Atom_Forge *forge, uint32_t frames,
			const LV2_Atom *value = &prop->value;

			props_impl_t *impl = _props_impl_get(props, property);
			if(impl && (impl->access == props->urid.patch_writable) )
			if(impl)
			{
				_props_impl_set(props, impl, value->type, value->size,
					LV2_ATOM_BODY_CONST(value));

				// send on (e.g. to UI)
				if(*ref && !impl->def->hidden)
					*ref = _props_patch_set(props, forge, frames, impl, sequence_num);

				const props_def_t *def = impl->def;
				if(def->event_cb)
					def->event_cb(props->data, frames, impl);

M test/props.ttl => test/props.ttl +1 -1
@@ 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 ;
	] .

M test/props_test.c => test/props_test.c +6 -0
@@ 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;