Merge branch 'master' of github.com:jean-emmanuel/open-stage-control
This commit is contained in:
commit
3998477ec0
8 changed files with 36 additions and 18 deletions
|
|
@ -89,7 +89,9 @@ module.exports = function editField(editor, widget, propName, defaultValue){
|
|||
field.appendChild(input)
|
||||
|
||||
}
|
||||
var lock
|
||||
var lock,
|
||||
selectedWidgets = [...editor.selectedWidgets]
|
||||
|
||||
var onChange = ()=>{
|
||||
|
||||
if (lock) return
|
||||
|
|
@ -106,9 +108,9 @@ module.exports = function editField(editor, widget, propName, defaultValue){
|
|||
}
|
||||
|
||||
var newWidgets = []
|
||||
for (var w of editor.selectedWidgets) {
|
||||
for (var w of selectedWidgets) {
|
||||
w.props[propName] = v !== '' ? v : deepCopy(defaultValue.value)
|
||||
newWidgets.push(updateWidget(w, {changedProps: [propName], preventSelect: editor.selectedWidgets.length > 1}))
|
||||
newWidgets.push(updateWidget(w, {changedProps: [propName], preventSelect: selectedWidgets.length > 1}))
|
||||
}
|
||||
editor.pushHistory()
|
||||
if (newWidgets.length > 1) editor.select(newWidgets)
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class Push extends Widget {
|
|||
]},
|
||||
norelease: {type: 'boolean', value: false, help: 'Set to `true` to prevent sending any osc message when releasing the button'},
|
||||
|
||||
}, ['_value', 'default', 'value'])
|
||||
}, ['default'])
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ class Keys extends Widget {
|
|||
|
||||
binding: {type: 'string|array', value: '', help: 'Key combo `string` or `array` of strings (see <a href="https://github.com/RobertWHurst/KeyboardJS">KeyboardJS</a> documentation)'},
|
||||
keydown: {type: 'string', value: '', help: [
|
||||
'This property is evaluated each time the key combo is pressed. Formulas are given extras variables in this context:',
|
||||
'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)',
|
||||
'- `ctrl`: control key state',
|
||||
'- `alt`: alt key state',
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ module.exports = class Fader extends Slider {
|
|||
meter: {type: 'boolean', value: false, help: [
|
||||
'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 `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: {type: 'boolean', value: false, help: 'Set to `true` to display a compact alternative for the widget. Disables default mouse/touch focusing on the value display.'},
|
||||
dashed: {type: 'boolean', value: false, help: 'Set to `true` to display a dashed gauge'},
|
||||
|
|
@ -97,9 +97,9 @@ module.exports = class Fader extends Slider {
|
|||
horizontal:this.getProp('horizontal'),
|
||||
range:this.getProp('range'),
|
||||
logScale:this.getProp('logScale'),
|
||||
address:this.getProp('meterAddress') || this.getProp('address') + '/meter',
|
||||
preArgs:this.getProp('preArgs'),
|
||||
color:this.getProp('color'),
|
||||
address: '#{@{parent.meterAddress} ? @{parent.meterAddress} : concat(@{parent.address}, "/meter")}',
|
||||
preArgs: '@{parent.preArgs}',
|
||||
color: '@{parent.color}',
|
||||
pips:false,
|
||||
dashed:true
|
||||
}
|
||||
|
|
|
|||
|
|
@ -140,9 +140,15 @@ class Slider extends Canvas {
|
|||
var direction = e.wheelDelta / Math.abs(e.wheelDelta),
|
||||
increment = e.ctrlKey?0.25:1
|
||||
|
||||
this.percent = clip(this.percent + Math.max(increment,10/Math.pow(10,this.precision + 1)) * direction, [0,100])
|
||||
|
||||
this.setValue(this.percentToValue(this.percent), {sync:true,send:true,dragged:true})
|
||||
if (this.getProp('steps')) {
|
||||
var i = this.steps.indexOf(this.value)
|
||||
if (i > -1 && i < this.steps.length) {
|
||||
this.setValue(this.steps[i + direction], {sync: true, send: true, fromLocal: true})
|
||||
}
|
||||
} else {
|
||||
this.percent = clip(this.percent + Math.max(increment,10/Math.pow(10,this.precision + 1)) * direction, [0,100])
|
||||
this.setValue(this.percentToValue(this.percent), {sync: true, send: true, dragged: true})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -199,8 +199,6 @@ module.exports = {
|
|||
data[k] = shortdata[k]
|
||||
}
|
||||
|
||||
data.args = data.preArgs ? data.preArgs.concat(value) : [value]
|
||||
|
||||
if (data.target) {
|
||||
|
||||
var targets = []
|
||||
|
|
@ -225,11 +223,13 @@ module.exports = {
|
|||
if (data.split) {
|
||||
|
||||
for (var j in data.split) {
|
||||
osc.send(host,port,data.split[j],data.args[j],data.precision)
|
||||
data.args = data.preArgs ? data.preArgs.concat(value[j]) : [value[j]]
|
||||
osc.send(host,port,data.split[j],data.args,data.precision)
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
data.args = data.preArgs ? data.preArgs.concat(value) : [value]
|
||||
osc.send(host,port,data.address,data.args,data.precision)
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue