Merge branch 'master' of github.com:jean-emmanuel/open-stage-control

This commit is contained in:
jean-emmanuel 2019-02-01 14:04:30 +01:00
commit 3998477ec0
8 changed files with 36 additions and 18 deletions

View file

@ -1,10 +1,20 @@
# Changelog
## 0.41.5
- bug fixes
- editor: changes applied to wrong widget when clicking on a widget while editing another widget's property
- push: allow setting `value` property
- allow whitespaces in path for `--custom-module`
- widgets
- sliders: when `steps` is set, scrolling on the widget makes it go directly from one step to another
## 0.41.4
- bug fixes
- broken `--remote-saving` option
- allow whitespaces in path for `--custom-module`
- broken `--remote-saving` option*
- `fader`: built-in `meter` not updating its `address`, `preArgs` & `color` properties
- incorrect osc messsages when widget's `split` and `preArgs` are set
## 0.41.3

View file

@ -2,7 +2,7 @@
"name": "open-stage-control",
"productName": "Open Stage Control",
"description": "Libre and modular OSC / MIDI controller",
"version": "0.41.3",
"version": "0.41.4",
"author": {
"name": "Jean-Emmanuel Doucet",
"email": "jean-emmanuel@ammd.net"

View file

@ -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)

View file

@ -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'])
}

View file

@ -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',

View file

@ -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
}

View file

@ -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})
}
}

View file

@ -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)
}