<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-cite-prefix">On 17/10/14 15:56, Harry van Haaren
wrote:<br>
</div>
<blockquote
cite="mid:CAKudYbMdCHoXWyQkSTuVS=45r2bpswmmM_vS6P9sUWFAp+h6VA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div>On Fri, Oct 17, 2014 at 1:30 PM, Phil CM <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:philcm@gnu.org"
target="_blank">philcm@gnu.org</a>></span> wrote:<br>
</div>
<div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">Also each time the UI
is opened, the widgets are reset at maximum (not the
values).</div>
</blockquote>
<div> </div>
</div>
Hi Phil,
<div> <br>
</div>
<div>Glad to see you're excited and working hard on learning
LV2! Checkout the example plugins: they show how things work.</div>
<div><br>
</div>
<div>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 ;)</div>
<div><br>
Eg (from OpenAV's ArtyFX, Bitta plugin)</div>
<div><a moz-do-not-send="true"
href="https://github.com/harryhaaren/openAV-ArtyFX/blob/master/bitta/gui/ui.cxx#L131">https://github.com/harryhaaren/openAV-ArtyFX/blob/master/bitta/gui/ui.cxx#L131</a><br>
</div>
</div>
</blockquote>
In this very example, <tt>value()</tt> seems to be a method of
graph object, but when I look at it :<br>
<br>
<tt>{ graph = new Avtk::Crusher(5, 36, 150, 126, "graph");</tt><tt><br>
</tt><tt>graph->box(FL_UP_BOX);</tt><tt><br>
</tt><tt>graph->color((Fl_Color)179);</tt><tt><br>
</tt><tt>graph->selection_color(FL_INACTIVE_COLOR);</tt><tt><br>
</tt><tt>graph->labeltype(FL_NO_LABEL);</tt><tt><br>
</tt><tt>graph->labelfont(0);</tt><tt><br>
</tt><tt>graph->labelsize(14);</tt><tt><br>
</tt><tt>graph->labelcolor(FL_FOREGROUND_COLOR);</tt><tt><br>
</tt><tt>graph->callback((Fl_Callback*)cb_graph);</tt><tt><br>
</tt><tt>graph->align(Fl_Align(FL_ALIGN_BOTTOM));</tt><tt><br>
</tt><tt>graph->when(FL_WHEN_CHANGED);</tt><tt><br>
</tt><tt>} // Avtk::Crusher* graph</tt><br>
<br>
Still can't see the <tt>setValue() </tt>you are talking about... I
do see <tt>when(FL_WHEN_CHANGED);</tt> used a lot in your plugins,
is <tt>when()</tt> what I'm looking for?<br>
<br>
Thanks -Phil<br>
<blockquote
cite="mid:CAKudYbMdCHoXWyQkSTuVS=45r2bpswmmM_vS6P9sUWFAp+h6VA@mail.gmail.com"
type="cite">
<div dir="ltr">
<div><br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">How
can I <i>get</i> the control ports values from the UI
perspective?</blockquote>
<div>In answer to your Q, how to "get", you don't: you're told
when there's a new value.</div>
<div><br>
</div>
<div>HTH, Cheers, -Harry</div>
<div class="gmail_extra">
<div><br>
</div>
-- <br>
<br>
<a moz-do-not-send="true"
href="http://www.openavproductions.com" target="_blank">http://www.openavproductions.com</a>
</div>
</div>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Philippe "xaccrocheur" Coatmeur
<a class="moz-txt-link-freetext" href="http://bitbucket.org/xaccrocheur">http://bitbucket.org/xaccrocheur</a> / <a class="moz-txt-link-freetext" href="https://github.com/xaccrocheur">https://github.com/xaccrocheur</a>
<a class="moz-txt-link-freetext" href="http://opensimo.org/play/">http://opensimo.org/play/</a></pre>
</body>
</html>