widgets: add default property for setting initial/doubleTap/spring value (issue #174)

This commit is contained in:
jean-emmanuel 2018-03-01 19:00:42 +01:00
parent 72e724aa85
commit 99a7e4d2ac
33 changed files with 138 additions and 57 deletions

View file

@ -49,12 +49,12 @@ Pads are multidimensional widgets that output multiple values.
### `spring`
- type: `boolean`
- default: `false`
- usage: when set to `true`, the widget will go back to its initial value when released.
- usage: when set to `true`, the widget will go back to its `default` value when released.
### `doubleTap`
- type: `boolean`
- default: `false`
- usage: set to `true` to make the xy reset to its initial value when receiving a double tap
- usage: set to `true` to make the xy reset to its `default` value when receiving a double tap
### `split`
- type: `boolean|object`

View file

@ -82,13 +82,13 @@ range: {
### `spring`
- type: `boolean`
- default: `false`
- usage: when set to `true`, the widget will go back to its initial value when released.
- usage: when set to `true`, the widget will go back to its `default` value when released.
### `doubleTap`
- type: `boolean`
- default: `false`
- usage: set to `true` to make the fader reset to its initial value when receiving a double tap
- usage: set to `true` to make the fader reset to its `default` value when receiving a double tap
### `meter`
- type: `boolean`
@ -181,12 +181,12 @@ range: {
### `spring`
- type: `boolean`
- default: `false`
- usage: when set to `true`, the widget will go back to its initial value when released.
- usage: when set to `true`, the widget will go back to its `default` value when released.
### `doubleTap`
- type: `boolean`
- default: `false`
- usage: set to `true` to make the knob reset to its initial value when receiving a double tap
- usage: set to `true` to make the knob reset to its `default` value when receiving a double tap
### `css`
```

View file

@ -55,16 +55,24 @@ All widgets share a set of generic properties described below.
- `border-radius:5rem; > .label {font-size: 20rem}` will round the widget's corners and increase its label's font-size (the `>` selector targets only the direct children of the widget element)
## OSC
## Value
### `default`
- type: `*`
- default: `empty`
- usage: if set, the widget will be initialized with this `value` when the session is loaded. Some widgets use recall this property under specific conditions (see fader's `doubleTap` for example).
- note: its `type` must match the widget's value type (ie a `number` for sliders, an `array` for pads, etc).
### `value`<i class="md-icon" title="dynamic">flash_on</i>
- type: `*`
- default: `empty`
- usage: if set, the widget will be initialized with this `value`. This won't send any osc message unless it is changed because of a property inheritance update initiated by an action that should send osc (e.g. dragging a slider).
- usage: set `value` to define a widget's value depending on other widget's values / properties using [property inheritance](../extras/property-inheritance.md) and [property maths](../extras/property-maths.md). When updated by an osc-sending event (e.g. dragging a slider), the widget will send its own osc message as well.
- note: its `type` must match the widget's value type (ie a `number` for sliders, an `array` for pads, etc).
## OSC
### `precision`<i class="md-icon" title="dynamic">flash_on</i>
- type: `integer|string`
- default: `2`