[Devel] uri-map: what is the `map` parameter for?
d at drobilla.net
Mon Jul 18 14:35:32 PDT 2011
On Mon, 2011-07-18 at 16:23 -0500, Gabriel Beddingfield wrote:
> On Mon, Jul 18, 2011 at 4:10 PM, David Robillard <d at drobilla.net> wrote:
> >> Just what *is* this map parameter for? Docs say:
> >> * @param map The 'context' of this URI. Certain extensions may define a
> >> * URI that must be passed here with certain restrictions on the
> >> * return value (e.g. limited range). This value may be NULL if
> >> * the plugin needs an ID for a URI in general.
> >> Which doesn't give me any clues about what it's for... so I made it
> >> NULL. What I expect is a simple, global registry with URI ==> INT
> >> mappings, so this 'context' thing has me befuddled.
> >> Any hints?
> > NULL should be legal. Unfortunately this is a pretty bad bug in SLV2...
> > which I didn't plan to make any new releases of :/
> zynjacku has the same bug, too.
> > However, this is related to a much deeper problem: the context argument
> > was, as it turns out, a very huge mistake. Very unfortunately, though,
> > the event extension depends on it, so we are stuck. The event extension
> > is probably the single most troublesome one to replace. I don't know
> > what to do about this :(
> I'll agree that it was a mistake. But what was the intention? That
> the URI->INT mappings could be different for each extension? And so
> the `map` parameter was supposed to be the extention for which the URI
> mapping is intended to be used with? (Just a guess based on SLV2 and
> zynjacku's code).
Basically an extremely stupid solution whose only purpose was to make
the type field of the event structure uint16_t.
The best thing, in the long run, would be to replace the event and
uri-map extensions to resolve this. Well, uri-map could be updated to
just deprecate the map parameter at least, but event has to go. That's
going to piss some people off and cause a lot of bad PR, though.
More information about the Devel