Extra "ports" of juce-based plugins using the distrho build system
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

678 lines
17KB

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html>
  4. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
  5. <head>
  6. <title>protoplug: Module gui</title>
  7. <link rel="stylesheet" href="../ldoc.css" type="text/css" />
  8. </head>
  9. <body>
  10. <div id="container">
  11. <div id="product">
  12. <div id="product_logo"></div>
  13. <div id="product_name"><big><b></b></big></div>
  14. <div id="product_description"></div>
  15. </div> <!-- id="product" -->
  16. <div id="main">
  17. <!-- Menu -->
  18. <div id="navigation">
  19. <a href="http://osar.fr">
  20. <div class=osarlogo> </div>
  21. </a>
  22. <br/>
  23. <a href="http://osar.fr/protoplug">
  24. <h1>protoplug</h1>
  25. </a>
  26. <span class="proto_subtitle">Lua API reference</span>
  27. <ul>
  28. <li><a href="../index.html">Index</a></li>
  29. </ul>
  30. <h2>Contents</h2>
  31. <ul>
  32. <li><a href="#Functions">Functions</a></li>
  33. <li><a href="#Tables">Tables</a></li>
  34. <li><a href="#Class_gui_MouseEvent">Class gui.MouseEvent </a></li>
  35. <li><a href="#Class_gui_MouseWheelDetails">Class gui.MouseWheelDetails </a></li>
  36. <li><a href="#Class_gui_KeyPress">Class gui.KeyPress </a></li>
  37. </ul>
  38. <h2>Modules</h2>
  39. <ul class="$(kind=='Topics' and '' or 'nowrap'">
  40. <li><a href="../modules/plugin.html">plugin</a></li>
  41. <li><a href="../modules/script.html">script</a></li>
  42. <li><a href="../modules/midi.html">midi</a></li>
  43. <li><strong>gui</strong></li>
  44. <li><a href="../modules/polyGen.html">polyGen</a></li>
  45. <li><a href="../modules/stereoFx.html">stereoFx</a></li>
  46. </ul>
  47. <h2>Classes</h2>
  48. <ul class="$(kind=='Topics' and '' or 'nowrap'">
  49. <li><a href="../classes/juce.AffineTransform.html">juce.AffineTransform</a></li>
  50. <li><a href="../classes/juce.AudioFormatReader.html">juce.AudioFormatReader</a></li>
  51. <li><a href="../classes/juce.Colour.html">juce.Colour</a></li>
  52. <li><a href="../classes/juce.ColourGradient.html">juce.ColourGradient</a></li>
  53. <li><a href="../classes/juce.Component.html">juce.Component</a></li>
  54. <li><a href="../classes/juce.FillType.html">juce.FillType</a></li>
  55. <li><a href="../classes/juce.Font.html">juce.Font</a></li>
  56. <li><a href="../classes/juce.Graphics.html">juce.Graphics</a></li>
  57. <li><a href="../classes/juce.Image.html">juce.Image</a></li>
  58. <li><a href="../classes/juce.Justification.html">juce.Justification</a></li>
  59. <li><a href="../classes/juce.LagrangeInterpolator.html">juce.LagrangeInterpolator</a></li>
  60. <li><a href="../classes/juce.Line.html">juce.Line</a></li>
  61. <li><a href="../classes/juce.Path.html">juce.Path</a></li>
  62. <li><a href="../classes/juce.Point.html">juce.Point</a></li>
  63. <li><a href="../classes/juce.RectanglePlacement.html">juce.RectanglePlacement</a></li>
  64. <li><a href="../classes/juce.Rectangle_float.html">juce.Rectangle_float</a></li>
  65. <li><a href="../classes/juce.Rectangle_int.html">juce.Rectangle_int</a></li>
  66. </ul>
  67. <h2>Examples</h2>
  68. <ul class="$(kind=='Topics' and '' or 'nowrap'">
  69. <li><a href="../examples/classic-filter.lua.html">classic-filter.lua</a></li>
  70. <li><a href="../examples/sine-organ.lua.html">sine-organ.lua</a></li>
  71. <li><a href="../examples/midi-chordify.lua.html">midi-chordify.lua</a></li>
  72. <li><a href="../examples/sinemouse-demo.lua.html">sinemouse-demo.lua</a></li>
  73. <li><a href="../examples/soundfile-test.lua.html">soundfile-test.lua</a></li>
  74. </ul>
  75. </div>
  76. <div id="content">
  77. <h1>Module <code>gui</code></h1>
  78. <p>Use <a href="../modules/gui.html#">gui</a> to define your script's custom graphical user interface.</p>
  79. <p>
  80. <p> Custom GUI example : <a href="../examples/sinemouse-demo.lua.html#">sinemouse-demo.lua</a></p>
  81. <p> The <a href="../modules/gui.html#">gui</a> global is available to every protoplug script after including the
  82. main protoplug header :</p>
  83. <pre><code>require "include/protoplug"
  84. </code></pre>
  85. </p>
  86. <h2><a href="#Functions">Functions</a></h2>
  87. <table class="function_list">
  88. <tr>
  89. <td class="name" nowrap><a href="#addHandler"><span class="proto_prefix">gui</span>.addHandler (event, handler)</a></td>
  90. <td class="summary">Add a handler for a GUI event.</td>
  91. </tr>
  92. <tr>
  93. <td class="name" nowrap><a href="#paint"><span class="proto_prefix">gui</span>.paint (g)</a></td>
  94. <td class="summary">Override to paint a custom GUI.</td>
  95. </tr>
  96. <tr>
  97. <td class="name" nowrap><a href="#getComponent"><span class="proto_prefix">gui</span>.getComponent ()</a></td>
  98. <td class="summary">Get GUI Component.</td>
  99. </tr>
  100. </table>
  101. <h2><a href="#Tables">Tables</a></h2>
  102. <table class="function_list">
  103. <tr>
  104. <td class="name" nowrap><a href="#FocusCause"><span class="proto_prefix">gui</span>.FocusCause</a></td>
  105. <td class="summary">Focus change causes.</td>
  106. </tr>
  107. <tr>
  108. <td class="name" nowrap><a href="#ModifierKeys"><span class="proto_prefix">gui</span>.ModifierKeys</a></td>
  109. <td class="summary">Keyboard and mouse modifiers.</td>
  110. </tr>
  111. </table>
  112. <h2><a href="#Class_gui_MouseEvent">Class gui.MouseEvent </a></h2>
  113. <table class="function_list">
  114. <tr>
  115. <td class="name" nowrap><a href="#MouseEvent.x"><span class="proto_prefix">gui.MouseEvent</span>.x</a></td>
  116. <td class="summary">X.</td>
  117. </tr>
  118. <tr>
  119. <td class="name" nowrap><a href="#MouseEvent.y"><span class="proto_prefix">gui.MouseEvent</span>.y</a></td>
  120. <td class="summary">Y.</td>
  121. </tr>
  122. <tr>
  123. <td class="name" nowrap><a href="#MouseEvent.mods"><span class="proto_prefix">gui.MouseEvent</span>.mods</a></td>
  124. <td class="summary">Modifier keys.</td>
  125. </tr>
  126. <tr>
  127. <td class="name" nowrap><a href="#MouseEvent.eventComponent"><span class="proto_prefix">gui.MouseEvent</span>.eventComponent</a></td>
  128. <td class="summary">Event component.</td>
  129. </tr>
  130. <tr>
  131. <td class="name" nowrap><a href="#MouseEvent.originalComponent"><span class="proto_prefix">gui.MouseEvent</span>.originalComponent</a></td>
  132. <td class="summary">Original component.</td>
  133. </tr>
  134. <tr>
  135. <td class="name" nowrap><a href="#MouseEvent.eventTime"><span class="proto_prefix">gui.MouseEvent</span>.eventTime</a></td>
  136. <td class="summary">Time.</td>
  137. </tr>
  138. <tr>
  139. <td class="name" nowrap><a href="#MouseEvent.mouseDownTime"><span class="proto_prefix">gui.MouseEvent</span>.mouseDownTime</a></td>
  140. <td class="summary">Mouse down time.</td>
  141. </tr>
  142. <tr>
  143. <td class="name" nowrap><a href="#MouseEvent.mouseDownPos"><span class="proto_prefix">gui.MouseEvent</span>.mouseDownPos</a></td>
  144. <td class="summary">Mouse down position.</td>
  145. </tr>
  146. <tr>
  147. <td class="name" nowrap><a href="#MouseEvent.numberOfClicks"><span class="proto_prefix">gui.MouseEvent</span>.numberOfClicks</a></td>
  148. <td class="summary">Number of clicks.</td>
  149. </tr>
  150. <tr>
  151. <td class="name" nowrap><a href="#MouseEvent.wasMovedSinceMouseDown"><span class="proto_prefix">gui.MouseEvent</span>.wasMovedSinceMouseDown</a></td>
  152. <td class="summary">Was moved since mouse down.</td>
  153. </tr>
  154. </table>
  155. <h2><a href="#Class_gui_MouseWheelDetails">Class gui.MouseWheelDetails </a></h2>
  156. <table class="function_list">
  157. <tr>
  158. <td class="name" nowrap><a href="#MouseWheelDetails.deltaX"><span class="proto_prefix">gui.MouseWheelDetails</span>.deltaX</a></td>
  159. <td class="summary">X delta.</td>
  160. </tr>
  161. <tr>
  162. <td class="name" nowrap><a href="#MouseWheelDetails.deltaY"><span class="proto_prefix">gui.MouseWheelDetails</span>.deltaY</a></td>
  163. <td class="summary">Y delta.</td>
  164. </tr>
  165. <tr>
  166. <td class="name" nowrap><a href="#MouseWheelDetails.isReversed"><span class="proto_prefix">gui.MouseWheelDetails</span>.isReversed</a></td>
  167. <td class="summary">Is reversed.</td>
  168. </tr>
  169. <tr>
  170. <td class="name" nowrap><a href="#MouseWheelDetails.isSmooth"><span class="proto_prefix">gui.MouseWheelDetails</span>.isSmooth</a></td>
  171. <td class="summary">Is smooth.</td>
  172. </tr>
  173. </table>
  174. <h2><a href="#Class_gui_KeyPress">Class gui.KeyPress </a></h2>
  175. <table class="function_list">
  176. <tr>
  177. <td class="name" nowrap><a href="#KeyPress.keyCode"><span class="proto_prefix">gui.KeyPress</span>.keyCode</a></td>
  178. <td class="summary">Key code.</td>
  179. </tr>
  180. <tr>
  181. <td class="name" nowrap><a href="#KeyPress.mods"><span class="proto_prefix">gui.KeyPress</span>.mods</a></td>
  182. <td class="summary">Modifier Keys.</td>
  183. </tr>
  184. <tr>
  185. <td class="name" nowrap><a href="#KeyPress.textCharacter"><span class="proto_prefix">gui.KeyPress</span>.textCharacter</a></td>
  186. <td class="summary">Text character.</td>
  187. </tr>
  188. </table>
  189. <br/>
  190. <br/>
  191. <h2><a name="Functions"></a>Functions</h2>
  192. <dl class="function">
  193. <dt>
  194. <a name = "addHandler"></a>
  195. <strong><span class="proto_prefix">gui</span>.addHandler (event, handler)</strong>
  196. </dt>
  197. <dd>
  198. Add a handler for a GUI event. </p>
  199. <p>Here's a list of the events and their parameters, showing how they
  200. should be received :</p>
  201. <pre><code>gui.addHandler("resized", function() ... end)
  202. gui.addHandler("focusGained", function(focusCause) ... end)
  203. gui.addHandler("focusLost", function(focusCause) ... end)
  204. gui.addHandler("modifierKeysChanged", function(modifierKeys) ... end)
  205. gui.addHandler("mouseMove", function(mouseEvent) ... end)
  206. gui.addHandler("mouseEnter", function(mouseEvent) ... end)
  207. gui.addHandler("mouseExit", function(mouseEvent) ... end)
  208. gui.addHandler("mouseDown", function(mouseEvent) ... end)
  209. gui.addHandler("mouseDrag", function(mouseEvent) ... end)
  210. gui.addHandler("mouseUp", function(mouseEvent) ... end)
  211. gui.addHandler("mouseDoubleClick", function(mouseEvent) ... end)
  212. gui.addHandler("mouseWheelMove", function(mouseEvent, mouseWheelDetails) ... end)
  213. gui.addHandler("keyPressed", function(keyPress, srcComponent) ... end)
  214. gui.addHandler("keyStateChanged", function(keyPress, srcComponent) ... end)
  215. </code></pre>
  216. <p>Parameters received by the event handlers are of
  217. type <a href="../modules/gui.html#FocusCause">FocusCause</a>, <a href="../modules/gui.html#ModifierKeys">ModifierKeys</a>, <a href="../modules/gui.html#gui.MouseEvent">MouseEvent</a>, <a href="../modules/gui.html#gui.MouseWheelDetails">MouseWheelDetails</a>,
  218. and <a href="../modules/gui.html#gui.KeyPress">KeyPress</a>.
  219. </ul>
  220. <h3>Parameters:</h3>
  221. <ul>
  222. <li><span class="parameter">event</span>
  223. <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
  224. the event to handle
  225. </li>
  226. <li><span class="parameter">handler</span>
  227. <span class="types"><span class="type">function</span></span>
  228. a function to add the event's handlers
  229. </li>
  230. </ul>
  231. <h3>See also:</h3>
  232. <ul>
  233. <li><a href="../modules/script.html#addHandler">script.addHandler</a></li>
  234. <li><a href="../modules/plugin.html#addHandler">plugin.addHandler</a></li>
  235. </ul>
  236. </dd>
  237. <dt>
  238. <a name = "paint"></a>
  239. <strong><span class="proto_prefix">gui</span>.paint (g)</strong>
  240. </dt>
  241. <dd>
  242. Override to paint a custom GUI.
  243. Define this function to paint something in the custom GUI space.
  244. </ul>
  245. <h3>Parameters:</h3>
  246. <ul>
  247. <li><span class="parameter">g</span>
  248. <span class="types"><a class="type" href="../classes/juce.Graphics.html#">juce.Graphics</a></span>
  249. a JUCE graphics target
  250. </li>
  251. </ul>
  252. </dd>
  253. <dt>
  254. <a name = "getComponent"></a>
  255. <strong><span class="proto_prefix">gui</span>.getComponent ()</strong>
  256. </dt>
  257. <dd>
  258. Get GUI Component.
  259. </ul>
  260. <h3>Returns:</h3>
  261. <ol>
  262. the current GUI component, or <code>nil</code> if the GUI
  263. has not been opened yet.
  264. </ol>
  265. </dd>
  266. </dl>
  267. <h2><a name="Tables"></a>Tables</h2>
  268. <dl class="function">
  269. <dt>
  270. <a name = "FocusCause"></a>
  271. <strong><span class="proto_prefix">gui</span>.FocusCause</strong>
  272. </dt>
  273. <dd>
  274. Focus change causes.
  275. Values received by the <code>focusGained</code> and <code>focusLost</code> handlers.
  276. </ul>
  277. <h3>Fields:</h3>
  278. <ul>
  279. <li><span class="parameter">focusChangedByMouseClick</span>
  280. 0
  281. </li>
  282. <li><span class="parameter">focusChangedByTabKey</span>
  283. 1
  284. </li>
  285. <li><span class="parameter">focusChangedDirectly</span>
  286. 2
  287. </li>
  288. </ul>
  289. <h3>See also:</h3>
  290. <ul>
  291. <a href="../modules/gui.html#addHandler">gui.addHandler</a>
  292. </ul>
  293. </dd>
  294. <dt>
  295. <a name = "ModifierKeys"></a>
  296. <strong><span class="proto_prefix">gui</span>.ModifierKeys</strong>
  297. </dt>
  298. <dd>
  299. Keyboard and mouse modifiers.
  300. Contained in every <a href="../modules/gui.html#gui.MouseEvent">gui.MouseEvent</a> and received by the
  301. <code>modifierKeysChanged</code> handler.
  302. </ul>
  303. <h3>Fields:</h3>
  304. <ul>
  305. <li><span class="parameter">noModifiers</span>
  306. 0
  307. </li>
  308. <li><span class="parameter">shiftModifier</span>
  309. 1
  310. </li>
  311. <li><span class="parameter">ctrlModifier</span>
  312. 2
  313. </li>
  314. <li><span class="parameter">altModifier</span>
  315. 4
  316. </li>
  317. <li><span class="parameter">leftButtonModifier</span>
  318. 16
  319. </li>
  320. <li><span class="parameter">rightButtonModifier</span>
  321. 32
  322. </li>
  323. <li><span class="parameter">middleButtonModifier</span>
  324. 64
  325. </li>
  326. <li><span class="parameter">commandModifier</span>
  327. 8
  328. </li>
  329. <li><span class="parameter">ctrlAltCommandModifiers</span>
  330. 14
  331. </li>
  332. </ul>
  333. </dd>
  334. </dl>
  335. <h2><a name="Class_gui_MouseEvent"></a>Class gui.MouseEvent </h2>
  336. A mouse event as received by GUI handlers (see <a href="../modules/gui.html#addHandler">gui.addHandler</a>)
  337. <br><br>
  338. <dl class="function">
  339. <dt>
  340. <a name = "MouseEvent.x"></a>
  341. <strong><span class="proto_prefix">gui.MouseEvent</span>.x</strong>
  342. </dt>
  343. <dd>
  344. X.
  345. </ul>
  346. </dd>
  347. <dt>
  348. <a name = "MouseEvent.y"></a>
  349. <strong><span class="proto_prefix">gui.MouseEvent</span>.y</strong>
  350. </dt>
  351. <dd>
  352. Y.
  353. </ul>
  354. </dd>
  355. <dt>
  356. <a name = "MouseEvent.mods"></a>
  357. <strong><span class="proto_prefix">gui.MouseEvent</span>.mods</strong>
  358. </dt>
  359. <dd>
  360. Modifier keys.
  361. Values defined in <a href="../modules/gui.html#ModifierKeys">gui.ModifierKeys</a>
  362. </ul>
  363. </dd>
  364. <dt>
  365. <a name = "MouseEvent.eventComponent"></a>
  366. <strong><span class="proto_prefix">gui.MouseEvent</span>.eventComponent</strong>
  367. </dt>
  368. <dd>
  369. Event component.
  370. </ul>
  371. </dd>
  372. <dt>
  373. <a name = "MouseEvent.originalComponent"></a>
  374. <strong><span class="proto_prefix">gui.MouseEvent</span>.originalComponent</strong>
  375. </dt>
  376. <dd>
  377. Original component.
  378. </ul>
  379. </dd>
  380. <dt>
  381. <a name = "MouseEvent.eventTime"></a>
  382. <strong><span class="proto_prefix">gui.MouseEvent</span>.eventTime</strong>
  383. </dt>
  384. <dd>
  385. Time.
  386. </ul>
  387. </dd>
  388. <dt>
  389. <a name = "MouseEvent.mouseDownTime"></a>
  390. <strong><span class="proto_prefix">gui.MouseEvent</span>.mouseDownTime</strong>
  391. </dt>
  392. <dd>
  393. Mouse down time.
  394. </ul>
  395. </dd>
  396. <dt>
  397. <a name = "MouseEvent.mouseDownPos"></a>
  398. <strong><span class="proto_prefix">gui.MouseEvent</span>.mouseDownPos</strong>
  399. </dt>
  400. <dd>
  401. Mouse down position.
  402. </ul>
  403. </dd>
  404. <dt>
  405. <a name = "MouseEvent.numberOfClicks"></a>
  406. <strong><span class="proto_prefix">gui.MouseEvent</span>.numberOfClicks</strong>
  407. </dt>
  408. <dd>
  409. Number of clicks.
  410. </ul>
  411. </dd>
  412. <dt>
  413. <a name = "MouseEvent.wasMovedSinceMouseDown"></a>
  414. <strong><span class="proto_prefix">gui.MouseEvent</span>.wasMovedSinceMouseDown</strong>
  415. </dt>
  416. <dd>
  417. Was moved since mouse down.
  418. </ul>
  419. </dd>
  420. </dl>
  421. <h2><a name="Class_gui_MouseWheelDetails"></a>Class gui.MouseWheelDetails </h2>
  422. As received by the <code>mouseWheelMove</code> handler (see <a href="../modules/gui.html#addHandler">gui.addHandler</a>)
  423. <br><br>
  424. <dl class="function">
  425. <dt>
  426. <a name = "MouseWheelDetails.deltaX"></a>
  427. <strong><span class="proto_prefix">gui.MouseWheelDetails</span>.deltaX</strong>
  428. </dt>
  429. <dd>
  430. X delta.
  431. </ul>
  432. </dd>
  433. <dt>
  434. <a name = "MouseWheelDetails.deltaY"></a>
  435. <strong><span class="proto_prefix">gui.MouseWheelDetails</span>.deltaY</strong>
  436. </dt>
  437. <dd>
  438. Y delta.
  439. </ul>
  440. </dd>
  441. <dt>
  442. <a name = "MouseWheelDetails.isReversed"></a>
  443. <strong><span class="proto_prefix">gui.MouseWheelDetails</span>.isReversed</strong>
  444. </dt>
  445. <dd>
  446. Is reversed.
  447. </ul>
  448. </dd>
  449. <dt>
  450. <a name = "MouseWheelDetails.isSmooth"></a>
  451. <strong><span class="proto_prefix">gui.MouseWheelDetails</span>.isSmooth</strong>
  452. </dt>
  453. <dd>
  454. Is smooth.
  455. </ul>
  456. </dd>
  457. </dl>
  458. <h2><a name="Class_gui_KeyPress"></a>Class gui.KeyPress </h2>
  459. As received by the <code>keyPressed</code> and <code>keyStateChanged</code> handlers (see <a href="../modules/gui.html#addHandler">gui.addHandler</a>)
  460. <br><br>
  461. <dl class="function">
  462. <dt>
  463. <a name = "KeyPress.keyCode"></a>
  464. <strong><span class="proto_prefix">gui.KeyPress</span>.keyCode</strong>
  465. </dt>
  466. <dd>
  467. Key code.
  468. (undecipherable for now)
  469. </ul>
  470. </dd>
  471. <dt>
  472. <a name = "KeyPress.mods"></a>
  473. <strong><span class="proto_prefix">gui.KeyPress</span>.mods</strong>
  474. </dt>
  475. <dd>
  476. Modifier Keys.
  477. </ul>
  478. </dd>
  479. <dt>
  480. <a name = "KeyPress.textCharacter"></a>
  481. <strong><span class="proto_prefix">gui.KeyPress</span>.textCharacter</strong>
  482. </dt>
  483. <dd>
  484. Text character.
  485. </ul>
  486. </dd>
  487. </dl>
  488. </div> <!-- id="content" -->
  489. </div> <!-- id="main" -->
  490. <div id="about">
  491. <i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.4.2</a></i>
  492. </div> <!-- id="about" -->
  493. </div> <!-- id="container" -->
  494. </body>
  495. </html>