| 1 | |
| 2 | <refentry id="FLslider"> |
| 3 | <indexterm id="IndexFLslider"><primary>FLslider</primary></indexterm> |
| 4 | <refentryinfo><title>FLTK:Valuators</title></refentryinfo> |
| 5 | <refmeta> |
| 6 | <refentrytitle>FLslider</refentrytitle> |
| 7 | </refmeta> |
| 8 | |
| 9 | |
| 10 | |
| 11 | <refnamediv> |
| 12 | <refname>FLslider</refname> |
| 13 | <refpurpose> |
| 14 | Puts a slider into the corresponding FLTK container. |
| 15 | </refpurpose> |
| 16 | </refnamediv> |
| 17 | |
| 18 | <refsect1> |
| 19 | <title>Description</title> |
| 20 | <para> |
| 21 | Plugin opcode in widgets. This opcode is part of the plugin repository and has to be installed separately. These FLTK widgets do not work on the Mac. |
| 22 | The plugin repository can be found here: <ulink url="https://github.com/csound/plugins"><citetitle>https://github.com/csound/plugins</citetitle></ulink></para> |
| 23 | <para> |
| 24 | <emphasis>FLslider</emphasis> puts a slider into the corresponding container. |
| 25 | </para> |
| 26 | </refsect1> |
| 27 | |
| 28 | <refsect1> |
| 29 | <title>Syntax</title> |
| 30 | <synopsis>kout, ihandle <command>FLslider</command> "label", imin, imax, iexp, itype, idisp, iwidth, \ |
| 31 | iheight, ix, iy</synopsis> |
| 32 | </refsect1> |
| 33 | |
| 34 | <refsect1> |
| 35 | <title>Initialization</title> |
| 36 | <para> |
| 37 | <emphasis>ihandle</emphasis> -- a handle value (an integer number) that unequivocally references a corresponding widget. This is used by other opcodes that modify a widget's properties (see <link linkend="ControlFltkAppearance"><citetitle>Modifying FLTK Widget Appearance</citetitle></link>). It is automatically output by <emphasis>FLslider</emphasis> and must not be set by the user label. (The user label is a double-quoted string containing some user-provided text placed near the widget.) |
| 38 | </para> |
| 39 | |
| 40 | <para> |
| 41 | <emphasis><quote>label</quote></emphasis> -- a double-quoted string containing some user-provided text, placed near the corresponding widget. |
| 42 | </para> |
| 43 | |
| 44 | <para> |
| 45 | <emphasis>imin</emphasis> -- minimum value of output range (corresponds to the left value for horizontal sliders, and the top value for vertical sliders). |
| 46 | </para> |
| 47 | |
| 48 | <para> |
| 49 | <emphasis>imax</emphasis> -- maximum value of output range (corresponds to the right value for horizontal sliders, and the bottom value for vertical sliders). |
| 50 | </para> |
| 51 | |
| 52 | <para> |
| 53 | The <emphasis>imin</emphasis> argument may be greater than <emphasis>imax</emphasis> argument. This has the effect of <quote>reversing</quote> the object so the larger values are in the opposite direction. This also switches which end of the filled sliders is filled. |
| 54 | </para> |
| 55 | |
| 56 | <para> |
| 57 | <emphasis>iexp</emphasis> -- an integer number denoting the behaviour of valuator: |
| 58 | <itemizedlist> |
| 59 | <listitem><para>0 = valuator output is linear</para></listitem> |
| 60 | <listitem><para>-1 = valuator output is exponential</para></listitem> |
| 61 | </itemizedlist> |
| 62 | </para> |
| 63 | |
| 64 | <para> |
| 65 | All other positive numbers for <emphasis>iexp</emphasis> indicate the number of an existing table that is used for indexing. Linear interpolation is provided in table indexing. A negative table number suppresses interpolation. |
| 66 | </para> |
| 67 | <warning> |
| 68 | <title>IMPORTANT!</title> |
| 69 | <para> |
| 70 | Notice that the tables used by valuators must be created with the <link linkend="ftgen"><citetitle>ftgen</citetitle></link> opcode and placed in the orchestra before the corresponding valuator. They can not placed in the score. This is because tables placed in the score are created later than the initialization of the opcodes placed in the header section of the orchestra. |
| 71 | </para> |
| 72 | </warning> |
| 73 | |
| 74 | <para> |
| 75 | <emphasis>itype</emphasis> -- an integer number denoting the appearance of the valuator. |
| 76 | </para> |
| 77 | |
| 78 | <para> |
| 79 | The <emphasis>itype</emphasis> argument can be set to the following values: |
| 80 | |
| 81 | <itemizedlist> |
| 82 | <listitem><para>1 - shows a horizontal fill slider</para></listitem> |
| 83 | <listitem><para>2 - a vertical fill slider</para></listitem> |
| 84 | <listitem><para>3 - a horizontal engraved slider</para></listitem> |
| 85 | <listitem><para>4 - a vertical engraved slider</para></listitem> |
| 86 | <listitem><para>5 - a horizontal nice slider</para></listitem> |
| 87 | <listitem><para>6 - a vertical nice slider</para></listitem> |
| 88 | <listitem><para>7 - a horizontal up-box nice slider</para></listitem> |
| 89 | <listitem><para>8 - a vertical up-box nice slider</para></listitem> |
| 90 | </itemizedlist> |
| 91 | |
| 92 | <mediaobject> |
| 93 | <imageobject> |
| 94 | <imagedata fileref="images/flslider_horizontal-fill.png" format="PNG"/> |
| 95 | </imageobject> |
| 96 | |
| 97 | <textobject> |
| 98 | <phrase>FLslider - a horizontal fill slider (itype=1).</phrase> |
| 99 | </textobject> |
| 100 | |
| 101 | <caption> |
| 102 | <para>FLslider - a horizontal fill slider (itype=1).</para> |
| 103 | </caption> |
| 104 | </mediaobject> |
| 105 | |
| 106 | <mediaobject> |
| 107 | <imageobject> |
| 108 | <imagedata fileref="images/flslider_horizontal-engraved.png" format="PNG"/> |
| 109 | </imageobject> |
| 110 | |
| 111 | <textobject> |
| 112 | <phrase>FLslider - a horizontal engraved slider (itype=3).</phrase> |
| 113 | </textobject> |
| 114 | |
| 115 | <caption> |
| 116 | <para>FLslider - a horizontal engraved slider (itype=3).</para> |
| 117 | </caption> |
| 118 | </mediaobject> |
| 119 | |
| 120 | <mediaobject> |
| 121 | <imageobject> |
| 122 | <imagedata fileref="images/flslider_horizontal-nice.png" format="PNG"/> |
| 123 | </imageobject> |
| 124 | |
| 125 | <textobject> |
| 126 | <phrase>FLslider - a horizontal nice slider (itype=5).</phrase> |
| 127 | </textobject> |
| 128 | |
| 129 | <caption> |
| 130 | <para>FLslider - a horizontal nice slider (itype=5).</para> |
| 131 | </caption> |
| 132 | </mediaobject> |
| 133 | You can also create "plastic" looking sliders by adding 20 to <emphasis>itype</emphasis>. |
| 134 | </para> |
| 135 | |
| 136 | <para> |
| 137 | <emphasis>idisp</emphasis> -- a handle value that was output |
| 138 | from a previous instance of the <link |
| 139 | linkend="FLvalue"><citetitle>FLvalue</citetitle></link> opcode |
| 140 | to display the current value of the current valuator in the |
| 141 | <emphasis>FLvalue</emphasis> widget itself. If the user does not want to use this feature that displays current values, it must be set to a negative number by the user. |
| 142 | </para> |
| 143 | |
| 144 | <para> |
| 145 | <emphasis>iwidth</emphasis> -- width of widget. |
| 146 | </para> |
| 147 | |
| 148 | <para> |
| 149 | <emphasis>iheight</emphasis> -- height of widget. |
| 150 | </para> |
| 151 | |
| 152 | <para> |
| 153 | <emphasis>ix</emphasis> -- horizontal position of upper left corner of the valuator, relative to the upper left corner of corresponding window (expressed in pixels). |
| 154 | </para> |
| 155 | |
| 156 | <para> |
| 157 | <emphasis>iy</emphasis> -- vertical position of upper left corner of the valuator, relative to the upper |
| 158 | left corner of corresponding window (expressed in pixels). |
| 159 | </para> |
| 160 | </refsect1> |
| 161 | |
| 162 | <refsect1> |
| 163 | <title>Performance</title> |
| 164 | <para> |
| 165 | <emphasis>kout</emphasis> -- output value |
| 166 | </para> |
| 167 | <para> |
| 168 | FLsliders are created with the minimum value by default in the left/at the top. If you want to reverse the slider, reverse the values. See the example below. |
| 169 | </para> |
| 170 | </refsect1> |
| 171 | |
| 172 | <refsect1> |
| 173 | <title>Examples</title> |
| 174 | <para> |
| 175 | Here is an example of the FLslider opcode. It uses the file <ulink url="examples/FLslider.csd"><citetitle>FLslider.csd</citetitle></ulink>. |
| 176 | |
| 177 | <example> |
| 178 | <title>Example of the FLslider opcode.</title> |
| 179 | |
| 180 | <para>See the sections <link linkend="UsingRealTime"><citetitle>Real-time Audio</citetitle></link> and <link linkend="CommandFlags"><citetitle>Command Line Flags</citetitle></link> for more information on using command line flags.</para> |
| 181 | <xi:include href="examples-xml/FLslider.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 182 | </example> |
| 183 | </para> |
| 184 | <para> |
| 185 | Here is another example of the FLslider opcode, showing the slider types and other options. It also shows the usage of FLvalue to display a widget's contents. It uses the file <ulink url="examples/FLslider-2.csd"><citetitle>FLslider-2.csd</citetitle></ulink>. |
| 186 | |
| 187 | <example> |
| 188 | <title>More complex example of the FLslider opcode.</title> |
| 189 | |
| 190 | <xi:include href="examples-xml/FLslider-2.csd.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/> |
| 191 | </example> |
| 192 | </para> |
| 193 | </refsect1> |
| 194 | |
| 195 | <refsect1> |
| 196 | <title>See Also</title> |
| 197 | <para> |
| 198 | <link linkend="FLcount"><citetitle>FLcount</citetitle></link>, |
| 199 | <link linkend="FLjoy"><citetitle>FLjoy</citetitle></link>, |
| 200 | <link linkend="FLknob"><citetitle>FLknob</citetitle></link>, |
| 201 | <link linkend="FLroller"><citetitle>FLroller</citetitle></link>, |
| 202 | <link linkend="FLslidBnk"><citetitle>FLslidBnk</citetitle></link>, |
| 203 | <link linkend="FLtext"><citetitle>FLtext</citetitle></link> |
| 204 | </para> |
| 205 | </refsect1> |
| 206 | |
| 207 | <refsect1> |
| 208 | <title>Credits</title> |
| 209 | <para>Author: &namegabriel;</para> |
| 210 | <para>New in version 4.22</para> |
| 211 | <para>February 2004. Thanks to a note from Dave Phillips, deleted the extraneous istep parameter.</para> |
| 212 | <para>Example written by Iain McCurdy, edited by &namekevin;.</para> |
| 213 | </refsect1> |
| 214 | </refentry> |