From b29d88df3820ad01ffd0d603e77c99e058178292 Mon Sep 17 00:00:00 2001
From: David Robillard <d@drobilla.net>
Date: Wed, 9 Nov 2011 04:59:58 +0000
Subject: Clean up URID extension.

---
 plugins/eg-sampler.lv2/sampler.c    | 30 +++++++++++++++---------------
 plugins/eg-sampler.lv2/sampler_ui.c | 14 +++++++-------
 2 files changed, 22 insertions(+), 22 deletions(-)

(limited to 'plugins')

diff --git a/plugins/eg-sampler.lv2/sampler.c b/plugins/eg-sampler.lv2/sampler.c
index ecebc12..062cf66 100644
--- a/plugins/eg-sampler.lv2/sampler.c
+++ b/plugins/eg-sampler.lv2/sampler.c
@@ -66,7 +66,7 @@ typedef struct {
 
 typedef struct {
 	/* Features */
-	LV2_URID_Mapper* mapper;
+	LV2_URID_Map* map;
 
 	/* Sample */
 	SampleFile*     samp;
@@ -220,23 +220,23 @@ instantiate(const LV2_Descriptor*     descriptor,
 		goto fail;
 	}
 
-	/* Scan host features for uri mapper */
+	/* Scan host features for URID map */
 	for (int i = 0; features[i]; ++i) {
-		if (!strcmp(features[i]->URI, LV2_URID_URI "#Mapper")) {
-			plugin->mapper = (LV2_URID_Mapper*)features[i]->data;
-			plugin->midi_event_id = plugin->mapper->map_uri(
-				plugin->mapper->handle, MIDI_EVENT_URI);
-			plugin->atom_message_id = plugin->mapper->map_uri(
-				plugin->mapper->handle, ATOM_MESSAGE_URI);
-			plugin->set_message_id = plugin->mapper->map_uri(
-				plugin->mapper->handle, SET_MESSAGE_URI);
-			plugin->filename_key_id = plugin->mapper->map_uri(
-				plugin->mapper->handle, FILENAME_URI);
+		if (!strcmp(features[i]->URI, LV2_URID_URI "#map")) {
+			plugin->map = (LV2_URID_Map*)features[i]->data;
+			plugin->midi_event_id = plugin->map->map(
+				plugin->map->handle, MIDI_EVENT_URI);
+			plugin->atom_message_id = plugin->map->map(
+				plugin->map->handle, ATOM_MESSAGE_URI);
+			plugin->set_message_id = plugin->map->map(
+				plugin->map->handle, SET_MESSAGE_URI);
+			plugin->filename_key_id = plugin->map->map(
+				plugin->map->handle, FILENAME_URI);
 		}
 	}
 
-	if (!plugin->mapper) {
-		fprintf(stderr, "Host does not support urid:Mapper.\n");
+	if (!plugin->map) {
+		fprintf(stderr, "Host does not support urid:map.\n");
 		goto fail;
 	}
 
@@ -348,7 +348,7 @@ run(LV2_Handle instance,
 static uint32_t
 map_uri(Sampler* plugin, const char* uri)
 {
-	return plugin->mapper->map_uri(plugin->mapper->handle, uri);
+	return plugin->map->map(plugin->map->handle, uri);
 }
 
 static void
diff --git a/plugins/eg-sampler.lv2/sampler_ui.c b/plugins/eg-sampler.lv2/sampler_ui.c
index f8cc560..c2aa301 100644
--- a/plugins/eg-sampler.lv2/sampler_ui.c
+++ b/plugins/eg-sampler.lv2/sampler_ui.c
@@ -34,7 +34,7 @@
 #define SAMPLER_UI_URI "http://lv2plug.in/plugins/eg-sampler#ui"
 
 typedef struct {
-	LV2_URID_Mapper* mapper;
+	LV2_URID_Map* map;
 	LV2_Atom_Forge*  forge;
 
 	LV2UI_Write_Function write;
@@ -46,7 +46,7 @@ typedef struct {
 static LV2_URID
 uri_to_id(SamplerUI* ui, const char* uri)
 {
-	return ui->mapper->map_uri(ui->mapper->handle, uri);
+	return ui->map->map(ui->map->handle, uri);
 }
 
 static void
@@ -98,7 +98,7 @@ instantiate(const LV2UI_Descriptor*   descriptor,
             const LV2_Feature* const* features)
 {
 	SamplerUI* ui = (SamplerUI*)malloc(sizeof(SamplerUI));
-	ui->mapper     = NULL;
+	ui->map     = NULL;
 	ui->write      = write_function;
 	ui->controller = controller;
 	ui->button     = NULL;
@@ -106,18 +106,18 @@ instantiate(const LV2UI_Descriptor*   descriptor,
 	*widget = NULL;
 
 	for (int i = 0; features[i]; ++i) {
-		if (!strcmp(features[i]->URI, LV2_URID_URI "#Mapper")) {
-			ui->mapper = (LV2_URID_Mapper*)features[i]->data;
+		if (!strcmp(features[i]->URI, LV2_URID_URI "#Map")) {
+			ui->map = (LV2_URID_Map*)features[i]->data;
 		}
 	}
 
-	if (!ui->mapper) {
+	if (!ui->map) {
 		fprintf(stderr, "sampler_ui: Host does not support uri-map\n");
 		free(ui);
 		return NULL;
 	}
 
-	ui->forge = lv2_atom_forge_new(ui->mapper);
+	ui->forge = lv2_atom_forge_new(ui->map);
 
 	ui->button = gtk_button_new_with_label("Load Sample");
 	g_signal_connect(ui->button, "clicked",
-- 
cgit v1.2.1