On Tue, May 30, 2006 at 11:43:57AM -0400, Dave Robillard wrote:
The problem with returning strings is namespace
prefixes. It's all fine
if the type is in the lv2: namespace so it can return something nice
like lv2:float, but if it's something else it will have to return the
fully qualified URI. For consistency's sake I'll have to return the
full URI for everything.
Returning QNames is bad mojo.
I think what I'll do is have the type function
return a full URI, but
#define symbols for the builtin port types (which is easily extensible
without breaking anything).
Something like:
char* type = lv2_port_get_type(someplug, 0);
if (!strcmp(type, LV2_DATATYPE_FLOAT))
/* ... */
free(type);
Makes sense to me. You could make the API (optionally?) take a char * to
write the result into to avoid a lot of malloc() and free()s, but I doublt
it's a worthwhile saving.
- Steve