aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/eg-sampler.lv2/uris.h
diff options
context:
space:
mode:
authorFilipe Coelho <falktx@falktx.com>2020-12-08 17:15:00 +0000
committerDavid Robillard <d@drobilla.net>2020-12-18 10:15:28 +0100
commit64d4a4a46901b1b1ab4eaac4f3f57f8d353e42c5 (patch)
tree273a990a924bfc06d8c0b36037401f1edf55a534 /plugins/eg-sampler.lv2/uris.h
parentd6301787b3bc3192788bc428a75f4895111dc8bd (diff)
downloadlv2-64d4a4a46901b1b1ab4eaac4f3f57f8d353e42c5.tar.xz
eg-sampler: Send update to UI if gain parameter changes
Diffstat (limited to 'plugins/eg-sampler.lv2/uris.h')
-rw-r--r--plugins/eg-sampler.lv2/uris.h28
1 files changed, 28 insertions, 0 deletions
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
@@ -80,6 +80,34 @@ map_sampler_uris(LV2_URID_Map* map, SamplerURIs* uris)
----
[]
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]
+ ----
+ []
+ a patch:Set ;
patch:property eg:sample ;
patch:value </home/me/foo.wav> .
----