Merge branch 'master' of github.com:jean-emmanuel/open-stage-control
This commit is contained in:
commit
ff4cd0b01a
10 changed files with 62 additions and 8 deletions
|
|
@ -48,6 +48,7 @@ module.exports.widgets = {
|
|||
|
||||
// scripts
|
||||
script: require('./scripts/script'),
|
||||
variable: require('./scripts/variable'),
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -59,7 +60,7 @@ module.exports.categories = {
|
|||
'Indicators':['led', 'text'],
|
||||
'Pads':['xy','rgb','multixy'],
|
||||
'Sliders':['fader','knob', 'encoder', 'range'],
|
||||
'Scripts':['script'],
|
||||
'Scripts':['script', 'variable'],
|
||||
}
|
||||
|
||||
var defaults = {}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ class Script extends Widget {
|
|||
|
||||
}, [
|
||||
|
||||
'visible', 'label', 'interaction',
|
||||
'visible', 'interaction',
|
||||
'_geometry', 'left', 'top', 'width', 'height', 'expand',
|
||||
'_style', 'colorBg', 'colorText', 'colorWidget', 'colorFill', 'colorStroke', 'alphaStroke', 'alphaFillOn', 'alphaFillOff', 'padding', 'css'
|
||||
|
||||
|
|
|
|||
41
src/client/widgets/scripts/variable.js
Normal file
41
src/client/widgets/scripts/variable.js
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
var Widget = require('../common/widget'),
|
||||
StaticProperties = require('../mixins/static_properties')
|
||||
|
||||
module.exports = class Variable extends StaticProperties(Widget, {bypass: true, interaction: false, visible: false}) {
|
||||
|
||||
static description() {
|
||||
|
||||
return 'Receives / stores a value, to be used in scripts (using the get function) or in properties (using the @{} syntax).'
|
||||
|
||||
}
|
||||
|
||||
static defaults() {
|
||||
|
||||
return super.defaults({
|
||||
|
||||
|
||||
}, [
|
||||
'visible', 'interaction',
|
||||
'_geometry', 'left', 'top', 'width', 'height', 'expand',
|
||||
'_style', 'colorBg', 'colorText', 'colorWidget', 'colorFill', 'colorStroke', 'alphaStroke', 'alphaFillOn', 'alphaFillOff', 'padding', 'css',
|
||||
'decimals', 'bypass'
|
||||
], {})
|
||||
|
||||
}
|
||||
|
||||
constructor(options) {
|
||||
|
||||
super({...options, html: null})
|
||||
|
||||
}
|
||||
|
||||
|
||||
setValue(v, options={}) {
|
||||
|
||||
this.value = v
|
||||
|
||||
if (options.sync) this.changed(options)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ class MidiConverter {
|
|||
try {
|
||||
[name, data] = JSON.parse(message)
|
||||
} catch (err) {
|
||||
// console.log(err)
|
||||
if (settings.read('debug')) console.error(`(DEBUG, MIDI) Unparsed python log:\n ${message}`)
|
||||
}
|
||||
if (name == 'log') {
|
||||
if (data.indexOf('ERROR') > -1) {
|
||||
|
|
@ -93,7 +93,9 @@ class MidiConverter {
|
|||
}
|
||||
}
|
||||
|
||||
MidiConverter.parseIpc(results)
|
||||
for (let r of results) {
|
||||
MidiConverter.parseIpc(r)
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue