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

From: Philippe Coatmeur <philcm@email-addr-hidden>
Date: Mon Oct 20 2014 - 03:38:59 EEST

On 17/10/14 15:56, Harry van Haaren wrote:
> On Fri, Oct 17, 2014 at 1:30 PM, Phil CM <philcm@email-addr-hidden
> <mailto:philcm@email-addr-hidden>> wrote:
>
> Also each time the UI is opened, the widgets are reset at maximum
> (not the values).
>
> Hi Phil,
>
> Glad to see you're excited and working hard on learning LV2! Checkout
> the example plugins: they show how things work.
>
> In the UI, there is a port_event() function. It tells the UI what
> port changed, and what its current value is. Use this to do
> widget->setValue( newValue ); and you're done ;)
>
> Eg (from OpenAV's ArtyFX, Bitta plugin)
> https://github.com/harryhaaren/openAV-ArtyFX/blob/master/bitta/gui/ui.cxx#L131
In this very example, value() seems to be a method of graph object, but
when I look at it :

{ graph = new Avtk::Crusher(5, 36, 150, 126, "graph");
graph->box(FL_UP_BOX);
graph->color((Fl_Color)179);
graph->selection_color(FL_INACTIVE_COLOR);
graph->labeltype(FL_NO_LABEL);
graph->labelfont(0);
graph->labelsize(14);
graph->labelcolor(FL_FOREGROUND_COLOR);
graph->callback((Fl_Callback*)cb_graph);
graph->align(Fl_Align(FL_ALIGN_BOTTOM));
graph->when(FL_WHEN_CHANGED);
} // Avtk::Crusher* graph

Still can't see the setValue() you are talking about... I do see
when(FL_WHEN_CHANGED); used a lot in your plugins, is when() what I'm
looking for?

Thanks -Phil
>
> How can I /get/ the control ports values from the UI perspective?
>
> In answer to your Q, how to "get", you don't: you're told when there's
> a new value.
>
> HTH, Cheers, -Harry
>
> --
>
> http://www.openavproductions.com

-- 
Philippe "xaccrocheur" Coatmeur
http://bitbucket.org/xaccrocheur / https://github.com/xaccrocheur
http://opensimo.org/play/

_______________________________________________
Linux-audio-dev mailing list
Linux-audio-dev@email-addr-hidden
http://lists.linuxaudio.org/listinfo/linux-audio-dev
Received on Mon Oct 20 04:15:02 2014

This archive was generated by hypermail 2.1.8 : Mon Oct 20 2014 - 04:15:02 EEST