aboutsummaryrefslogtreecommitdiffstats
path: root/src/jalv.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-12-18 20:33:14 +0000
committerDavid Robillard <d@drobilla.net>2011-12-18 20:33:14 +0000
commit0ca0ef03a8ae12f5004f0129aade7ea7915a1431 (patch)
treec99d11033857ce2dbebe937ec0276f983f615cca /src/jalv.c
parent8f6a6a7302ab9ff47f9034393b9a30b975ef08a4 (diff)
downloadjalv-0ca0ef03a8ae12f5004f0129aade7ea7915a1431.tar.gz
jalv-0ca0ef03a8ae12f5004f0129aade7ea7915a1431.tar.bz2
jalv-0ca0ef03a8ae12f5004f0129aade7ea7915a1431.zip
Make state implementation more generic.
git-svn-id: http://svn.drobilla.net/lad/trunk/jalv@3889 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/jalv.c')
-rw-r--r--src/jalv.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/jalv.c b/src/jalv.c
index 44b7aae..fb9ce14 100644
--- a/src/jalv.c
+++ b/src/jalv.c
@@ -84,11 +84,9 @@ uri_to_id(LV2_URI_Map_Callback_Data callback_data,
#define NS_EXT "http://lv2plug.in/ns/ext/"
static LV2_URI_Map_Feature uri_map = { NULL, &uri_to_id };
-static const LV2_Feature uri_map_feature = { NS_EXT "uri-map", &uri_map };
-static LV2_URID_Map map = { NULL, &map_uri };
-static const LV2_Feature map_feature = { NS_EXT "urid#map", &map };
-static LV2_URID_Unmap unmap = { NULL, &unmap_uri };
-static const LV2_Feature unmap_feature = { NS_EXT "urid#unmap", &unmap };
+static LV2_Feature uri_map_feature = { NS_EXT "uri-map", &uri_map };
+static LV2_Feature map_feature = { NS_EXT "urid#map", NULL };
+static LV2_Feature unmap_feature = { NS_EXT "urid#unmap", NULL };
static LV2_Feature instance_feature = { NS_EXT "instance-access", NULL };
#ifdef HAVE_LV2_UI_RESIZE
@@ -449,7 +447,7 @@ jalv_ui_write(SuilController controller,
if (protocol != 0 && protocol != host->atom_prot_id) {
fprintf(stderr, "UI write with unsupported protocol %d (%s)\n",
- protocol, unmap.unmap(host, protocol));
+ protocol, symap_unmap(host->symap, protocol));
return;
}
@@ -519,12 +517,19 @@ main(int argc, char** argv)
host.symap = symap_new();
uri_map.callback_data = &host;
- map.handle = &host;
- unmap.handle = &host;
+
+ host.map.handle = &host;
+ host.map.map = map_uri;
+ map_feature.data = &host.map;
+
+ host.unmap.handle = &host;
+ host.unmap.unmap = unmap_uri;
+ unmap_feature.data = &host.unmap;
+
host.midi_event_id = uri_to_id(&host,
"http://lv2plug.in/ns/ext/event",
NS_MIDI "MidiEvent");
- host.atom_prot_id = map.map(map.handle, NS_ATOM "atomTransfer");
+ host.atom_prot_id = symap_map(host.symap, NS_ATOM "atomTransfer");
#ifdef HAVE_LV2_UI_RESIZE
ui_resize.data = &host;