From 64d4a4a46901b1b1ab4eaac4f3f57f8d353e42c5 Mon Sep 17 00:00:00 2001 From: Filipe Coelho Date: Tue, 8 Dec 2020 17:15:00 +0000 Subject: eg-sampler: Send update to UI if gain parameter changes --- plugins/eg-sampler.lv2/uris.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'plugins/eg-sampler.lv2/uris.h') diff --git a/plugins/eg-sampler.lv2/uris.h b/plugins/eg-sampler.lv2/uris.h index 5837402..8a0eb6f 100644 --- a/plugins/eg-sampler.lv2/uris.h +++ b/plugins/eg-sampler.lv2/uris.h @@ -74,6 +74,34 @@ map_sampler_uris(LV2_URID_Map* map, SamplerURIs* uris) uris->patch_value = map->map(map->handle, LV2_PATCH__value); } +/** + Write a message like the following to `forge`: + [source,turtle] + ---- + [] + a patch:Set ; + patch:property param:gain ; + patch:value 0.0f . + ---- +*/ +static inline LV2_Atom_Forge_Ref +write_set_gain(LV2_Atom_Forge* forge, + const SamplerURIs* uris, + const float gain) +{ + LV2_Atom_Forge_Frame frame; + LV2_Atom_Forge_Ref set = lv2_atom_forge_object( + forge, &frame, 0, uris->patch_Set); + + lv2_atom_forge_key(forge, uris->patch_property); + lv2_atom_forge_urid(forge, uris->param_gain); + lv2_atom_forge_key(forge, uris->patch_value); + lv2_atom_forge_float(forge, gain); + + lv2_atom_forge_pop(forge, &frame); + return set; +} + /** Write a message like the following to `forge`: [source,turtle] -- cgit v1.2.1