Re: [LAD] Design of similar LV2 plugins

From: David Robillard <d@email-addr-hidden>
Date: Sat Dec 06 2014 - 01:32:39 EET

On 2014-12-05 13:32, Aurélien Leblond wrote:
> I don't know if that would fit that I would need.
> More complex plugins like the Dynamic Waves with 4, 6, or 8 VCOs and
> Envelops, they have the same number of inputs, outputs but a completely
> different number of Comtrol Ports.

In an ideal world, event-based control, unless they're CV (and actually
need to be).

> I was thinking in the simpler line of having 3 different ttls calling the
> same binaries, but I can't find a way to find a way in the plugin to find
> out the nunber of port referenced in the ttls.

This is both reasonable and common. Every plugin has a distinct URI, so
you always know which you are in the code.

> I could always have 3 ttls with 3 shared objects. Each shared object could
> call a final shared object where the plugin code could actually be. But I
> would have to add additional code to find the right index of the right
> controls port which would increase the amount of cpu resource used or I
> would have to organise the ports in such a way it wouldn't be very user
> friendly.

Just cache the indices appropriately in the descriptor.

> At the end of the day, I don't know if any of your or my solution is worth
> it compared to just a bit of extra copy/past!

Factoring out the common code of several plugin variants which are
extremely similar is surely worth it, I'd say. At least you can just
factor out the run() and pass the appropriate buffers to it, so the
plugins would just be little skeletons whose purpose in life is to do that.

(We should be passing buffers to run() anyway, connect_port() is
idiotic, but that's another discussion...)

-- 
dr

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev

Received on Sat Dec 6 04:15:07 2014

This archive was generated by hypermail 2.1.8 : Sat Dec 06 2014 - 04:15:08 EET