[LV2] lv2_descriptor() considered harmful
Stefan Kersten
sk at k-hornz.de
Thu Mar 15 11:43:53 PDT 2012
On 3/15/12 7:12 PM, David Robillard wrote:
> In related news, I have discovered a different quasi-problem with this
> API. I was hoping having a LV2_Lib_Descriptor would remove the need for
> all static data in the lib. However, the library descriptor is not
> available to LV2_Descriptor::instantiate, so if you load a list of
> plugins at discovery time, you can't get at it in instantiate, unless:
>
> * You have static data in the library, shared between all instances of
> that library
>
> * You calculate all that stuff again, for every plugin instantiation
>
> This kinda sucks, but I see no solution. It makes me wonder if a
> library descriptor is even worth it.
i thought the problem was not so much static data per se, but getting
control over initialization and destruction? if you want to avoid static
data you'll need to call lv2_lib_descriptor once and pass the
LV2_Lib_Descriptor to LV2_Descriptor::instantiate, i don't see any other
way. i personally consider it important to be able to obtain the host's
feature set when the library is loaded.
<sk>
More information about the Devel
mailing list