diff --git a/app/assets/fonts b/app/assets/fonts new file mode 120000 index 00000000..db461b94 --- /dev/null +++ b/app/assets/fonts @@ -0,0 +1 @@ +../../resources/fonts \ No newline at end of file diff --git a/resources/docs/docs.md b/resources/docs/docs.md deleted file mode 120000 index 2539e41e..00000000 --- a/resources/docs/docs.md +++ /dev/null @@ -1 +0,0 @@ -docs/getting-started.md \ No newline at end of file diff --git a/resources/docs/docs/url-options.md b/resources/docs/docs/client-options.md similarity index 58% rename from resources/docs/docs/url-options.md rename to resources/docs/docs/client-options.md index 7dcae063..5cd7a07b 100644 --- a/resources/docs/docs/url-options.md +++ b/resources/docs/docs/client-options.md @@ -1,6 +1,4 @@ -# URL Options - -Client specific options can be set by adding query parameters to the server's url. One must prepend the url with a question mark (`?`) followed by `parameter=value` pairs separated with ampersands (`&`). +Client options can be set either with the server's `--client-options` option, or per client by adding query parameters to the server's url. One must prepend the url with a question mark (`?`) followed by `parameter=value` pairs separated with ampersands (`&`). | Option | Value | Default | Description | @@ -15,9 +13,3 @@ Client specific options can be set by adding query parameters to the server's ur Example: `http://server-ip:port?hdpi=1` - - -!!! note "" - When using the built-in client, url options can be set through the `--url-options` switch. - - Example: `open-stage-control --url-options zoom=2 doubletap=200` diff --git a/resources/docs/docs/credits.md b/resources/docs/docs/credits.md index f19ae400..2661279c 100644 --- a/resources/docs/docs/credits.md +++ b/resources/docs/docs/credits.md @@ -5,8 +5,36 @@ This program is a free software released under the [GNU/GPL3](https://github.com ## Dependencies -Open Stage Control relies on several other free softwares, including [Node.js](https://nodejs.org/), [Electron](http://electron.atom.io/), [osc.js](https://github.com/colinbdclark/osc.js), [babel](http://babeljs.io/), [browserify](http://browserify.org), [exorcist](https://github.com/thlorenz/exorcist), [express](http://expressjs.com), [node-sass](https://github.com/sass/node-sass), [jQuery](http://jquery.com/), [jQuery-UI](http://jqueryui.com/), [Font Awesome](http://fontawesome.io/), [stacktracejs](http://stacktracejs.com), [mathjs](http://mathjs.org/). A comprehensive and up-to-date list can be found [here](https://github.com/jean-emmanuel/open-stage-control/network/dependencies). +Open Stage Control relies on several other free softwares: + +https://github.com/jean-emmanuel/open-stage-control/network/dependencies ## Contributors https://github.com/jean-emmanuel/open-stage-control/graphs/contributors + +## Infrastructure supports + +---- + + + +AMMD hosts this website and made this project possible by funding its first 2 years of development. + +---- + + + +Discourse provides the community forum. + +---- + + + +BrowserStack provides remote browsers for debbuging. diff --git a/resources/docs/docs/custom-module.md b/resources/docs/docs/custom-module/custom-module.md similarity index 77% rename from resources/docs/docs/custom-module.md rename to resources/docs/docs/custom-module/custom-module.md index 4e4b00c5..7a0a397d 100644 --- a/resources/docs/docs/custom-module.md +++ b/resources/docs/docs/custom-module/custom-module.md @@ -50,9 +50,13 @@ module.exports = { The module is executed in a restricted context, only a few globals are available : +---- + #### `app`: [`Event Emitter`](https://nodejs.org/api/events.html#events_class_eventemitter) Useful for monitoring the events sent by the different clients. Event names can be found in [callbacks.js](https://github.com/jean-emmanuel/open-stage-control/blob/master/src/server/callbacks.js), callbacks are called with 2 arguments: `data` (object) and `client` (object: `{address, id}`) +---- + #### `receive`: `function(host, port, address, ...args, options)` Send osc/midi message to connected clients. `host` and `port` can be specified to simulate a specific origin for the message. @@ -61,29 +65,40 @@ Send osc/midi message to connected clients. `host` and `port` can be specified t - `port` (optional): `integer` port number or `string` midi device name - `address`: osc address - `args`: value or `{type: "OSC_TYPE_LETTER", value: VALUE}` `object` -- `options` (optional): set to `{clientId: id}` to define which client receives the message (where `id` is the client's id as retreived from `app` events or `oscOutFilter`) +- `options` (optional): set to `{clientId: id}` to define which client receives the message (where `id` is the client's id as retreived from `app` events or `oscOutFilter`) + +---- #### `send`: `function(host, port, address, ...args)` Send osc/midi to a target. +---- #### `settings.read`: `function(name)` Returns specified server option. `name` must be the option's long name without the leading dashes (ie: `"send"`, not `"s"`) +---- + #### `options`: `array` Contains the extra options passed to `--custom-module` after the filename +---- + #### `loadJSON`: `function(path)` Loads a json file (path is relative to the custom module location) +---- + #### `saveJSON`: `function(path, object)` Saves an object/array to a json file (path is relative to the custom module location) +---- + #### Other javascript globals - `console` - `setTimeout` @@ -91,34 +106,4 @@ Saves an object/array to a json file (path is relative to the custom module loca - `setInterval` - `clearInterval` -## Managing big modules - -Custom modules don't let you use node's `require` function at runtime, but you can manage your sources in multiple files and bundle them into a single file before loading it in Open Stage Control. - -The common pattern for this is using the [browserify](http://browserify.org/) library: - -**1**. define some variable in `number.js` - -```javascript -module.exports = 42 -``` - -**2**. retreive it in your main module file (`main.js`): - -```javascript -var num = require('./number.js') - -module.exports = { - init: function(){ - console.log(num) // 42 - }, - oscInFilter: function(data){ - // etc - } -} -``` - - -**3**. bundle your sources into `custom-module.js`: - -`browserify main.js -o custom-module.js --standalone module.exports` +---- diff --git a/resources/docs/docs/custom-module/examples.md b/resources/docs/docs/custom-module/examples.md new file mode 100644 index 00000000..cb3acefc --- /dev/null +++ b/resources/docs/docs/custom-module/examples.md @@ -0,0 +1 @@ +!!! warning "Incomplete documentation" diff --git a/resources/docs/docs/custom-module/managing-big-modules.md b/resources/docs/docs/custom-module/managing-big-modules.md new file mode 100644 index 00000000..b9097065 --- /dev/null +++ b/resources/docs/docs/custom-module/managing-big-modules.md @@ -0,0 +1,29 @@ +Custom modules don't let you use node's `require` function at runtime, but you can manage your sources in multiple files and bundle them into a single file before loading it in OSC. + +The common pattern for this is using the [browserify](http://browserify.org/) library: + +**1**. define some variable in `number.js` + +```javascript +module.exports = 42 +``` + +**2**. retreive it in your main module file (`main.js`): + +```javascript +var num = require('./number.js') + +module.exports = { + init: function(){ + console.log(num) // 42 + }, + oscInFilter: function(data){ + // etc + } +} +``` + + +**3**. bundle your sources into `custom-module.js`: + +`browserify main.js -o custom-module.js --standalone module.exports` diff --git a/resources/docs/docs/css-tips.md b/resources/docs/docs/customization/css-tips.md similarity index 98% rename from resources/docs/docs/css-tips.md rename to resources/docs/docs/customization/css-tips.md index a06d9c52..ebd93d37 100644 --- a/resources/docs/docs/css-tips.md +++ b/resources/docs/docs/customization/css-tips.md @@ -31,7 +31,7 @@ CSS selectors can be used to apply styles to specific elements: ``` -!!! warning "" +!!! info "" Mixing Inline and Selector syntaxes doesn't work, once you use selectors, you have to use the `:host` selector to target the widget element. ## Extra css classes: `class` @@ -39,7 +39,7 @@ CSS selectors can be used to apply styles to specific elements: This non-standard css property can be used to add custom css classes to the widget element: `class: my-custom-class;` Multiple classes can be added (one per `class` statement). Custom classes are always added to the widget's root element, css selectors are ignored. -!!! warning "" +!!! info "" Using class names that are already used in the app can be hazardous. In order to avoid that, custom class names should be prefixed with something uncommon and preferably cool, such as `xxx-myclass` or `crispy-seitan-myclass`. ## Layering: `z-index` @@ -50,7 +50,7 @@ Z-Axis ordering can be set using the `z-index` rule. Absolutely positionned widg To make a widget ignore interactions (ie to be able to click through it), add `pointer-events:none;`. -!!! note "" +!!! info "" This is always ignored when the editor is enabled. ## Responsive sizing diff --git a/resources/docs/docs/theming.md b/resources/docs/docs/customization/themes.md similarity index 71% rename from resources/docs/docs/theming.md rename to resources/docs/docs/customization/themes.md index 6f47c976..01dc5840 100644 --- a/resources/docs/docs/theming.md +++ b/resources/docs/docs/customization/themes.md @@ -5,14 +5,6 @@ Themes can be loaded with the `--theme` option. Multiple themes can be combined. Available themes (full color scheme): - `orange`: grey and orange theme -- `light`: light and blue -- `dark`: blue night theme - -Available extensions (alternative visual settings) - -- `flat`: remove 3d effects -- `alt-buttons`: colorful active buttons -- `responsive-fonts`: bigger texts for bigger screens ## Creating a custom theme @@ -20,7 +12,7 @@ Creating a custom theme is as simple as writing a tiny css file that will overri ```css :root { - --color-accent:red; + --color-accent: red; } ``` @@ -28,15 +20,15 @@ This will change the default accent color to red. Variables can also be overridd ```css .panel-container { - --color-text:blue; + --color-accent: blue; } ``` -This will change the default text color to blue for all elements in panel widgets. +This will change the default accent color to blue for all elements in panel widgets. ## Scss / autoreload -When running the app [from sources](/docs/getting-started), custom themes can be written in scss: +When running the app from sources, custom themes can be written in scss: - the scss file must be located in `src/browser/scss/themes/` - run `npm run watch-css` diff --git a/resources/docs/docs/examples.md b/resources/docs/docs/examples.md deleted file mode 100644 index 50e5f5b8..00000000 --- a/resources/docs/docs/examples.md +++ /dev/null @@ -1,46 +0,0 @@ -# Community examples - -Feel free to submit your own by [opening an issue](https://github.com/jean-emmanuel/open-stage-control/issues/new?title=[example]) on github. - -## Ardour - -[Ardour Control](https://github.com/jean-emmanuel/ardour-control) - -![](https://user-images.githubusercontent.com/5261671/30510969-39451104-9acf-11e7-8ee0-6e93fa34464d.png) - -## Reaper - -[Reaper OSC Panels](https://github.com/ThrashJazzAssassin/REAPER-OSC-panels) - -![](https://raw.githubusercontent.com/ThrashJazzAssassin/REAPER-OSC-panels/master/ReaperOSCtja0.1.7-1.PNG) - -## QLab - -[QLab Cook Book / Open Stage Control](https://qlabcookbook.com/tag/open-stage-control/) - -![](https://user-images.githubusercontent.com/36141834/37744217-be4b5f7e-2d65-11e8-9b83-64ca245417d4.jpg) - -## Bitwig - -[Open Stage Control Bitwig](https://github.com/kdejaeger/open-stage-control-bitwig) - -![](https://raw.githubusercontent.com/kdejaeger/open-stage-control-bitwig/master/img/mixer_nexus_9.png) - - -[OpenStageControl4Bitwig](http://www.mossgrabers.de/Software/Bitwig/Bitwig.html) - -- https://www.youtube.com/watch?v=u-fgArpsHQQ -- https://www.youtube.com/watch?v=RvEMlo72ynQ - - -## Cubase - -[Manaberry's UI](https://vi-control.net/community/threads/open-stage-control-tutorial-an-alternative-to-lemur-and-touchosc.72643/) - -![](https://user-images.githubusercontent.com/5261671/57039426-dce07780-6c5c-11e9-96ce-1f11b472c704.jpg) - -# Ableton - -[Hiram's AaMakro5oul](https://github.com/hiramegl/AaMakro5oul) (v0.23.0 only) - -![](https://raw.githubusercontent.com/hiramegl/AaMakro5oul/master/AaMakro5oul/doc/images/AaMakro5oul_Mix.jpg) diff --git a/resources/docs/docs/getting-started.md b/resources/docs/docs/getting-started.md deleted file mode 100644 index e3b44f89..00000000 --- a/resources/docs/docs/getting-started.md +++ /dev/null @@ -1,206 +0,0 @@ -# Getting started - -!!! tip "" - Prebuilt binaries for Linux, Windows and OS X can be found on the [release](https://github.com/jean-emmanuel/open-stage-control/releases) page. - -## Supported platforms - -Open Stage Control is a *desktop* server application. It runs on all [platforms supported by Electron](https://electron.atom.io/docs/tutorial/supported-platforms/) or [Node](https://nodejs.org/en/) (in headless mode only, see [Running without Electron](#running-without-electron)). Any device running a compatible browser can connect to the server : - -- Chrome/Chromium version `50` or later (Linux, MacOS, Windows, Android, etc) -- iOS version `9.3` or later - -!!! tip "Android / iOS native app ?" - There is no native mobile application. The server's url can be added to the home screen to launch the interface in fullscreen. - - -## Options - -Below are the available command-line options. Note that when running without any command-line switch (ie from a file browser), a launcher window will spawn to help setting them. - -!!! tip "" - Preferences are stored in the user's home folder in a file named `.open-stage-control` (hidden under Linux / macOS) - -|| Option | Description | -|---||---| -| `-s` | `--send` | default targets for all widgets (ip:port / domain:port / midi:port_name pairs) | -| `-l` | `--load` | session file to load | -| | `--state` | state file to load (osc messages will be sent, unless there are other clients connected) | -| `-b` | `--blank` | load a blank session and start the editor | -| `-c` | `--custom-module` | custom module file to load (custom options can be passed after the filename) | -| `-p` | `--port` | http port of the server (default to 8080) | -| `-o` | `--osc-port` | osc input port (default to --port) | -| | `--tcp-port` | tcp server input port | -| | `--tcp-targets` | tcp servers to connect to (ip:port pairs), does not susbtitute for --send | -| `-m` | `--midi` | midi router settings | -| `-d` | `--debug` | log received osc messages in the console | -| `-n` | `--no-gui` | disable default gui | -| `-g` | `--gui-only` | app server's url. If true, local port (--port) is used | -| `-t` | `--theme` | theme name or path (mutliple values allowed) see [theming](/docs/theming/) | -| `-e` | `--examples` | list examples instead of recent sessions | -| | `--url-options` | [url options](/docs/url-options) (opt=value pairs) | -| |`--disable-vsync` | disable gui's vertical synchronization | -| |`--disable-gpu` | disable hardware acceleration | -| |`--force-gpu` | ignore chrome's gpu blacklist | -| |`--read-only` | disable session editing and session history changes | -| |`--remote-saving` | disable remote session saving for hosts that don\'t match the regular expresion | -| |`--remote-root` | set remote file browsing root folder | -| |`--instance-name` | used to differenciate multiple instances in a zeroconf network | -| |`--fullscreen` | launch in fullscreen mode (only affects the default gui, F11 to exit) | - -Command-line only : - -|| Option | Description | -|---||---| -| `-h` | `--help` | print available options | -| `-v` | `--version` | print version number | -| | `--inspect` | enable node/electron inspector (visit chrome://inspect with chromium to access DevTools) | - -**Examples** - -```bash -open-stage-control --send 127.0.0.1:5555 127.0.0.1:6666 --port 7777 -``` - -This will create an app listening on port 7777 for synchronization messages, and sending its widgets state changes to ports 5555 and 6666. - -```bash -open-stage-control --no-gui --load path/to/session.js --port 9999 -``` - -This will create a headless app available through http on port 9999 with session.js loaded automatically. - -!!! tip "What about HTTPS ?" - Security is out of the app's scope. If you are concerned about safety, using a private - protected - network should be enough. - - -## Run from sources - -Running the app from the sources slightly differs from using built binaries : we'll build and launch the app with npm (node package manager). - -**1. Requirements** - -- [Node.js >= 4.8](https://nodejs.org/en/#download) -- [git](https://git-scm.com/downloads) - -**2. Download sources** - -```bash -git clone https://github.com/jean-emmanuel/open-stage-control -cd open-stage-control/ -# uncomment next line if you want the latest release -# instead of the current development version -# git checkout $(git describe --tags `git rev-list --tags --max-count=1`) -npm install -npm run build -``` - -!!! note "Updating from sources" - ```bash - git pull - npm install - npm run build - ``` - -**3. Run !** - -```bash -npm start [ -- options] -``` - -!!! note "" - A double hyphen (`--`) is used here to tell npm that the options are to be passed to the app. - - -## Build from sources - -**1. Requirements** - -- [Node.js >= 4.8](https://nodejs.org/en/#download) -- [git](https://git-scm.com/downloads) - -**2. Download sources & build package** - -```bash -git clone https://github.com/jean-emmanuel/open-stage-control -cd open-stage-control/ -# uncomment next line if you want the latest release -# instead of the current development version -# git checkout $(git describe --tags `git rev-list --tags --max-count=1`) - -# TARGET_PLATFORM can be linux, win32 (windows) or darwin (os x) -export PLATFORM=TARGET_PLATFORM -# TARGET_ARCH can be ia32, x64, armv7l or arm64 -export ARCH=TARGET_ARCH - - -npm install - -# run this instead if ARCH is armv7l -# npm install --arch=armv7l - - -npm run build - -npm run package - -# Do one of the following if you want a deb package for debian/ubuntu -npm run deb32 -npm run deb64 -npm run debarm -``` - -This will build the app in `dist/open-stage-control-PLATFORM-ARCH`. - -!!! note "" - Building the app for windows from a linux system requires wine to be installed.* - -## Running in a headless context - -Electron, Open Stage Control's engine, is based on chromium and can't run out of the box without a display server. However, using a virtual framebuffer does the trick. Detailed instructions can be found in Electron's [documentation](http://electron.atom.io/docs/tutorial/testing-on-headless-ci/). - -In short: install [xvfb](https://en.wikipedia.org/wiki/Xvfb) and prepend your command with `xvfb-run`: - -```bash -xvfb-run open-stage-control -n -``` - -## Running without Electron - -It is possible to run the server in headless mode without Electron using [node](https://nodejs.org/en/download/package-manager/) (v6 or higher) : - -```bash -node /path/to/packaged/open-stage-control/resources/app/ -n -node /path/to/sources/open-stage-control/app/ -n -``` - -Or using the precompilled binaries for node: - -```bash -node /path/to/packaged/open-stage-control-node/ -n -``` - -To build the app for node only from sources: - -```bash - -# git clone, etc... - -npm install - -npm run build - -npm run package-node - -``` - -## Running in a terminal on Windows - -Windows users launching the app from a terminal need to add a double dash (`--`) before their options: - -```bash -open-stage-control.exe -- --port 5555 [...] - -# when running from sources -npm start -- -- [options] -``` diff --git a/resources/docs/docs/getting-started/running-from-sources.md b/resources/docs/docs/getting-started/running-from-sources.md new file mode 100644 index 00000000..62ddfb23 --- /dev/null +++ b/resources/docs/docs/getting-started/running-from-sources.md @@ -0,0 +1,79 @@ +## Requirements + +- [Node.js](https://nodejs.org/en/#download) +- [git](https://git-scm.com/downloads) + + +## Run from sources + +Running the app from the sources slightly differs from using built binaries : we'll build and launch the app with npm (node package manager). + +**2. Download sources** + +```bash +git clone https://github.com/jean-emmanuel/open-stage-control +cd open-stage-control/ +# uncomment next line if you want the latest release +# instead of the current development version +# git checkout $(git describe --tags `git rev-list --tags --max-count=1`) +npm install +npm run build +``` + +!!! info "Updating from sources" + ```bash + git pull + npm install + npm run build + ``` + +**3. Run !** + +```bash +npm start [ -- options] +``` + +!!! info "" + A double hyphen (`--`) is used here to tell npm that the options are to be passed to the app. + + +## Package from sources + +```bash +git clone https://github.com/jean-emmanuel/open-stage-control +cd open-stage-control/ +# uncomment next line if you want the latest release +# instead of the current development version +# git checkout $(git describe --tags `git rev-list --tags --max-count=1`) + +# TARGET_PLATFORM can be linux, win32 (windows) or darwin (os x) +export PLATFORM=TARGET_PLATFORM +# TARGET_ARCH can be ia32, x64, armv7l or arm64 +export ARCH=TARGET_ARCH + + +npm install + +# run this instead if ARCH is armv7l +# npm install --arch=armv7l + + +npm run build + +npm run package + +# Do one of the following if you want a deb package for debian/ubuntu +npm run deb32 +npm run deb64 +npm run debarm + + +# The node-only package can be built with +npm run package-node + +``` + +This will build the app in `dist/open-stage-control-PLATFORM-ARCH`. + +!!! info "" + Building the app for windows from a linux system requires wine to be installed. diff --git a/resources/docs/docs/getting-started/running-with-node.md b/resources/docs/docs/getting-started/running-with-node.md new file mode 100644 index 00000000..0ad4098f --- /dev/null +++ b/resources/docs/docs/getting-started/running-with-node.md @@ -0,0 +1,13 @@ +It is possible to run the server in headless mode using [Node.js](https://nodejs.org/en/download/package-manager/). This allows running OSC on systems that + + +1. Install [Node.js](https://nodejs.org/en/download/package-manager/) +2. Download `open-stage-control-[version]-node.zip` package and extract it +3. Run `node /path/to/open-stage-control` + + +!!! info + When running from sources or with regular binaries (packaged with electron), the command slightly differs: + + - electron package: `node /path/to/open-stage-control/resources/app` + - from sources: `node /path/to/open-stage-control/app` diff --git a/resources/docs/docs/getting-started/server-setup.md b/resources/docs/docs/getting-started/server-setup.md new file mode 100644 index 00000000..143930ef --- /dev/null +++ b/resources/docs/docs/getting-started/server-setup.md @@ -0,0 +1,50 @@ +# Server options + +Below are the available command-line options. Note that when running without any command-line switch (ie from a file browser), a launcher window will spawn to help setting them. + +
+| Option | Description | +|---|---| +| --send | default targets for all widgets (ip: port / domain: port / midi: port_name pairs) | +| --load | session file to load | +| --state | state file to load | +| --custom-module | custom module file to load (custom options can be passed after the filename) | +| --port | http port of the server (default to 8080) | +| --osc-port | osc input port (default to --port) | +| --tcp-port | tcp server input port | +| --tcp-targets | tcp servers to connect to (ip: port pairs), does not susbtitute for --send | +| --midi | midi router settings | +| --debug | log received osc messages in the console | +| --no-gui | disable default gui | +| --theme | theme name or path (mutliple values allowed) | +| --client-options | client options (opt=value pairs) | +| --disable-vsync | disable gui's vertical synchronization | +| --force-gpu | ignore chrome's gpu blacklist | +| --read-only | disable session editing and session history changes | +| --remote-saving | disable remote session saving for hosts that don't match the regular expresion | +| --remote-root | set remote file browsing root folder | +| --instance-name | used to differenciate multiple instances in a zeroconf network | +| --fullscreen | launch in fullscreen mode (only affects the default client gui) | + +The following options can only be set when running the app from a terminal: + +
+| Option | Description | +|---|---| +| --disable-gpu | disable hardware acceleration | +| --inspect | enable node/electron inspector | +| --cache-dir | override default cache directory | +| --config-file | override default config file (defaults to cache-dir/config.json) | +| --help | Show help | +| --version | Show version number | + +## Running in a terminal on Windows + +Windows users launching the app from a terminal need to add a double dash (`--`) before their options: + +```bash +open-stage-control.exe -- --port 5555 [...] + +# when running from sources +npm start -- -- [options] +``` diff --git a/resources/docs/docs/getting-started/supported-platforms.md b/resources/docs/docs/getting-started/supported-platforms.md new file mode 100644 index 00000000..f637ceb6 --- /dev/null +++ b/resources/docs/docs/getting-started/supported-platforms.md @@ -0,0 +1,9 @@ +# Supported platforms + +Open Stage Control is a *desktop* server application. It runs on all [platforms supported by Electron](https://electron.atom.io/docs/tutorial/supported-platforms/) or [Node](https://nodejs.org/en/) (in headless mode only, see [Running with Node](./running-with-node.md)). Any device running a compatible browser can connect to the server : + +- Chrome/Chromium version `60` or later (Linux, MacOS, Windows, Android, etc) +- iOS version `10.3` or later + +!!! info "Android / iOS app ?" + There is no native mobile application. The server's url can be added to the home screen to launch the interface in fullscreen. diff --git a/resources/docs/docs/interface.md b/resources/docs/docs/interface.md deleted file mode 100644 index a555209a..00000000 --- a/resources/docs/docs/interface.md +++ /dev/null @@ -1,45 +0,0 @@ -# User interface - -The interface is made of two main components: the widgets and the sidepanel. - -## Widgets - -All widgets are contained in the `root` widget, a special `panel` widget that can only contain tabs. - -### Interacting with widgets - -| Mouse | Touch | Description | -|---|---|---| -| Click | Tap | Handled at pressing time, not releasing. | -| Double Click | Double Tap | Some widgets handle double click / tap events. | -| Drag | Drag | The widgets respond to mouse and touch drag gestures with a 1:1 precision ratio. | -| `Ctrl` + Drag | | Holding the `Ctrl` key while dragging with the mouse increases the gesture's precision by 10.| -| | Two-fingers drag (single target) | Using two fingers on a single-touch target increases the gesture's precision by 10. | - - -## Sidepanel - -The sidepanel can be opened by clicking the navigation icon in the upper right corner or by pressing `F10`. - -### State management - -- Store: save the state of all widgets in the temporary slot -- Recall: reload saved state from the temporary slot -- Send All: make all widgets send their current value -- Save / Save As: save the state of all widgets to a `.state` file on the server -- Load: load a state from a `.state` file on the server -- Export: save to local filesystem -- Import: load from local filesystem - -### Traversing gestures - -By default, a dragging gesture can only affect the widget it started on. Enabling traversing gesture does two things: - -- make gestures affect every widgets no matter where they started -- make sliders-like widgets respond as if their `snap` option is enabled - -When traversing gestures are set to `auto`, these will only affect widgets that have the same type as the first touched widget. - -### Editor - -See [Editing sessions](/docs/editing-sessions.md). diff --git a/resources/docs/docs/midi.md b/resources/docs/docs/midi/midi-messages.md similarity index 51% rename from resources/docs/docs/midi.md rename to resources/docs/docs/midi/midi-messages.md index 1cd9647e..35a3008c 100644 --- a/resources/docs/docs/midi.md +++ b/resources/docs/docs/midi/midi-messages.md @@ -1,49 +1,7 @@ -## Requirements - -MIDI support requires additional software to be installed on the server's system: - -- python (2 or 3) -- python package [python-rtmidi](https://spotlightkid.github.io/python-rtmidi/installation.html) - -To install `python-rtmidi`, run `pip install python-rtmidi` (python 2) in a terminal or `pip3 install python-rtmidi` (python 3). - -!!! note "Why an additionnal dependency ?" - Providing cross-platform MIDI support is not trivial, as it requires OS-specific compilation that cannot be automated within Open Stage Control's current packaging workflow. Using a python addon seems to be the best compromise so far : the core app remains easy to build, and the extra dependency is easy to install. - -## Setup - -When running the app, the `-m / --midi` switch must be set; it accepts the following options (separated by spaces): - -- `list`: prints the available MIDI ports to the console; numbers in the first column may be used for `input`/`output` definition below -- `device_name:input,output`: connect to midi ports `input` and `output`; osc messages sent to target `midi:device_name` will be processed as midi events; Multiple devices can be declared. If the `device_name` contains white spaces, the declaration must be enquoted (ie `"spaced name:input,output"`). `device_name` doesn't need to match the actual midi device name, it is just an identifier (see [Widget settings](#widget-settings)). -- `sysex`: parse incomming system exclusive messages (disabled by default) -- `pc_offset`: send program changes with a `-1` offset to match some software/hardware implementations -- `path=/path/to/python`: indicates where to find python or python3 binary in case open stage control doesn't (`Error: spawn python3 ENOENT`) - -*Linux only:* - -- `device_name:virtual`: creates a virtual midi device with one input port and one output port -- `jack`: use JACK MIDI instead of ALSA (add as extra parameter). `rtmidi` must be compiled with `--jack-midi` flag for this to work. - -!!! tip - When using the launcher window, midi devices can be listed by right-clicking and choosing `Midi > List Devices` - -## Widget settings - -In order to send MIDI messages, a widget must have at least one `target` formatted as follows: - -`midi:device_name` (where `device_name` is one of the declared midi devices) - -!!! warning - Messages received from a MIDI port only affect widgets that send to this port. - - -## Supported MIDI messages - -!!! warning "" +!!! info "" Define static argument values using the [`preArgs`](/docs/widgets-reference/#preArgs) option in order to complete the respective MIDI message. - +---- #### `/note channel note velocity` @@ -63,6 +21,8 @@ A push button might be configured as follows in order to send a MIDI note whose - `off`: 0 (to send a noteOff on button release) - `target`: ["midi:device_name"] (where device_name is one of the declared midi devices defined during [setup](#setup)) +---- + #### `/control channel cc value` Control change event. @@ -80,6 +40,8 @@ A fader might be configured as follows in order to send a MIDI control message ( - `range`: {"min": 0, "max": 127} (MIDI values are encoded in this range) - `target`: ["midi:device_name"] +---- + #### `/program channel program` Program change event. @@ -87,9 +49,11 @@ Program change event. - `channel`: integer between 1 and 16 - `program`: integer between 0 and 127* -!!! note +!!! info \* Some devices / softwares display the `program` value between 1 and 128, thus interpreting `program change 0` as `program change 1` and so on. Enable the `pc_offset` option to make Open Stage Control behave this way. +---- + #### `/pitch channel pitch` PitchWheel event. @@ -97,6 +61,8 @@ PitchWheel event. - `channel`: integer between 1 and 16 - `pitch`: integer between 0 and 16383 +---- + #### `/sysex msg v1 .. vN` System exclusive message. @@ -105,3 +71,5 @@ System exclusive message. - `v1, .., vN`: values encoded as hexadecimal data strings to include in `msg`. Most probably, you will need to sepcify a [custom module](/docs/custom-module/) in order to convert numeric widget values into the required hexadecimal format. In general, this conversion will be different for each manufacturer / device. For a very simple example, refer to session 'sysex.json' found in the application's sub folder 'resources/app/examples/'. Please remember to adjust the button's `target` to the `device_name` used in your MIDI setup. + +---- diff --git a/resources/docs/docs/midi/midi-setup.md b/resources/docs/docs/midi/midi-setup.md new file mode 100644 index 00000000..9e0f427a --- /dev/null +++ b/resources/docs/docs/midi/midi-setup.md @@ -0,0 +1,36 @@ +## Requirements + +MIDI support requires additional software to be installed on the server's system: + +- python (2 or 3) +- python package [python-rtmidi](https://spotlightkid.github.io/python-rtmidi/installation.html) + +To install `python-rtmidi`, run `pip install python-rtmidi` (python 2) in a terminal or `pip3 install python-rtmidi` (python 3). + +!!! info "Why an additionnal dependency ?" + Providing cross-platform MIDI support is not trivial, as it requires OS-specific compilation that cannot be automated within Open Stage Control's current packaging workflow. Using a python addon seems to be the best compromise so far : the core app remains easy to build, and the extra dependency is easy to install. + +## Setup + +When running the app, the `-m / --midi` switch must be set; it accepts the following options (separated by spaces): + +- `list`: prints the available MIDI ports to the console; numbers in the first column may be used for `input`/`output` definition below +- `device_name:input,output`: connect to midi ports `input` and `output`; osc messages sent to target `midi:device_name` will be processed as midi events; Multiple devices can be declared. If the `device_name` contains white spaces, the declaration must be enquoted (ie `"spaced name:input,output"`). `device_name` doesn't need to match the actual midi device name, it is just an identifier (see [Widget settings](#widget-settings)). +- `sysex`: parse incomming system exclusive messages (disabled by default) +- `pc_offset`: send program changes with a `-1` offset to match some software/hardware implementations +- `path=/path/to/python`: indicates where to find python or python3 binary in case open stage control doesn't (`Error: spawn python3 ENOENT`) + +*Linux only:* + +- `device_name:virtual`: creates a virtual midi device with one input port and one output port +- `jack`: use JACK MIDI instead of ALSA (add as extra parameter). `rtmidi` must be compiled with `--jack-midi` flag for this to work. + + +## Widget setup + +In order to send MIDI messages, a widget must have at least one `target` formatted as follows: + +`midi:device_name` (where `device_name` is one of the declared midi devices) + +!!! warning + Messages received from a MIDI port only affect widgets that send to this port. diff --git a/resources/docs/docs/remote-control.md b/resources/docs/docs/remote-control.md index f936615f..553b09a7 100644 --- a/resources/docs/docs/remote-control.md +++ b/resources/docs/docs/remote-control.md @@ -3,7 +3,7 @@ All widgets that send osc messages respond to the same messages. Additionnaly, Open Stage Control responds to some general osc commands. -## `/EDIT id options` +#### `/EDIT id options` Apply a set of options to an existing widget by replacing the old ones with the new ones. @@ -13,10 +13,10 @@ Apply a set of options to an existing widget by replacing the old ones with the - `options`: `string`, [JSON5](https://github.com/json5/json5) stringified object defining the new properties to merge - example: `{"label":"New Label", "color":"red"}` -!!! warning "" +!!! info "" Editing a widget can be cpu expensive, hence updating the UI continuously is not a good idea -## `/EDIT/MERGE id options` +#### `/EDIT/MERGE id options` Apply a set of options to an existing widget by merging them to the widget's options. @@ -25,18 +25,18 @@ Apply a set of options to an existing widget by merging them to the widget's opt - `options`: `string`, [JSON5](https://github.com/json5/json5) stringified object defining the new properties to merge - example: `{"label":"New Label", "color":"red"}` -!!! warning "" +!!! info "" Editing a widget can be cpu expensive, hence updating the UI continuously is not a good idea -## `/EDIT/UNDO` +#### `/EDIT/UNDO` Undo editing action -## `/EDIT/REDO` +#### `/EDIT/REDO` Redo editing action -## `/EDIT/GET target id` +#### `/EDIT/GET target id` Sends back a widget's data (JSON stringified object), including its children, to specified target. @@ -48,7 +48,7 @@ Replies `/EDIT/GET id data` - `id`: `string` - `data`: `string` -## `/EDIT/GET target address preArg1 preArg2 ...` +#### `/EDIT/GET target address preArg1 preArg2 ...` Sends back a widget's data (JSON stringified object), including its children, to specified target. @@ -63,7 +63,7 @@ Replies `/EDIT/GET address preArg1 preArg2 ... data` - `data`: `string` -## `/GET target id` +#### `/GET target id` Sends back a widget's value to specified target. @@ -75,7 +75,7 @@ Replies `/GET id value` - `id`: `string` - `value`: `*` -## `/GET target address preArg1 preArg2 ...` +#### `/GET target address preArg1 preArg2 ...` Sends back a widget's value to specified target. @@ -89,18 +89,18 @@ Replies `/GET address preArg1 preArg2 ... value` - `preArg[1...]`: `*`, widget's `preArgs` - `value`: `*` -## `/GET/#` +#### `/GET/#` Same as `/GET` but uses the widget's address instead of `/GET` to reply. -## `/SET target id value` +#### `/SET target id value` Set a widget's value as if it was interacted with from the interface. This is likely to make it send its value. - `id`: `string`, widget's `id` - `value`: `*`, widget's new value -## `/SET address preArg1 preArg2 ... value` +#### `/SET address preArg1 preArg2 ... value` Set a widget's value as if it was interacted with from the interface. This is likely to make it send its value. @@ -109,28 +109,23 @@ Set a widget's value as if it was interacted with from the interface. This is li - `value`: `*`, widget's new value -## `/STATE/GET target` +#### `/STATE/GET target` Sends back the app's state to specified target - `target`: `string`, `ip:port` pair -## `/STATE/SET state` +#### `/STATE/SET state` Set widgets' state - `state`: `string`, json stringified object (`"widget_id": value` pairs) -## `/STATE/STORE` +#### `/STATE/STORE` Save the state of all widgets in the temporary slot. -## `/STATE/RECALL` +#### `/STATE/RECALL` Reload saved state from the temporary slot. - - -## `/TABS id id etc` - -Open the tabs designated by the `id` parameters. diff --git a/resources/docs/docs/editing-sessions.md b/resources/docs/docs/user-interface/editor.md similarity index 55% rename from resources/docs/docs/editing-sessions.md rename to resources/docs/docs/user-interface/editor.md index 2e0e0d31..f0c5cbc0 100644 --- a/resources/docs/docs/editing-sessions.md +++ b/resources/docs/docs/user-interface/editor.md @@ -1,19 +1,13 @@ -# Editing sessions +!!! warning "Incomplete documentation" -The session editor can be enabled from the sidepanel. Once enabled, clicking on a widget will make it the *selected widget*. - -## Root panel - -The root panel can be selected by clicking on the "Root" button in the sidepanel. ## Context menu Right clicking / long touch on a widget or on a tab will also display a context menu providing useful utilities : -- `Edit parent`: select widget's parent for edition +- `Show in tree`: show widget in project tree - `Copy`: copy widget's data - `Cut`: copy widget's data and delete selected widget -- `Wrap in`: wrap the widget in a new container - `Paste`: paste copied widget in selected container - `Paste`: paste the widget as is - `ID + 1` : increments the id of the copied widget (and all its children) before pasting @@ -26,14 +20,13 @@ Right clicking / long touch on a widget or on a tab will also display a context By default, sessions are saved and opened on the server's filesystem. When saving a session opened by mutliple clients, these will reload the session file automatically. -!!! note +!!! info It is possible to limit this feature to specific client addresses by using the server's `--remote-saving` option. For example: - `open-stage-control --remote-saving 127.0.0.1|192.168.0.10` + + `open-stage-control --remote-saving "127.0.0.1|192.168.0.10"` Will disable remote saving except for the clients with ip addresses `127.0.0.1` (the server's local address) and `192.168.0.10`. - - ## Import / Export Sessions can be exported/imported on the device's filesystem, doing so has a few limitations: @@ -55,45 +48,11 @@ Properties are written in JSON, with some flexibility brought by the [JSON5](htt Selected widget can be resized using its south, south-east and east handles. It can be dragged with its north-west handle. Using this feature will convert position and size values to plain number values, thus breaking previously set percent or inherited values. -## Keyboard shortcuts - -The following shortcuts are always available: - -| Shortcut | Description | -|---|---| -| `mod + e` | enable/disable editor | -| `mod + s` | save session | -| `mod + shift s` | export session as... | -| `mod + o` | open a session file | - -The following shortcuts are available only when the editor is enabled: - -| Shortcut | Description | -|---|---| -| `mod + click`* | Multi-widget selection. Widgets can be toggled from selection by clicking on them individually.| -| `shift + click + drag`* | Draw a selection rectangle and attempt to select widgets in it (starts by selecting the widget under the cursor). If `mod` is pressed too, current selection is kept and will be merged with the new one if possible. | -| `f2` | Edit selected widget's label | -| `mod + z` | Undo | -| `mod + y / mod + shift + z` | Redo | -| `delete` (`backspace` on Mac) | Delete selected widgets | -| `mod + c` | Copy selected widgets | -| `mod + x` | Cut selected widgets | -| `mod + v` | Paste clipboard in selected widget | -| `mod + shift + v` | Paste and increment id | -| `up, down, left, right` | Move selected widgets (1 grid unit, hold `shift` for 5 grid units) | -| `alt + [up, down, left, right]` | Resize selected widgets (1 grid unit, hold `shift` for 5 grid units) | -| `mod + a` | Select current widget's siblings and itself | -| `mod + shift + a` | Cancel current widget selection | -| `mod + up` | Select current widget's parent | -| `mod + down` | Select current widget's first child | -| `mod + right` | Select current widget's next sibling | -| `mod + left` | Select current widget's previous sibling | -Where `mod` is `ctrl` except on MacOs (`command`) +!!! info "" + \* *Multi-widgets editing* - -!!! note "* Multi-widgets editing" - selection can only contain sibling widgets (same direct parent) - context-menu actions and properties changes apply to all selected widgets - resizing / dragging will affect all selected widgets, relatively to the first selected widget diff --git a/resources/docs/docs/user-interface/keyboard-shortcuts.md b/resources/docs/docs/user-interface/keyboard-shortcuts.md new file mode 100644 index 00000000..475c259f --- /dev/null +++ b/resources/docs/docs/user-interface/keyboard-shortcuts.md @@ -0,0 +1,38 @@ +!!! info + `mod` refers to the `ctrl` key except on MacOs (`command`) + +## General + +The following shortcuts are always available: + +
+| Shortcut | Description | +|---|---| +| `mod + e` | enable/disable editor | +| `mod + s` | save session | +| `mod + shift s` | save session as... | +| `mod + o` | open a session file | + +## Editor + +The following shortcuts are available only when the editor is enabled: + +| Shortcut | Description | +|---|---| +| `mod + click`* | Multi-widget selection. Widgets can be toggled from selection by clicking on them individually.| +| `shift + click + drag`* | Draw a selection rectangle and attempt to select widgets in it (starts by selecting the widget under the cursor). If `mod` is pressed too, current selection is kept and will be merged with the new one if possible. | +| `mod + z` | Undo | +| `mod + y / mod + shift + z` | Redo | +| `delete` (`backspace` on Mac) | Delete selected widgets | +| `mod + c` | Copy selected widgets | +| `mod + x` | Cut selected widgets | +| `mod + v` | Paste clipboard in selected widget | +| `mod + shift + v` | Paste and increment id | +| `up, down, left, right` | Move selected widgets (1 grid unit, hold `shift` for 5 grid units) | +| `alt + [up, down, left, right]` | Resize selected widgets (1 grid unit, hold `shift` for 5 grid units) | +| `mod + a` | Select current widget's siblings and itself | +| `mod + shift + a` | Cancel current widget selection | +| `mod + up` | Select current widget's parent | +| `mod + down` | Select current widget's first child | +| `mod + right` | Select current widget's next sibling | +| `mod + left` | Select current widget's previous sibling | diff --git a/resources/docs/docs/user-interface/user-interface.md b/resources/docs/docs/user-interface/user-interface.md new file mode 100644 index 00000000..0d75f665 --- /dev/null +++ b/resources/docs/docs/user-interface/user-interface.md @@ -0,0 +1,5 @@ +!!! warning "Incomplete documentation" + +## Layout + +## Menu diff --git a/resources/docs/docs/widgets-reference.md b/resources/docs/docs/widgets-reference.md deleted file mode 100644 index 481cf3f0..00000000 --- a/resources/docs/docs/widgets-reference.md +++ /dev/null @@ -1,832 +0,0 @@ - - -# Widget reference - -
- - -
Properties shared by all widgets
- -| property | type |default | description | -| --- | --- | --- | --- | -|

type#

| `string` | "auto" | | -|

id#

| `string` | "auto" | Widgets sharing the same `id` will act as clones and update each other's value(s) without sending extra osc messages. | -|

linkId#

| `string`|
`array` | "" | Widgets sharing the same `linkId` update each other's value(s) AND send their respective osc messages.

When prefixed with >>, the `linkId` will make the widget act as a master (sending but not receiving)

When prefixed with <<, the `linkId` will make the widget act as a slave (receiving but not sending) | -|

geometry#

|||| -|

left#

| `number`|
`string` | "auto" | When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).

Otherwise, the widget will be absolutely positioned | -|

top#

| `number`|
`percentage` | "auto" | When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).

Otherwise, the widget will be absolutely positioned | -|

width#

| `number`|
`percentage` | "auto" | | -|

height#

| `number`|
`percentage` | "auto" | | -|

style#

|||| -|

label#

| `string`|
`boolean` | "auto" | Set to `false` to hide completely

Insert icons using the prefix ^ followed by the icon's name : ^play, ^pause, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free) | -|

color#

| `string` | "auto" | Defines the widget's accent color (css variable `--custom-color`). Must be a valid CSS color. Set to "auto" to inherit from parent widget. | -|

css#

| `string` | "" | CSS rules. See documentation. | -|

value#

|||| -|

default#

| `*` | "" | If set, the widget will be initialized with this value when the session is loaded. | -|

value#

| `*` | "" | Define the widget's value depending on other widget's values / properties using property inheritance and property maths | -|

osc#

|||| -|

precision#

| `integer`|
`string` | 2 | Defines the number of decimals to display and to send.

Set to `0` to send integers only.

Data type can be specified by appending a valid osc type tag to the precision value, for example : `3d` will make the widget send double precision numbers rounded to three decimals | -|

address#

| `string` | "auto" | OSC address for sending messages, it must start with a / | -|

preArgs#

| `*`|
`array` | "" | A value or array of values that will be prepended to the OSC messages.

Values can be defined as objects if the osc type tag needs to be specified: `{type: "i", value: 1}` | -|

target#

| `string`|
`array`|
`null` | "" | This defines the targets of the widget's OSC messages
- A `string` or `array` of strings formatted as follow: `ip:port` or `["ip:port"]`
- If midi is enabled, targets can be `midi:device_name`
- The special item `"self"` can be used to refer to the emitting client directly.
- If no target is set, messages can still be sent if the server has default targets
- The server's default targets can be bypassed by setting one of the items to `null` | -|

bypass#

| `boolean` | false | Set to `true` to prevent the widget from sending any osc message |
- -## Sliders - - -
- - -
Vertical / horizontal slider.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

style#

|||| -|

css#

| `string` | "" | Available CSS variables:
- `--color-gauge: color;`
- `--color-knob: color;`
- `--color-pips: color;`
- `--gauge-opacity: number;`
- `--gauge-width: number;` (2-16, requires a manual resize to take effect) | -|

fader#

|||| -|

horizontal#

| `boolean` | false | Set to `true` to display the fader horizontally | -|

alignRight#

| `boolean` | false | Set to `true` to invert the pip's and fader's position | -|

pips#

| `boolean` | true | Set to `false` to hide the scale | -|

input#

| `boolean` | true | Set to `false` to hide the built-in input | -|

meter#

| `boolean` | false | Set to true to display a vu-meter next in the fader
- the meter's `id` will be the same as the widget's with `/meter` appended to it
- the meter's `address` will be the same as the widget's with `/meter` appended to it | -|

compact#

| `boolean` | false | Set to `true` to display a compact alternative for the widget. If `input` is `true`, the input can be focused with a right-click (mouse only). Disables `pips` when enabled. | -|

dashed#

| `boolean` | false | Set to `true` to display a dashed gauge | -|

snap#

| `boolean` | false | By default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position | -|

spring#

| `boolean` | false | When set to `true`, the widget will go back to its `default` value when released | -|

doubleTap#

| `boolean` | false | Set to `true` to make the fader reset to its `default` value when receiving a double tap.

Can also be an osc address, in which case the widget will just send an osc message (`/ `) | -|

range#

| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the breakpoints of the fader's scale:
- keys can be percentages and/or `min` / `max`
- values can be `number` or `object` if a custom label is needed

Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`) | -|

logScale#

| `boolean`|
`number` | false | Set to `true` to use logarithmic scale (base 10). Set to a `number` to define the logarithm's base. | -|

sensitivity#

| `number` | 1 | Defines the fader's sensitivity when `snap` is `false` | -|

steps#

| `string`|
`number`|
`array` | "" | Restricts the widget's value:
- `auto`: use values defined in `range`
- `number`: define a number of evenly spaced steps
- `array`: use arbitrary values | -|

unit#

| `string` | "" | Unit will be appended to the displayed widget's value (it doesn't affect osc messages) | -|

origin#

| `number` | "auto" | Defines the starting point's value of the fader's gauge | -|

osc#

|||| -|

touchAddress#

| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1` | -|

meterAddress#

| `string` | "" | OSC address for the built-in meter |
- - - - -
- - -
Rotative knob slider.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

style#

|||| -|

css#

| `string` | "" | Available CSS variables:
- `--color-gauge: color;`
- `--color-knob: color;`
- `--color-pips: color;` | -|

knob#

|||| -|

pips#

| `boolean` | false | Set to `true` to show the scale's breakpoints | -|

input#

| `boolean` | true | Set to `false` to hide the built-in input | -|

compact#

| `boolean` | false | Set to `true` to display a compact alternative for the widget. If `input` is `true`, the input can be focused with a right-click (mouse only). Disables `pips` when enabled. | -|

dashed#

| `boolean` | false | Set to `true` to display a dashed gauge | -|

angle#

| `number` | 270 | Defines the angle's width of the knob, in degrees | -|

snap#

| `boolean` | false | By default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position | -|

spring#

| `boolean` | false | When set to `true`, the widget will go back to its `default` value when released | -|

doubleTap#

| `boolean` | false | Set to `true` to make the knob reset to its `default` value when receiving a double tap.

Can also be an osc address, in which case the widget will just send an osc message (`/ `) | -|

range#

| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the breakpoints of the fader's scale:
- keys can be percentages and/or `min` / `max`
- values can be `number` or `object` if a custom label is needed

Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`) | -|

logScale#

| `boolean`|
`number` | false | Set to `true` to use logarithmic scale (base 10). Set to a `number` to define the logarithm's base. | -|

sensitivity#

| `number` | 1 | Defines the knob's sensitivity when `snap` is `false` | -|

steps#

| `string`|
`number`|
`array` | "" | Restricts the widget's value:
- `auto`: use values defined in `range`
- `number`: define a number of evenly spaced steps
- `array`: use arbitrary values | -|

unit#

| `string` | "" | Unit will be appended to the displayed widget's value (it doesn't affect osc messages) | -|

origin#

| `number` | "auto" | Defines the starting point's value of the knob's gauge | -|

osc#

|||| -|

touchAddress#

| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1` |
- - - - -
- - -
A knob that sends a relative direction infomation instead of an absolute value.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

encoder#

|||| -|

compact#

| `boolean` | false | Set to `true` to display a compact alternative for the widget. | -|

ticks#

| `number` | 360 | defines the granularity / verbosity of the encoder (number of step for a 360° arc) | -|

back#

| `*` | -1 | Defines which value is sent when rotating the encoder anticlockwise | -|

forth#

| `*` | 1 | Defines which value is sent when rotating the encoder clockwise | -|

release#

| `number` | "" | Defines which value is sent when releasing the encoder:
- Set to `null` to send send no argument in the osc message
- Can be an `object` if the type needs to be specified | -|

snap#

| `boolean` | false | By default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position | -|

doubleTap#

| `boolean` | false | Set to `true` to make the fader reset to its `default` value when receiving a double tap.

Can also be an osc address, in which case the widget will just send an osc message (`/ `) | -|

osc#

|||| -|

touchAddress#

| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1` |
- - - - -
- - -
A fader with two heads for setting a range.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

style#

|||| -|

css#

| `string` | "" | Available CSS variables:
- `--color-gauge: color;`
- `--color-knob: color;`
- `--color-pips: color;`
- `--gauge-opacity: number;` | -|

range#

|||| -|

range#

| `object` | \{
 "min": 0,
 "max": 1
}
| See fader's `range` | -|

horizontal#

| `boolean` | false | See fader's `horizontal` | -|

alignRight#

| `boolean` | false | See fader's `alignRight` | -|

input#

| `boolean` | true | See fader's `input` | -|

compact#

| `boolean` | false | See fader's `compact` | -|

pips#

| `boolean` | true | See fader's `pips` | -|

snap#

| `boolean` | false | See fader's `snap` | -|

spring#

| `boolean` | false | See fader's `spring` | -|

logScale#

| `boolean` | false | See fader's `logScale` | -|

sensitivity#

| `number` | 1 | See fader's `sensitivity` | -|

osc#

|||| -|

touchAddress#

| `string` | "" | See fader's `touchAddress` | -|

split#

| `boolean`|
`object` | false | Set to `true` to send separate osc messages for `low` and `high` handles. The `address` will be the same as the widget's with `/low` or `/high` appended to it

Can be set as an object to specify a different `address` : `['/osc_address_low', '/osc_address_high']`

Note: the widget will only respond to its original osc address, not to the splitted version |
- - - -## Buttons - - -
- - -
On / off button.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

toggle#

|||| -|

doubleTap#

| `boolean` | false | Set to `true` to make the button require a double tap to be toggled instead of a single tap | -|

led#

| `boolean` | false | Set to `true` to display the toggle's state with a led | -|

on#

| `*` | 1 | Set to `null` to send send no argument in the osc message

Can be an `object` if the type needs to be specified (see preArgs) | -|

off#

| `*` | 0 | Set to `null` to send send no argument in the osc message

Can be an `object` if the type needs to be specified (see preArgs) |
- - - - -
- - -
On / off button that turns off when released.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

push#

|||| -|

doubleTap#

| `boolean` | false | Set to `true` to make the button require a double tap to be pushed instead of a single tap | -|

on#

| `*` | 1 | Set to `null` to send send no argument in the osc message

Can be an `object` if the type needs to be specified (see preArgs) | -|

off#

| `*` | 0 | Set to `null` to send send no argument in the osc message

Can be an `object` if the type needs to be specified (see preArgs) | -|

norelease#

| `boolean` | false | Set to `true` to prevent sending any osc message when releasing the button |
- - - - -
- - -
Value selector button.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

switch#

|||| -|

horizontal#

| `boolean` | false | Set to `true` to display values horizontally | -|

showValues#

| `boolean` | false | If values is an object, set to `true` to display both values and labels instead of labels only | -|

values#

| `array`|
`object` | \{
 "Value 1": 1,
 "Value 2": 2
}
| `Array` of possible values to switch between : `[1,2,3]`

`Object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept | -|

traversing#

| `boolean` | true | Set to `false` to disable traversing gestures |
- - - - -
- - -
Native dropdown menu.
- -| property | type |default | description | -| --- | --- | --- | --- | -| |||| -| | `array`|
`object` | \{
 "Value 1": 1,
 "Value 2": 2
}
| `Array` of possible values to switch between : `[1,2,3]`

`Object` of label:value pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept

An empty option will always be prepended to values (sends an osc message without any value); it can be hidden by adding `option:first-child{display:none}` to the widget's `css` |
- - - - -
- - -
Drag and drop menu with a circular or grid layout.
- -| property | type |default | description | -| --- | --- | --- | --- | -| |||| -| | `number`|
`array` | 200 | - If `circular` is `true`: diameter (in px)
- If `circular` is `false`: square size or `[width, height]` array | -| | `boolean` | true | Defines whether the menu should be rendered in a circle or in a box | -| | `boolean`|
`number` | false | If `circular` is `false`, set this to `true` for vertical layout

Ignored when `grid` is `true` | -| | `boolean`|
`number` | false | - If `circular` is `false`, set this to `true` for grid layout
- Can be a `number` to define the number of columns | -| | `boolean` | false | Set to `true` to make the menu stay opened after mouse/touch release | -| | `boolean` | false | Set to `true` to make the menu require a double tap to be opened instead of a single tap | -| | `array`|
`object` | \{
 "Value 1": 1,
 "Value 2": 2
}
| `Array` of possible values to switch between : `[1,2,3]`

`Object` of label:value pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept | -| | `array` | "" | `Array` of `number` defining the weights of each value in `values`

Ignored when `grid` is `true` |
- - - -## Pads - - -
- - -
Two-dimensional slider.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

style#

|||| -|

css#

| `string` | "" | Available CSS variables:
- `--background: background;`: sets the dragging area's background
- `--pips-color: color;`
- `--pips-opacity: number;`
- `--point-opacity: number;` | -|

xy#

|||| -|

pointSize#

| `integer` | 20 | Defines the points' size | -|

snap#

| `boolean` | false | By default, the points are dragged from their initial position.

If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates | -|

spring#

| `boolean` | false | When set to `true`, the widget will go back to its default value when released | -|

pips#

| `boolean` | true | Set to `false` to hide the scale | -|

rangeX#

| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis | -|

rangeY#

| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | -|

logScaleX#

| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis (base 10). Set to a `number` to define the logarithm's base. | -|

logScaleY#

| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis (base 10). Set to a `number` to define the logarithm's base. | -|

input#

| `boolean` | true | Set to false to hide the built-in input widget | -|

doubleTap#

| `boolean`|
`string` | false | Set to `true` to make the fader reset to its default value when receiving a double tap.

Can also be an osc address, which case the widget will just send an osc message: `/ ` | -|

sensitivity#

| `number` | 1 | Defines the pad's sensitivity when `snap` is `false` | -|

osc#

|||| -|

touchAddress#

| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1`) | -|

split#

| `boolean`|
`object` | false | Set to `true` to send separate osc messages for each point's x and y axis. The address will be the same as the widget's with `/x` or `/y` appended to it

Can be set as an `object` to specify a different address : ['/osc_address_x', '/osc_address_y']

Note: the widget will only respond to its original osc address, not to the splitted version |
- - - - -
- - -
Color picker with optional alpha slider.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

rgb#

|||| -|

snap#

| `boolean` | false | By default, the points are dragged from their initial position.

If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates | -|

spring#

| `boolean` | false | When set to `true`, the widget will go back to its default value when released | -|

range#

| `object` | \{
 "min": 0,
 "max": 255
}
| Defines the widget's output scale. | -|

input#

| `boolean` | true | Set to `false` to hide the built-in input widget | -|

alpha#

| `boolean` | false | Set to `true` to enable alpha channel | -|

osc#

|||| -|

split#

| `boolean`|
`object` | false | Set to `true` to send separate osc messages for for r and g & b. The address will be the same as the widget's with `/r`, `/g` or `/b` appended to it

Can be set as an `object` to specify a different address : `['/r', '/g', 'b']`

Note: the widget will only respond to its original osc address, not to the splitted version |
- - - - -
- - -
Multi-point XY pad.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

style#

|||| -|

css#

| `string` | "" | Available CSS variables:
- `--background: background;`: sets the dragging area's background
- `--pips-color: color;`
- `--pips-opacity: number;`
- `--color-text: point-color;`

Pads can be targetted individually with the .pad-X selector (where X is the pad's index) | -|

multi xy#

|||| -|

points#

| `integer`|
`array` | 2 | Defines the number of points on the pad

Can be an array of strings that will be used as labels for the points (ex: `['A', 'B']`) | -|

xy#

|||| -|

pointSize#

| `integer` | 20 | Defines the points' size | -|

snap#

| `boolean` | false | By default, the points are dragged from their initial position.

If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates | -|

spring#

| `boolean` | false | When set to `true`, the widget will go back to its default value when released | -|

pips#

| `boolean` | true | Set to `false` to hide the scale | -|

rangeX#

| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis | -|

rangeY#

| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | -|

logScaleX#

| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis (base 10). Set to a `number` to define the logarithm's base. | -|

logScaleY#

| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis (base 10). Set to a `number` to define the logarithm's base. | -|

sensitivity#

| `number` | 1 | Defines the pad's sensitivity when `snap` is `false` | -|

osc#

|||| -|

touchAddress#

| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1` | -|

split#

| `boolean`|
`object` | false | Set to `true` to send separate osc messages for each point's x and y axis. The address will be the same as the widget's with `/N/x` or `/N/y` appended to it, where N is the point's id (or the point's label if points is an array)

Can be set as an `object` to specify a different address : `['/0/x', '/0/y', '/1/x', '/2/y']`

Note: the widget will only respond to its original osc address, not to the splitted version |
- - - -## Matrices - - -
- - -
Generic matrix for creating rows/columns of widgets.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

matrix#

|||| -|

widgetType#

| `string` | "toggle" | Defines the type of the widgets in the matrix | -|

matrix#

| `array` | [
 2,
 2
]
| Defines the number of columns and and rows in the matrix | -|

start#

| `integer` | 0 | First widget's index | -|

spacing#

| `integer` | 0 | Adds space between widgets | -|

traversing#

| `boolean` | true | Set to `false` to disable traversing gestures | -|

border#

| `boolean` | true | Set to `false` to disables the widgets' borders | -|

props#

| `object` | \{} | Defines a set of property to override the widgets' defaults.

Formulas in this field are resolved with an extra variable representing each widget's index: `$`

Note: by default, the widgets inherit from the matrix' `id` and osc properties (`id` and `address` are appended with `/$`) |
- - - - -
- - -
Piano keyboard.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

style#

|||| -|

css#

| `string` | "" | Available CSS variables:
- `--color-white:color;` (white keys color)
- `--color-black:color;` (black keys color) | -|

matrix#

|||| -|

keys#

| `number` | 25 | Defines the number keys | -|

start#

| `number` | 48 | MIDI note number to start with (default is C4)

Standard keyboards settings are: `[25, 48]`, `[49, 36]`, `[61, 36]`, `[88, 21]` | -|

traversing#

| `boolean` | true | Set to `false` to disable traversing gestures | -|

on#

| `*` | 1 | Set to `null` to send send no argument in the osc message

Can be an `object` if the type needs to be specified (see preArgs) | -|

off#

| `*` | 0 | Set to `null` to send send no argument in the osc message

Can be an `object` if the type needs to be specified (see preArgs) | -|

toggles#

| `boolean` | false | Set to `true` to make keys bahave like toggle buttons | -|

osc#

|||| -|

split#

| `boolean`|
`string` | false | `true`: the widget's index will be appended to the matrice's osc address

`false`: it will be prepended to the widget's preArgs

`string`: will be used to define the widgets' addresses, replacing dollar signs (`$`) with their respective index (to insert the actual dollar sign, it must be escaped with a backslash (`\$`)) |
- - - - -
- - -
Connect inputs to outputs.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

style#

|||| -|

css#

| `string` | "" | The inputs/ouputs width can be adjusted by using the `.nodes` selector:

`.nodes { width: 25% }` | -|

patchbay#

|||| -|

inputs#

| `array`|
`object` | [
 "input_1",
 "input_2"
]
| - `Array` of input names : `['input_1', 'input_2']`
- `Object` of `"label_1": "input_1"` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept



Patchbay inputs can be connected to one or more outputs and will send messages of the following form when they are connected/disconnected:

`/patchbay_address input_x output_x output_y etc`

If no output is connected to the input, the message will be `/patchbay_address input_x`

The inputs values can be consumed with the property inheritance syntax: `@{patchbay_id/input_1}` returns an array of output names connected to `input_1` | -|

outputs#

| `array`|
`object` | [
 "output_1",
 "output_2"
]
| List of output values the inputs can connect to (see `inputs`). |
- - - -## Plots - - -
- - -
XY coordinates plot.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

plot#

|||| -|

rangeX#

| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis | -|

rangeY#

| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | -|

logScaleX#

| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis (base 10). Set to a `number` to define the logarithm's base. | -|

logScaleY#

| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis (base 10). Set to a `number` to define the logarithm's base. | -|

origin#

| `number` | "auto" | Defines the y axis origin. Set to `false` to disable it. | -|

dots#

| `boolean` | true | | -|

bars#

| `boolean` | false | Set to `true` to use draw bars instead (disables `logScaleX` and forces `x axis` even spacing) | -|

smooth#

| `boolean`|
`number` | false | Set to `true` to make the line smooth. Float values are also acceptable (works fine between `0` and `0.5`) | -|

pips#

| `boolean` | true | Set to `false` to hide the scale | -|

value#

|||| -|

value#

| `array`|
`string` | "" | - `Array` of `y` values
- `Array` of `[x, y]` `array` values
- `String` `array`
- `String` `object` to update specific coordinates only: `{0:1, 4:0}` will change the 1st and 5th points' coordinates |
- - - - -
- - -
Draws frequency response between from from an array of filter objects.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

eq#

|||| -|

pips#

| `boolean` | true | Set to false to hide the scale | -|

resolution#

| `number` | 128 | Defines the number of points used to compute the frequency response | -|

rangeY#

| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | -|

origin#

| `number`|
`boolean` | "auto" | Defines the y axis origin. Set to `false` to disable it | -|

logScaleX#

| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis (base 10). Set to a `number` to define the logarithm's base. | -|

smooth#

| `boolean`|
`number` | false | Set to `true` to make the line smooth. Float values are also acceptable (works fine between `0` and `0.5`) | -|

value#

|||| -|

value#

| `array` | "" | Each item must be an object with the following properties
- `type`: string ("highpass", "highshelf", "lowpass", "lowshelf", "peak" or "notch")
- `freq`: number (filter's resonant frequency)
- `q`: number (Q factor)
- `gain`: number
- `on`: boolean |
- - - - -
- - -
Display its value over time.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

visualizer#

|||| -|

duration#

| `number` | 1 | Defines visualization duration in seconds | -|

range#

| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | -|

origin#

| `number` | "auto" | Defines the y axis origin. Set to `false` to disable it | -|

logScale#

| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis (base 10). Set to a `number` to define the logarithm's base. | -|

smooth#

| `boolean`|
`number` | false | Set to `true` to make the line smooth. Float values are also acceptable (works fine between `0` and `0.5`) | -|

pips#

| `boolean` | true | Set to `false` to hide the scale |
- - - - -
- - -
Intensity display.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

led#

|||| -|

range#

| `object` | \{
 "min": 0,
 "max": 1
}
| Value to led intensity mapping range | -|

logScale#

| `boolean`|
`number` | false | Set to `true` to use logarithmic scale (base 10). Set to a `number` to define the logarithm's base. |
- - - - -
- - -
Rgb / rgba color display
- -| property | type |default | description | -| --- | --- | --- | --- | -|

value#

|||| -|

value#

| `array`|
`string` | "" | - `Array`: `[r, g, b]` (`r`, `g` and `b` between `0` and `255`)
- `Array`: `[r, g, b, alpha]` (`alpha` between `0` and `255`)
- `String`: CSS color |
- - - - -
- - -
Non-interactable fader.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

style#

|||| -|

css#

| `string` | "" | Available CSS variables:
- `--color-gauge: color;`
- `--color-knob: color;`
- `--color-pips: color;`
- `--gauge-opacity: number;` | -|

meter#

|||| -|

range#

| `object` | \{
 "min": 0,
 "max": 1
}
| See fader's `range` | -|

logScale#

| `boolean` | false | See fader's `logScale` | -|

origin#

| `number` | "auto" | See fader's `origin` | -|

unit#

| `string` | "auto" | See fader's `unit` | -|

alignRight#

| `boolean` | false | See fader's `alignRight` | -|

horizontal#

| `boolean` | false | See fader's `horizontal` | -|

pips#

| `boolean` | false | See fader's `pips` | -|

dashed#

| `boolean` | false | See fader's `dashed` | -|

gradient#

| `array`|
`object` | [] | When set, the meter's gauge will be filled with a linear color gradient
- each item must be a CSS color string.
- as an `object`: each key must be a number between 0 and 1
- each item must be a CSS color string.

Examples: `['blue', 'red']`, {'0': 'blue', '0.9': 'blue', '1': 'red'} |
- - - - -
- - -
Display text.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

text#

|||| -|

vertical#

| `boolean` | false | Set to `true` to display the text vertically | -|

wrap#

| `boolean` | false | Set to `true` to wrap long lines automatically.

This will not break overflowing words by default, word-breaking can be enabled by adding `word-break: break-all;` to the `css` property | -|

align#

| `string` | "" | Set to `left` or `right` to change text alignment (otherwise center) |
- - - - -
- - -
Load a image (url or base64-encoded).
- -| property | type |default | description | -| --- | --- | --- | --- | -|

image#

|||| -|

size#

| `string` | "cover" | CSS background-size | -|

position#

| `string` | "center" | CSS background-position | -|

repeat#

| `string` | "no-repeat" | CSS background-repeat | -|

border#

| `boolean` | true | Set to `false` to disable the borders and background-color | -|

cache#

| `boolean` | true | Set to false to disable image caching (forces file reload when updating or editing the widget).

When true, sending `reload` to the widget reloads its image without changing its value | -|

value#

|||| -|

value#

| `string` | "" | - File `url` or `path` (relative to the session file location by default, falling back to absolute path)
- Base64 encoded image : `data:image/...` |
- - - - -
- - -
Svg parser.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

svg#

|||| -|

svg#

| `string` | "" | Svg xml definition:
- will be wrapped in a `< svg />` element
- `` commands support a special percent notation (`%x` and `%y`) | -|

border#

| `boolean` | true | Set to `false` to disable the borders and background-color |
- - - - -
- - -
Simple HTML parser.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

html#

|||| -|

html#

| `string` | "" | Allowed HTML tags:

  h1-6, blockquote, p, a, ul, ol, nl, li,

  b, i, strong, em, strike, code, hr, br, div,

  table, thead, img, caption, tbody, tr, th, td, pre | -|

border#

| `boolean` | true | Set to `false` to disable the borders and background-color |
- - - - -
- - -
Embed a page in a frame (local network only).
- -| property | type |default | description | -| --- | --- | --- | --- | -|

style#

|||| -|

label#

| `string`|
`boolean` | "auto" | Set to `false` to hide completely

Insert icons using the prefix ^ followed by the icon's name : ^play, ^pause, etc

If set to `false`, all pointer-events will be disabled on the frame as long as the editor is enabled to ensure it can be selected | -|

frame#

|||| -|

border#

| `boolean` | true | Set to `false` to disable the borders and background-color | -|

value#

|||| -|

value#

| `string` | "" | External web page URL. Only local URLs are allowed (starting with `http://127.0.0.1/`, `http://10.x.x.x/`, `http://192.168.x.x/`, etc) |
- - - -## Containers - - -
- - -
Widgets or Tabs container.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

panel#

|||| -|

scroll#

| `boolean` | true | Set to `false` to disable scrollbars | -|

border#

| `boolean` | true | By default, widgets in panels/strip have their border disabled, except for panels and strips. Set to `false` to apply this rule to the panel too | -|

value#

|||| -|

value#

| `integer` | "" | Defines currently opened tab in the widget

A tab can be opened only by setting its parent's value | -|

children#

|||| -|

variables#

| `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | -|

widgets#

| `array` | [] | Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously. | -|

tabs#

| `array` | [] | Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously |
- - - - -
- - -
Widget container that display its children in a single column or row.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

strip#

|||| -|

scroll#

| `boolean` | true | Set to `false` to disable scrollbars | -|

horizontal#

| `boolean` | false | Set to `true` to display widgets horizontally | -|

stretch#

| `boolean` | false | Set to `true` to stretch widgets evenly | -|

border#

| `boolean` | true | By default, widgets in panels/strip have their border disabled, except for panels and strips. Set to `false` to apply this rule to the panel too | -|

spacing#

| `integer`|
`percentage` | 0 | Adds space between widgets. Percents are always relative to the strips width | -|

children#

|||| -|

variables#

| `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | -|

widgets#

| `array` | [] | Each element of the array must be a widget object
- By default, children widgets that don't have an explicit `width`/`height` set will be shrinked to respect the sizes specified by others
- Adding `flex:1;` to a children's `css` will give it the ability the fill the remaining space
- Multiple children can have a `flex:x;` css property (`x` will ponderate their expansion) |
- - - - -
- - -
A toggle button that opens a popup panel. Cannot contain tabs directly.
- -| property | type |default | description | -| --- | --- | --- | --- | -| |||| -| | `boolean` | false | Set to `true` to make the modal require a double tap to open instead of a single tap | -| | `string` | "" | Alternative label for the modal popup | -| | `number`|
`percentage` | "80%" | Modal popup's size | -| | `number`|
`percentage` | "80%" | Modal popup's size | -| | `number`|
`percentage` | "auto" | Modal popup's position | -| | `number`|
`percentage` | "auto" | Modal popup's position | -| | `boolean` | true | Set to `false` to disable scrollbars | -| |||| -| | `integer` | "" | Defines the modal's state:`0` for closed, `1` for opened | -| |||| -| | `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | -| | `array` | [] | Each element of the array must be a widget object |
- - - - -
- - -
Widget replication with overridable properties.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

clone#

|||| -|

widgetId#

| `string` | "" | `id` of the widget to clone | -|

overrides#

|||| -|

props#

| `object` | \{} | Cloned widget's properties to override |
- - - - -
- - -
Main (unique) container
- -| property | type |default | description | -| --- | --- | --- | --- | -|

id#

| `string` | "root" | Widgets sharing the same id will act as clones and update each other's value(s) without sending extra osc messages | -|

value#

|||| -|

value#

| `integer` | "" | Defines currently opened tab in the widget

A tab can be opened only by setting its parent's value | -|

children#

|||| -|

traversing#

| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | -|

variables#

| `*` | \{} | Defines one or more arbitrary variables that can be inherited by children widgets | -|

tabs#

| `array` | [
 \{}
]
| Each element of the array must be a tab object |
- - - - -
- - -
Tabbed panel widget
- -| property | type |default | description | -| --- | --- | --- | --- | -|

tab#

|||| -|

detached#

| `boolean` | true | Set to `false` if the tab contains `frame` widgets that should not be reloaded when the tab opens | -|

value#

|||| -|

value#

| `integer` | "" | Defines currently opened tab in the widget

A tab can be opened only by setting its parent's value | -|

children#

|||| -|

variables#

| `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | -|

widgets#

| `array` | [] | Each element of the array must be a widget object. A tab cannot contain widgets and tabs simultaneously | -|

tabs#

| `array` | [] | Each element of the array must be a tab object. A tab cannot contain widgets and tabs simultaneously |
- - - -## Switchers - - -
- - -
Save and recall the state of other widgets.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

state#

|||| -|

filter#

| `string`|
`array` | "" | Only save state from widgets contained in widgets designated by id. If empty, the whole session's state is saved. Switchers are always ignored.
- widget id `string`
- `array` of widget id strings | -|

saveLabel#

| `string` | "Save" | Label for save button | -|

loadLabel#

| `string` | "Load" | Label for load button | -|

horizontal#

| `boolean` | false | Set to `true` to display buttons horizontally | -|

value#

|||| -|

value#

| `object`|
`string` | "" | - `object`: `"widget_id": VALUE` pairs
- `string`: `"save"` (trigger save action), `"load"` (trigger load action) or `""` (reset value)



Note: the widget's actual value is never `"save"` or `"load"`, it's either an empty string or an object. |
- - - - -
- - -
Store other widgets' values and recall them.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

switcher#

|||| -|

linkedWidgets#

| `string`|
`array` | "" | - `String`: a widget's `id` whose state changes will be stored
- `Array`: a list of widget `id` string | -|

horizontal#

| `boolean` | false | Set to `true` to display values horizontally | -|

values#

| `array`|
`object` | \{
 "Value 1": 1,
 "Value 2": 2
}
| Each item represents a bank that stores the values from the widgets listed in `linkedWidgets`
- `Array` of possible values to switch between : `[1,2,3]`
- `Object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept |
- - - - -
- - -
Switcher with linear interpolation slider.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

crossfader#

|||| -|

linkedWidgets#

| `string`|
`array` | "" | - `String`: a widget's `id` whose state changes will be stored
- `Array`: a list of widget `id` string | -|

horizontal#

| `boolean` | false | Set to `true` to display values horizontally |
- - - -## Inputs - - -
- - -
Text input.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

input#

|||| -|

vertical#

| `boolean` | false | Set to `true` to display the text vertically | -|

align#

| `string` | "" | Set to `left` or `right` to change text alignment (otherwise center) | -|

unit#

| `string` | "" | Unit will be appended to the displayed widget's value (it doesn't affect osc messages) | -|

editable#

| `boolean` | true | Set to `false` to make the input non-editable | -|

asYouType#

| `boolean` | false | Set to `true` to make the input send its value at each keystroke |
- - - - -
- - -
Keyboard binding.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

keys#

|||| -|

binding#

| `string`|
`array` | "" | Key combo `string` or `array` of strings (see KeyboardJS documentation) | -|

keydown#

| `string` | "" | This property is evaluated each time the key combo is pressed and defines the widget's own value. Formulas are given extras variables in this context:
- `key`: pressed key name (usefull for handling multiple keys with a single keys widget, lowercased when referencing a character key)
- `code`: pressed key code name (full list)
- `ctrl`: control key state
- `alt`: alt key state
- `shift`: shift key state
- `meta`: command/windows key state | -|

keyup#

| `string` | "" | Same as `keydown`, but evaluated when releasing the key combo | -|

repeat#

| `boolean` | true | Set to `false` to prevent keydown repeats when holding the key combo pressed |
- - - - -
- - -
Evaluates a script each time it receives a value.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

script#

|||| -|

condition#

| `string` | 1 | When the widget receives a value, if this property return a falsy value, the script property won't be evaluated. If it's non-falsy, it will be evaluated normally. Formulas are given one extra variable in this context:
- `value`: the value received by the widget | -|

script#

| `string` | "" | This property is evaluated each time the widget receives a value* if condition is non-falsy. Formulas are given extras variables in this context:
- `value`: value received by the widget
- `id`: id of the widget that triggered the script
- `send(target, address, arg1, arg2, ...)`: function for sending osc messages (ignores the script's targets and the server's defaults unless `target` is `false`; ignores the script's `preArgs`)
- `set(id, value)`: function for setting a widget's value
- `get(id)`: function for getting a widget's value (dynamic equivalent of @{id})
- `getProp(id, property)`: function for getting a widget's property value ((dynamic equivalent of @{id.property})
- `httpGet(url, callback)`: function for making http requests (asynchronous "GET" request and local urls only)



* Note: `value` or `linkId` properties can be used to receive other widgets' values. The `value` property must actually change to trigger the execution, where linked widgets via `linkId` can submit the same value over and over and trigger the execution |
- - - - -
- - -
Device motion/orientation sensor.
- -| property | type |default | description | -| --- | --- | --- | --- | -|

gyroscope#

|||| -|

frequency#

| `number` | 30 | Value update frequency (updates per seconds) | -|

normalize#

| `boolean` | true | Normalize gravity related values | -|

compass#

| `boolean` | false | Set to `true` to return the orientation values with respect to the actual north direction of the world instead of the head direction of the device | -|

screenAdjusted#

| `boolean` | false | Set to `true` to return screen adjusted values | -|

value#

|||| -|

value#

| `object` | "" | The gyroscope's value is an object containing multiple values, which can be used by other widgets via the property maths syntax
- `value.do.alpha`: deviceorientation event alpha
- `value.do.beta`: deviceorientation event beta
- `value.do.gamma`: deviceorientation event gamma
- `value.do.absolute`: deviceorientation event absolute
- `value.dm.x`: devicemotion event acceleration x
- `value.dm.y`: devicemotion event acceleration y
- `value.dm.z`: devicemotion event acceleration z
- `value.dm.gx`: devicemotion event accelerationIncludingGravity x
- `value.dm.gy`: devicemotion event accelerationIncludingGravity y
- `value.dm.gz`: devicemotion event accelerationIncludingGravity z
- `value.dm.alpha`: devicemotion event rotationRate alpha
- `value.dm.beta`: devicemotion event rotationRate beta
- `value.dm.gamma`: devicemotion event rotationRate gamma |
- - - - -
- - -
File/Folder selector (server-side).
- -| property | type |default | description | -| --- | --- | --- | --- | -|

input#

|||| -|

directory#

| `string` | "auto" | Default browsing directory | -|

extension#

| `string` | "*" | Only display files with this extension | -|

hidePath#

| `boolean` | false | Set to `true` to only display the filename (the whole path will still be used as value) | -|

allowDir#

| `boolean` | false | Allow selecting a folder (by pressing "open" when no file is selected) |
- - - - - - diff --git a/resources/docs/docs/advanced-property-syntax.md b/resources/docs/docs/widgets/advanced-syntaxes.md similarity index 99% rename from resources/docs/docs/advanced-property-syntax.md rename to resources/docs/docs/widgets/advanced-syntaxes.md index 2e55d9da..1e900639 100644 --- a/resources/docs/docs/advanced-property-syntax.md +++ b/resources/docs/docs/widgets/advanced-syntaxes.md @@ -1,4 +1,4 @@ -# Advanced property syntax +# Advanced syntaxes ## Inheritance: `@{id.property}` diff --git a/resources/docs/docs/widgets/general-mechanics.md b/resources/docs/docs/widgets/general-mechanics.md new file mode 100644 index 00000000..92a84803 --- /dev/null +++ b/resources/docs/docs/widgets/general-mechanics.md @@ -0,0 +1,13 @@ +!!! warning "Incomplete documentation" + +## Receiving / sending messages + +## Interactions + +| Mouse | Touch | Description | +|---|---|---| +| Click | Tap | Handled at pressing time, not releasing. | +| Double Click | Double Tap | Some widgets handle double click / tap events. | +| Drag | Drag | The widgets respond to mouse and touch drag gestures with a 1:1 precision ratio. | +| `Ctrl` + Drag | / | Holding the `Ctrl` key while dragging with the mouse increases the gesture's precision by 10.| +| / | Two-fingers drag (single target) | Using two fingers on a single-touch target increases the gesture's precision by 10. | diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md new file mode 100644 index 00000000..1629fe50 --- /dev/null +++ b/resources/docs/docs/widgets/properties-reference.md @@ -0,0 +1,689 @@ +# Properties reference + +
+ + +
Properties shared by all widgets
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
widget#
|||| +|
type#
| `string` | "auto" | | +|
id#
| `string` | "auto" | Widgets sharing the same `id` will act as clones and update each other's value(s) without sending extra osc messages. | +|
label#
| `string`|
`boolean` | "auto" | Set to `false` to hide completely

Insert icons using the prefix ^ followed by the icon's name : ^play, ^pause, etc (see https://fontawesome.com/icons?d=gallery&s=solid&m=free) | +|
visible#
| `boolean` | true | Set to `false` to hide the widget. | +|
interaction#
| `boolean` | true | Set to `false` to disable pointer interactions. | +|
geometry#
|||| +|
left#
| `number`|
`string` | "auto" | When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).

Otherwise, the widget will be absolutely positioned | +|
top#
| `number`|
`percentage` | "auto" | When both top and left are set to auto, the widget is positioned according to the normal flow of the page (from left to right, by order of creation).

Otherwise, the widget will be absolutely positioned | +|
width#
| `number`|
`percentage` | "auto" | | +|
height#
| `number`|
`percentage` | "auto" | | +|
expand#
| `boolean`|
`number` | "false" | If parent's layout is `vertical` or `horizontal`, set this to `true` to stretch the widget to use available space automatically. | +|
style#
|||| +|
colorText#
| `string` | "auto" | Text color. Set to "auto" to inherit from parent widget. | +|
colorWidget#
| `string` | "auto" | Widget's default accent color. Set to "auto" to inherit from parent widget. | +|
colorStroke#
| `string` | "auto" | Stroke color. Set to "auto" to use `colorWidget`. | +|
colorFill#
| `string` | "auto" | Fill color. Set to "auto" to use `colorWidget`. | +|
alphaStroke#
| `number` | "auto" | Stroke color opacity. | +|
alphaFillOff#
| `number` | "auto" | Fill color opacity (off). | +|
alphaFillOn#
| `number` | "auto" | Fill color opacity (on). | +|
padding#
| `number` | "auto" | Inner spacing. | +|
css#
| `string` | "" | CSS rules. See documentation. | +|
value#
|||| +|
value#
| `*` | "" | Define the widget's value depending on other widget's values / properties using the advanced property syntax | +|
default#
| `*` | "" | If set, the widget will be initialized with this value when the session is loaded. | +|
linkId#
| `string`|
`array` | "" | Widgets sharing the same `linkId` update each other's value(s) AND send their respective osc messages.

When prefixed with >>, the `linkId` will make the widget act as a master (sending but not receiving)

When prefixed with <<, the `linkId` will make the widget act as a slave (receiving but not sending) | +|
script#
| `script` | "" | Script executed whenever the widget's value is set. | +|
osc#
|||| +|
address#
| `string` | "auto" | OSC address for sending messages, it must start with a / | +|
preArgs#
| `*`|
`array` | "" | A value or array of values that will be prepended to the OSC messages. | +|
typeTags#
| `string` | "" | Defines the osc argument types, one letter per argument (including preArgs)
- If empty, the types are infered automatically from the values (with numbers casted to floats by default)
- If there are more arguments than type letters, the last type is used for the extra arguments

See http://opensoundcontrol.org/spec-1_0 for existing typetags | +|
decimals#
| `integer` | 2 | Defines the number of decimals to send. | +|
target#
| `string`|
`array`|
`null` | "" | This defines the targets of the widget's OSC messages
- A `string` or `array` of strings formatted as follow: `ip:port` or `["ip:port"]`
- If midi is enabled, targets can be `midi:device_name`
- The special item `"self"` can be used to refer to the emitting client directly.
- If no target is set, messages can still be sent if the server has default targets
- The server's default targets can be bypassed by setting one of the items to `null` | +|
bypass#
| `boolean` | false | Set to `true` to prevent the widget from sending any osc message |
+ +## Basics + + +
+ + +
On / off button.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
button#
|||| +|
on#
| `*` | 1 | Set to `null` to send send no argument in the osc message | +|
off#
| `*` | 0 | Set to `null` to send send no argument in the osc message. Must be different from `on`. | +|
mode#
| `string` | "toggle" | Interraction mode:
- `toggle` (classic on/off switch)
- `push` (press & release)
- `tap` (no release) | +|
doubleTap#
| `boolean` | false | Set to `true` to make the button require a double tap to be pushed instead of a single tap | +|
colorTextOn#
| `string` | "auto" | Defines the widget's text color when active. |
+ + + + +
+ + +
Value selector button.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
switch#
|||| +|
layout#
| `string` | "vertical" | | +|
gridTemplate#
| `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | +|
values#
| `array`|
`object` | \{
 "Value 1": 1,
 "Value 2": 2
}
| `Array` of possible values to switch between : `[1,2,3]`

`Object` of `"label":value` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept | +|
mode#
| `string` | "tap" | Interraction mode:
- `tap`: activates when the pointer is down but prevents further scrolling
- `slide`: same as `tap` but allows sliding between values
- `click`: activates upon click only and allows further scrolling | +|
colorTextOn#
| `string` | "auto" | Defines the widget's text color when active. |
+ + + + +
+ + +
Native dropdown menu.
+ +| property | type |default | description | +| --- | --- | --- | --- | +| |||| +| | `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center) | +| | `array`|
`object` | \{
 "Value 1": 1,
 "Value 2": 2
}
| `Array` of possible values to switch between : `[1,2,3]`

`Object` of label:value pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept |
+ + + + +
+ + +
Drag and drop menu with a circular or grid layout.
+ +| property | type |default | description | +| --- | --- | --- | --- | +| |||| +| | `number`|
`array` | 200 | - If `layout` is `circular`: diameter (in px)
- Else: square size or `[width, height]` array | +| | `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center) | +| | `string` | "circular" | Defines whether the menu's layout should be rendered in a circle or in a box | +| | `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | +| | `boolean` | false | Set to `true` to make the menu stay opened after mouse/touch release | +| | `boolean` | false | Set to `true` to make the menu require a double tap to be opened instead of a single tap | +| | `array`|
`object` | [
 1,
 2,
 3
]
| `Array` of possible values to switch between : `[1,2,3]`

`Object` of label:value pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept | +| | `array` | "" | `Array` of `number` defining the weights of each value in `values`

Ignored when `mode` is `grid` |
+ + + + +
+ + +
Text input.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
input#
|||| +|
align#
| `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center) | +|
unit#
| `string` | "" | Unit will be appended to the displayed widget's value (it doesn't affect osc messages) | +|
asYouType#
| `boolean` | false | Set to `true` to make the input send its value at each keystroke |
+ + + + +
+ + +
File/Folder selector (server-side).
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
input#
|||| +|
align#
| `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center) | +|
directory#
| `string` | "auto" | Default browsing directory | +|
extension#
| `string` | "*" | Only display files with this extension | +|
hidePath#
| `boolean` | false | Set to `true` to only display the filename (the whole path will still be used as value) | +|
allowDir#
| `boolean` | false | Allow selecting a folder (by pressing "open" when no file is selected) |
+ + + +## Containers + + +
+ + +
Widgets or Tabs container.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
panel#
|||| +|
colorPanel#
| `string` | "auto" | Panel background color. Set to "auto" to inherit from parent widget. | +|
layout#
| `string` | "default" | Defines how children are laid out. | +|
justify#
| `string` | "start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified. | +|
gridTemplate#
| `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | +|
verticalTabs#
| `boolean` | false | Set to `true` to display for vertical tab layout | +|
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | +|
scroll#
| `boolean` | true | Set to `false` to disable scrollbars | +|
variables#
| `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | +|
value#
|||| +|
value#
| `integer` | "" | Defines currently widgeted tab in the widget

A tab can be opened only by setting its parent's value | +|
osc#
|||| +|
widgets#
| `array` | [] | Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously. | +|
tabs#
| `array` | [] | Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously |
+ + + + +
+ + +
A toggle button that opens a popup panel. Cannot contain tabs directly.
+ +| property | type |default | description | +| --- | --- | --- | --- | +| |||| +| | `boolean` | false | Set to `true` to make the modal require a double tap to open instead of a single tap | +| | `string` | "" | Alternative label for the modal popup | +| | `number`|
`percentage` | "80%" | Modal popup's size | +| | `number`|
`percentage` | "80%" | Modal popup's size | +| | `number`|
`percentage` | "auto" | Modal popup's position | +| | `number`|
`percentage` | "auto" | Modal popup's position | +| | `string` | "auto" | Panel background color. Set to "auto" to inherit from parent widget. | +| | `string` | "default" | Defines how children are laid out. | +| | `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | +| | `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | +| | `boolean` | true | Set to `false` to disable scrollbars | +| | `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | +| |||| +| | `integer` | "" | Defines the modal's state:`0` for closed, `1` for opened | +| |||| +| | `array` | [] | Each element of the array must be a widget object |
+ + + + +
+ + +
Widget replication with overridable properties.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
clone#
|||| +|
widgetId#
| `string` | "" | `id` of the widget to clone | +|
overrides#
|||| +|
props#
| `object` | \{} | Cloned widget's properties to override |
+ + + + +
+ + +
Generic matrix for creating rows/columns of widgets.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
matrix#
|||| +|
widgetType#
| `string` | "button" | Defines the type of the widgets in the matrix | +|
colorPanel#
| `string` | "auto" | Panel background color. Set to "auto" to inherit from parent widget. | +|
layout#
| `string` | "horizontal" | Defines how children are laid out. | +|
gridTemplate#
| `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | +|
quantity#
| `number` | 4 | Defines the number of widgets in the matrix | +|
start#
| `integer` | 0 | First widget's index | +|
traversing#
| `boolean` | true | Set to `false` to disable traversing gestures | +|
props#
| `object` | \{} | Defines a set of property to override the widgets' defaults.

Formulas in this field are resolved with an extra variable representing each widget's index: `$`

Note: by default, the widgets inherit from the matrix' `id` and osc properties (`id` and `address` are appended with `/$`) |
+ + + + +
+ + +
Piano keyboard.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
style#
|||| +|
css#
| `string` | "" | Available CSS variables:
- `--color-white:color;` (white keys color)
- `--color-black:color;` (black keys color) | +|
matrix#
|||| +|
keys#
| `number` | 25 | Defines the number keys | +|
start#
| `number` | 48 | MIDI note number to start with (default is C4)

Standard keyboards settings are: `[25, 48]`, `[49, 36]`, `[61, 36]`, `[88, 21]` | +|
traversing#
| `boolean` | true | Set to `false` to disable traversing gestures | +|
on#
| `*` | 1 | Set to `null` to send send no argument in the osc message

Can be an `object` if the type needs to be specified (see preArgs) | +|
off#
| `*` | 0 | Set to `null` to send send no argument in the osc message

Can be an `object` if the type needs to be specified (see preArgs) | +|
toggles#
| `boolean` | false | Set to `true` to make keys bahave like toggle buttons |
+ + + + +
+ + +
Connect inputs to outputs.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
style#
|||| +|
css#
| `string` | "" | The inputs/ouputs width can be adjusted by using the `.nodes` selector:

`.nodes { width: 25% }` | +|
patchbay#
|||| +|
inputs#
| `array`|
`object` | [
 "input_1",
 "input_2"
]
| - `Array` of input names : `['input_1', 'input_2']`
- `Object` of `"label_1": "input_1"` pairs. Numeric labels must be prepended or appended with a white space (or any other non-numeric character) otherwise the order of the values won't be kept



Patchbay inputs can be connected to one or more outputs and will send messages of the following form when they are connected/disconnected:

`/patchbay_address input_x output_x output_y etc`

If no output is connected to the input, the message will be `/patchbay_address input_x`

The inputs values can be consumed with the property inheritance syntax: `@{patchbay_id/input_1}` returns an array of output names connected to `input_1` | +|
outputs#
| `array`|
`object` | [
 "output_1",
 "output_2"
]
| List of output values the inputs can connect to (see `inputs`). |
+ + + + +
+ + +
Main (unique) container
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
panel#
|||| +|
colorPanel#
| `string` | "auto" | Panel background color. Set to "auto" to inherit from parent widget. | +|
layout#
| `string` | "default" | Defines how children are laid out. | +|
justify#
| `string` | "start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified. | +|
gridTemplate#
| `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | +|
verticalTabs#
| `boolean` | false | Set to `true` to display for vertical tab layout | +|
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | +|
scroll#
| `boolean` | true | Set to `false` to disable scrollbars | +|
variables#
| `*` | "" | Defines one or more arbitrary variables that can be inherited by children widgets | +|
value#
|||| +|
value#
| `integer` | "" | Defines currently widgeted tab in the widget

A tab can be opened only by setting its parent's value | +|
osc#
|||| +|
widgets#
| `array` | [] | Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously. | +|
tabs#
| `array` | [] | Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously |
+ + + + +
+ + +
Tabbed panel widget
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
tab#
|||| +|
colorPanel#
| `string` | "auto" | Panel background color. Set to "auto" to inherit from parent widget. | +|
layout#
| `string` | "default" | Defines how children are laid out. | +|
justify#
| `string` | "start" | If `layout` is `vertical` or `horizontal`, defines how widgets should be justified. | +|
gridTemplate#
| `string`|
`number` | "" | If `layout` is `grid`, can be either a number of columns of a value css grid-template definition. | +|
verticalTabs#
| `boolean` | false | Set to `true` to display for vertical tab layout | +|
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` or `auto` to limit affected widgets by the type of the first touched widget | +|
scroll#
| `boolean` | true | Set to `false` to disable scrollbars | +|
variables#
| `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | +|
value#
|||| +|
value#
| `integer` | "" | Defines currently widgeted tab in the widget

A tab can be opened only by setting its parent's value | +|
osc#
|||| +|
widgets#
| `array` | [] | Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously. | +|
tabs#
| `array` | [] | Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously |
+ + + +## Frames + + +
+ + +
Embed a page in a frame (local network only).
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
widget#
|||| +|
label#
| `string`|
`boolean` | "auto" | Set to `false` to hide completely

Insert icons using the prefix ^ followed by the icon's name : ^play, ^pause, etc

If set to `false`, all pointer-events will be disabled on the frame as long as the editor is enabled to ensure it can be selected | +|
value#
|||| +|
value#
| `string` | "" | External web page URL. Only local URLs are allowed (starting with `http://127.0.0.1/`, `http://10.x.x.x/`, `http://192.168.x.x/`, etc) |
+ + + + +
+ + +
Svg parser.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
svg#
|||| +|
svg#
| `string` | "" | Svg xml definition:
- will be wrapped in a `< svg />` element
- `` commands support a special percent notation (`%x` and `%y`) |
+ + + + +
+ + +
Simple HTML parser.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
html#
|||| +|
html#
| `string` | "" | Allowed HTML tags:

  h1-6, blockquote, p, a, ul, ol, nl, li,

  b, i, strong, em, strike, code, hr, br, div,

  table, thead, img, caption, tbody, tr, th, td, pre

Allowed attributes:

  <*>: class, style, title

  : src, width, height |
+ + + + +
+ + +
Load a image (url or base64-encoded).
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
image#
|||| +|
size#
| `string` | "cover" | CSS background-size | +|
position#
| `string` | "center" | CSS background-position | +|
repeat#
| `string` | "no-repeat" | CSS background-repeat | +|
cache#
| `boolean` | true | Set to false to disable image caching (forces file reload when updating or editing the widget).

When true, sending `reload` to the widget reloads its image without changing its value | +|
value#
|||| +|
value#
| `string` | "" | - File `url` or `path` (relative to the session file location by default, falling back to absolute path)
- Base64 encoded image : `data:image/...` |
+ + + +## Graphs + + +
+ + +
XY coordinates plot.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
plot#
|||| +|
rangeX#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis | +|
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | +|
logScaleX#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis (base 10). Set to a `number` to define the logarithm's base. | +|
logScaleY#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis (base 10). Set to a `number` to define the logarithm's base. | +|
origin#
| `number` | "auto" | Defines the y axis origin. Set to `false` to disable it. | +|
dots#
| `boolean` | true | | +|
bars#
| `boolean` | false | Set to `true` to use draw bars instead (disables `logScaleX` and forces `x axis` even spacing) | +|
pips#
| `boolean` | true | Set to `false` to hide the scale | +|
value#
|||| +|
value#
| `array`|
`string` | "" | - `Array` of `y` values
- `Array` of `[x, y]` `array` values
- `String` `array`
- `String` `object` to update specific coordinates only: `{0:1, 4:0}` will change the 1st and 5th points' coordinates |
+ + + + +
+ + +
Draws logarithmic frequency response from an array of filter objects.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
eq#
|||| +|
filters#
| `array` | "" | Each item must be an object with the following properties
- `type`: string ("highpass", "highshelf", "lowpass", "lowshelf", "peak", "bandpass" or "notch", default: "peak")
- `freq`: number (filter's resonant frequency, default: 1000)
- `q`: number (Q factor, default: 1)
- `gain`: number (default: 0)
- `on`: boolean (default: true)

See https://developer.mozilla.org/en-US/docs/Web/API/BiquadFilterNode | +|
pips#
| `boolean` | true | Set to false to hide the scale | +|
rangeX#
| `object` | \{
 "min": 20,
 "max": 22000
}
| Defines the min and max values for the x axis (in Hz, logarithmic scale) | +|
rangeY#
| `object` | \{
 "min": -6,
 "max": 6
}
| Defines the min and max values for the y axis (in dB) | +|
origin#
| `number`|
`boolean` | "auto" | Defines the y axis origin. Set to `false` to disable it |
+ + + + +
+ + +
Display its value over time.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
visualizer#
|||| +|
duration#
| `number` | 1 | Defines visualization duration in seconds | +|
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | +|
origin#
| `number` | "auto" | Defines the y axis origin. Set to `false` to disable it | +|
logScaleY#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis (base 10). Set to a `number` to define the logarithm's base. | +|
pips#
| `boolean` | true | Set to `false` to hide the scale |
+ + + +## Indicators + + +
+ + +
Intensity display.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
led#
|||| +|
mode#
| `string` | "intensity" | Defines how value is interpreted (see `value`) | +|
range#
| `object` | \{
 "min": 0,
 "max": 1
}
| Value range | +|
alphaRange#
| `object` | \{
 "min": 0,
 "max": 1
}
| Alpha range (if `mode` is `color`) | +|
logScale#
| `boolean` | false | If `mode` is `intensity`, set to `true` to use logarithmic scale. | +|
borderRadius#
| `string` | "" | Css border-radius property. | +|
value#
|||| +|
value#
| `number`|
`array`|
`string` | "" | If `mode` is `intensity`:
- `Number`: `intensity` between `range.min` and `range.max`

If `mode` is `color`:
- `Array`: `[r, g, b]` (`r`, `g` and `b` between `range.min` and `range.max`)
- `Array`: `[r, g, b, alpha]` (`alpha` between `alphaRange.min` and `alphaRange.max`)
- `String`: CSS color |
+ + + + +
+ + +
Display text.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
text#
|||| +|
vertical#
| `boolean` | false | Set to `true` to display the text vertically | +|
wrap#
| `boolean` | false | Set to `true` to wrap long lines automatically.

This will not break overflowing words by default, word-breaking can be enabled by adding `word-break: break-all;` to the `css` property | +|
align#
| `string` | "center" | Css text-align property. |
+ + + +## Pads + + +
+ + +
Two-dimensional slider.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
xy#
|||| +|
pointSize#
| `integer` | 20 | Defines the points' size | +|
snap#
| `boolean` | false | By default, the points are dragged from their initial position.

If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates | +|
spring#
| `boolean` | false | When set to `true`, the widget will go back to its default value when released | +|
pips#
| `boolean` | true | Set to `false` to hide the scale | +|
rangeX#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis | +|
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | +|
logScaleX#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale. | +|
logScaleY#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis. Set to `-1` for exponential scale. | +|
doubleTap#
| `boolean`|
`string` | false | Set to `true` to make the fader reset to its default value when receiving a double tap.

Can also be an osc address, which case the widget will just send an osc message: `/ ` | +|
sensitivity#
| `number` | 1 | Defines the pad's sensitivity when `snap` is `false` | +|
osc#
|||| +|
touchAddress#
| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1`) |
+ + + + +
+ + +
Color picker with optional alpha slider.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
rgb#
|||| +|
snap#
| `boolean` | false | By default, the points are dragged from their initial position.

If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates | +|
spring#
| `boolean` | false | When set to `true`, the widget will go back to its default value when released | +|
range#
| `object` | \{
 "min": 0,
 "max": 255
}
| Defines the widget's output scale. | +|
alpha#
| `boolean` | false | Set to `true` to enable alpha channel | +|
rangeAlpha#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the widget's output scale for the alpha channel. |
+ + + + +
+ + +
Multi-point XY pad.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
multi xy#
|||| +|
points#
| `integer`|
`array` | 2 | Defines the number of points on the pad

Can be an array of strings that will be used as labels for the points (ex: `['A', 'B']`) | +|
xy#
|||| +|
pointSize#
| `integer` | 20 | Defines the points' size | +|
snap#
| `boolean` | false | By default, the points are dragged from their initial position.

If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates | +|
spring#
| `boolean` | false | When set to `true`, the widget will go back to its default value when released | +|
pips#
| `boolean` | true | Set to `false` to hide the scale | +|
rangeX#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis | +|
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | +|
logScaleX#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale. | +|
logScaleY#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis. Set to `-1` for exponential scale. | +|
sensitivity#
| `number` | 1 | Defines the pad's sensitivity when `snap` is `false` | +|
osc#
|||| +|
touchAddress#
| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1` |
+ + + +## Sliders + + +
+ + +
Vertical / horizontal slider.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
fader#
|||| +|
design#
| `string` | "default" | Design style | +|
horizontal#
| `boolean` | false | Set to `true` to display the fader horizontally | +|
pips#
| `boolean` | false | Set to `true` to show range breakpoints (ignored if `design` is `compact`) | +|
dashed#
| `boolean` | false | Set to `true` to display a dashed gauge | +|
gradient#
| `array`|
`object` | [] | When set, the meter's gauge will be filled with a linear color gradient
- each item must be a CSS color string.
- as an `object`: each key must be a number between 0 and 1
- each item must be a CSS color string.

Examples: `['blue', 'red']`, {'0': 'blue', '0.9': 'blue', '1': 'red'} | +|
snap#
| `boolean` | false | By default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position | +|
spring#
| `boolean` | false | When set to `true`, the widget will go back to its `default` value when released | +|
doubleTap#
| `boolean` | false | Set to `true` to make the fader reset to its `default` value when receiving a double tap.

Can also be an osc address, in which case the widget will just send an osc message (`/ `) | +|
range#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the breakpoints of the fader's scale:
- keys can be percentages and/or `min` / `max`
- values can be `number` or `object` if a custom label is needed

Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`) | +|
logScale#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale. Set to `-1` for exponential scale. | +|
sensitivity#
| `number` | 1 | Defines the fader's sensitivity when `snap` is `false` | +|
steps#
| `string`|
`number`|
`array` | "" | Restricts the widget's value:
- `auto`: use values defined in `range`
- `number`: define a number of evenly spaced steps
- `array`: use arbitrary values | +|
origin#
| `number` | "auto" | Defines the starting point's value of the fader's gauge | +|
osc#
|||| +|
touchAddress#
| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1` |
+ + + + +
+ + +
Rotative knob slider.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
knob#
|||| +|
mode#
| `string` | "vertical" | - `circular`: relative move in circular motion
- `snap`: snap to touch position and move in vertical motion
- `vertical`: relative move in vertical motion | +|
spring#
| `boolean` | false | When set to `true`, the widget will go back to its `default` value when released | +|
pips#
| `boolean` | false | Set to `true` to show the scale's breakpoints | +|
dashed#
| `boolean` | false | Set to `true` to display a dashed gauge | +|
angle#
| `number` | 270 | Defines the angle's width of the knob, in degrees | +|
doubleTap#
| `boolean` | false | Set to `true` to make the knob reset to its `default` value when receiving a double tap.

Can also be an osc address, in which case the widget will just send an osc message (`/ `) | +|
range#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the breakpoints of the fader's scale:
- keys can be percentages and/or `min` / `max`
- values can be `number` or `object` if a custom label is needed

Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`) | +|
logScale#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale. Set to `-1` for exponential scale. | +|
sensitivity#
| `number` | 1 | Defines the knob's sensitivity when `mode` is not `snap` | +|
steps#
| `string`|
`number`|
`array` | "" | Restricts the widget's value:
- `auto`: use values defined in `range`
- `number`: define a number of evenly spaced steps
- `array`: use arbitrary values | +|
origin#
| `number` | "auto" | Defines the starting point's value of the knob's gauge | +|
osc#
|||| +|
touchAddress#
| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1` |
+ + + + +
+ + +
A knob that sends a relative direction infomation instead of an absolute value.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
encoder#
|||| +|
ticks#
| `number` | 360 | defines the granularity / verbosity of the encoder (number of step for a 360° arc) | +|
back#
| `*` | -1 | Defines which value is sent when rotating the encoder anticlockwise | +|
forth#
| `*` | 1 | Defines which value is sent when rotating the encoder clockwise | +|
release#
| `number` | "" | Defines which value is sent when releasing the encoder:
- Set to `null` to send send no argument in the osc message
- Can be an `object` if the type needs to be specified | +|
mode#
| `string` | "circular" | - `circular`: relative move in circular motion
- `snap`: snap to touch position and move in vertical motion
- `vertical`: relative move in vertical motion | +|
doubleTap#
| `boolean` | false | Set to `true` to make the fader reset to its `default` value when receiving a double tap.

Can also be an osc address, in which case the widget will just send an osc message (`/ `) | +|
osc#
|||| +|
touchAddress#
| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1` |
+ + + + +
+ + +
A fader with two heads for setting a range.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
fader#
|||| +|
design#
| `string` | "default" | Design style | +|
horizontal#
| `boolean` | false | Set to `true` to display the fader horizontally | +|
pips#
| `boolean` | false | Set to `true` to show range breakpoints (ignored if `design` is `compact`) | +|
dashed#
| `boolean` | false | Set to `true` to display a dashed gauge | +|
gradient#
| `array`|
`object` | [] | When set, the meter's gauge will be filled with a linear color gradient
- each item must be a CSS color string.
- as an `object`: each key must be a number between 0 and 1
- each item must be a CSS color string.

Examples: `['blue', 'red']`, {'0': 'blue', '0.9': 'blue', '1': 'red'} | +|
snap#
| `boolean` | false | By default, dragging the widget will modify it's value starting from its last value. Setting this to `true` will make it snap directly to the mouse/touch position | +|
spring#
| `boolean` | false | When set to `true`, the widget will go back to its `default` value when released | +|
doubleTap#
| `boolean` | false | Set to `true` to make the fader reset to its `default` value when receiving a double tap.

Can also be an osc address, in which case the widget will just send an osc message (`/ `) | +|
range#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the breakpoints of the fader's scale:
- keys can be percentages and/or `min` / `max`
- values can be `number` or `object` if a custom label is needed

Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`) | +|
logScale#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale. Set to `-1` for exponential scale. | +|
sensitivity#
| `number` | 1 | Defines the fader's sensitivity when `snap` is `false` | +|
steps#
| `string`|
`number`|
`array` | "" | Restricts the widget's value:
- `auto`: use values defined in `range`
- `number`: define a number of evenly spaced steps
- `array`: use arbitrary values | +|
origin#
| `number` | "auto" | Defines the starting point's value of the fader's gauge | +|
osc#
|||| +|
touchAddress#
| `string` | "" | OSC address for touched state messages: `/touchAddress [preArgs] 0/1` |
+ + + +## Scripts + + +
+ + +
Evaluates a script each time it receives a value.
+ +| property | type |default | description | +| --- | --- | --- | --- | +|
script#
|||| +|
event#
| `string` | "value" | Define which events trigger the script's execution. | +|
event: keyboard#
|||| +|
keyBinding#
| `string`|
`array` | "" | Key combo `string` or `array` of strings (see KeyboardJS documentation) | +|
keyRepeat#
| `boolean` | true | Set to `false` to prevent keydown repeats when holding the key combo pressed | +|
keyType#
| `string` | "keyDown" | Determines which key event trigger the script's execution |
+ + + + + diff --git a/resources/docs/docs/scripting.md b/resources/docs/docs/widgets/scripting.md similarity index 73% rename from resources/docs/docs/scripting.md rename to resources/docs/docs/widgets/scripting.md index a8756908..45d85848 100644 --- a/resources/docs/docs/scripting.md +++ b/resources/docs/docs/widgets/scripting.md @@ -1,24 +1,39 @@ # Scripting The `script` property allows widgets to run javascript code when their value update. It differs from the javascript property syntax in the following ways: -- no `JS{{}}` wrapper, only `code` + +- no `JS{{}}` wrapper, just the code - `@{}`, `OSC{}`, `JS{{}}` and `#{}` blocks are replaced with their value before the script's compilation ## Available variables -#### `value`: widget's value +---- -#### `id`: id of the widget that's reponsible for the value update +#### `value` + +Widget's value + +---- + +#### `id`: `string` + +Id of the widget that's reponsible for the value update + +---- #### `get`: `function(id)` Returns the value of the first widget whose id is `"id"`. +---- + #### `set`: `function(id, value)` Sets the value of the first widget whose id is `"id"`. If the event that triggered the script's execution was initiated by a user interaction, this will make the widget send its value as well. +---- + #### `send`: `function(target, address, ...args)` - `target` (optional): `"ip:port"` or `"midi:device_name"` string. If omitted, the widget's target will be used. - `address`: osc address, must start with a `/` @@ -26,28 +41,42 @@ If the event that triggered the script's execution was initiated by a user inter If the event that triggered the script's execution was not initiated by a user interaction, this function will have no effect. +---- + #### `getProp`: `function(id, name)` Returns the property called `"name"` of the first widget whose id is `"id"`. +---- + #### `httpGet`: `function(url, callback)` - `url`: url of the resource to fetch (local url only) - `callback`: function executed when/if the http request succeeds, with the response text as argument +---- + #### `stateGet`: `function(id)` Returns a state object (`id:value`) for the widget that match `id` and all its children. +---- + #### `stateSet`: `function(state)` Loads a state object. If the event that triggered the script's execution was initiated by a user interaction, this will make the updated widgets send their value as well. -#### `storage`: [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) +---- + +#### `storage`: `localStorage` Allows storing data that persists upon refresh/relaunch. -#### [`setTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout) / [`setInterval`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval): `function(id, callback, delay)` +Reference: https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage + +---- + +#### `setTimeout` / `setInterval`: `function(id, callback, delay)` These work like their native equivalent, with an extra (optional) `id` argument. @@ -55,7 +84,20 @@ These work like their native equivalent, with an extra (optional) `id` argument. - `callback`: function to executed - `delay`: delay before execution is ms +Reference: -#### [`clearTimeout`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearTimeout) / [`clearInterval`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearInterval): `function(id)` +- https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setTimeout +- https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/setInterval + +----- + +#### `clearTimeout` / `clearInterval`: `function(id)` Clear timeout with matching `id`. + +Reference: + +- https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearTimeout +- https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/clearInterval + +---- diff --git a/resources/docs/download.md b/resources/docs/download.md new file mode 100644 index 00000000..d59a8388 --- /dev/null +++ b/resources/docs/download.md @@ -0,0 +1,69 @@ +# Download latest release + + Open Stage Control + +
Loading assets...
+ +## Changelog + +
Loading changelog...
+ + + + + diff --git a/resources/docs/extra/styles.css b/resources/docs/extra/styles.css new file mode 100644 index 00000000..101834a2 --- /dev/null +++ b/resources/docs/extra/styles.css @@ -0,0 +1,73 @@ +html { + overflow-y: scroll; +} + +.md-header-nav__title { + padding-top: 1px; + padding-left: 0!important +} + +td:first-child { + white-space: pre!important; + vertical-align: top; +} + + +.force-full-table + .md-typeset__scrollwrap .md-typeset__table { + width:100%; +} +.force-full-table + .md-typeset__scrollwrap .md-typeset__table table { + display: table!important; + width:100%; +} + + +.accordion { + margin: 1.5625em 0; + padding: .6rem; + overflow: hidden; + font-size: .64rem; + page-break-inside: avoid; + border-left: .2rem solid #448aff; + border-radius: .1rem; + box-shadow: 0 0.2rem 0.5rem rgba(0,0,0,.05), 0 0 0.05rem rgba(0,0,0,.1); +} +.accordion h6 { + cursor: pointer; + margin-top: 0; +} + +.accordion > :last-child { + display: none; +} +.accordion .md-typeset__table { + margin-bottom: 0; +} +.accordion.show > :last-child { + display: block; + margin-bottom: 0; +} +.accordionlink > .headerlink { + opacity: 1!important; + visibility: visible!important; + text-decoration: none; + color: inherit!important; + display: block; + outline: none; + box-shadow: none; + margin-left: 0; +} +.accordion-description { + opacity: 0.8; +} +.accordion.show .accordion-description { + margin-bottom: 8px; +} + +table .thead2 { + background: rgba(0, 0, 0, 0.05); + white-space: nowrap; +} +table .thead2 h6 { + color: #888; +} diff --git a/resources/docs/img/logo-nobadge.png b/resources/docs/img/logo-nobadge.png deleted file mode 120000 index 88c35c42..00000000 --- a/resources/docs/img/logo-nobadge.png +++ /dev/null @@ -1 +0,0 @@ -../../images/logo-nobadge.png \ No newline at end of file diff --git a/resources/docs/img/logo-nobadge.svg b/resources/docs/img/logo-nobadge.svg deleted file mode 120000 index 71ddf3d3..00000000 --- a/resources/docs/img/logo-nobadge.svg +++ /dev/null @@ -1 +0,0 @@ -../../images/logo-nobadge.svg \ No newline at end of file diff --git a/resources/docs/img/logo.png b/resources/docs/img/logo.png new file mode 120000 index 00000000..e018c559 --- /dev/null +++ b/resources/docs/img/logo.png @@ -0,0 +1 @@ +../../images/logo.png \ No newline at end of file diff --git a/resources/docs/img/logo_discourse.png b/resources/docs/img/logo_discourse.png deleted file mode 120000 index fe0933c4..00000000 --- a/resources/docs/img/logo_discourse.png +++ /dev/null @@ -1 +0,0 @@ -../../images/logo_discourse.png \ No newline at end of file diff --git a/resources/docs/img/logo_nobadge.png b/resources/docs/img/logo_nobadge.png new file mode 120000 index 00000000..8bdc8145 --- /dev/null +++ b/resources/docs/img/logo_nobadge.png @@ -0,0 +1 @@ +../../images/logo_nobadge.png \ No newline at end of file diff --git a/resources/docs/index.md b/resources/docs/index.md index e69de29b..8e79c8f7 100644 --- a/resources/docs/index.md +++ b/resources/docs/index.md @@ -0,0 +1,27 @@ +# Open Stage Control +## Libre and modular OSC / MIDI controller + + + + + + + diff --git a/app/assets/fonts/fa-solid-900.woff b/resources/fonts/fa-solid-900.woff similarity index 100% rename from app/assets/fonts/fa-solid-900.woff rename to resources/fonts/fa-solid-900.woff diff --git a/app/assets/fonts/fa-solid.css b/resources/fonts/fa-solid.css similarity index 100% rename from app/assets/fonts/fa-solid.css rename to resources/fonts/fa-solid.css diff --git a/app/assets/fonts/fontawesome.min.css b/resources/fonts/fontawesome.min.css similarity index 100% rename from app/assets/fonts/fontawesome.min.css rename to resources/fonts/fontawesome.min.css diff --git a/resources/fonts/fonts b/resources/fonts/fonts new file mode 120000 index 00000000..6dafdaff --- /dev/null +++ b/resources/fonts/fonts @@ -0,0 +1 @@ +fonts \ No newline at end of file diff --git a/app/assets/fonts/roboto-medium.css b/resources/fonts/roboto-medium.css similarity index 100% rename from app/assets/fonts/roboto-medium.css rename to resources/fonts/roboto-medium.css diff --git a/app/assets/fonts/roboto-medium.woff b/resources/fonts/roboto-medium.woff similarity index 100% rename from app/assets/fonts/roboto-medium.woff rename to resources/fonts/roboto-medium.woff diff --git a/app/assets/fonts/roboto-mono.woff b/resources/fonts/roboto-mono.woff similarity index 100% rename from app/assets/fonts/roboto-mono.woff rename to resources/fonts/roboto-mono.woff diff --git a/resources/images/logo-nobadge.png b/resources/images/logo-nobadge.png deleted file mode 100644 index d0fa5ef9..00000000 Binary files a/resources/images/logo-nobadge.png and /dev/null differ diff --git a/resources/images/logo-nobadge.svg b/resources/images/logo-nobadge.svg deleted file mode 100644 index 9824cd48..00000000 --- a/resources/images/logo-nobadge.svg +++ /dev/null @@ -1,86 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - - - - diff --git a/resources/images/logo.png b/resources/images/logo.png index f16ee0b7..3eca5a0a 100644 Binary files a/resources/images/logo.png and b/resources/images/logo.png differ diff --git a/resources/images/logo.svg b/resources/images/logo.svg index f80bb8cc..8b5e69d7 100644 --- a/resources/images/logo.svg +++ b/resources/images/logo.svg @@ -7,7 +7,6 @@ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" - xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" version="1.1" @@ -15,8 +14,10 @@ width="191.29887" height="191.29887" viewBox="0 0 191.29887 191.29887" - sodipodi:docname="logo-2.svg" - inkscape:version="0.92.2 (5c3e80d, 2017-08-06)"> + sodipodi:docname="logo_badge.svg" + inkscape:version="0.92.4 (5da689c313, 2019-01-14)"> + @@ -38,20 +39,20 @@ guidetolerance="10" inkscape:pageopacity="0" inkscape:pageshadow="2" - inkscape:window-width="1024" - inkscape:window-height="732" + inkscape:window-width="1920" + inkscape:window-height="1003" id="namedview871" showgrid="false" fit-margin-top="0" fit-margin-left="0" fit-margin-right="0" fit-margin-bottom="0" - inkscape:zoom="1.0826988" - inkscape:cx="41.558745" - inkscape:cy="54.862386" + inkscape:zoom="2.1653976" + inkscape:cx="88.174993" + inkscape:cy="70.732017" inkscape:window-x="0" - inkscape:window-y="36" - inkscape:window-maximized="0" + inkscape:window-y="24" + inkscape:window-maximized="1" inkscape:current-layer="layer2" showguides="true" inkscape:pagecheckerboard="true" /> @@ -62,17 +63,16 @@ style="display:inline" transform="translate(-8.257576,-8.257576)"> - + + inkscape:connector-curvature="0" /> - + transform="translate(8.257576,8.257576)" /> - + style="display:inline;opacity:1;fill:#ffffff;fill-opacity:1;stroke:none;stroke-width:5.27885389;stroke-linecap:square;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" /> diff --git a/resources/images/logo_discourse.png b/resources/images/logo_discourse.png index 38997ad4..e188dbc5 100644 Binary files a/resources/images/logo_discourse.png and b/resources/images/logo_discourse.png differ diff --git a/resources/images/logo_discourse.svg b/resources/images/logo_discourse.svg new file mode 100644 index 00000000..3cca9401 --- /dev/null +++ b/resources/images/logo_discourse.svg @@ -0,0 +1,110 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + Open Stage Control + + diff --git a/resources/images/logo_discourse_black.png b/resources/images/logo_discourse_black.png deleted file mode 100644 index 884a3de0..00000000 Binary files a/resources/images/logo_discourse_black.png and /dev/null differ diff --git a/resources/images/logo_nobadge.png b/resources/images/logo_nobadge.png new file mode 100644 index 00000000..89235c82 Binary files /dev/null and b/resources/images/logo_nobadge.png differ diff --git a/resources/images/logo_nobadge.svg b/resources/images/logo_nobadge.svg new file mode 100644 index 00000000..75035d74 --- /dev/null +++ b/resources/images/logo_nobadge.svg @@ -0,0 +1,97 @@ + + + + + + + + + image/svg+xml + + + + + + + + + + + + + diff --git a/resources/mkdocs.yml b/resources/mkdocs.yml index beacef3b..e9baf071 100644 --- a/resources/mkdocs.yml +++ b/resources/mkdocs.yml @@ -6,13 +6,22 @@ copyright: "Open Stage Control is an AMMD software site_description: "Libre and modular OSC / MIDI controller" theme: - name: null - custom_dir: 'theme/' - favicon: 'img/logo-nobadge.png?1' - include_search_page: true - static_templates: - - 404.html + name: 'material' + custom_dir: 'theme' + # font: false + features: + - tabs + - instant + palette: + primary: 'Black' + accent: 'Indigo' + logo: 'img/logo.png' + favicon: 'img/logo_nobadge.png?6' + # static_templates: + # - 404.html +extra_css: + - 'extra/styles.css' extra: screenshot: img/ardour-osc.png @@ -26,24 +35,42 @@ extra: url : http://openstagecontrol.herokuapp.com nav: - - Open Stage Control: index.md - - Docs: docs.md - - Docs: - - Getting started: docs/getting-started.md - - User interface: docs/interface.md - - Editing sessions: docs/editing-sessions.md - - Widgets reference: docs/widgets-reference.md - - Advanced property syntax: docs/advanced-property-syntax.md - - Scripting: docs/scripting.md - - CSS Tips: docs/css-tips.md - - Theming: docs/theming.md - - URL options: docs/url-options.md + - Home: index.md + - Download: + - download.md + - Documentation: + - Getting started: + - docs/getting-started/server-setup.md + - docs/getting-started/supported-platforms.md + - docs/getting-started/running-from-sources.md + - docs/getting-started/running-with-node.md + - User interface: + - docs/user-interface/user-interface.md + - docs/user-interface/editor.md + - docs/user-interface/keyboard-shortcuts.md + - Widgets: + - docs/widgets/general-mechanics.md + - docs/widgets/properties-reference.md + - docs/widgets/advanced-syntaxes.md + - docs/widgets/scripting.md + - MIDI: + - MIDI setup: docs/midi/midi-setup.md + - MIDI messages: docs/midi/midi-messages.md + - Custom module: + - docs/custom-module/custom-module.md + - docs/custom-module/examples.md + - docs/custom-module/managing-big-modules.md + - Customization: + - docs/customization/themes.md + - docs/customization/css-tips.md + - Client options: docs/client-options.md - Remote control: docs/remote-control.md - - Custom module: docs/custom-module.md - - Midi: docs/midi.md - - Examples: docs/examples.md - Credits: docs/credits.md - - Support: support.md + + - Bug Tracker: + - 'Bug Tracker': 'https://github.com/jean-emmanuel/open-stage-control/issues' + - Community: + - 'Community forums': 'https://openstagecontrol.discourse.group' markdown_extensions: - markdown.extensions.extra @@ -68,6 +95,6 @@ markdown_extensions: - pymdownx.tasklist: custom_checkbox: true - pymdownx.tilde - -plugins: - - search +# +# plugins: +# - search diff --git a/resources/package.json b/resources/package.json index 51e6a1df..1e0dcc51 100644 --- a/resources/package.json +++ b/resources/package.json @@ -7,7 +7,7 @@ "doc": "docs" }, "scripts": { - "build": "node scripts/build-css && mkdocs build" + "build": "mkdocs build" }, "author": "", "license": "ISC", diff --git a/resources/site/.htaccess b/resources/site/.htaccess deleted file mode 100644 index 46950d80..00000000 --- a/resources/site/.htaccess +++ /dev/null @@ -1,14 +0,0 @@ -RewriteEngine On -RewriteBase / - -RewriteRule ^extras/(.*)$ docs/$1 [QSA,L,R=301] -RewriteRule ^user-guide/(.*)$ docs/$1 [QSA,L,R=301] -RewriteRule ^docs/$ docs/getting-started [QSA,L] - -RewriteCond %{HTTPS} !on -RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301] - -RewriteCond %{HTTP_HOST} ^osc.ammd.net -RewriteRule ^(.*)$ https://openstagecontrol.ammd.net/%{REQUEST_URI} [L,R=301] - -ErrorDocument 404 /404.html diff --git a/resources/src/scss/styles.scss b/resources/src/scss/styles.scss index 3bbf2bb0..608e1142 100644 --- a/resources/src/scss/styles.scss +++ b/resources/src/scss/styles.scss @@ -23,10 +23,11 @@ h1,h2,h3,h4,h5 { font-weight: 100; } h2 { - font-weight: 400; + // font-weight: 400; } h4 { - font-size: 1.1rem; + font-size: .8rem; + font-weight: 800; } h1 + h2 { // position: relative; @@ -195,13 +196,18 @@ code { padding: 2px!important; } -h1,h2,h3,h4,h5 { +h1,h2,h3 { code { vertical-align: middle; font-size: 70%; } } - +h4,h5 { + code { + vertical-align: middle; + font-size: inherit; + } +} table code { diff --git a/resources/theme/404.html b/resources/theme/404.html deleted file mode 100644 index 8615bbe9..00000000 --- a/resources/theme/404.html +++ /dev/null @@ -1,8 +0,0 @@ -{% extends "base.html" %} - -{% block content %} - -

404

-

Page not found.

- -{% endblock %} diff --git a/resources/theme/base.html b/resources/theme/base.html deleted file mode 100644 index af307122..00000000 --- a/resources/theme/base.html +++ /dev/null @@ -1,127 +0,0 @@ - - - - - - - - - {% if page.title and not page.is_homepage %}{{ page.title }} - {% endif %}{{ config.site_name }} - - - - - {% block extrahead %} - {% endblock %} - - -
-
-
-
- -
-
- - -
-
- -
-
- Home - Docs - Support - Bug Tracker - Community -
-
-
-
-
- - {% if page.is_homepage %} -
- -
-

{{ config.site_name }}

-

{{ config.site_description }}

-
-
    - {% for link in config.extra.links %} -
  • {{link.title}}
  • - {% endfor %} -
-
-
- {% endif %} - -
- {% if 'docs' in page.url %} - {% set ns = namespace(navigation=[]) %} - {% for nav_item in nav %} - {% if nav_item.children %} - {% set ns.navigation = nav_item %} - {% endif %} - {% endfor %} -
- -
- {% endif %} - - -
- {% if page.is_homepage %} - {% include 'home.html' %} - {% endif %} - - {% block content %} - {{ page.content }} - {% endblock %} -
-
- - - - - - - - diff --git a/resources/theme/fonts/Roboto-Light-webfont.woff b/resources/theme/fonts/Roboto-Light-webfont.woff deleted file mode 100644 index 8f5552d8..00000000 Binary files a/resources/theme/fonts/Roboto-Light-webfont.woff and /dev/null differ diff --git a/resources/theme/fonts/Roboto-Regular-webfont.woff b/resources/theme/fonts/Roboto-Regular-webfont.woff deleted file mode 100644 index 8aa07d73..00000000 Binary files a/resources/theme/fonts/Roboto-Regular-webfont.woff and /dev/null differ diff --git a/resources/theme/fonts/roboto.css b/resources/theme/fonts/roboto.css deleted file mode 100644 index 5f19f8f4..00000000 --- a/resources/theme/fonts/roboto.css +++ /dev/null @@ -1,16 +0,0 @@ -@font-face { - font-family: Roboto; - src: url('Roboto-Regular-webfont.woff') format('woff'); - font-weight: normal; - font-style: normal; - -} - - -@font-face { - font-family: Roboto; - src: url('Roboto-Light-webfont.woff') format('woff'); - font-weight: 100; - font-style: normal; - -} diff --git a/resources/theme/home.html b/resources/theme/home.html deleted file mode 100644 index 935c6916..00000000 --- a/resources/theme/home.html +++ /dev/null @@ -1,3 +0,0 @@ -
- -
diff --git a/resources/theme/main.html b/resources/theme/main.html index 94d9808c..904cb547 100644 --- a/resources/theme/main.html +++ b/resources/theme/main.html @@ -1 +1,5 @@ {% extends "base.html" %} + +{% block fonts %} + +{% endblock %} diff --git a/resources/theme/scripts.js b/resources/theme/scripts.js deleted file mode 100644 index 36846f73..00000000 --- a/resources/theme/scripts.js +++ /dev/null @@ -1,43 +0,0 @@ -function getOffset(element) { - var offset = 0 - if (element) { - do { - if (!isNaN(element.offsetTop)) { - offset += element.offsetTop - element.scrollTop - } - } while ((element = element.offsetParent)) - } - - return offset -} - -var navHeight = 80 -function offsetScroll(){ - if (document.location.hash) { - var el = document.getElementById(document.location.hash.substring(1)) - if (el) document.body.scrollTop = document.documentElement.scrollTop = getOffset(el) - navHeight - } -} -window.addEventListener('hashchange', offsetScroll) -setTimeout(offsetScroll, 250) - - -var mobileToggle = document.getElementById('mobile-toggle'), - mobileMenu = document.getElementById('mobile-menu'), - show = false - -function toggleMenu(s){ - show = s === undefined ? !show : s - mobileToggle.classList.toggle('show', show) - mobileMenu.classList.toggle('show', show) -} - -mobileToggle.addEventListener('click', function(){ - toggleMenu() -}) - -document.addEventListener('click', function(e){ - if (!mobileToggle.parentNode.contains(e.target)) { - toggleMenu(false) - } -}) diff --git a/resources/theme/search.html b/resources/theme/search.html deleted file mode 100644 index 42d98728..00000000 --- a/resources/theme/search.html +++ /dev/null @@ -1,14 +0,0 @@ -{% extends "base.html" %} - -{% block extrahead %} - -{% endblock %} - -{% block content %} - - - -
-
- -{% endblock %}