[SCM] slv2 packaging branch, master, updated. upstream/0.6.4-9-ge11d1d2

mira-guest at users.alioth.debian.org mira-guest at users.alioth.debian.org
Tue Jul 14 22:54:41 UTC 2009


The following commit has been merged in the master branch:
commit a42b7b36c4af2413a5e2be15147a07b1bee1e097
Author: miramikes <mira at 64studio.64studio>
Date:   Wed Jul 15 00:34:40 2009 +0200

    Imported Upstream version 0.6.6

diff --git a/ChangeLog b/ChangeLog
index a8ab85c..ebce3c9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+slv2 (0.6.6) unstable; urgency=low
+
+  * Add manual pages for utilities
+  * Reduce plugin load overhead (on-demand querying with finer granularity)
+  * Fix compilation on Mac OS X
+ 
+ -- Dave Robillard <dave at drobilla.net>  Mon, 25 May 2009 23:30:49 -0400
+
 slv2 (0.6.4) unstable; urgency=low
 
   * Add generic query interface to allow arbitrary querying of data
diff --git a/autowaf.py b/autowaf.py
index fc9a72e..4797ea3 100644
--- a/autowaf.py
+++ b/autowaf.py
@@ -224,7 +224,6 @@ def set_local_lib(conf, name, has_objects):
 		conf.env['AUTOWAF_LOCAL_HEADERS'][name.lower()] = True
 
 def use_lib(bld, obj, libs):
-	abssrcdir = os.path.abspath('.')
 	libs_list = libs.split()
 	for l in libs_list:
 		in_headers = l.lower() in bld.env['AUTOWAF_LOCAL_HEADERS']
@@ -236,10 +235,10 @@ def use_lib(bld, obj, libs):
 				obj.uselib_local = 'lib' + l.lower() + ' '
 		
 		if in_headers or in_libs:
-			inc_flag = '-iquote ' + os.path.join(abssrcdir, l.lower())
+			inc_flag = '-iquote../' + l.lower()
 			for f in ['CCFLAGS', 'CXXFLAGS']:
 				if not inc_flag in bld.env[f]:
-					bld.env.prepend_value(f, inc_flag)
+					bld.env.append_value(f, inc_flag)
 		else:
 			if hasattr(obj, 'uselib'):
 				obj.uselib += ' ' + l
diff --git a/debian-sid/changelog b/debian-sid/changelog
index a8ab85c..ebce3c9 100644
--- a/debian-sid/changelog
+++ b/debian-sid/changelog
@@ -1,3 +1,11 @@
+slv2 (0.6.6) unstable; urgency=low
+
+  * Add manual pages for utilities
+  * Reduce plugin load overhead (on-demand querying with finer granularity)
+  * Fix compilation on Mac OS X
+ 
+ -- Dave Robillard <dave at drobilla.net>  Mon, 25 May 2009 23:30:49 -0400
+
 slv2 (0.6.4) unstable; urgency=low
 
   * Add generic query interface to allow arbitrary querying of data
diff --git a/doc/mainpage.dox b/doc/mainpage.dox
index 6f0a37a..21840b2 100644
--- a/doc/mainpage.dox
+++ b/doc/mainpage.dox
@@ -12,7 +12,7 @@
  * (http://librdf.org).  It should be portable to any system with Redland, and
  * is tested on various GNU/Linux distributions (often), and MacOS X (occasionally).
  * 
- * The Data (RDF) and code (shared library) functionality in SLV2 is strictly
+ * The data (RDF) and code (shared library) functionality in SLV2 is strictly
  * separated so it is simple to control where each is used (e.g. it is
  * possible to discover/investigate plugins and related data without loading
  * any shared libraries, avoiding the associated risks).
@@ -41,7 +41,7 @@
  * (http://librdf.org).  It should be portable to any system with Redland, and
  * is tested on various GNU/Linux distributions (often), and MacOS X (occasionally).
  * 
- * The Data (RDF) and code (shared library) functionality in SLV2 is strictly
+ * The data (RDF) and code (shared library) functionality in SLV2 is strictly
  * separated so it is simple to control where each is used (e.g. it is
  * possible to discover/investigate plugins and related data without loading
  * any shared libraries, avoiding the associated risks).
diff --git a/hosts/lv2_event.h b/hosts/lv2_event.h
index 6ea90c8..7b98569 100644
--- a/hosts/lv2_event.h
+++ b/hosts/lv2_event.h
@@ -1,8 +1,8 @@
 /* lv2_event.h - C header file for the LV2 events extension.
- * 
+ *
  * Copyright (C) 2006-2007 Lars Luthman <lars.luthman at gmail.com>
- * Copyright (C) 2008 Dave Robillard <dave at drobilla.net>
- * 
+ * Copyright (C) 2008-2009 Dave Robillard <http://drobilla.net>
+ *
  * This header is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
  * by the Free Software Foundation; either version 2 of the License, or
@@ -20,7 +20,7 @@
 
 #ifndef LV2_EVENT_H
 #define LV2_EVENT_H
- 
+
 #define LV2_EVENT_URI "http://lv2plug.in/ns/ext/event"
 #define LV2_EVENT_AUDIO_STAMP 0
 
@@ -76,7 +76,7 @@ typedef struct {
 	 * otherwise this is 1/(2^32) of an audio frame.
 	 */
 	uint32_t subframes;
-	
+
 	/** The type of this event, as a number which represents some URI
 	 * defining an event type.  This value MUST be some value previously
 	 * returned from a call to the uri_to_id function defined in the LV2
@@ -121,7 +121,7 @@ typedef struct {
  * |FRAMES |SUBFRMS|TYP|LEN|DATA..DATA..PAD|FRAMES | ...
  */
 typedef struct {
-	
+
 	/** The contents of the event buffer.  This may or may not reside in the
 	 * same block of memory as this header, plugins must not assume either.
 	 * The host guarantees this points to at least capacity bytes of allocated
@@ -201,14 +201,14 @@ typedef void* LV2_Event_Callback_Data;
  * and data pointed to an instance of this struct.
  */
 typedef struct {
-	
+
 	/** Opaque pointer to host data.
 	 *
 	 * The plugin MUST pass this to any call to functions in this struct.
 	 * Otherwise, it must not be interpreted in any way.
 	 */
 	LV2_Event_Callback_Data callback_data;
-	
+
 	/** Take a reference to a non-POD event.
 	 *
 	 * If a plugin receives an event with type 0, it means the event is a
@@ -231,7 +231,7 @@ typedef struct {
 	 */
 	uint32_t (*lv2_event_ref)(LV2_Event_Callback_Data callback_data,
 	                          LV2_Event*              event);
-	
+
 	/** Drop a reference to a non-POD event.
 	 *
 	 * If a plugin receives an event with type 0, it means the event is a
diff --git a/hosts/lv2_event_helpers.h b/hosts/lv2_event_helpers.h
index 8659b9b..a964eb1 100644
--- a/hosts/lv2_event_helpers.h
+++ b/hosts/lv2_event_helpers.h
@@ -1,6 +1,6 @@
 /* lv2_event_helpers.h - Helper functions for the LV2 events extension.
  *
- * Copyright (C) 2008 Dave Robillard <dave at drobilla.net>
+ * Copyright (C) 2008-2009 Dave Robillard <http://drobilla.net>
  *
  * This header is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
@@ -118,8 +118,8 @@ lv2_event_increment(LV2_Event_Iterator* iter)
 	LV2_Event* const ev = (LV2_Event*)(
 			(uint8_t*)iter->buf->data + iter->offset);
 
-	iter->offset += lv2_event_pad_size(sizeof(LV2_Event) + ev->size);	
-	
+	iter->offset += lv2_event_pad_size(sizeof(LV2_Event) + ev->size);
+
 	return true;
 }
 
@@ -165,18 +165,18 @@ lv2_event_write(LV2_Event_Iterator* iter,
 
 	LV2_Event* const ev = (LV2_Event*)(
 			(uint8_t*)iter->buf->data + iter->offset);
-	
+
 	ev->frames = frames;
 	ev->subframes = subframes;
 	ev->type = type;
 	ev->size = size;
 	memcpy((uint8_t*)ev + sizeof(LV2_Event), data, size);
 	++iter->buf->event_count;
-	
+
 	size = lv2_event_pad_size(sizeof(LV2_Event) + size);
 	iter->buf->size += size;
 	iter->offset    += size;
-	
+
 	return true;
 }
 
@@ -189,25 +189,25 @@ lv2_event_reserve(LV2_Event_Iterator* iter,
 		  uint32_t frames,
 		  uint32_t subframes,
 		  uint16_t type,
-		  uint16_t size) 
+		  uint16_t size)
 {
 	size = lv2_event_pad_size(size);
 	if (iter->buf->capacity - iter->buf->size < sizeof(LV2_Event) + size)
 		return NULL;
 
-	LV2_Event* const ev = (LV2_Event*)((uint8_t*)iter->buf->data + 
+	LV2_Event* const ev = (LV2_Event*)((uint8_t*)iter->buf->data +
 					   iter->offset);
-	
+
 	ev->frames = frames;
 	ev->subframes = subframes;
 	ev->type = type;
 	ev->size = size;
 	++iter->buf->event_count;
-	
+
 	size = lv2_event_pad_size(sizeof(LV2_Event) + size);
 	iter->buf->size += size;
 	iter->offset    += size;
-	
+
 	return (uint8_t*)ev + sizeof(LV2_Event);
 }
 
@@ -227,15 +227,15 @@ lv2_event_write_event(LV2_Event_Iterator* iter,
 
 	LV2_Event* const write_ev = (LV2_Event*)(
 			(uint8_t*)iter->buf->data + iter->offset);
-	
+
 	*write_ev = *ev;
 	memcpy((uint8_t*)write_ev + sizeof(LV2_Event), data, ev->size);
 	++iter->buf->event_count;
-	
+
 	const uint16_t size = lv2_event_pad_size(sizeof(LV2_Event) + ev->size);
 	iter->buf->size += size;
 	iter->offset    += size;
-	
+
 	return true;
 }
 
diff --git a/hosts/lv2_jack_host.c b/hosts/lv2_jack_host.c
index 1beef0e..ebeb96b 100644
--- a/hosts/lv2_jack_host.c
+++ b/hosts/lv2_jack_host.c
@@ -1,6 +1,6 @@
 /* jack_host - SLV2 Jack Host
- * Copyright (C) 2007 Dave Robillard <drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <drobilla.net>
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -113,12 +113,12 @@ main(int argc, char** argv)
 	host.jack_client = NULL;
 	host.num_ports   = 0;
 	host.ports       = NULL;
-	
+
 	/* Find all installed plugins */
 	SLV2World world = slv2_world_new();
 	slv2_world_load_all(world);
 	SLV2Plugins plugins = slv2_world_get_all_plugins(world);
-	
+
 	/* Set up the port classes this app supports */
 	host.input_class = slv2_value_new_uri(world, SLV2_PORT_CLASS_INPUT);
 	host.output_class = slv2_value_new_uri(world, SLV2_PORT_CLASS_OUTPUT);
@@ -130,7 +130,7 @@ main(int argc, char** argv)
 
 	/* Find the plugin to run */
 	const char* plugin_uri_str = (argc == 2) ? argv[1] : NULL;
-	
+
 	if (!plugin_uri_str) {
 		fprintf(stderr, "\nYou must specify a plugin URI to load.\n");
 		fprintf(stderr, "\nKnown plugins:\n\n");
@@ -144,7 +144,7 @@ main(int argc, char** argv)
 	SLV2Value plugin_uri = slv2_value_new_uri(world, plugin_uri_str);
 	host.plugin = slv2_plugins_get_by_uri(plugins, plugin_uri);
 	slv2_value_free(plugin_uri);
-	
+
 	if (!host.plugin) {
 		fprintf(stderr, "Failed to find plugin %s.\n", plugin_uri_str);
 		slv2_world_free(world);
@@ -164,7 +164,7 @@ main(int argc, char** argv)
 	} else {
 		jack_name = strdup(name_str);
 	}
-	
+
 	/* Connect to JACK */
 	printf("JACK Name:\t%s\n", jack_name);
 	host.jack_client = jack_client_open(jack_name, JackNullOption, NULL);
@@ -176,7 +176,7 @@ main(int argc, char** argv)
 		die("Failed to connect to JACK.");
 	else
 		printf("Connected to JACK.\n");
-	
+
 	/* Instantiate the plugin */
 	host.instance = slv2_plugin_instantiate(
 		host.plugin, jack_get_sample_rate(host.jack_client), features);
@@ -186,11 +186,11 @@ main(int argc, char** argv)
 		printf("Succesfully instantiated plugin.\n");
 
 	jack_set_process_callback(host.jack_client, &jack_process_cb, (void*)(&host));
-	
+
 	/* Create ports */
 	host.num_ports = slv2_plugin_get_num_ports(host.plugin);
 	host.ports = calloc((size_t)host.num_ports, sizeof(struct Port));
-	float* default_values  = calloc(slv2_plugin_get_num_ports(host.plugin), 
+	float* default_values  = calloc(slv2_plugin_get_num_ports(host.plugin),
 					sizeof(float));
 	slv2_plugin_get_port_ranges_float(host.plugin, NULL, NULL, default_values);
 
@@ -198,19 +198,19 @@ main(int argc, char** argv)
 	  create_port(&host, i, default_values[i]);
 
 	free(default_values);
-	
+
 	/* Activate plugin and JACK */
 	slv2_instance_activate(host.instance);
 	jack_activate(host.jack_client);
-	
+
 	/* Run */
 	printf("Press enter to quit: ");
 	getc(stdin);
 	printf("\n");
-	
+
 	/* Deactivate JACK */
 	jack_deactivate(host.jack_client);
-	
+
 	printf("Shutting down JACK.\n");
 	for (unsigned long i=0; i < host.num_ports; ++i) {
 		if (host.ports[i].jack_port != NULL) {
@@ -222,11 +222,11 @@ main(int argc, char** argv)
 		}
 	}
 	jack_client_close(host.jack_client);
-	
+
 	/* Deactivate plugin */
 	slv2_instance_deactivate(host.instance);
 	slv2_instance_free(host.instance);
-	
+
 	/* Clean up */
 	free(host.ports);
 	slv2_value_free(host.input_class);
@@ -289,7 +289,7 @@ create_port(struct JackHost* host,
 	} else {
 		die("Mandatory port has unknown type (neither input or output)");
 	}
-	
+
 	/* Set control values */
 	if (slv2_port_is_a(host->plugin, port->slv2_port, host->control_class)) {
 		port->type = CONTROL;
@@ -362,7 +362,7 @@ jack_process_cb(jack_nframes_t nframes, void* data)
 			}
 		}
 	}
-	
+
 
 	/* Run plugin for this cycle */
 	slv2_instance_run(host->instance, nframes);
diff --git a/hosts/lv2_simple_jack_host.c b/hosts/lv2_simple_jack_host.c
index 32c852c..4f0654a 100644
--- a/hosts/lv2_simple_jack_host.c
+++ b/hosts/lv2_simple_jack_host.c
@@ -1,6 +1,6 @@
 /* SLV2 Simple Jack Host Example
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -53,7 +53,7 @@ main(int argc, char** argv)
 	host.num_ports   = 0;
 	host.jack_ports  = NULL;
 	host.controls    = NULL;
-	
+
 	/* Find all installed plugins */
 	host.world = slv2_world_new();
 	slv2_world_load_all(host.world);
@@ -70,7 +70,7 @@ main(int argc, char** argv)
 
 	/* Find the plugin to run */
 	const char* plugin_uri_str = (argc == 2) ? argv[1] : NULL;
-	
+
 	if (!plugin_uri_str) {
 		fprintf(stderr, "\nYou must specify a plugin URI to load.\n");
 		fprintf(stderr, "\nKnown plugins:\n\n");
@@ -83,7 +83,7 @@ main(int argc, char** argv)
 	SLV2Value plugin_uri = slv2_value_new_uri(host.world, plugin_uri_str);
 	host.plugin = slv2_plugins_get_by_uri(plugins, plugin_uri);
 	slv2_value_free(plugin_uri);
-	
+
 	if (!host.plugin) {
 		fprintf(stderr, "Failed to find plugin %s.\n", plugin_uri_str);
 		slv2_world_free(host.world);
@@ -107,7 +107,7 @@ main(int argc, char** argv)
 	/* Connect to JACK */
 	printf("JACK Name:\t%s\n", jack_name);
 	host.jack_client = jack_client_open(jack_name, JackNullOption, NULL);
-	
+
 	free(jack_name);
 	slv2_value_free(name);
 
@@ -115,7 +115,7 @@ main(int argc, char** argv)
 		die("Failed to connect to JACK.");
 	else
 		printf("Connected to JACK.\n");
-	
+
 	/* Instantiate the plugin */
 	host.instance = slv2_plugin_instantiate(
 		host.plugin, jack_get_sample_rate(host.jack_client), NULL);
@@ -125,27 +125,27 @@ main(int argc, char** argv)
 		printf("Succesfully instantiated plugin.\n");
 
 	jack_set_process_callback(host.jack_client, &jack_process_cb, (void*)(&host));
-	
+
 	/* Create ports */
 	host.num_ports  = slv2_plugin_get_num_ports(host.plugin);
 	host.jack_ports = calloc((size_t)host.num_ports, sizeof(jack_port_t*));
 	host.controls   = calloc((size_t)host.num_ports, sizeof(float*));
-	
+
 	for (uint32_t i=0; i < host.num_ports; ++i)
 		create_port(&host, i);
-	
+
 	/* Activate plugin and JACK */
 	slv2_instance_activate(host.instance);
 	jack_activate(host.jack_client);
-	
+
 	/* Run */
 	printf("Press enter to quit: ");
 	getc(stdin);
 	printf("\n");
-	
+
 	/* Deactivate JACK */
 	jack_deactivate(host.jack_client);
-	
+
 	printf("Shutting down JACK.\n");
 	for (unsigned long i=0; i < host.num_ports; ++i) {
 		if (host.jack_ports[i] != NULL) {
@@ -154,7 +154,7 @@ main(int argc, char** argv)
 		}
 	}
 	jack_client_close(host.jack_client);
-	
+
 	/* Deactivate plugin */
 	slv2_instance_deactivate(host.instance);
 	slv2_instance_free(host.instance);
@@ -195,11 +195,11 @@ create_port(struct JackHost* host,
 	/* Get the port symbol (label) for console printing */
 	SLV2Value symbol       = slv2_port_get_symbol(host->plugin, port);
 	const char* symbol_str = slv2_value_as_string(symbol);
-	
+
 	/* Initialize the port array elements */
 	host->jack_ports[index] = NULL;
 	host->controls[index]   = 0.0f;
-	
+
 	/* Connect control ports to controls array */
 	if (slv2_port_is_a(host->plugin, port, host->control_class)) {
 
@@ -211,7 +211,7 @@ create_port(struct JackHost* host,
 			printf("Set %s to %f\n", symbol_str, host->controls[index]);
 			slv2_value_free(def);
 		}
-		
+
 		slv2_instance_connect_port(host->instance, index, &host->controls[index]);
 
 	} else if (slv2_port_is_a(host->plugin, port, host->audio_class)) {
@@ -240,7 +240,7 @@ jack_process_cb(jack_nframes_t nframes, void* data)
 		if (host->jack_ports[i] != NULL)
 			slv2_instance_connect_port(host->instance, i,
 				jack_port_get_buffer(host->jack_ports[i], nframes));
-	
+
 	/* Run plugin for this cycle */
 	slv2_instance_run(host->instance, nframes);
 
diff --git a/hosts/lv2_uri_map.h b/hosts/lv2_uri_map.h
index 1c2f5b0..4031401 100644
--- a/hosts/lv2_uri_map.h
+++ b/hosts/lv2_uri_map.h
@@ -1,7 +1,7 @@
 /* lv2_uri_map.h - C header file for the LV2 URI Map extension.
- * 
- * Copyright (C) 2008 Dave Robillard <dave at drobilla.net>
- * 
+ *
+ * Copyright (C) 2008-2009 Dave Robillard <http://drobilla.net>
+ *
  * This header is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Lesser General Public License as published
  * by the Free Software Foundation; either version 2 of the License, or
@@ -36,7 +36,7 @@
  * comparison.  This allows the extensibility of RDF with the performance of
  * integers (or centrally defined enumerations).
  */
-	
+
 
 /** Opaque pointer to host data. */
 typedef void* LV2_URI_Map_Callback_Data;
@@ -49,14 +49,14 @@ typedef void* LV2_URI_Map_Callback_Data;
  * and data pointed to an instance of this struct.
  */
 typedef struct {
-	
+
 	/** Opaque pointer to host data.
 	 *
 	 * The plugin MUST pass this to any call to functions in this struct.
 	 * Otherwise, it must not be interpreted in any way.
 	 */
 	LV2_URI_Map_Callback_Data callback_data;
-	
+
 	/** Get the numeric ID of a URI from the host.
 	 *
 	 * @param callback_data Must be the callback_data member of this struct.
diff --git a/slv2-0.6.6.tar.bz2.sig b/slv2-0.6.6.tar.bz2.sig
new file mode 100644
index 0000000..ac690cd
Binary files /dev/null and b/slv2-0.6.6.tar.bz2.sig differ
diff --git a/slv2/collections.h b/slv2/collections.h
index a76e80c..f81a60d 100644
--- a/slv2/collections.h
+++ b/slv2/collections.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2008 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2008-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -40,7 +40,7 @@ extern "C" {
 #define SLV2_COLLECTION(CollType, ElemType, prefix) \
 \
 /** Free a collection.
- * 
+ *
  * Time = O(1)
  */ \
 void \
@@ -103,7 +103,7 @@ slv2_plugins_size(SLV2Plugins plugins);
  * modified by the caller in any way.
  *
  * Time = O(log2(n))
- * 
+ *
  * \return NULL if plugin with \a url not found in \a plugins.
  */
 SLV2Plugin
@@ -136,7 +136,7 @@ slv2_plugins_get_at(SLV2Plugins plugins,
  * modified by the caller in any way.
  *
  * Time = O(log2(n))
- * 
+ *
  * \return NULL if plugin with \a url not found in \a classes.
  */
 SLV2PluginClass
@@ -179,7 +179,7 @@ slv2_values_contains(SLV2Values values, SLV2Value value);
  * modified by the caller in any way.
  *
  * Time = O(log2(n))
- * 
+ *
  * \return NULL if plugin with \a url not found in \a list.
  */
 SLV2UI
diff --git a/slv2/plugin.h b/slv2/plugin.h
index 473a12b..edf54c9 100644
--- a/slv2/plugin.h
+++ b/slv2/plugin.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -47,7 +47,7 @@ extern "C" {
  * This is used by plugin lists to avoid loading plugins that are not valid
  * and will not work with libslv2 (eg plugins missing required fields, or
  * having multiple values for mandatory single-valued fields, etc.
- * 
+ *
  * Note that normal hosts do NOT need to use this - slv2 does not
  * load invalid plugins into plugin lists.  This is included for plugin
  * testing utilities, etc.
@@ -90,7 +90,7 @@ slv2_plugin_get_uri(SLV2Plugin plugin);
  *
  * Note this always returns a fully qualified URI.  If you want a local
  * filesystem path, use slv2_uri_to_path.
- * 
+ *
  * \return a shared string which must not be modified or freed.
  *
  * Time = O(1)
@@ -119,7 +119,7 @@ slv2_plugin_get_data_uris(SLV2Plugin plugin);
  *
  * Note this always returns a fully qualified URI.  If you want a local
  * filesystem path, use slv2_uri_to_path.
- * 
+ *
  * \return a shared string which must not be modified or freed.
  *
  * Time = O(1)
@@ -151,7 +151,7 @@ slv2_plugin_get_class(SLV2Plugin plugin);
  * Returns the ?object of all triples found of the form:
  *
  * <code>&lt;plugin-uri&gt; predicate ?object</code>
- * 
+ *
  * May return NULL if the property was not found, or if object(s) is not
  * sensibly represented as an SLV2Values (e.g. blank nodes).
  *
@@ -291,14 +291,14 @@ slv2_plugin_get_num_ports(SLV2Plugin p);
  * with array index corresponding to port index.  If a port doesn't have a
  * minimum, maximum or default value, or the port's type is not float, the
  * corresponding array element will be set to NAN.
- * 
+ *
  * This is a convenience method for the common case of getting the range of
  * all float ports on a plugin, and may be significantly faster than
  * repeated calls to slv2_port_get_range.
  */
 void
-slv2_plugin_get_port_ranges_float(SLV2Plugin p, 
-                                  float*     min_values, 
+slv2_plugin_get_port_ranges_float(SLV2Plugin p,
+                                  float*     min_values,
                                   float*     max_values,
                                   float*     def_values);
 
@@ -405,7 +405,7 @@ slv2_plugin_get_port_by_symbol(SLV2Plugin plugin,
  *
  * Returned value must be freed by caller using slv2_uis_free.
  *
- * \param plugin The plugin to get the UIs for. 
+ * \param plugin The plugin to get the UIs for.
  *
  * Time = Query
  */
diff --git a/slv2/pluginclass.h b/slv2/pluginclass.h
index 2b19ac8..0c14235 100644
--- a/slv2/pluginclass.h
+++ b/slv2/pluginclass.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
diff --git a/slv2/plugininstance.h b/slv2/plugininstance.h
index 784cea3..15b2d22 100644
--- a/slv2/plugininstance.h
+++ b/slv2/plugininstance.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -55,7 +55,7 @@ typedef struct _Instance {
  * An SLV2Instance is an instantiated SLV2Plugin (ie a loaded dynamic
  * library).  These functions interact with the binary library code only,
  * they do not read data files in any way.
- * 
+ *
  * @{
  */
 
@@ -64,10 +64,10 @@ typedef struct _Instance {
  * The returned object represents shared library objects loaded into memory,
  * it must be cleaned up with slv2_instance_free when no longer
  * needed.
- * 
+ *
  * \a plugin is not modified or directly referenced by the returned object
  * (instances store only a copy of the plugin's URI).
- * 
+ *
  * \a host_features NULL-terminated array of features the host supports.
  * NULL may be passed if the host supports no additional features (unlike
  * the LV2 specification - SLV2 takes care of it).
@@ -190,7 +190,7 @@ slv2_instance_get_descriptor(SLV2Instance instance)
  *
  * Normally hosts should not need to access the LV2_Handle directly,
  * use the slv2_instance_* functions.
- * 
+ *
  * The returned handle is shared and must not be deleted.
  */
 static inline LV2_Handle
diff --git a/slv2/pluginui.h b/slv2/pluginui.h
index f862024..0436fb6 100644
--- a/slv2/pluginui.h
+++ b/slv2/pluginui.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
diff --git a/slv2/pluginuiinstance.h b/slv2/pluginuiinstance.h
index 84ee690..f2c16e2 100644
--- a/slv2/pluginuiinstance.h
+++ b/slv2/pluginuiinstance.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -49,10 +49,10 @@ typedef struct _SLV2UIInstance {
  * The returned object represents shared library objects loaded into memory,
  * it must be cleaned up with slv2_ui_instance_free when no longer
  * needed.
- * 
+ *
  * \a plugin is not modified or directly referenced by the returned object
  * (instances store only a copy of the plugin's URI).
- * 
+ *
  * \a host_features NULL-terminated array of features the host supports.
  * NULL may be passed if the host supports no additional features (unlike
  * the LV2 specification - SLV2 takes care of it).
@@ -100,7 +100,7 @@ slv2_ui_instance_get_descriptor(SLV2UIInstance instance);
  *
  * Normally hosts should not need to access the LV2UI_Handle directly,
  * use the slv2_ui_instance_* functions.
- * 
+ *
  * The returned handle is shared and must not be deleted.
  */
 LV2UI_Handle
diff --git a/slv2/port.h b/slv2/port.h
index 498da54..7a461cc 100644
--- a/slv2/port.h
+++ b/slv2/port.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -129,7 +129,7 @@ slv2_port_get_name(SLV2Plugin plugin,
 SLV2Values
 slv2_port_get_classes(SLV2Plugin plugin,
                       SLV2Port   port);
-                      
+
 
 /** Determine if a port is of a given class (input, output, audio, etc).
  *
@@ -158,7 +158,7 @@ slv2_port_is_a(SLV2Plugin plugin,
  * Time = Query
  */
 void
-slv2_port_get_range(SLV2Plugin plugin, 
+slv2_port_get_range(SLV2Plugin plugin,
                     SLV2Port   port,
                     SLV2Value* def,
                     SLV2Value* min,
diff --git a/slv2/query.h b/slv2/query.h
index 7319c84..61b266b 100644
--- a/slv2/query.h
+++ b/slv2/query.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2008 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2008-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
diff --git a/slv2/scalepoint.h b/slv2/scalepoint.h
index 1fb6867..311b014 100644
--- a/slv2/scalepoint.h
+++ b/slv2/scalepoint.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
diff --git a/slv2/slv2.h b/slv2/slv2.h
index 0960282..48d54a5 100644
--- a/slv2/slv2.h
+++ b/slv2/slv2.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
diff --git a/slv2/types.h b/slv2/types.h
index 0e18d6d..2cf01fd 100644
--- a/slv2/types.h
+++ b/slv2/types.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
diff --git a/slv2/util.h b/slv2/util.h
index f01fdaa..f1ef2d4 100644
--- a/slv2/util.h
+++ b/slv2/util.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
diff --git a/slv2/value.h b/slv2/value.h
index f1af35f..4a32c1a 100644
--- a/slv2/value.h
+++ b/slv2/value.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -104,10 +104,10 @@ slv2_value_is_uri(SLV2Value value);
 
 
 /** Return this value as a URI string, e.g. "http://example.org/foo".
- * 
+ *
  * Valid to call only if slv2_value_is_uri(\a value) returns true.
  * Returned value is owned by \a value and must not be freed by caller.
- * 
+ *
  * Time = O(1)
  */
 const char*
@@ -127,10 +127,10 @@ slv2_value_is_qname(SLV2Value value);
 
 
 /** Return this value as a QName string, e.g. "lv2:Plugin".
- * 
+ *
  * Valid to call only if slv2_value_is_qname(\a value) returns true.
  * Returned value is owned by \a value and must not be freed by caller.
- * 
+ *
  * Time = O(1)
  */
 const char*
@@ -175,7 +175,7 @@ slv2_value_is_float(SLV2Value value);
 
 
 /** Return \a value as a float.
- * 
+ *
  * Valid to call only if slv2_value_is_float(\a value) or
  * slv2_value_is_int(\a value) returns true.
  *
@@ -186,7 +186,7 @@ slv2_value_as_float(SLV2Value value);
 
 
 /** Return whether this value is an integer literal.
- * 
+ *
  * Time = O(1)
  */
 bool
@@ -194,7 +194,7 @@ slv2_value_is_int(SLV2Value value);
 
 
 /** Return \a value as an integer.
- * 
+ *
  * Valid to call only if slv2_value_is_int(\a value) returns true.
  *
  * Time = O(1)
diff --git a/slv2/world.h b/slv2/world.h
index 0e6106c..9d2dd77 100644
--- a/slv2/world.h
+++ b/slv2/world.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -27,7 +27,7 @@ extern "C" {
 #include "slv2/collections.h"
 
 /** \defgroup slv2_world Global library state
- * 
+ *
  * The "world" represents all library state, and the data found in bundles'
  * manifest.ttl (ie it is an in-memory index of all things LV2 found).
  * Plugins (and plugin extensions) and the LV2 specification (and LV2
@@ -121,7 +121,7 @@ slv2_world_get_plugin_class(SLV2World world);
 /** Return a list of all found plugin classes.
  *
  * Returned list is owned by world and must not be freed by the caller.
- * 
+ *
  * Time = O(1)
  */
 SLV2PluginClasses
diff --git a/src/collections.c b/src/collections.c
index 4598eab..be4d898 100644
--- a/src/collections.c
+++ b/src/collections.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2008 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2008-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -75,19 +75,19 @@ SLV2PluginClass
 slv2_plugin_classes_get_by_uri(SLV2PluginClasses list, SLV2Value uri)
 {
 	// good old fashioned binary search
-	
+
 	int lower = 0;
 	int upper = raptor_sequence_size(list) - 1;
 	int i;
-	
+
 	while (upper >= lower) {
 		i = lower + ((upper - lower) / 2);
 
 		SLV2PluginClass p = raptor_sequence_get_at(list, i);
-	
+
 		const int cmp = strcmp(slv2_value_as_uri(slv2_plugin_class_get_uri(p)),
 		                       slv2_value_as_uri(uri));
-		
+
 		if (cmp == 0)
 			return p;
 		else if (cmp > 0)
@@ -109,7 +109,7 @@ slv2_values_contains(SLV2Values list, SLV2Value value)
 	for (unsigned i=0; i < slv2_values_size(list); ++i)
 		if (slv2_value_equals(slv2_values_get_at(list, i), value))
 			return true;
-	
+
 	return false;
 }
 
@@ -129,11 +129,11 @@ SLV2UI
 slv2_uis_get_by_uri(SLV2UIs list, SLV2Value uri)
 {
 	// good old fashioned binary search
-	
+
 	int lower = 0;
 	int upper = raptor_sequence_size(list) - 1;
 	int i;
-	
+
 	while (upper >= lower) {
 		i = lower + ((upper - lower) / 2);
 
diff --git a/src/plugin.c b/src/plugin.c
index 1986f2c..bb294a8 100644
--- a/src/plugin.c
+++ b/src/plugin.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -23,11 +23,11 @@
 #include <stdlib.h>
 #include <string.h>
 #include <librdf.h>
+#include "slv2/types.h"
 #include "slv2/collections.h"
 #include "slv2/plugin.h"
 #include "slv2/pluginclass.h"
 #include "slv2/query.h"
-#include "slv2/types.h"
 #include "slv2/util.h"
 #include "slv2_internal.h"
 
@@ -45,7 +45,7 @@ slv2_plugin_new(SLV2World world, SLV2Value uri, librdf_uri* bundle_uri)
 	plugin->binary_uri = NULL;
 	plugin->plugin_class = NULL;
 	plugin->data_uris = slv2_values_new();
-	plugin->ports = raptor_new_sequence((void (*)(void*))&slv2_port_free, NULL);
+	plugin->ports = NULL;
 	plugin->storage = NULL;
 	plugin->rdf = NULL;
 
@@ -59,26 +59,27 @@ slv2_plugin_free(SLV2Plugin p)
 {
 	slv2_value_free(p->plugin_uri);
 	p->plugin_uri = NULL;
-	
+
 	slv2_value_free(p->bundle_uri);
 	p->bundle_uri = NULL;
-	
+
 	slv2_value_free(p->binary_uri);
 	p->binary_uri = NULL;
-	
-	raptor_free_sequence(p->ports);
+
+	if (p->ports)
+		raptor_free_sequence(p->ports);
 	p->ports = NULL;
 
 	if (p->rdf) {
 		librdf_free_model(p->rdf);
 		p->rdf = NULL;
 	}
-	
+
 	if (p->storage) {
 		librdf_free_storage(p->storage);
 		p->storage = NULL;
 	}
-	
+
 	slv2_values_free(p->data_uris);
 	p->data_uris = NULL;
 
@@ -113,164 +114,105 @@ slv2_plugin_load_if_necessary(SLV2Plugin p)
 }
 
 
+/* private */
 void
-slv2_plugin_load(SLV2Plugin p)
+slv2_plugin_load_ports_if_necessary(SLV2Plugin p)
 {
-	//printf("Loading cache for %s\n", (const char*)librdf_uri_as_string(p->plugin_uri));
+	if (!p->rdf)
+		slv2_plugin_load(p);
 
-	if (!p->storage) {
-		assert(!p->rdf);
-		//p->storage = librdf_new_storage(p->world->world, "hashes", NULL,
-		//		"hash-type='memory'");
-		p->storage = librdf_new_storage(p->world->world, "trees", NULL, NULL);
-		if (!p->storage)
-			p->storage = librdf_new_storage(p->world->world, "memory", NULL, NULL);
-		p->rdf = librdf_new_model(p->world->world, p->storage, NULL);
-	}
+	if (!p->ports) {
+		p->ports = raptor_new_sequence((void (*)(void*))&slv2_port_free, NULL);
 
-	// Parse all the plugin's data files into RDF model
-	for (unsigned i=0; i < slv2_values_size(p->data_uris); ++i) {
-		SLV2Value data_uri_val = slv2_values_get_at(p->data_uris, i);
-		librdf_uri* data_uri = librdf_new_uri(p->world->world,
-				(const unsigned char*)slv2_value_as_uri(data_uri_val));
-		librdf_parser_parse_into_model(p->world->parser, data_uri, NULL, p->rdf);
-		librdf_free_uri(data_uri);
-	}
+		const unsigned char* query = (const unsigned char*)
+			"PREFIX : <http://lv2plug.in/ns/lv2core#>\n"
+			"SELECT DISTINCT ?type ?symbol ?index WHERE {\n"
+			"<>    :port    ?port .\n"
+			"?port a        ?type ;\n"
+			"      :symbol  ?symbol ;\n"
+			"      :index   ?index .\n"
+			"} ORDER BY (?index)";
 
-	// Load plugin_class
-	const unsigned char* query = (const unsigned char*)
-		"SELECT DISTINCT ?class WHERE { <> a ?class }";
-	
-	librdf_query* q = librdf_new_query(p->world->world, "sparql",
-		NULL, query, slv2_value_as_librdf_uri(p->plugin_uri));
-	
-	librdf_query_results* results = librdf_query_execute(q, p->rdf);
-		
-	while (!librdf_query_results_finished(results)) {
-		librdf_node* class_node = librdf_query_results_get_binding_value(results, 0);
-		librdf_uri*  class_uri  = librdf_node_get_uri(class_node);
+		librdf_query* q = librdf_new_query(p->world->world, "sparql",
+				NULL, query, slv2_value_as_librdf_uri(p->plugin_uri));
 
-		if (!class_uri) {
-			librdf_query_results_next(results);
-			continue;
-		}
+		librdf_query_results* results = librdf_query_execute(q, p->rdf);
 
-		SLV2Value class = slv2_value_new_librdf_uri(p->world, class_uri);
-		
-		if ( ! slv2_value_equals(class, p->world->lv2_plugin_class->uri)) {
+		int num_ports  = 0;
+		int last_index = -1;
 
-			SLV2PluginClass plugin_class = slv2_plugin_classes_get_by_uri(
-					p->world->plugin_classes, class);
+		while (!librdf_query_results_finished(results)) {
 
-			librdf_free_node(class_node);
+			librdf_node* type_node = librdf_query_results_get_binding_value(results, 0);
+			librdf_node* symbol_node = librdf_query_results_get_binding_value(results, 1);
+			librdf_node* index_node = librdf_query_results_get_binding_value(results, 2);
 
-			if (plugin_class) {
-				p->plugin_class = plugin_class;
-				slv2_value_free(class);
-				break;
+			assert(librdf_node_is_literal(symbol_node));
+			assert(librdf_node_is_literal(index_node));
+
+			const char* symbol = (const char*)librdf_node_get_literal_value(symbol_node);
+			const char* index = (const char*)librdf_node_get_literal_value(index_node);
+
+			//printf("PORT: %s %s %s\n", type, index, symbol);
+
+			const int this_index = atoi(index);
+			SLV2Port  this_port  = NULL;
+
+			// ORDER BY guarantees order
+			assert(this_index <= num_ports);
+
+			// Create a new SLV2Port, and add to template
+			if (this_index == num_ports) {
+				assert(this_index == last_index + 1);
+				this_port = slv2_port_new(p->world, (unsigned)atoi(index), symbol);
+				raptor_sequence_push(p->ports, this_port);
+				++num_ports;
+				++last_index;
+
+			// More information about a port we already created
+			} else if (this_index < num_ports) {
+				this_port = slv2_plugin_get_port_by_index(p, this_index);
 			}
-		}
 
-		slv2_value_free(class);
-		librdf_query_results_next(results);
-	}
-	
-	if (p->plugin_class == NULL)
-		p->plugin_class = p->world->lv2_plugin_class;
+			if (this_port) {
+				raptor_sequence_push(this_port->classes,
+						slv2_value_new_librdf_uri(p->world, librdf_node_get_uri(type_node)));
+			}
 
-	librdf_free_query_results(results);
-	librdf_free_query(q);
-	
-	// Load ports
-	query = (const unsigned char*)
-		"PREFIX : <http://lv2plug.in/ns/lv2core#>\n"
-		"SELECT DISTINCT ?type ?symbol ?index WHERE {\n"
-		"<>    :port    ?port .\n"
-		"?port a        ?type ;\n"
-		"      :symbol  ?symbol ;\n"
-		"      :index   ?index .\n"
-		"} ORDER BY (?index)";
-	
-	q = librdf_new_query(p->world->world, "sparql",
-		NULL, query, slv2_value_as_librdf_uri(p->plugin_uri));
-	
-	results = librdf_query_execute(q, p->rdf);
-
-	int num_ports = 0;
-	int last_index = -1;
+			librdf_free_node(type_node);
+			librdf_free_node(symbol_node);
+			librdf_free_node(index_node);
 
-	while (!librdf_query_results_finished(results)) {
-	
-		librdf_node* type_node = librdf_query_results_get_binding_value(results, 0);
-		librdf_node* symbol_node = librdf_query_results_get_binding_value(results, 1);
-		librdf_node* index_node = librdf_query_results_get_binding_value(results, 2);
-
-		assert(librdf_node_is_literal(symbol_node));
-		assert(librdf_node_is_literal(index_node));
-
-		const char* symbol = (const char*)librdf_node_get_literal_value(symbol_node);
-		const char* index = (const char*)librdf_node_get_literal_value(index_node);
-
-		//printf("PORT: %s %s %s\n", type, index, symbol);
-
-		const int this_index = atoi(index);
-		SLV2Port  this_port  = NULL;
-		
-		// ORDER BY guarantees order
-		assert(this_index <= num_ports);
-
-		// Create a new SLV2Port, and add to template
-		if (this_index == num_ports) {
-			assert(this_index == last_index + 1);
-			this_port = slv2_port_new(p->world, (unsigned)atoi(index), symbol);
-			raptor_sequence_push(p->ports, this_port);
-			++num_ports;
-			++last_index;
-
-		// More information about a port we already created
-		} else if (this_index < num_ports) {
-			this_port = slv2_plugin_get_port_by_index(p, this_index);
-		}
-			
-		if (this_port) {
-			raptor_sequence_push(this_port->classes,
-					slv2_value_new_librdf_uri(p->world, librdf_node_get_uri(type_node)));
+			librdf_query_results_next(results);
 		}
 
-		librdf_free_node(type_node);
-		librdf_free_node(symbol_node);
-		librdf_free_node(index_node);
-		
-		librdf_query_results_next(results);
+		librdf_free_query_results(results);
+		librdf_free_query(q);
 	}
-	
-	librdf_free_query_results(results);
-	librdf_free_query(q);
+}
 
-	// Load binary URI
-	query = (const unsigned char*)
-		"PREFIX : <http://lv2plug.in/ns/lv2core#>\n"
-		"SELECT ?binary WHERE { <> :binary ?binary . }";
-	
-	q = librdf_new_query(p->world->world, "sparql",
-		NULL, query, slv2_value_as_librdf_uri(p->plugin_uri));
-	
-	results = librdf_query_execute(q, p->rdf);
-
-	if (!librdf_query_results_finished(results)) {
-		librdf_node* binary_node = librdf_query_results_get_binding_value(results, 0);
-		librdf_uri* binary_uri = librdf_node_get_uri(binary_node);
-		
-		if (binary_uri) {
-			SLV2Value binary = slv2_value_new_librdf_uri(p->world, binary_uri);
-			p->binary_uri = binary;
-		}
 
-		librdf_free_node(binary_node);
+void
+slv2_plugin_load(SLV2Plugin p)
+{
+	//printf("Loading cache for %s\n", slv2_value_as_string(p->plugin_uri));
+
+	if (!p->storage) {
+		assert(!p->rdf);
+		p->storage = librdf_new_storage(p->world->world, "trees", NULL, NULL);
+		if (!p->storage)
+			p->storage = librdf_new_storage(p->world->world, "memory", NULL, NULL);
+		p->rdf = librdf_new_model(p->world->world, p->storage, NULL);
+	}
+
+	// Parse all the plugin's data files into RDF model
+	for (unsigned i=0; i < slv2_values_size(p->data_uris); ++i) {
+		SLV2Value data_uri_val = slv2_values_get_at(p->data_uris, i);
+		librdf_uri* data_uri = librdf_new_uri(p->world->world,
+				(const unsigned char*)slv2_value_as_uri(data_uri_val));
+		librdf_parser_parse_into_model(p->world->parser, data_uri, NULL, p->rdf);
+		librdf_free_uri(data_uri);
 	}
-	
-	librdf_free_query_results(results);
-	librdf_free_query(q);
 }
 
 
@@ -297,6 +239,31 @@ slv2_plugin_get_library_uri(SLV2Plugin p)
 {
 	assert(p);
 	slv2_plugin_load_if_necessary(p);
+	if (!p->binary_uri) {
+		const unsigned char* query = (const unsigned char*)
+			"PREFIX : <http://lv2plug.in/ns/lv2core#>\n"
+			"SELECT ?binary WHERE { <> :binary ?binary . }";
+
+		librdf_query* q = librdf_new_query(p->world->world, "sparql",
+				NULL, query, slv2_value_as_librdf_uri(p->plugin_uri));
+
+		librdf_query_results* results = librdf_query_execute(q, p->rdf);
+
+		if (!librdf_query_results_finished(results)) {
+			librdf_node* binary_node = librdf_query_results_get_binding_value(results, 0);
+			librdf_uri* binary_uri = librdf_node_get_uri(binary_node);
+
+			if (binary_uri) {
+				SLV2Value binary = slv2_value_new_librdf_uri(p->world, binary_uri);
+				p->binary_uri = binary;
+			}
+
+			librdf_free_node(binary_node);
+		}
+
+		librdf_free_query_results(results);
+		librdf_free_query(q);
+	}
 	return p->binary_uri;
 }
 
@@ -311,10 +278,52 @@ slv2_plugin_get_data_uris(SLV2Plugin p)
 SLV2PluginClass
 slv2_plugin_get_class(SLV2Plugin p)
 {
-	// FIXME: Typical use case this will bring every single plugin model
-	// into memory
-	
 	slv2_plugin_load_if_necessary(p);
+	if (!p->plugin_class) {
+		const unsigned char* query = (const unsigned char*)
+			"SELECT DISTINCT ?class WHERE { <> a ?class }";
+
+		librdf_query* q = librdf_new_query(p->world->world, "sparql",
+				NULL, query, slv2_value_as_librdf_uri(p->plugin_uri));
+
+		librdf_query_results* results = librdf_query_execute(q, p->rdf);
+
+		while (!librdf_query_results_finished(results)) {
+			librdf_node* class_node = librdf_query_results_get_binding_value(results, 0);
+			librdf_uri*  class_uri  = librdf_node_get_uri(class_node);
+
+			if (!class_uri) {
+				librdf_query_results_next(results);
+				continue;
+			}
+
+			SLV2Value class = slv2_value_new_librdf_uri(p->world, class_uri);
+
+			if ( ! slv2_value_equals(class, p->world->lv2_plugin_class->uri)) {
+
+				SLV2PluginClass plugin_class = slv2_plugin_classes_get_by_uri(
+						p->world->plugin_classes, class);
+
+				librdf_free_node(class_node);
+
+				if (plugin_class) {
+					p->plugin_class = plugin_class;
+					slv2_value_free(class);
+					break;
+				}
+			}
+
+			slv2_value_free(class);
+			librdf_query_results_next(results);
+		}
+
+		if (p->plugin_class == NULL)
+			p->plugin_class = p->world->lv2_plugin_class;
+
+		librdf_free_query_results(results);
+		librdf_free_query(q);
+	}
+
 	return p->plugin_class;
 }
 
@@ -322,7 +331,7 @@ slv2_plugin_get_class(SLV2Plugin p)
 bool
 slv2_plugin_verify(SLV2Plugin plugin)
 {
-	char* query_str = 
+	char* query_str =
 		"SELECT DISTINCT ?type ?name ?license ?port WHERE {\n"
 		"<> a ?type ;\n"
 		"doap:name    ?name ;\n"
@@ -344,13 +353,13 @@ slv2_plugin_verify(SLV2Plugin plugin)
 
 		if (librdf_node_get_type(type_node) == LIBRDF_NODE_TYPE_RESOURCE)
 			has_type = true;
-		
+
 		if (name_node)
 			has_name = true;
-		
+
 		if (license_node)
 			has_license = true;
-		
+
 		if (port_node)
 			has_port = true;
 
@@ -379,7 +388,7 @@ slv2_plugin_get_name(SLV2Plugin plugin)
 {
 	SLV2Values results = slv2_plugin_get_value_by_qname_i18n(plugin, "doap:name");
 	SLV2Value  ret     = NULL;
-	
+
 	if (results) {
 		SLV2Value val = slv2_values_get_at(results, 0);
 		if (slv2_value_is_string(val))
@@ -402,7 +411,7 @@ slv2_plugin_get_value(SLV2Plugin p,
                       SLV2Value  predicate)
 {
 	char* query = NULL;
-	
+
 	/* Hack around broken RASQAL, full URI predicates don't work :/ */
 	query = slv2_strjoin(
 		"PREFIX slv2predicate: <", slv2_value_as_string(predicate), ">\n",
@@ -411,7 +420,7 @@ slv2_plugin_get_value(SLV2Plugin p,
 		"}\n", NULL);
 
 	SLV2Values result = slv2_plugin_query_variable(p, query, 0);
-	
+
 	free(query);
 
 	return result;
@@ -429,13 +438,13 @@ slv2_plugin_get_value_by_qname(SLV2Plugin  p,
 			"}\n", NULL);
 
 	SLV2Values result = slv2_plugin_query_variable(p, query, 0);
-	
+
 	free(query);
 
 	return result;
 }
 
-	
+
 /* internal: get i18n value if possible */
 SLV2Values
 slv2_plugin_get_value_by_qname_i18n(SLV2Plugin  p,
@@ -448,13 +457,13 @@ slv2_plugin_get_value_by_qname_i18n(SLV2Plugin  p,
 			"}\n", NULL);
 
 	SLV2Values result = slv2_plugin_query_variable(p, query, 0);
-	
+
 	free(query);
 
 	return result;
 }
 
-	
+
 SLV2Values
 slv2_plugin_get_value_for_subject(SLV2Plugin p,
                                   SLV2Value  subject,
@@ -480,7 +489,7 @@ slv2_plugin_get_value_for_subject(SLV2Plugin p,
 		"}\n", NULL);
 
 	SLV2Values result = slv2_plugin_query_variable(p, query, 0);
-	
+
 	free(query);
 	free(subject_token);
 
@@ -507,7 +516,7 @@ slv2_plugin_get_hints(SLV2Plugin p)
 uint32_t
 slv2_plugin_get_num_ports(SLV2Plugin p)
 {
-	slv2_plugin_load_if_necessary(p);
+	slv2_plugin_load_ports_if_necessary(p);
 	return raptor_sequence_size(p->ports);
 }
 
@@ -516,8 +525,8 @@ void
 slv2_plugin_get_port_float_values(SLV2Plugin  p,
                                   const char* qname,
                                   float*      values)
-{	
-	slv2_plugin_load_if_necessary(p);
+{
+	slv2_plugin_load_ports_if_necessary(p);
 
 	for (int i = 0; i < raptor_sequence_size(p->ports); ++i)
 		values[i] = NAN;
@@ -556,8 +565,8 @@ slv2_plugin_get_port_float_values(SLV2Plugin  p,
 
 
 void
-slv2_plugin_get_port_ranges_float(SLV2Plugin p, 
-                                  float*     min_values, 
+slv2_plugin_get_port_ranges_float(SLV2Plugin p,
+                                  float*     min_values,
                                   float*     max_values,
                                   float*     def_values)
 {
@@ -576,6 +585,8 @@ uint32_t
 slv2_plugin_get_num_ports_of_class(SLV2Plugin p,
                                    SLV2Value  class_1, ...)
 {
+	slv2_plugin_load_ports_if_necessary(p);
+
 	uint32_t ret = 0;
 	va_list  args;
 
@@ -585,7 +596,7 @@ slv2_plugin_get_num_ports_of_class(SLV2Plugin p,
 			continue;
 
 		va_start(args, class_1);
-		
+
 		bool matches = true;
 		for (SLV2Value class_i = NULL; (class_i = va_arg(args, SLV2Value)) != NULL ; ) {
 			if (!slv2_port_is_a(p, port, class_i)) {
@@ -608,7 +619,7 @@ slv2_plugin_get_num_ports_of_class(SLV2Plugin p,
 bool
 slv2_plugin_has_latency(SLV2Plugin p)
 {
-    const char* const query = 
+    const char* const query =
 		"SELECT ?index WHERE {\n"
 		"	<>      lv2:port         ?port .\n"
 		"	?port   lv2:portProperty lv2:reportsLatency ;\n"
@@ -618,7 +629,7 @@ slv2_plugin_has_latency(SLV2Plugin p)
 	SLV2Values results = slv2_plugin_query_variable(p, query, 0);
 	const bool latent = (slv2_values_size(results) > 0);
 	slv2_values_free(results);
-	
+
 	return latent;
 }
 
@@ -626,7 +637,7 @@ slv2_plugin_has_latency(SLV2Plugin p)
 uint32_t
 slv2_plugin_get_latency_port_index(SLV2Plugin p)
 {
-    const char* const query = 
+    const char* const query =
 		"SELECT ?index WHERE {\n"
 		"	<>      lv2:port         ?port .\n"
 		"	?port   lv2:portProperty lv2:reportsLatency ;\n"
@@ -634,7 +645,7 @@ slv2_plugin_get_latency_port_index(SLV2Plugin p)
 		"}\n";
 
 	SLV2Values result = slv2_plugin_query_variable(p, query, 0);
-	
+
 	// FIXME: need a sane error handling strategy
 	assert(slv2_values_size(result) > 0);
 	SLV2Value val = slv2_values_get_at(result, 0);
@@ -645,13 +656,13 @@ slv2_plugin_get_latency_port_index(SLV2Plugin p)
 	return ret;
 }
 
-	
+
 bool
 slv2_plugin_has_feature(SLV2Plugin p,
                         SLV2Value  feature)
 {
 	SLV2Values features = slv2_plugin_get_supported_features(p);
-	
+
 	const bool ret = features && feature && slv2_values_contains(features, feature);
 
 	slv2_values_free(features);
@@ -664,7 +675,7 @@ slv2_plugin_get_supported_features(SLV2Plugin p)
 {
 	SLV2Values optional = slv2_plugin_get_optional_features(p);
 	SLV2Values required = slv2_plugin_get_required_features(p);
-	
+
 	SLV2Values result = slv2_values_new();
 	unsigned n_optional = slv2_values_size(optional);
 	unsigned n_required = slv2_values_size(required);
@@ -676,7 +687,7 @@ slv2_plugin_get_supported_features(SLV2Plugin p)
 
 	slv2_values_free(optional);
 	slv2_values_free(required);
-	
+
 	return result;
 }
 
@@ -699,7 +710,7 @@ SLV2Port
 slv2_plugin_get_port_by_index(SLV2Plugin p,
                               uint32_t   index)
 {
-	slv2_plugin_load_if_necessary(p);
+	slv2_plugin_load_ports_if_necessary(p);
 	return raptor_sequence_get_at(p->ports, (int)index);
 }
 
@@ -708,7 +719,7 @@ SLV2Port
 slv2_plugin_get_port_by_symbol(SLV2Plugin p,
                                SLV2Value  symbol)
 {
-	slv2_plugin_load_if_necessary(p);
+	slv2_plugin_load_ports_if_necessary(p);
 	for (int i=0; i < raptor_sequence_size(p->ports); ++i) {
 		SLV2Port port = raptor_sequence_get_at(p->ports, i);
 		if (slv2_value_equals(port->symbol, symbol))
@@ -724,14 +735,14 @@ slv2_plugin_get_author_name(SLV2Plugin plugin)
 {
 	SLV2Value ret = NULL;
 
-    const char* const query = 
+    const char* const query =
 		"SELECT ?name WHERE {\n"
 		"	<>      doap:maintainer ?maint . \n"
 		"	?maint  foaf:name ?name . \n"
 		"}\n";
 
 	SLV2Values results = slv2_plugin_query_variable(plugin, query, 0);
-	
+
 	if (results && slv2_values_size(results) > 0) {
 		SLV2Value val = slv2_values_get_at(results, 0);
 		if (slv2_value_is_string(val))
@@ -750,14 +761,14 @@ slv2_plugin_get_author_email(SLV2Plugin plugin)
 {
 	SLV2Value ret = NULL;
 
-    const char* const query = 
+    const char* const query =
 		"SELECT ?email WHERE {\n"
 		"	<>      doap:maintainer ?maint . \n"
 		"	?maint  foaf:mbox ?email . \n"
 		"}\n";
-	
+
 	SLV2Values results = slv2_plugin_query_variable(plugin, query, 0);
-	
+
 	if (results && slv2_values_size(results) > 0) {
 		SLV2Value val = slv2_values_get_at(results, 0);
 		if (slv2_value_is_uri(val))
@@ -770,20 +781,20 @@ slv2_plugin_get_author_email(SLV2Plugin plugin)
 	return ret;
 }
 
-	
+
 SLV2Value
 slv2_plugin_get_author_homepage(SLV2Plugin plugin)
 {
 	SLV2Value ret = NULL;
 
-    const char* const query = 
+    const char* const query =
 		"SELECT ?page WHERE {\n"
 		"	<>      doap:maintainer ?maint . \n"
 		"	?maint  foaf:homepage ?page . \n"
 		"}\n";
-	
+
 	SLV2Values results = slv2_plugin_query_variable(plugin, query, 0);
-	
+
 	if (results && slv2_values_size(results) > 0) {
 		SLV2Value val = slv2_values_get_at(results, 0);
 		if (slv2_value_is_uri(val))
diff --git a/src/pluginclass.c b/src/pluginclass.c
index 6cc3bfe..62475e3 100644
--- a/src/pluginclass.c
+++ b/src/pluginclass.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -21,6 +21,7 @@
 #include <assert.h>
 #include <stdlib.h>
 #include <string.h>
+#include "slv2/types.h"
 #include "slv2/pluginclass.h"
 #include "slv2/value.h"
 #include "slv2_internal.h"
diff --git a/src/plugininstance.c b/src/plugininstance.c
index c3e0601..26fd503 100644
--- a/src/plugininstance.c
+++ b/src/plugininstance.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -37,19 +37,19 @@ slv2_plugin_instantiate(SLV2Plugin               plugin,
                         const LV2_Feature*const* features)
 {
 	struct _Instance* result = NULL;
-	
+
 	const LV2_Feature** local_features = NULL;
 	if (features == NULL) {
 		local_features = malloc(sizeof(LV2_Feature));
 		local_features[0] = NULL;
 	}
-	
+
 	const char* const lib_uri = slv2_value_as_uri(slv2_plugin_get_library_uri(plugin));
 	const char* const lib_path = slv2_uri_to_path(lib_uri);
-	
+
 	if (!lib_path)
 		return NULL;
-	
+
 	dlerror();
 	void* lib = dlopen(lib_path, RTLD_NOW);
 	if (!lib) {
@@ -66,24 +66,24 @@ slv2_plugin_instantiate(SLV2Plugin               plugin,
 		return NULL;
 	} else {
 		// Search for plugin by URI
-		
+
 		// FIXME: Kludge to get bundle path (containing directory of binary)
 		const char* bundle_path = slv2_uri_to_path(slv2_value_as_uri(
 					slv2_plugin_get_bundle_uri(plugin)));
 
 		//printf("Bundle path: %s\n", bundle_path);
-		
+
 		for (uint32_t i=0; 1; ++i) {
-			
+
 			const LV2_Descriptor* ld = df(i);
-				
+
 			if (!ld) {
 				fprintf(stderr, "Did not find plugin %s in %s\n",
 						slv2_value_as_uri(slv2_plugin_get_uri(plugin)), lib_path);
 				dlclose(lib);
 				break; // return NULL
 			} else if (!strcmp(ld->URI, slv2_value_as_uri(slv2_plugin_get_uri(plugin)))) {
-					
+
 				assert(plugin->plugin_uri);
 
 				//printf("Found %s at index %u in:\n\t%s\n\n",
diff --git a/src/plugins.c b/src/plugins.c
index f392bcd..4aee191 100644
--- a/src/plugins.c
+++ b/src/plugins.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -29,7 +29,7 @@
 #include "slv2/util.h"
 #include "slv2_internal.h"
 
-	
+
 SLV2Plugins
 slv2_plugins_new()
 {
@@ -71,11 +71,11 @@ SLV2Plugin
 slv2_plugins_get_by_uri(SLV2Plugins list, SLV2Value uri)
 {
 	// good old fashioned binary search
-	
+
 	int lower = 0;
 	int upper = raptor_sequence_size(list) - 1;
 	int i;
-	
+
 	while (upper >= lower) {
 		i = lower + ((upper - lower) / 2);
 
@@ -98,7 +98,7 @@ slv2_plugins_get_by_uri(SLV2Plugins list, SLV2Value uri)
 
 SLV2Plugin
 slv2_plugins_get_at(SLV2Plugins list, unsigned index)
-{	
+{
 	if (index > INT_MAX)
 		return NULL;
 	else
diff --git a/src/pluginui.c b/src/pluginui.c
index fb87f63..6c080b0 100644
--- a/src/pluginui.c
+++ b/src/pluginui.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -21,6 +21,7 @@
 #include <assert.h>
 #include <string.h>
 #include <stdlib.h>
+#include "slv2/types.h"
 #include "slv2/collections.h"
 #include "slv2_internal.h"
 
@@ -40,9 +41,9 @@ slv2_ui_new(SLV2World   world,
 	ui->world = world;
 	ui->uri = slv2_value_new_librdf_uri(world, uri);
 	ui->binary_uri = slv2_value_new_librdf_uri(world, binary_uri);
-	
+
 	assert(ui->binary_uri);
-	
+
 	// FIXME: kludge
 	char* bundle = strdup(slv2_value_as_string(ui->binary_uri));
 	char* last_slash = strrchr(bundle, '/') + 1;
@@ -63,15 +64,15 @@ slv2_ui_free(SLV2UI ui)
 {
 	slv2_value_free(ui->uri);
 	ui->uri = NULL;
-	
+
 	slv2_value_free(ui->bundle_uri);
 	ui->bundle_uri = NULL;
-	
+
 	slv2_value_free(ui->binary_uri);
 	ui->binary_uri = NULL;
 
 	slv2_values_free(ui->classes);
-	
+
 	free(ui);
 }
 
diff --git a/src/pluginuiinstance.c b/src/pluginuiinstance.c
index c1c4720..2c59537 100644
--- a/src/pluginuiinstance.c
+++ b/src/pluginuiinstance.c
@@ -1,5 +1,5 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
  * Author: Lars Luthman
  *
  * This library is free software; you can redistribute it and/or modify it
@@ -40,48 +40,48 @@ slv2_ui_instantiate(SLV2Plugin                     plugin,
                     const LV2_Feature* const*      features)
 {
 	struct _SLV2UIInstance* result = NULL;
-	
+
 	bool local_features = (features == NULL);
 	if (local_features) {
 		features = malloc(sizeof(LV2_Feature));
 		((LV2_Feature**)features)[0] = NULL;
 	}
-	
+
 	const char* const lib_uri = slv2_value_as_string(slv2_ui_get_binary_uri(ui));
 	const char* const lib_path = slv2_uri_to_path(lib_uri);
-	
+
 	if (!lib_path)
 		return NULL;
-	
+
 	dlerror();
 	void* lib = dlopen(lib_path, RTLD_NOW);
 	if (!lib) {
 		fprintf(stderr, "Unable to open UI library %s (%s)\n", lib_path, dlerror());
 		return NULL;
 	}
-	
+
 	LV2UI_DescriptorFunction df = dlsym(lib, "lv2ui_descriptor");
-	
+
 	if (!df) {
 		fprintf(stderr, "Could not find symbol 'lv2ui_descriptor', "
 				"%s is not a LV2 plugin UI.\n", lib_path);
 		dlclose(lib);
 		return NULL;
 	} else {
-		
+
 		const char* bundle_path = slv2_uri_to_path(slv2_value_as_uri(slv2_ui_get_bundle_uri(ui)));
-		
+
 		for (uint32_t i=0; 1; ++i) {
-			
+
 			const LV2UI_Descriptor* ld = df(i);
-				
+
 			if (!ld) {
 				fprintf(stderr, "Did not find UI %s in %s\n",
 						slv2_value_as_uri(slv2_ui_get_uri(ui)), lib_path);
 				dlclose(lib);
 				break; // return NULL
 			} else if (!strcmp(ld->URI, slv2_value_as_uri(slv2_ui_get_uri(ui)))) {
-	
+
 				assert(plugin->plugin_uri);
 
 				printf("Found UI %s at index %u in:\n\t%s\n\n",
@@ -93,9 +93,9 @@ slv2_ui_instantiate(SLV2Plugin                     plugin,
 				result = malloc(sizeof(struct _SLV2UIInstance));
 				struct _SLV2UIInstanceImpl* impl = malloc(sizeof(struct _SLV2UIInstanceImpl));
 				impl->lv2ui_descriptor = ld;
-				impl->lv2ui_handle = ld->instantiate(ld, 
+				impl->lv2ui_handle = ld->instantiate(ld,
 						slv2_value_as_uri(slv2_plugin_get_uri(plugin)),
-						(char*)bundle_path, 
+						(char*)bundle_path,
 						write_function,
 						controller,
 						&impl->widget,
@@ -114,7 +114,7 @@ slv2_ui_instantiate(SLV2Plugin                     plugin,
 		free(result);
 		return NULL;
 	}
-	
+
 	// Failed to create a widget, but still got a handle - this means that
 	// the plugin is buggy
 	if (result->pimpl->widget == NULL) {
diff --git a/src/port.c b/src/port.c
index e72aba0..50b62c3 100644
--- a/src/port.c
+++ b/src/port.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -22,10 +22,10 @@
 #include <stdio.h>
 #include <string.h>
 #include <limits.h>
+#include "slv2/types.h"
 #include "slv2/collections.h"
 #include "slv2/port.h"
 #include "slv2/query.h"
-#include "slv2/types.h"
 #include "slv2/util.h"
 #include "slv2_internal.h"
 
@@ -90,12 +90,12 @@ slv2_port_has_property(SLV2Plugin p,
 			"<", slv2_value_as_uri(p->plugin_uri), "> lv2:port ?port ."
 			"?port lv2:symbol \"", slv2_value_as_string(port->symbol), "\";\n",
 			"      lv2:portProperty <", slv2_value_as_uri(property), "> .\n}", NULL);
-			
+
 	SLV2Values results = slv2_plugin_query_variable(p, query, 0);
 	const bool ret = (slv2_values_size(results) > 0);
 	slv2_values_free(results);
 	free(query);
-	
+
 	return ret;
 }
 
@@ -113,7 +113,7 @@ slv2_port_supports_event(SLV2Plugin p,
 			"?port lv2:symbol \"", slv2_value_as_string(port->symbol), "\";\n",
 			"      lv2ev:supportsEvent <", slv2_value_as_uri(event), "> .\n"
 			"}", NULL);
-			
+
 	SLV2Results results = slv2_plugin_query_sparql(p, query);
 	assert(librdf_query_results_is_boolean(results->rdf_results));
 
@@ -121,7 +121,7 @@ slv2_port_supports_event(SLV2Plugin p,
 
 	free(query);
 	slv2_results_free(results);
-	
+
 	return ret;
 }
 
@@ -140,7 +140,7 @@ slv2_port_get_value_by_qname(SLV2Plugin  p,
 			"?port lv2:symbol \"", slv2_value_as_string(port->symbol), "\";\n\t",
 			property, " ?value .\n"
 			"FILTER(lang(?value) = \"\") }", NULL);
-			
+
 	results = slv2_plugin_query_variable(p, query, 0);
 
 	free(query);
@@ -154,7 +154,7 @@ slv2_port_get_value(SLV2Plugin p,
                     SLV2Value  predicate)
 {
 	char* query = NULL;
-	
+
 	/* Hack around broken RASQAL, full URI predicates don't work :/ */
 	query = slv2_strjoin(
 		"PREFIX slv2predicate: <", slv2_value_as_string(predicate), ">",
@@ -165,7 +165,7 @@ slv2_port_get_value(SLV2Plugin p,
 		"}\n", NULL);
 
 	SLV2Values result = slv2_plugin_query_variable(p, query, 0);
-	
+
 	free(query);
 
 	return result;
@@ -185,9 +185,9 @@ slv2_port_get_value_by_qname_i18n(SLV2Plugin  p,
 			"<", slv2_value_as_uri(p->plugin_uri), "> lv2:port ?port .\n"
 			"?port lv2:symbol \"", slv2_value_as_string(port->symbol), "\";\n\t",
 			property, " ?value .\n"
-			"FILTER(lang(?value) = \"", slv2_get_lang(), 
+			"FILTER(lang(?value) = \"", slv2_get_lang(),
 			"\") }", NULL);
-	
+
 	results = slv2_plugin_query_variable(p, query, 0);
 
 	free(query);
@@ -202,7 +202,7 @@ slv2_port_get_symbol(SLV2Plugin p,
 	return port->symbol;
 }
 
-	
+
 SLV2Value
 slv2_port_get_name(SLV2Plugin p,
                    SLV2Port   port)
@@ -217,13 +217,13 @@ slv2_port_get_name(SLV2Plugin p,
 		if (results && slv2_values_size(results) > 0)
 			ret = slv2_value_duplicate(slv2_values_get_at(results, 0));
 	}
-		
+
 	slv2_values_free(results);
 
 	return ret;
 }
 
-	
+
 SLV2Values
 slv2_port_get_classes(SLV2Plugin p,
                       SLV2Port   port)
@@ -233,7 +233,7 @@ slv2_port_get_classes(SLV2Plugin p,
 
 
 void
-slv2_port_get_range(SLV2Plugin p, 
+slv2_port_get_range(SLV2Plugin p,
                     SLV2Port   port,
                     SLV2Value* def,
                     SLV2Value* min,
@@ -254,7 +254,7 @@ slv2_port_get_range(SLV2Plugin p,
 			"OPTIONAL { ?port lv2:minimum ?min }\n",
 			"OPTIONAL { ?port lv2:maximum ?max }\n",
 			"\n}", NULL);
-	
+
 	SLV2Results results = slv2_plugin_query_sparql(p, query);
 
     while (!librdf_query_results_finished(results->rdf_results)) {
@@ -274,7 +274,7 @@ slv2_port_get_range(SLV2Plugin p,
 
 		librdf_query_results_next(results->rdf_results);
 	}
-	
+
 	slv2_results_free(results);
 
 	free(query);
@@ -293,9 +293,9 @@ slv2_port_get_scale_points(SLV2Plugin p,
 			"?point rdf:value ?value ;\n"
 			"       rdfs:label ?label .\n"
 			"\n} ORDER BY ?value", NULL);
-	
+
 	SLV2Results results = slv2_plugin_query_sparql(p, query);
-	
+
 	SLV2ScalePoints ret = NULL;
 
     if (!slv2_results_finished(results))
@@ -307,10 +307,10 @@ slv2_port_get_scale_points(SLV2Plugin p,
 
 		if (value && label)
 			raptor_sequence_push(ret, slv2_scale_point_new(value, label));
-		
+
 		slv2_results_next(results);
 	}
-			
+
 	slv2_results_free(results);
 
 	free(query);
diff --git a/src/query.c b/src/query.c
index 8990c9b..7176f35 100644
--- a/src/query.c
+++ b/src/query.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -23,6 +23,7 @@
 #include <locale.h>
 #include <stdlib.h>
 #include <string.h>
+#include "slv2/types.h"
 #include "slv2/collections.h"
 #include "slv2/plugin.h"
 #include "slv2/query.h"
@@ -137,24 +138,24 @@ slv2_plugin_query_sparql(SLV2Plugin  plugin,
 	char* query_str = slv2_strjoin(slv2_query_prefixes, sparql_str, NULL);
 
 	//printf("******** Query \n%s********\n", query_str);
-	
+
 	librdf_query* query = librdf_new_query(plugin->world->world, "sparql", NULL,
 			(const unsigned char*)query_str, base_uri);
-	
+
 	if (!query) {
 		fprintf(stderr, "ERROR: Could not create query\n");
 		return NULL;
 	}
-	
+
 	// FIXME: locale kludges to work around librdf bug
 	char* locale = strdup(setlocale(LC_NUMERIC, NULL));
 
 	setlocale(LC_NUMERIC, "POSIX");
 	librdf_query_results* results = librdf_query_execute(query, plugin->rdf);
 	setlocale(LC_NUMERIC, locale);
-	
+
 	free(locale);
-	
+
 	librdf_free_query(query);
 	free(query_str);
 
@@ -225,7 +226,7 @@ slv2_plugin_query_variable(SLV2Plugin  plugin,
 
 	SLV2Values ret = slv2_query_get_variable_bindings(plugin->world,
 			results, (int)variable);
-	
+
 	slv2_results_free(results);
 
 	return ret;
@@ -236,7 +237,7 @@ slv2_plugin_query_variable(SLV2Plugin  plugin,
  *
  * More efficient than slv2_plugin_simple_query if you're only interested
  * in the number of results (ie slv2_plugin_num_ports).
- * 
+ *
  * Note the result of this function is probably meaningless unless the query
  * is a SELECT DISTINCT.
  */
diff --git a/src/scalepoint.c b/src/scalepoint.c
index 29bedf9..769ed1f 100644
--- a/src/scalepoint.c
+++ b/src/scalepoint.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -23,6 +23,7 @@
 #include <assert.h>
 #include <locale.h>
 #include <raptor.h>
+#include "slv2/types.h"
 #include "slv2/value.h"
 #include "slv2_internal.h"
 
diff --git a/src/slv2_internal.h b/src/slv2_internal.h
index 9aea9f9..a24570f 100644
--- a/src/slv2_internal.h
+++ b/src/slv2_internal.h
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -69,6 +69,7 @@ struct _SLV2Plugin {
 SLV2Plugin slv2_plugin_new(SLV2World world, SLV2Value uri, librdf_uri* bundle_uri);
 void       slv2_plugin_load(SLV2Plugin p);
 void       slv2_plugin_load_if_necessary(SLV2Plugin p);
+void       slv2_plugin_load_ports_if_necessary(SLV2Plugin p);
 void       slv2_plugin_free(SLV2Plugin plugin);
 void       slv2_plugin_get_port_float_values(SLV2Plugin  p,
 					     const char* qname,
@@ -156,7 +157,7 @@ void
 slv2_world_load_path(SLV2World   world,
                      const char* search_path);
 
-	
+
 void
 slv2_world_load_specifications(SLV2World world);
 
@@ -209,7 +210,7 @@ SLV2Value   slv2_value_new_librdf_node(SLV2World world, librdf_node* node);
 SLV2Value   slv2_value_new_librdf_uri(SLV2World world, librdf_uri* uri);
 librdf_uri* slv2_value_as_librdf_uri(SLV2Value value);
 
-	
+
 /* ********* Values ********* */
 
 void slv2_values_set_at(SLV2Values list, unsigned index, void* value);
diff --git a/src/util.c b/src/util.c
index 71094ab..a58b5d1 100644
--- a/src/util.c
+++ b/src/util.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -71,7 +71,7 @@ slv2_uri_to_path(const char* uri)
 }
 
 
-char* 
+char*
 slv2_get_lang()
 {
 	static char lang[32];
diff --git a/src/value.c b/src/value.c
index ae24a68..ed2f95a 100644
--- a/src/value.c
+++ b/src/value.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -23,6 +23,7 @@
 #include <assert.h>
 #include <locale.h>
 #include <raptor.h>
+#include "slv2/types.h"
 #include "slv2/value.h"
 #include "slv2_internal.h"
 
@@ -45,7 +46,7 @@ slv2_value_set_numerics_from_string(SLV2Value val)
 		val->val.float_val = strtod(val->str_val, &endptr);
 		setlocale(LC_NUMERIC, locale);
 	}
-	
+
 	free(locale);
 }
 
@@ -78,7 +79,7 @@ slv2_value_new_librdf_node(SLV2World world, librdf_node* node)
 	SLV2Value val = (SLV2Value)malloc(sizeof(struct _SLV2Value));
 	val->type = SLV2_VALUE_STRING;
 	val->str_val = NULL;
-	
+
 	librdf_uri* datatype_uri = NULL;
 
 	switch (librdf_node_get_type(node)) {
@@ -107,7 +108,7 @@ slv2_value_new_librdf_node(SLV2World world, librdf_node* node)
 		val = NULL;
 		break;
 	}
-	
+
 	if (val)
 		slv2_value_set_numerics_from_string(val);
 
@@ -227,7 +228,7 @@ slv2_value_get_turtle_token(SLV2Value value)
 	size_t len    = 0;
 	char*  result = NULL;
 	char*  locale = strdup(setlocale(LC_NUMERIC, NULL));
-		
+
 	// FIXME: locale kludges to work around librdf bug
 
 	switch (value->type) {
@@ -258,7 +259,7 @@ slv2_value_get_turtle_token(SLV2Value value)
 	}
 
 	free(locale);
-	
+
 	return result;
 }
 
@@ -277,7 +278,7 @@ slv2_value_as_uri(SLV2Value value)
 	return value->str_val;
 }
 
-	
+
 /* private */
 librdf_uri*
 slv2_value_as_librdf_uri(SLV2Value value)
diff --git a/src/world.c b/src/world.c
index 88a1f63..04d98a6 100644
--- a/src/world.c
+++ b/src/world.c
@@ -1,6 +1,6 @@
 /* SLV2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This library is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -24,6 +24,7 @@
 #include <dirent.h>
 #include <string.h>
 #include <librdf.h>
+#include "slv2/types.h"
 #include "slv2/world.h"
 #include "slv2/slv2.h"
 #include "slv2/util.h"
@@ -44,7 +45,7 @@ slv2_world_new_internal(SLV2World world)
 		world->storage = librdf_new_storage(world->world, "hashes", NULL,
 				"hash-type='memory'");
 	}
-	
+
 	if (!world->storage)
 		goto fail;
 
@@ -57,27 +58,27 @@ slv2_world_new_internal(SLV2World world)
 		goto fail;
 
 	world->plugin_classes = slv2_plugin_classes_new();
-	
+
 	world->plugins = slv2_plugins_new();
-	
+
 	world->lv2_specification_node = librdf_new_node_from_uri_string(world->world,
 			(const unsigned char*)"http://lv2plug.in/ns/lv2core#Specification");
-	
+
 	world->lv2_plugin_node = librdf_new_node_from_uri_string(world->world,
 			(const unsigned char*)"http://lv2plug.in/ns/lv2core#Plugin");
-	
+
 	world->rdf_a_node = librdf_new_node_from_uri_string(world->world,
 			(const unsigned char*)"http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
-	
+
 	world->xsd_integer_node = librdf_new_node_from_uri_string(world->world,
 			(const unsigned char*)"http://www.w3.org/2001/XMLSchema#integer");
-	
+
 	world->xsd_decimal_node = librdf_new_node_from_uri_string(world->world,
 			(const unsigned char*)"http://www.w3.org/2001/XMLSchema#decimal");
-	
+
 	world->lv2_plugin_class = slv2_plugin_class_new(world, NULL,
 			librdf_node_get_uri(world->lv2_plugin_node), "Plugin");
-	
+
 	return world;
 
 fail:
@@ -96,11 +97,11 @@ slv2_world_new()
 		free(world);
 		return NULL;
 	}
-	
+
 	world->local_world = true;
-	
+
 	librdf_world_open(world->world);
-	
+
 	return slv2_world_new_internal(world);
 }
 
@@ -136,24 +137,24 @@ slv2_world_free(SLV2World world)
 		slv2_plugin_free(raptor_sequence_get_at(world->plugins, i));
 	raptor_free_sequence(world->plugins);
 	world->plugins = NULL;
-	
+
 	raptor_free_sequence(world->plugin_classes);
 	world->plugin_classes = NULL;
-	
+
 	librdf_free_parser(world->parser);
 	world->parser = NULL;
-	
+
 	librdf_free_model(world->model);
 	world->model = NULL;
-	
+
 	librdf_free_storage(world->storage);
 	world->storage = NULL;
-	
+
 	if (world->local_world)
 		librdf_free_world(world->world);
 
 	world->world = NULL;
-	
+
 	free(world);
 }
 
@@ -181,7 +182,7 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri)
 
 	librdf_model* manifest_model = librdf_new_model(world->world,
 			manifest_storage, NULL);
-	librdf_parser_parse_into_model(world->parser, manifest_uri, NULL, 
+	librdf_parser_parse_into_model(world->parser, manifest_uri, NULL,
 			manifest_model);
 
 	/* Query statement: ?plugin a lv2:Plugin */
@@ -198,16 +199,16 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri)
 
 		/* Add ?plugin rdfs:seeAlso <manifest.ttl>*/
 		librdf_node* subject = plugin_node;
-		librdf_node* predicate = librdf_new_node_from_uri_string(world->world, 
+		librdf_node* predicate = librdf_new_node_from_uri_string(world->world,
 				(unsigned char*)"http://www.w3.org/2000/01/rdf-schema#seeAlso");
 		librdf_node* object = librdf_new_node_from_uri(world->world,
 				manifest_uri);
 
 		librdf_model_add(world->model, subject, predicate, object);
-		
+
 		/* Add ?plugin slv2:bundleURI <file://some/path> */
 		subject = librdf_new_node_from_node(plugin_node);
-		predicate = librdf_new_node_from_uri_string(world->world, 
+		predicate = librdf_new_node_from_uri_string(world->world,
 				(unsigned char*)"http://drobilla.net/ns/slv2#bundleURI");
 		object = librdf_new_node_from_uri(world->world, bundle_uri->val.uri_val);
 
@@ -215,10 +216,10 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri)
 
 		librdf_stream_next(results);
 	}
-	
+
 	librdf_free_stream(results);
 	librdf_free_statement(q);
-	
+
 	/* Query statement: ?specification a lv2:Specification */
 	q = librdf_new_statement_from_nodes(world->world,
 			NULL, librdf_new_node_from_node(world->rdf_a_node),
@@ -233,16 +234,16 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri)
 
 		/* Add ?specification rdfs:seeAlso <manifest.ttl> */
 		librdf_node* subject = spec_node;
-		librdf_node* predicate = librdf_new_node_from_uri_string(world->world, 
+		librdf_node* predicate = librdf_new_node_from_uri_string(world->world,
 				(unsigned char*)"http://www.w3.org/2000/01/rdf-schema#seeAlso");
 		librdf_node* object = librdf_new_node_from_uri(world->world,
 				manifest_uri);
-		
+
 		librdf_model_add(world->model, subject, predicate, object);
-		
+
 		/* Add ?specification slv2:bundleURI <file://some/path> */
 		subject = librdf_new_node_from_node(spec_node);
-		predicate = librdf_new_node_from_uri_string(world->world, 
+		predicate = librdf_new_node_from_uri_string(world->world,
 				(unsigned char*)"http://drobilla.net/ns/slv2#bundleURI");
 		object = librdf_new_node_from_uri(world->world, bundle_uri->val.uri_val);
 
@@ -250,10 +251,10 @@ slv2_world_load_bundle(SLV2World world, SLV2Value bundle_uri)
 
 		librdf_stream_next(results);
 	}
-	
+
 	librdf_free_stream(results);
 	librdf_free_statement(q);
-	
+
 	/* Join the temporary model to the main model */
 	librdf_stream* manifest_stream = librdf_model_as_stream(manifest_model);
 	librdf_model_add_statements(world->model, manifest_stream);
@@ -274,7 +275,7 @@ slv2_world_load_directory(SLV2World world, const char* dir)
 	DIR* pdir = opendir(dir);
 	if (!pdir)
 		return;
-	
+
 	struct dirent* pfile;
 	while ((pfile = readdir(pdir))) {
 		if (!strcmp(pfile->d_name, ".") || !strcmp(pfile->d_name, ".."))
@@ -291,7 +292,7 @@ slv2_world_load_directory(SLV2World world, const char* dir)
 			slv2_world_load_bundle(world, uri_val);
 			slv2_value_free(uri_val);
 		}
-		
+
 		free(uri);
 	}
 
@@ -305,19 +306,19 @@ slv2_world_load_path(SLV2World   world,
 {
 	char* path = slv2_strjoin(lv2_path, ":", NULL);
 	char* dir  = path; // Pointer into path
-	
+
 	// Go through string replacing ':' with '\0', using the substring,
 	// then replacing it with 'X' and moving on.  i.e. strtok on crack.
 	while (strchr(path, ':') != NULL) {
 		char* delim = strchr(path, ':');
 		*delim = '\0';
-		
+
 		slv2_world_load_directory(world, dir);
-		
+
 		*delim = 'X';
 		dir = delim + 1;
 	}
-	
+
 	free(path);
 }
 
@@ -356,9 +357,9 @@ slv2_world_load_specifications(SLV2World world)
 		"	?spec a            :Specification ;\n"
 		"         rdfs:seeAlso ?data .\n"
 		"}\n";
-	
+
 	librdf_query* q = librdf_new_query(world->world, "sparql", NULL, query_string, NULL);
-	
+
 	librdf_query_results* results = librdf_query_execute(q, world->model);
 
 	while (!librdf_query_results_finished(results)) {
@@ -385,9 +386,9 @@ slv2_world_load_plugin_classes(SLV2World world)
 {
 	// FIXME: This will need to be a bit more clever when more data is around
 	// then the ontology (ie classes which aren't LV2 plugin_classes)
-	
+
 	// FIXME: This loads things that aren't plugin categories
-	
+
 	unsigned char* query_string = (unsigned char*)
     	"PREFIX : <http://lv2plug.in/ns/lv2core#>\n"
 		"PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n"
@@ -395,10 +396,10 @@ slv2_world_load_plugin_classes(SLV2World world)
 		//"	?plugin a ?class .\n"
 		"	?class a rdfs:Class; rdfs:subClassOf ?parent; rdfs:label ?label\n"
 		"}\n"; // ORDER BY ?class\n";
-	
+
 	librdf_query* q = librdf_new_query(world->world, "sparql",
 		NULL, query_string, NULL);
-	
+
 	librdf_query_results* results = librdf_query_execute(q, world->model);
 
 	while (!librdf_query_results_finished(results)) {
@@ -425,7 +426,7 @@ slv2_world_load_plugin_classes(SLV2World world)
 	}
 
 	// FIXME: filter list here
-	
+
 	librdf_free_query_results(results);
 	librdf_free_query(q);
 }
@@ -463,7 +464,7 @@ slv2_world_load_all(SLV2World world)
 		free(lv2_path);
 	}
 
-	
+
 	/* 2. Query out things to cache */
 
 	slv2_world_load_specifications(world);
@@ -478,10 +479,10 @@ slv2_world_load_all(SLV2World world)
 		"SELECT DISTINCT ?plugin ?data ?bundle\n"
 		"WHERE { ?plugin a :Plugin; slv2:bundleURI ?bundle; rdfs:seeAlso ?data }\n";
 		//"ORDER BY ?plugin\n";
-	
+
 	librdf_query* q = librdf_new_query(world->world, "sparql",
 		NULL, query_string, NULL);
-	
+
 	librdf_query_results* results = librdf_query_execute(q, world->model);
 
 	while (!librdf_query_results_finished(results)) {
@@ -524,7 +525,7 @@ slv2_world_load_all(SLV2World world)
 
 	if (results)
 		librdf_free_query_results(results);
-	
+
 	librdf_free_query(q);
 }
 
@@ -535,7 +536,7 @@ slv2_world_serialize(const char* filename)
 {
 	librdf_uri* lv2_uri = librdf_new_uri(slv2_rdf_world,
 			(unsigned char*)"http://lv2plug.in/ns/lv2core#");
-	
+
 	librdf_uri* rdfs_uri = librdf_new_uri(slv2_rdf_world,
 			(unsigned char*)"http://www.w3.org/2000/01/rdf-schema#");
 
@@ -590,17 +591,17 @@ slv2_world_get_plugins_by_filter(SLV2World world, bool (*include)(SLV2Plugin))
 SLV2Plugins
 slv2_world_get_plugins_by_query(SLV2World world, const char* query)
 {
-	SLV2Plugins list = slv2_plugins_new();	
+	SLV2Plugins list = slv2_plugins_new();
 
 	librdf_query* rq = librdf_new_query(world->world, "sparql",
 		NULL, (const unsigned char*)query, NULL);
-	
+
 	librdf_query_results* results = librdf_query_execute(rq, world->model);
-	
+
 	while (!librdf_query_results_finished(results)) {
 		librdf_node* plugin_node = librdf_query_results_get_binding_value(results, 0);
 		librdf_uri*  plugin_uri  = librdf_node_get_uri(plugin_node);
-		
+
 		SLV2Plugin plugin = slv2_plugins_get_by_uri(list,
 				(const char*)librdf_uri_as_string(plugin_uri));
 
@@ -609,15 +610,15 @@ slv2_world_get_plugins_by_query(SLV2World world, const char* query)
 			SLV2Plugin new_plugin = slv2_plugin_new(world, plugin_uri);
 			raptor_sequence_push(list, new_plugin);
 		}
-		
+
 		librdf_free_node(plugin_node);
-		
+
 		librdf_query_results_next(results);
-	}	
-	
+	}
+
 	if (results)
 		librdf_free_query_results(results);
-	
+
 	librdf_free_query(rq);
 
 	return list;
diff --git a/test/slv2_test.c b/test/slv2_test.c
index 24f26a0..72f6a1f 100644
--- a/test/slv2_test.c
+++ b/test/slv2_test.c
@@ -1,5 +1,5 @@
 /* SLV2 Tests
- * Copyright (C) 2008 Dave Robillard <http://drobilla.net>
+ * Copyright (C) 2008-2009 Dave Robillard <http://drobilla.net>
  * Copyright (C) 2008 Krzysztof Foltman
  *
  * This library is free software; you can redistribute it and/or modify it
@@ -222,7 +222,7 @@ test_value()
 	TEST_ASSERT(slv2_value_is_string(sval));
 	TEST_ASSERT(slv2_value_is_int(ival));
 	TEST_ASSERT(slv2_value_is_float(fval));
-	
+
 	TEST_ASSERT(!slv2_value_is_literal(uval));
 	TEST_ASSERT(slv2_value_is_literal(sval));
 	TEST_ASSERT(slv2_value_is_literal(ival));
@@ -245,7 +245,7 @@ test_value()
 	tok = slv2_value_get_turtle_token(fval);
 	TEST_ASSERT(!strncmp(tok, "1.6180", 6));
 	free(tok);
-	
+
 	SLV2Value uval_e = slv2_value_new_uri(world, "http://example.org");
 	SLV2Value sval_e = slv2_value_new_string(world, "Foo");
 	SLV2Value ival_e = slv2_value_new_int(world, 42);
@@ -259,23 +259,23 @@ test_value()
 	TEST_ASSERT(slv2_value_equals(sval, sval_e));
 	TEST_ASSERT(slv2_value_equals(ival, ival_e));
 	TEST_ASSERT(slv2_value_equals(fval, fval_e));
-	
+
 	TEST_ASSERT(!slv2_value_equals(uval, uval_ne));
 	TEST_ASSERT(!slv2_value_equals(sval, sval_ne));
 	TEST_ASSERT(!slv2_value_equals(ival, ival_ne));
 	TEST_ASSERT(!slv2_value_equals(fval, fval_ne));
-	
+
 	TEST_ASSERT(!slv2_value_equals(uval, sval));
 	TEST_ASSERT(!slv2_value_equals(sval, ival));
 	TEST_ASSERT(!slv2_value_equals(ival, fval));
-	
+
 	SLV2Value uval_dup = slv2_value_duplicate(uval);
 	TEST_ASSERT(slv2_value_equals(uval, uval_dup));
 
 	SLV2Value ifval = slv2_value_new_float(world, 42.0);
 	TEST_ASSERT(!slv2_value_equals(ival, ifval));
 	slv2_value_free(ifval);
-	
+
 	SLV2Value nil = NULL;
 	TEST_ASSERT(!slv2_value_equals(uval, nil));
 	TEST_ASSERT(!slv2_value_equals(nil, uval));
@@ -517,7 +517,7 @@ test_classes()
 	SLV2PluginClass plugin = slv2_world_get_plugin_class(world);
 	SLV2PluginClasses classes = slv2_world_get_plugin_classes(world);
 	SLV2PluginClasses children = slv2_plugin_class_get_children(plugin);
-	
+
 	TEST_ASSERT(slv2_plugin_class_get_parent_uri(plugin) == NULL);
 	TEST_ASSERT(slv2_plugin_classes_size(classes) > slv2_plugin_classes_size(children));
 	TEST_ASSERT(!strcmp(slv2_value_as_string(slv2_plugin_class_get_label(plugin)), "Plugin"));
@@ -533,9 +533,9 @@ test_classes()
 	SLV2Value some_uri = slv2_value_new_uri(world, "http://example.org/whatever");
 	TEST_ASSERT(slv2_plugin_classes_get_by_uri(classes, some_uri) == NULL);
 	slv2_value_free(some_uri);
-	
+
 	TEST_ASSERT(slv2_plugin_classes_get_at(classes, (unsigned)INT_MAX + 1) == NULL);
-	
+
 	slv2_plugin_classes_free(children);
 
 	cleanup_uris();
@@ -574,7 +574,7 @@ test_plugin()
 			"] . \n"
 			":thing doap:name \"Something else\" .\n"))
 		return 0;
-	
+
 	init_uris();
 	SLV2Plugins plugins = slv2_world_get_all_plugins(world);
 	SLV2Plugin plug = slv2_plugins_get_by_uri(plugins, plugin_uri_value);
@@ -587,17 +587,17 @@ test_plugin()
 
 	SLV2Value plug_bundle_uri = slv2_plugin_get_bundle_uri(plug);
 	TEST_ASSERT(!strcmp(slv2_value_as_string(plug_bundle_uri), bundle_dir_uri));
-	
+
 	SLV2Values data_uris = slv2_plugin_get_data_uris(plug);
 	TEST_ASSERT(slv2_values_size(data_uris) == 2);
-	
+
 	char* manifest_uri = (char*)malloc(TEST_PATH_MAX);
 	char* data_uri     = (char*)malloc(TEST_PATH_MAX);
 	snprintf(manifest_uri, TEST_PATH_MAX, "%s%s",
 			slv2_value_as_string(plug_bundle_uri), "manifest.ttl");
 	snprintf(data_uri, TEST_PATH_MAX, "%s%s",
 			slv2_value_as_string(plug_bundle_uri), "plugin.ttl");
-	
+
 	SLV2Value manifest_uri_val = slv2_value_new_uri(world, manifest_uri);
 	TEST_ASSERT(slv2_values_contains(data_uris, manifest_uri_val));
 	slv2_value_free(manifest_uri_val);
@@ -615,7 +615,7 @@ test_plugin()
 	TEST_ASSERT(mins[0] == -1.0f);
 	TEST_ASSERT(maxs[0] == 1.0f);
 	TEST_ASSERT(defs[0] == 0.5f);
-	
+
 	SLV2Value audio_class = slv2_value_new_uri(world,
 			"http://lv2plug.in/ns/lv2core#AudioPort");
 	SLV2Value control_class = slv2_value_new_uri(world,
@@ -661,7 +661,7 @@ test_plugin()
 	slv2_values_free(supported);
 	slv2_values_free(required);
 	slv2_values_free(optional);
-	
+
 	SLV2Value foo_p = slv2_value_new_uri(world, "http://example.org/foo");
 	SLV2Values foos = slv2_plugin_get_value(plug, foo_p);
 	TEST_ASSERT(slv2_values_size(foos) == 1);
@@ -672,11 +672,11 @@ test_plugin()
 	SLV2Value author_name = slv2_plugin_get_author_name(plug);
 	TEST_ASSERT(!strcmp(slv2_value_as_string(author_name), "David Robillard"));
 	slv2_value_free(author_name);
-	
+
 	SLV2Value author_email = slv2_plugin_get_author_email(plug);
 	TEST_ASSERT(!strcmp(slv2_value_as_string(author_email), "mailto:dave at drobilla.net"));
 	slv2_value_free(author_email);
-	
+
 	SLV2Value author_homepage = slv2_plugin_get_author_homepage(plug);
 	TEST_ASSERT(!strcmp(slv2_value_as_string(author_homepage), "http://drobilla.net"));
 	slv2_value_free(author_homepage);
@@ -689,10 +689,10 @@ test_plugin()
 	TEST_ASSERT(thing_name);
 	TEST_ASSERT(slv2_value_is_string(thing_name));
 	TEST_ASSERT(!strcmp(slv2_value_as_string(thing_name), "Something else"));
-	
+
 	SLV2UIs uis = slv2_plugin_get_uis(plug);
 	TEST_ASSERT(slv2_uis_size(uis) == 0);
-	
+
 	SLV2Results results = slv2_plugin_query_sparql(plug,
 "SELECT ?name WHERE { <> doap:maintainer [ foaf:name ?name ] }");
 	TEST_ASSERT(!slv2_results_finished(results));
@@ -758,7 +758,7 @@ test_port()
 	TEST_ASSERT(p != NULL);
 	TEST_ASSERT(p2 != NULL);
 	TEST_ASSERT(p == p2);
-	
+
 	SLV2Value nopsym = slv2_value_new_string(world, "thisaintnoportfoo");
 	SLV2Port p3 = slv2_plugin_get_port_by_symbol(plug, nopsym);
 	TEST_ASSERT(p3 == NULL);
@@ -777,7 +777,7 @@ test_port()
 	TEST_ASSERT(slv2_port_is_a(plug, p, control_class));
 	TEST_ASSERT(slv2_port_is_a(plug, p, in_class));
 	TEST_ASSERT(!slv2_port_is_a(plug, p, audio_class));
-	
+
 	TEST_ASSERT(slv2_values_size(slv2_port_get_properties(plug, p)) == 0);
 
 	TEST_ASSERT(!strcmp(slv2_value_as_string(slv2_port_get_symbol(plug, p)), "foo"));
@@ -794,7 +794,7 @@ test_port()
 	TEST_ASSERT(sp0);
 	SLV2ScalePoint sp1 = slv2_scale_points_get_at(points, 1);
 	TEST_ASSERT(sp1);
-	
+
 	TEST_ASSERT(!strcmp(slv2_value_as_string(slv2_scale_point_get_label(sp0)), "Sin"));
 	TEST_ASSERT(slv2_value_as_float(slv2_scale_point_get_value(sp0)) == 3);
 	TEST_ASSERT(!strcmp(slv2_value_as_string(slv2_scale_point_get_label(sp1)), "Cos"));
@@ -808,10 +808,10 @@ test_port()
 
 	TEST_ASSERT(slv2_plugin_query_count(plug, "SELECT DISTINCT ?bin WHERE {\n"
 			   "<> lv2:binary ?bin . }") == 1);
-	
+
 	TEST_ASSERT(slv2_plugin_query_count(plug, "SELECT DISTINCT ?parent WHERE {\n"
 			   "<> rdfs:subClassOf ?parent . }") == 0);
-	
+
 	SLV2Value min, max, def;
 	slv2_port_get_range(plug, p, &def, &min, &max);
 	TEST_ASSERT(def);
@@ -820,20 +820,20 @@ test_port()
 	TEST_ASSERT(slv2_value_as_float(def) == 0.5);
 	TEST_ASSERT(slv2_value_as_float(min) == -1.0);
 	TEST_ASSERT(slv2_value_as_float(max) == 1.0);
-	
+
 	SLV2Value integer_prop = slv2_value_new_uri(world, "http://lv2plug.in/ns/lv2core#integer");
 	SLV2Value toggled_prop = slv2_value_new_uri(world, "http://lv2plug.in/ns/lv2core#toggled");
 
 	TEST_ASSERT(slv2_port_has_property(plug, p, integer_prop));
 	TEST_ASSERT(!slv2_port_has_property(plug, p, toggled_prop));
-	
+
 	SLV2Port ep = slv2_plugin_get_port_by_index(plug, 1);
 
 	SLV2Value event_type = slv2_value_new_uri(world, "http://example.org/event");
 	SLV2Value event_type_2 = slv2_value_new_uri(world, "http://example.org/otherEvent");
 	TEST_ASSERT(slv2_port_supports_event(plug, ep, event_type));
 	TEST_ASSERT(!slv2_port_supports_event(plug, ep, event_type_2));
-	
+
 	SLV2Value name_p = slv2_value_new_uri(world, "http://lv2plug.in/ns/lv2core#name");
 	SLV2Values names = slv2_port_get_value(plug, p, name_p);
 	TEST_ASSERT(slv2_values_size(names) == 2);
@@ -928,16 +928,16 @@ test_ui()
 
 	SLV2UI ui0_2 = slv2_uis_get_by_uri(uis, ui_uri);
 	TEST_ASSERT(ui0 == ui0_2);
-	
+
 	SLV2UI ui2 = slv2_uis_get_by_uri(uis, ui2_uri);
 	TEST_ASSERT(ui2 != ui0);
-	
+
 	SLV2UI ui3 = slv2_uis_get_by_uri(uis, ui3_uri);
 	TEST_ASSERT(ui3 != ui0);
-	
+
 	SLV2UI noui = slv2_uis_get_by_uri(uis, noui_uri);
 	TEST_ASSERT(noui == NULL);
-	
+
 	SLV2Values classes = slv2_ui_get_classes(ui0);
 	TEST_ASSERT(slv2_values_size(classes) == 1);
 
@@ -946,7 +946,7 @@ test_ui()
 
 	TEST_ASSERT(slv2_value_equals(slv2_values_get_at(classes, 0), ui_class_uri));
 	TEST_ASSERT(slv2_ui_is_a(ui0, ui_class_uri));
-	
+
 	SLV2Value plug_bundle_uri = slv2_plugin_get_bundle_uri(plug);
 	SLV2Value ui_bundle_uri = slv2_ui_get_bundle_uri(ui0);
 	TEST_ASSERT(slv2_value_equals(plug_bundle_uri, ui_bundle_uri));
diff --git a/utils/ladspa.h b/utils/ladspa.h
index 5c30a8a..b1a9c4e 100644
--- a/utils/ladspa.h
+++ b/utils/ladspa.h
@@ -3,17 +3,17 @@
    Linux Audio Developer's Simple Plugin API Version 1.1[LGPL].
    Copyright (C) 2000-2002 Richard W.E. Furse, Paul Barton-Davis,
    Stefan Westerfeld.
-   
+
    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public License
    as published by the Free Software Foundation; either version 2.1 of
    the License, or (at your option) any later version.
-   
+
    This library is distributed in the hope that it will be useful, but
    WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    Lesser General Public License for more details.
-   
+
    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
@@ -32,7 +32,7 @@ extern "C" {
 
 /*****************************************************************************/
 
-/* Overview: 
+/* Overview:
 
    There is a large number of synthesis packages in use or development
    on the Linux platform at this time. This API (`The Linux Audio
@@ -76,7 +76,7 @@ extern "C" {
 /* Fundamental data type passed in and out of plugin. This data type
    is used to communicate audio samples and control values. It is
    assumed that the plugin will work sensibly given any numeric input
-   value although it may have a preferred range (see hints below). 
+   value although it may have a preferred range (see hints below).
 
    For audio it is generally assumed that 1.0f is the `0dB' reference
    amplitude and is a `normal' signal level. */
@@ -85,8 +85,8 @@ typedef float LADSPA_Data;
 
 /*****************************************************************************/
 
-/* Special Plugin Properties: 
- 
+/* Special Plugin Properties:
+
    Optional features of the plugin type are encapsulated in the
    LADSPA_Properties type. This is assembled by ORing individual
    properties together. */
@@ -122,7 +122,7 @@ typedef int LADSPA_Properties;
    (3) The plugin will not access files, devices, pipes, sockets, IPC
    or any other mechanism that might result in process or thread
    blocking.
-      
+
    (4) The plugin will take an amount of time to execute a run() or
    run_adding() call approximately of form (A+B*SampleCount) where A
    and B depend on the machine and host in use. This amount of time
@@ -137,7 +137,7 @@ typedef int LADSPA_Properties;
 
 /*****************************************************************************/
 
-/* Plugin Ports: 
+/* Plugin Ports:
 
    Plugins have `ports' that are inputs or outputs for audio or
    data. Ports can communicate arrays of LADSPA_Data (for audio
@@ -172,23 +172,23 @@ typedef int LADSPA_PortDescriptor;
 
 /*****************************************************************************/
 
-/* Plugin Port Range Hints: 
+/* Plugin Port Range Hints:
 
    The host may wish to provide a representation of data entering or
    leaving a plugin (e.g. to generate a GUI automatically). To make
    this more meaningful, the plugin should provide `hints' to the host
    describing the usual values taken by the data.
-   
+
    Note that these are only hints. The host may ignore them and the
    plugin must not assume that data supplied to it is meaningful. If
    the plugin receives invalid input data it is expected to continue
    to run without failure and, where possible, produce a sensible
    output (e.g. a high-pass filter given a negative cutoff frequency
    might switch to an all-pass mode).
-    
+
    Hints are meaningful for all input and output ports but hints for
    input control ports are expected to be particularly useful.
-   
+
    More hint information is encapsulated in the
    LADSPA_PortRangeHintDescriptor type which is assembled by ORing
    individual hint types together. Hints may require further
@@ -353,7 +353,7 @@ typedef struct _LADSPA_PortRangeHint {
 
 /*****************************************************************************/
 
-/* Plugin Handles: 
+/* Plugin Handles:
 
    This plugin handle indicates a particular instance of the plugin
    concerned. It is valid to compare this to NULL (0 for C++) but
@@ -364,13 +364,13 @@ typedef void * LADSPA_Handle;
 
 /*****************************************************************************/
 
-/* Descriptor for a Type of Plugin: 
+/* Descriptor for a Type of Plugin:
 
    This structure is used to describe a plugin type. It provides a
    number of functions to examine the type, instantiate it, link it to
    buffers and workspaces and to run it. */
 
-typedef struct _LADSPA_Descriptor { 
+typedef struct _LADSPA_Descriptor {
 
   /* This numeric identifier indicates the plugin type
      uniquely. Plugin programmers may reserve ranges of IDs from a
@@ -430,7 +430,7 @@ typedef struct _LADSPA_Descriptor {
      instantiation function accepts a sample rate as a parameter. The
      plugin descriptor from which this instantiate function was found
      must also be passed. This function must return NULL if
-     instantiation fails. 
+     instantiation fails.
 
      Note that instance initialisation should generally occur in
      activate() rather than here. */
@@ -551,7 +551,7 @@ typedef struct _LADSPA_Descriptor {
   /* Once an instance of a plugin has been finished with it can be
      deleted using the following function. The instance handle passed
      ceases to be valid after this call.
-  
+
      If activate() was called for a plugin instance then a
      corresponding call to deactivate() must be made before cleanup()
      is called. */
@@ -589,7 +589,7 @@ typedef struct _LADSPA_Descriptor {
 const LADSPA_Descriptor * ladspa_descriptor(unsigned long Index);
 
 /* Datatype corresponding to the ladspa_descriptor() function. */
-typedef const LADSPA_Descriptor * 
+typedef const LADSPA_Descriptor *
 (*LADSPA_Descriptor_Function)(unsigned long Index);
 
 /**********************************************************************/
diff --git a/utils/ladspa2lv2.c b/utils/ladspa2lv2.c
index 023c40d..2573bec 100644
--- a/utils/ladspa2lv2.c
+++ b/utils/ladspa2lv2.c
@@ -1,6 +1,6 @@
 /* ladspa2lv2
- * Copyright (C) 2007 Dave Robillard <http://drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -43,9 +43,9 @@ add_resource(librdf_model* model,
 {
 	librdf_node* predicate = librdf_new_node_from_uri_string(world, U(predicate_uri));
 	librdf_node* object    = librdf_new_node_from_uri_string(world, U(object_uri));
-	
+
 	librdf_statement* triple = librdf_new_statement_from_nodes(world, subject, predicate, object);
-	
+
 	librdf_model_add_statement(model, triple);
 
 	//librdf_free_statement(triple);
@@ -59,9 +59,9 @@ add_node(librdf_model* model,
              librdf_node*  object)
 {
 	librdf_node* predicate = librdf_new_node_from_uri_string(world, U(predicate_uri));
-	
+
 	librdf_statement* triple = librdf_new_statement_from_nodes(world, subject, predicate, object);
-	
+
 	librdf_model_add_statement(model, triple);
 
 	//librdf_free_statement(triple);
@@ -76,9 +76,9 @@ add_string(librdf_model* model,
 {
 	librdf_node* predicate = librdf_new_node_from_uri_string(world, U(predicate_uri));
 	librdf_node* object    = librdf_new_node_from_literal(world, U(object_string), NULL, 0);
-	
+
 	librdf_statement* triple = librdf_new_statement_from_nodes(world, subject, predicate, object);
-	
+
 	librdf_model_add_statement(model, triple);
 
 	//librdf_free_statement(triple);
@@ -99,9 +99,9 @@ add_int(librdf_model* model,
 
 	librdf_node* predicate = librdf_new_node_from_uri_string(world, U(predicate_uri));
 	librdf_node* object    = librdf_new_node_from_typed_literal(world, U(object_str), NULL, type);
-	
+
 	librdf_statement* triple = librdf_new_statement_from_nodes(world, subject, predicate, object);
-	
+
 	librdf_model_add_statement(model, triple);
 
 	//librdf_free_statement(triple);
@@ -123,9 +123,9 @@ add_float(librdf_model* model,
 
 	librdf_node* predicate = librdf_new_node_from_uri_string(world, U(predicate_uri));
 	librdf_node* object    = librdf_new_node_from_typed_literal(world, U(object_str), NULL, type);
-	
+
 	librdf_statement* triple = librdf_new_statement_from_nodes(world, subject, predicate, object);
-	
+
 	librdf_model_add_statement(model, triple);
 
 	//librdf_free_statement(triple);
@@ -146,7 +146,7 @@ load_ladspa_plugin(const char* lib_path, unsigned long index)
 	if (df == NULL) {
 		dlclose(handle);
 		return NULL;
-	}	
+	}
 
 	LADSPA_Descriptor* const descriptor = (LADSPA_Descriptor*)df(index);
 
@@ -174,14 +174,14 @@ add_port_range(LADSPA_Descriptor* plugin,
 		lower = plugin->PortRangeHints[port_index].LowerBound;
 		range_valid = true;
 	}
-	
+
 	if (LADSPA_IS_HINT_INTEGER(hint_descriptor)) {
 		add_resource(model, port, NS_LV2("portHint"), NS_LV2("integer"));
 		upper = plugin->PortRangeHints[port_index].UpperBound;
 		lower = plugin->PortRangeHints[port_index].LowerBound;
 		range_valid = true;
 	}
-	
+
 	if (LADSPA_IS_HINT_TOGGLED(hint_descriptor)) {
 		add_resource(model, port, NS_LV2("portHint"), NS_LV2("toggled"));
 		upper = 1.0;
@@ -236,12 +236,12 @@ add_port_range(LADSPA_Descriptor* plugin,
 		} else {
 			valid = false;
 		}
-		
+
 		if (valid)
 			add_float(model, port, NS_LV2("default"), normal);
 
 	} else {  // No default hint
-	
+
 		if (range_valid && LADSPA_IS_HINT_BOUNDED_BELOW(hint_descriptor)) {
 			normal = lower;
 			add_float(model, port, NS_LV2("default"), normal);
@@ -278,11 +278,11 @@ write_lv2_turtle(LADSPA_Descriptor* descriptor, const char* plugin_uri, const ch
 			U("http://xmlns.com/foaf/0.1/")), "foaf");
 	librdf_serializer_set_namespace(serializer, librdf_new_uri(world,
 			U("http://lv2plug.in/ns/lv2core#")), "lv2");
-	
+
 	add_resource(model, plugin,
 		NS_RDF("type"),
 		NS_LV2("Plugin"));
-	
+
 	add_string(model, plugin,
 		NS_DOAP("name"),
 		descriptor->Name);
@@ -291,7 +291,7 @@ write_lv2_turtle(LADSPA_Descriptor* descriptor, const char* plugin_uri, const ch
 		add_resource(model, plugin,
 			NS_LV2("optionalFeature"),
 		 	NS_LV2("hardRTCapable"));
-	
+
 	for (uint32_t i=0; i < descriptor->PortCount; ++i) {
 		char index_str[32];
 		snprintf(index_str, (size_t)32, "%u", i);
@@ -308,7 +308,7 @@ write_lv2_turtle(LADSPA_Descriptor* descriptor, const char* plugin_uri, const ch
 		add_int(model, port_node,
 			NS_LV2("index"),
 		 	(int)i);
-	
+
 		if (LADSPA_IS_PORT_INPUT(port_descriptor))
 			add_resource(model, port_node,
 				NS_RDF("type"),
@@ -317,7 +317,7 @@ write_lv2_turtle(LADSPA_Descriptor* descriptor, const char* plugin_uri, const ch
 			add_resource(model, port_node,
 				NS_RDF("type"),
 				NS_LV2("OutputPort"));
-		
+
 		if (LADSPA_IS_PORT_AUDIO(port_descriptor))
 			add_resource(model, port_node,
 				NS_RDF("type"),
@@ -326,7 +326,7 @@ write_lv2_turtle(LADSPA_Descriptor* descriptor, const char* plugin_uri, const ch
 			add_resource(model, port_node,
 				NS_RDF("type"),
 				NS_LV2("ControlPort"));
-		
+
 		add_string(model, port_node,
 			NS_LV2("name"),
 		 	descriptor->PortNames[i]);
diff --git a/utils/lv2_inspect.c b/utils/lv2_inspect.c
index 33043dd..8278fe6 100644
--- a/utils/lv2_inspect.c
+++ b/utils/lv2_inspect.c
@@ -1,6 +1,6 @@
 /* lv2_inspect - Display information about an LV2 plugin.
- * Copyright (C) 2007 Dave Robillard <drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <drobilla.net>
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -104,7 +104,7 @@ print_plugin(SLV2Plugin p)
 	val = slv2_plugin_get_name(p);
 	printf("\tName:              %s\n", slv2_value_as_string(val));
 	slv2_value_free(val);
-	
+
 	SLV2Value class_label = slv2_plugin_class_get_label(slv2_plugin_get_class(p));
 	printf("\tClass:             %s\n", slv2_value_as_string(class_label));
 
@@ -113,13 +113,13 @@ print_plugin(SLV2Plugin p)
 		printf("\tAuthor:            %s\n", slv2_value_as_string(val));
 		slv2_value_free(val);
 	}
-	
+
 	val = slv2_plugin_get_author_email(p);
 	if (val) {
 		printf("\tAuthor Email:      %s\n", slv2_value_as_uri(val));
 		slv2_value_free(val);
 	}
-	
+
 	val = slv2_plugin_get_author_homepage(p);
 	if (val) {
 		printf("\tAuthor Homepage:   %s\n", slv2_value_as_uri(val));
@@ -144,16 +144,16 @@ print_plugin(SLV2Plugin p)
 			printf("%s\n", slv2_value_as_uri(slv2_ui_get_uri(ui)));
 
 			const char* binary = slv2_value_as_uri(slv2_ui_get_binary_uri(ui));
-			
+
 			SLV2Values types = slv2_ui_get_classes(ui);
 			for (unsigned i=0; i < slv2_values_size(types); ++i) {
 				printf("\t                       Class:  %s\n",
 						slv2_value_as_uri(slv2_values_get_at(types, i)));
 			}
-	
+
 			if (binary)
 				printf("\t                       Binary: %s\n", binary);
-	
+
 			printf("\t                       Bundle: %s\n",
 					slv2_value_as_uri(slv2_ui_get_bundle_uri(ui)));
 		}
@@ -188,8 +188,8 @@ print_plugin(SLV2Plugin p)
 	if (features)
 		printf("\n");
 	slv2_values_free(features);
-	
-	
+
+
 	/* Optional Features */
 
 	features = slv2_plugin_get_optional_features(p);
@@ -204,7 +204,7 @@ print_plugin(SLV2Plugin p)
 	if (features)
 		printf("\n");
 	slv2_values_free(features);
-	
+
 
 	/* Presets */
 
@@ -219,7 +219,7 @@ SELECT ?name WHERE { <> lv2p:hasPreset ?preset . ?preset dc:title ?name }");
 		printf("\t         %s\n", slv2_value_as_string(name));
 	}
 	slv2_results_free(presets);
-	
+
 
 	/* Ports */
 
@@ -228,9 +228,9 @@ SELECT ?name WHERE { <> lv2p:hasPreset ?preset . ?preset dc:title ?name }");
 	float* maxes    = calloc(num_ports, sizeof(float));
 	float* defaults = calloc(num_ports, sizeof(float));
 	slv2_plugin_get_port_ranges_float(p, mins, maxes, defaults);
-	
+
 	//printf("\n\t# Ports: %d\n", num_ports);
-	
+
 	for (uint32_t i=0; i < num_ports; ++i)
 		print_port(p, i, mins, maxes, defaults);
 
@@ -244,7 +244,7 @@ void
 print_version()
 {
 	printf("lv2_inspect (slv2) " SLV2_VERSION "\n");
-	printf("Copyright (C) 2007 Dave Robillard <dave at drobilla.net>\n");
+	printf("Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>\n");
 	printf("License: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>\n");
 	printf("This is free software: you are free to change and redistribute it.\n");
 	printf("There is NO WARRANTY, to the extent permitted by law.\n");
@@ -258,7 +258,7 @@ print_usage()
 	printf("Show information about an installed LV2 plugin.\n");
 }
 
-	
+
 int
 main(int argc, char** argv)
 {
@@ -303,7 +303,7 @@ main(int argc, char** argv)
 	}
 
 	ret = (p != NULL ? 0 : -1);
-	
+
 	slv2_value_free(uri);
 	slv2_plugins_free(world, plugins);
 
diff --git a/utils/lv2_list.c b/utils/lv2_list.c
index cefd24e..2314a97 100644
--- a/utils/lv2_list.c
+++ b/utils/lv2_list.c
@@ -1,6 +1,6 @@
 /* lv2_list - List system installed LV2 plugins.
- * Copyright (C) 2007 Dave Robillard <drobilla.net>
- *  
+ * Copyright (C) 2007-2009 Dave Robillard <drobilla.net>
+ *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
  * Software Foundation; either version 2 of the License, or (at your option)
@@ -36,7 +36,7 @@ void
 print_version()
 {
 	printf("lv2_list (slv2) " SLV2_VERSION "\n");
-	printf("Copyright (C) 2007 Dave Robillard <dave at drobilla.net>\n");
+	printf("Copyright (C) 2007-2009 Dave Robillard <http://drobilla.net>\n");
 	printf("License: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>\n");
 	printf("This is free software: you are free to change and redistribute it.\n");
 	printf("There is NO WARRANTY, to the extent permitted by law.\n");
@@ -75,7 +75,7 @@ main(int argc, char** argv)
 	SLV2Plugins plugins = slv2_world_get_all_plugins(world);
 
 	list_plugins(plugins);
-	
+
 	slv2_plugins_free(world, plugins);
 	slv2_world_free(world);
 
diff --git a/wscript b/wscript
index a2c276a..b33166c 100644
--- a/wscript
+++ b/wscript
@@ -3,7 +3,7 @@ import autowaf
 import Options
 
 # Version of this package (even if built as a child)
-SLV2_VERSION = '0.6.4'
+SLV2_VERSION = '0.6.6'
 
 # Library version (UNIX style major, minor, micro)
 # major increment <=> incompatible changes
@@ -27,6 +27,7 @@ SLV2_VERSION = '0.6.4'
 #   0.6.1 = 9,1,0
 #   0.6.2 = 9,1,1
 #   0.6.4 = 9,2,0
+#   0.6.6 = 9,2,0
 SLV2_LIB_VERSION = '9.2.0'
 
 # Variables for 'waf dist'

-- 
slv2 packaging



More information about the pkg-multimedia-commits mailing list