From 7c84ad8bdb1bd5dbdd8d9437e388b3cdea19157c Mon Sep 17 00:00:00 2001 From: David Robillard Date: Sat, 26 Apr 2014 17:51:12 +0000 Subject: Add support for data-access extension (close #967). git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@5368 a436a847-0d15-0410-975c-d299462d15a1 --- src/jalv.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/jalv.c') diff --git a/src/jalv.c b/src/jalv.c index bb4a574..50a818a 100644 --- a/src/jalv.c +++ b/src/jalv.c @@ -1,5 +1,5 @@ /* - Copyright 2007-2012 David Robillard + Copyright 2007-2014 David Robillard Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above @@ -50,6 +50,7 @@ #include "lv2/lv2plug.in/ns/ext/atom/atom.h" #include "lv2/lv2plug.in/ns/ext/buf-size/buf-size.h" +#include "lv2/lv2plug.in/ns/ext/data-access/data-access.h" #include "lv2/lv2plug.in/ns/ext/event/event.h" #include "lv2/lv2plug.in/ns/ext/options/options.h" #include "lv2/lv2plug.in/ns/ext/parameters/parameters.h" @@ -138,6 +139,8 @@ uri_to_id(LV2_URI_Map_Callback_Data callback_data, static LV2_URI_Map_Feature uri_map = { NULL, &uri_to_id }; +static LV2_Extension_Data_Feature ext_data = { NULL }; + static LV2_Feature uri_map_feature = { NS_EXT "uri-map", &uri_map }; static LV2_Feature map_feature = { LV2_URID__map, NULL }; static LV2_Feature unmap_feature = { LV2_URID__unmap, NULL }; @@ -664,9 +667,13 @@ jalv_ui_instantiate(Jalv* jalv, const char* native_ui_type, void* parent) const LV2_Feature instance_feature = { NS_EXT "instance-access", lilv_instance_get_handle(jalv->instance) }; + const LV2_Feature data_feature = { + LV2_DATA_ACCESS_URI, &ext_data + }; const LV2_Feature* ui_features[] = { &uri_map_feature, &map_feature, &unmap_feature, &instance_feature, + &data_feature, &log_feature, &parent_feature, &options_feature, @@ -1133,6 +1140,8 @@ main(int argc, char** argv) die("Failed to instantiate plugin.\n"); } + ext_data.data_access = lilv_instance_get_descriptor(jalv.instance)->extension_data; + fprintf(stderr, "\n"); if (!jalv.buf_size_set) { jalv_allocate_port_buffers(&jalv); -- cgit v1.2.1