[LAD] Fwd: Re: How can an LV2 plugin UI get the value of a control port from the plugin?

Harry van Haaren harryhaaren at gmail.com
Mon Oct 20 08:07:33 UTC 2014


On Mon, Oct 20, 2014 at 1:39 AM, Philippe Coatmeur <philcm at gnu.org> wrote:
<lots of emails>

Hi Philippe,

I can't follow the issue you're having here: you've sent 8 emails, most
with different questions with a layout that is hard to follow: please be
more careful in what text you reply to, and remove all the rest of the
email. Then make sure you're repling to the "linux-audio-dev" list, and not
(only) to the individual.

If you're struggling with code, take a step back, and write a single email,
with a direct question, that sums up what you're trying to learn.


Eg:
How does setValue() work to updated a widgets value in NTK, in the context
of an LV2 plugin?

To which I would answer:
Most NTK widgets that have a "value" like a slider or a dial, derive from a
base class that implements value() and value( float );

What this means for a widget, is that in order to change the value of a
widget called "wid", we do this:
wid->value( 0.0f ); // sets widget value to 0

What you will see here:
https://github.com/harryhaaren/openAV-ArtyFX/blob/master/ui/crusher.h#L156
Is the value() call, which returns the value stored in the base class, aka
0.0f in this case.

To connect an LV2 port to a widget, in port_event() have this type of code:
https://github.com/harryhaaren/openAV-ArtyFX/blob/master/bitta/gui/ui.cxx#L116
Which checks the port number, and assigns the incoming value to the widget,
using the value( float ); call.

Its pretty simple right? Cool.

RE: the other emails, Yes Sorcer uses NTK, NTK is in turn based on FLTK,
and to maintain backwards compatibility with existing code, the function
names weren't changed.


HTH, -Harry

-- 

http://www.openavproductions.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20141020/c50f6310/attachment.html>


More information about the Linux-audio-dev mailing list