- added generic value option for setting a widget's initial value
- **text** widget's `defaultText` replaced with `value`
This commit is contained in:
parent
7c01444e21
commit
4e8ca970a9
18 changed files with 36 additions and 12 deletions
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -1,10 +1,18 @@
|
|||
# Changelog
|
||||
|
||||
## next
|
||||
|
||||
- main
|
||||
- `--no-gui` didn't prevent the launcher from spanwing
|
||||
- widgets
|
||||
- added generic `value` option for setting a widget's initial value
|
||||
- **text** widget's `defaultText` replaced with `value`
|
||||
|
||||
## 0.10.4
|
||||
|
||||
- main
|
||||
- launcher displays new version if available
|
||||
- launcher stays opened after starting the server and/or the gui except if `--gui-only` is set
|
||||
- launcher stays opened after starting the server and/or the gui except if `--gui-only` is set
|
||||
|
||||
## 0.10.3
|
||||
|
||||
|
|
|
|||
|
|
@ -71,12 +71,18 @@ A widget object is a javascript object. All widgets share a set of generic prope
|
|||
### OSC
|
||||
|
||||
|
||||
#### `value`
|
||||
- type: `*`
|
||||
- default: `empty`
|
||||
- usage: if set, the widget will be initialized with this `value`. This won't affect linked widgets and won't send any osc message.
|
||||
- note: its `type` must match the widget's value type (ie a `number` for sliders, an `array` for pads, etc)
|
||||
|
||||
|
||||
#### `precision`
|
||||
- type: `integer`
|
||||
- default: `2`
|
||||
- usage: the `precision` property defines the number of decimals to display and to send. Set to `0` to send `integers` only.
|
||||
|
||||
|
||||
#### `target`
|
||||
- type: `array`
|
||||
- default: `[]`
|
||||
|
|
|
|||
|
|
@ -167,12 +167,6 @@ Text displays incoming values (via osc) as text. Sending a message with no argum
|
|||
- default: `false`
|
||||
- usage: set to `true` display vertically
|
||||
|
||||
#### `defaultText`
|
||||
- type: `string`
|
||||
- default: `empty`
|
||||
- usage: default text to be displayed. If not set, `label` or `id` is used
|
||||
|
||||
|
||||
## Meter
|
||||
|
||||
Meter displays incoming numerical values (via osc) as a gauge level
|
||||
|
|
|
|||
|
|
@ -202,6 +202,11 @@ module.exports.widgets = function(data,parent) {
|
|||
WIDGETS_BY_ADDRESS[addressref].push(widgetInner)
|
||||
}
|
||||
|
||||
// set widget's initial state
|
||||
if (widgetData.value !== '' && widgetInner.setValue) {
|
||||
widgetInner.setValue(widgetData.value)
|
||||
}
|
||||
|
||||
// Append the widget to its parent
|
||||
parent[0].appendChild(widgetContainer[0])
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ module.exports.options = {
|
|||
separator3:'osc',
|
||||
|
||||
range:{min:0,max:1},
|
||||
value:'',
|
||||
origin: 'auto',
|
||||
logScale:false,
|
||||
precision:2,
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ module.exports.options = {
|
|||
|
||||
on:1,
|
||||
off:0,
|
||||
value:'',
|
||||
norelease:false,
|
||||
precision:2,
|
||||
address:'auto',
|
||||
|
|
|
|||
|
|
@ -26,6 +26,7 @@ module.exports.options = {
|
|||
|
||||
on:1,
|
||||
off:0,
|
||||
value:'',
|
||||
precision:2,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@ module.exports.options = {
|
|||
rangeY:{min:0,max:1},
|
||||
logScaleX:false,
|
||||
logScaleY:false,
|
||||
value:'',
|
||||
precision:2,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ module.exports.options = {
|
|||
|
||||
separator3:'osc',
|
||||
|
||||
value:'',
|
||||
precision:0,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ module.exports.options = {
|
|||
rangeY:{min:0,max:1},
|
||||
logScaleX:false,
|
||||
logScaleY:false,
|
||||
value:'',
|
||||
precision:2,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ module.exports.options = {
|
|||
|
||||
range:{min:0,max:1},
|
||||
logScale:false,
|
||||
value:'',
|
||||
preArgs:[],
|
||||
address:'auto'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@ module.exports.options = {
|
|||
|
||||
range:{min:0,max:1},
|
||||
logScale:false,
|
||||
value:'',
|
||||
address:'auto',
|
||||
preArgs:[]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,18 +15,16 @@ module.exports.options = {
|
|||
|
||||
separator2:'osc',
|
||||
|
||||
value:'',
|
||||
preArgs:[],
|
||||
address:'auto',
|
||||
defaultText:''
|
||||
}
|
||||
module.exports.create = function(widgetData,container) {
|
||||
var widget = $(`
|
||||
<div class="text">
|
||||
</div>
|
||||
`),
|
||||
label = widgetData.defaultText!==''?
|
||||
widgetData.defaultText:
|
||||
widgetData.label===false?
|
||||
label = widgetData.label===false?
|
||||
widgetData.id:
|
||||
widgetData.label=='auto'?
|
||||
widgetData.id:
|
||||
|
|
|
|||
|
|
@ -25,6 +25,7 @@ module.exports.options = {
|
|||
|
||||
separator3:'osc',
|
||||
|
||||
value:'',
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
}
|
||||
|
|
|
|||
|
|
@ -30,6 +30,7 @@ module.exports.options = {
|
|||
|
||||
range:{min:0,max:1},
|
||||
origin: 'auto',
|
||||
value:'',
|
||||
logScale:false,
|
||||
precision:2,
|
||||
meter:false,
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ module.exports.options = {
|
|||
|
||||
range:{min:0,max:1},
|
||||
origin: 'auto',
|
||||
value:'',
|
||||
logScale:false,
|
||||
precision:2,
|
||||
address:'auto',
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ module.exports.options = {
|
|||
separator2:'osc',
|
||||
|
||||
values:{"Value 1":1,"Value 2":2},
|
||||
value:'',
|
||||
precision:2,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ module.exports.options = {
|
|||
|
||||
on:1,
|
||||
off:0,
|
||||
value:'',
|
||||
precision:2,
|
||||
address:'auto',
|
||||
preArgs:[],
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue