diff --git a/resources/docs/docs/client-options.md b/resources/docs/docs/client-options.md index 5cd7a07b..8c5bca6b 100644 --- a/resources/docs/docs/client-options.md +++ b/resources/docs/docs/client-options.md @@ -5,10 +5,11 @@ Client options can be set either with the server's `--client-options` option, or |----|----|----|----| | hdpi | 1 / 0 | 0 | enable high resolution canvas | | forceHdpi | number | 0 | force canvas scaling (ignore `hdpi`) | -| doubletab | number | 375 | sets the double tap/click time thershold in milliseconds | +| doubletab | number | 375 | sets the double tap/click time threshold in milliseconds | | zoom | number | 1 | sets the initial zoom | | framerate | number | 60 | limit canvas drawing framerate | -| lang | string | *system_default* | use a different language than the default if available (available languages: en, fr, ru) | +| lang | string | *system_default* | use a different language than the default if available (available languages: en, fr) | +| id | string | *random_id* | client's unique id (use with caution: two clients should never have the same id) | Example: diff --git a/resources/docs/docs/custom-module/examples.md b/resources/docs/docs/custom-module/examples.md deleted file mode 100644 index cb3acefc..00000000 --- a/resources/docs/docs/custom-module/examples.md +++ /dev/null @@ -1 +0,0 @@ -!!! warning "Incomplete documentation" diff --git a/resources/docs/docs/user-interface/client.md b/resources/docs/docs/user-interface/client.md index 231adf8f..db08e9de 100644 --- a/resources/docs/docs/user-interface/client.md +++ b/resources/docs/docs/user-interface/client.md @@ -11,7 +11,7 @@ - Export: export a session file to the client's filesystem - State - Store: save all widgets' state to a persistent slot (stored in the client's cache) - - Recall: apply state storer in the persistent slot + - Recall: apply state storer in the persistent slot (updated widgets may send messages) - Send All: make all widgets send their current value - Open: browse state files on the server - Save / Save as: save state file on the server diff --git a/resources/docs/docs/user-interface/editor.md b/resources/docs/docs/user-interface/editor.md index 49e22147..613244e4 100644 --- a/resources/docs/docs/user-interface/editor.md +++ b/resources/docs/docs/user-interface/editor.md @@ -34,6 +34,7 @@ Selected widget's properties are displayed and can be modified in the inspector. - Property fields are all multiline (press `shift + enter` for new line). - Properties are written in JSON, with some flexibility brought by the [JSON5](https://github.com/json5/json5) format. For example, doubles quotes around object keys are not mandatory. +- Clicking on a property name spawns a help modal window ## Project tree diff --git a/resources/docs/docs/user-interface/keyboard-shortcuts.md b/resources/docs/docs/user-interface/keyboard-shortcuts.md deleted file mode 100644 index 8b137891..00000000 --- a/resources/docs/docs/user-interface/keyboard-shortcuts.md +++ /dev/null @@ -1 +0,0 @@ - diff --git a/resources/docs/docs/widgets/general-mechanics.md b/resources/docs/docs/widgets/general-mechanics.md index 92a84803..6dcc7653 100644 --- a/resources/docs/docs/widgets/general-mechanics.md +++ b/resources/docs/docs/widgets/general-mechanics.md @@ -1,13 +1,60 @@ -!!! warning "Incomplete documentation" +## Interaction -## Receiving / sending messages - -## Interactions +These are interaction events widgets are likely to respond to: | Mouse | Touch | Description | |---|---|---| -| Click | Tap | Handled at pressing time, not releasing. | -| Double Click | Double Tap | Some widgets handle double click / tap events. | +| Mousedown | Tap | Handled at pressing time, not releasing. | +| Click | Click | Handled at release time. | +| Double Click | Double Tap | Some widgets handle double click / double tap events. | | Drag | Drag | The widgets respond to mouse and touch drag gestures with a 1:1 precision ratio. | + + +Widgets sensibility can be tuned with the `sensibility` property. Single-touch widgets (i.e. all widgets except `mutlixy` and `range`) also accept an alternate interaction event for fine control. + +| Mouse | Touch | Description | +|---|---|---| | `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. | +| / | Two-fingers drag | Using two fingers on a single-touch target increases the gesture's precision by 10. | + + +## Sending messages + +When interacted with, widgets with at least one target (including the server's defaults) send osc messages of the following form: + +``` +/address ...preArgs ...value +``` + +If they widget has MIDI targets, the server will try to convert the osc message into a MIDI message (see [MIDI messages](../midi/midi-messages.md)). + + +## Receiving messages + +When an osc message is received, it updates every widgets that meet the following conditions + +- exact same `address` +- same `preArgs` + +The remaining arguments after `preArgs` are passed to the widget. + + +When a MIDI message is received, it's converted into an osc message (see [MIDI messages](../midi/midi-messages.md)) and follows the same rules, except that only the widgets that include the emitting MIDI device in their targets will be able to receive it. + + +## Widget synchronization + +Within a single client's scope, there are multiple ways to synchronize widgets: + +- If they share the same `id`: in this case, the synchronized widget doesn't send any osc/midi message. This case is mostly used for widget cloning. +- If they share a `linkId`: in this case, the synchronized widget sends its osc/midi message normally. +- If their `value` properties depend on each other using the [advanced syntaxes](./advances-syntaxes.md) +- Using [scripting](./scripting.md) + +## Client synchronization + +From a client to another, widgets are automatically synchronized if they share the following properties: + +- `address` +- `preArgs` +- `targets` diff --git a/resources/mkdocs.yml b/resources/mkdocs.yml index b0f068e6..9cbeac83 100644 --- a/resources/mkdocs.yml +++ b/resources/mkdocs.yml @@ -44,7 +44,6 @@ nav: - 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 diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 9050e100..c63a4086 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -124,6 +124,7 @@ class Widget extends EventEmitter { '- 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`' ]}, + ignoreDefaults: {type: 'boolean', value: false, help: 'Set to `true` to ignore the server\'s default targets'}, bypass: {type: 'boolean', value: false, help: 'Set to `true` to prevent the widget from sending any osc message'} }