Sounds reasonable to me.

Just to clarify, does that mean LV2_DATATYPE_FLOAT
would be #define'd as: "http://lv2plug.in/ontology#float";
or something else?...

I guess consistency would suggest using the same approach for both
slv2_port_get_class() and slv2_port_get_data_type().


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.

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);

Better?

-DR-


Reply via email to