aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2016-04-25 17:17:01 -0400
committerDavid Robillard <d@drobilla.net>2016-04-25 17:17:01 -0400
commit56d7412603a36de29e74ef77b06ba6ba75cc8db6 (patch)
tree5026756963b8c4af2c484e5cc6f035ce1d9cc7a3
parent4f597a80888eb6a448ee29c0777e99c87fa2eba4 (diff)
downloadlv2-56d7412603a36de29e74ef77b06ba6ba75cc8db6.tar.xz
eg-params: Fix invalid Put response to Get
-rw-r--r--plugins/eg-params.lv2/params.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/plugins/eg-params.lv2/params.c b/plugins/eg-params.lv2/params.c
index 186c858..2fa95d3 100644
--- a/plugins/eg-params.lv2/params.c
+++ b/plugins/eg-params.lv2/params.c
@@ -57,6 +57,7 @@ typedef struct {
LV2_URID patch_Get;
LV2_URID patch_Set;
LV2_URID patch_Put;
+ LV2_URID patch_body;
LV2_URID patch_property;
LV2_URID patch_value;
} URIs;
@@ -95,6 +96,7 @@ map_uris(LV2_URID_Map* map, URIs* uris)
uris->patch_Get = map->map(map->handle, LV2_PATCH__Get);
uris->patch_Set = map->map(map->handle, LV2_PATCH__Set);
uris->patch_Put = map->map(map->handle, LV2_PATCH__Put);
+ uris->patch_body = map->map(map->handle, LV2_PATCH__body);
uris->patch_property = map->map(map->handle, LV2_PATCH__property);
uris->patch_value = map->map(map->handle, LV2_PATCH__value);
}
@@ -503,10 +505,16 @@ run(LV2_Handle instance, uint32_t sample_count)
} else if (obj->body.otype == uris->patch_Get) {
// Received a get message, emit our state (probably to UI)
lv2_atom_forge_frame_time(&self->forge, ev->time.frames);
- LV2_Atom_Forge_Frame frame;
- lv2_atom_forge_object(&self->forge, &frame, 0, uris->patch_Put);
+ LV2_Atom_Forge_Frame pframe;
+ lv2_atom_forge_object(&self->forge, &pframe, 0, uris->patch_Put);
+ lv2_atom_forge_key(&self->forge, uris->patch_body);
+
+ LV2_Atom_Forge_Frame bframe;
+ lv2_atom_forge_object(&self->forge, &bframe, 0, 0);
store_state(self, write_param_to_forge, &self->forge, 0, NULL);
- lv2_atom_forge_pop(&self->forge, &frame);
+
+ lv2_atom_forge_pop(&self->forge, &bframe);
+ lv2_atom_forge_pop(&self->forge, &pframe);
} else {
if (self->unmap) {
lv2_log_trace(&self->logger,