[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 15:39:54 UTC 2014
On Mon, Oct 20, 2014 at 12:26 PM, Philippe Coatmeur <philcm at gnu.org> wrote:
> Now for the direct questions:
> - Is it a proper NTK widget class declaration, that would expose a
> value() method?
> - Are those proper NTK widget class instances?
> You must derive from an NTK widget in order for it to work properly. See
// derive from slider, to provide
// - value() : to get the current value
// - value(float newVal) : to set a new value
// - redraw() will cause the widget to get repainted at the next
class MyWidget : public Fl_Slider
MyWidget( int, int, int, int, const char* ) :
Fl_Slider( ... blah blah ... )
// set default value:
value( 0.5 );
// draw stuff based on value() here
line_to( 0, width * value() );
// note: there's no *explicit* value() function here, it's inherited from
wid = new MyWidget( 10, 10, 200, 25 );
if ( portNumber == VOLUME )
wid->value( portValue );
Hope that clears things up somewhat, -Harry
PS: Hermann, FLTK / NTK will delete child instances when a window is
deleted. The window itself should be deleted though!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Linux-audio-dev