Re: [LAD] "enhanced event port" LV2 extension proposal

From: Krzysztof Foltman <wdev@email-addr-hidden>
Date: Thu Dec 06 2007 - 11:33:40 EET

Lars Luthman wrote:

> That sounds OK. I suggest something like this:
> struct URI_Mapper {
> // call this with your URI and the host_data member - not RT safe
> uint16_t (map_function*)(const char* uri, void* host_data);
> // pass this as the second parameter to map_function()
> void* host_data;
> };
> It doesn't provide a way for the host to say "I'm out of IDs!" though.
> Will that be needed?

What about using int32_t and returning -1 as "out of IDs"? There's no
difference in CPU time spent anyway, because uint16_t is returned in the
same 32-bit register as int32_t is (eax, on x86).

Or you can use 0 (or 65535) for error. It doesn't look like something
that requires lots of thinking.

Also, a reverse mapping mechanism would be helpful at times (for
debugging/data monitors). I put it in my proposal for that specific
reason. It shouldn't be hard to implement, either (might be a waste of
memory, but of acceptable kind).

Or it might be a separate feature, so that certain people won't get too
confused ;)

Krzysztof

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/mailman/listinfo/linux-audio-dev
Received on Thu Dec 6 12:15:02 2007

This archive was generated by hypermail 2.1.8 : Thu Dec 06 2007 - 12:15:02 EET