<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=windows-1252">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<br>
<div class="moz-forward-container"><br>
<br>
-------- Forwarded Message --------
<table class="moz-email-headers-table" border="0" cellpadding="0"
cellspacing="0">
<tbody>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Subject:
</th>
<td>Re: [LAD] How can an LV2 plugin UI get the value of a
control port from the plugin?</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Date: </th>
<td>Mon, 20 Oct 2014 01:27:10 +0100</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">From: </th>
<td>Philippe Coatmeur <a class="moz-txt-link-rfc2396E" href="mailto:philcm@gnu.org"><philcm@gnu.org></a></td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">Organisation:
</th>
<td>GNU</td>
</tr>
<tr>
<th align="RIGHT" nowrap="nowrap" valign="BASELINE">To: </th>
<td>Harry van Haaren <a class="moz-txt-link-rfc2396E" href="mailto:harryhaaren@gmail.com"><harryhaaren@gmail.com></a></td>
</tr>
</tbody>
</table>
<br>
<br>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
<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>
</blockquote>
<br>
For this I had to write my own<br>
<tt><br>
</tt><tt> int setValue(int value) {</tt><tt><br>
</tt><tt> // this->scrollvalue(value);</tt><tt><br>
</tt><tt> cout << "Called with value " << value
<< endl;</tt><tt><br>
</tt><tt> }</tt><br>
<br>
And it does get called by <tt>port_event()</tt> now <br>
<ul>
<li>what do I put in this <tt>setValue()</tt> in order to <i>actually</i><i>
update</i> the widget value? </li>
</ul>
There is a <tt>int scrollvalue(int pos,int size,int first,int
total);</tt> in Fl_Slider.H but can't call it from the class,
witch is <a moz-do-not-send="true"
href="https://bitbucket.org/xaccrocheur/kis/src/8c3a85a9899f117d2fa273b6c7948402d780fb46/widget.h?at=master">not
explicitely extending Fl_Slider</a> from what I can see... Is
it?<br>
<br>
Thanks everybody<br>
<br>
--Phil<br>
<br>
PS - Apparently Sorcer is using AvTK on top of FLTK, I was under
the impression that Sorcer's UI was using NTK, am I mistaking?<br>
<blockquote
cite="mid:CAKudYbMdCHoXWyQkSTuVS=45r2bpswmmM_vS6P9sUWFAp+h6VA@mail.gmail.com"
type="cite">
<div dir="ltr">
<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><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 moz-do-not-send="true" class="moz-txt-link-freetext" href="http://bitbucket.org/xaccrocheur">http://bitbucket.org/xaccrocheur</a> / <a moz-do-not-send="true" class="moz-txt-link-freetext" href="https://github.com/xaccrocheur">https://github.com/xaccrocheur</a>
<a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://opensimo.org/play/">http://opensimo.org/play/</a></pre>
<br>
</div>
<br>
</body>
</html>