diff --git a/src/browser/js/app/managers.js b/src/browser/js/app/managers.js index a7733bd6..950e149e 100644 --- a/src/browser/js/app/managers.js +++ b/src/browser/js/app/managers.js @@ -13,7 +13,7 @@ var WidgetManager = function(){ this.preArgsSeparator = '||||' $(document).ready(()=>{ - $('body').off('sync.global').on('sync.global',(e)=>{ + $('body').off('change.global').on('change.global',(e)=>{ var {id, widget, linkId, fromExternal, options} = e, widgetsById = this.getWidgetById(id), diff --git a/src/browser/js/app/osc.js b/src/browser/js/app/osc.js index 607a2050..bcd56c9c 100644 --- a/src/browser/js/app/osc.js +++ b/src/browser/js/app/osc.js @@ -29,7 +29,7 @@ Osc.prototype.send = function(data) { Osc.prototype.sync = function(data) { - ipc.send('syncOsc', data) + ipc.send('changeOsc', data) } diff --git a/src/browser/js/app/widgets/buttons/dropdown.js b/src/browser/js/app/widgets/buttons/dropdown.js index ae6aa058..78871e6e 100644 --- a/src/browser/js/app/widgets/buttons/dropdown.js +++ b/src/browser/js/app/widgets/buttons/dropdown.js @@ -65,12 +65,12 @@ module.exports = class Dropdown extends _widgets_base { this.value = this.values[i] if (!options.fromLocal) this.select[0].selectedIndex = i if (options.send) this.sendValue() - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) this.container.removeClass('noselect') } else { this.value = undefined this.select[0].selectedIndex = -1 - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) this.container.addClass('noselect') } diff --git a/src/browser/js/app/widgets/buttons/push.js b/src/browser/js/app/widgets/buttons/push.js index f375c3bd..56dca131 100644 --- a/src/browser/js/app/widgets/buttons/push.js +++ b/src/browser/js/app/widgets/buttons/push.js @@ -83,14 +83,14 @@ module.exports = class Push extends _widgets_base { this.lastChanged = 'active' this.updateValue() if (options.send) this.sendValue(v) - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) } else if (v===this.getProp('off') || (this.getProp('off') != null && v === this.getProp('off').value && v !== undefined)) { this.widget.removeClass('active') this.active = 0 this.lastChanged = 'active' this.updateValue() if (options.send) this.sendValue(v, this.getProp('norelease')) - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) } } @@ -107,13 +107,13 @@ module.exports = class Push extends _widgets_base { this.state = 1 if (options.send) this.sendValue(v) this.lastChanged = 'state' - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'),options:options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'),options:options}) } else if (v===this.getProp('off') || (this.getProp('off') != null && v === this.getProp('off').value && v !== undefined)) { this.widget.removeClass('on') this.state = 0 if (options.send) this.sendValue(v) this.lastChanged = 'state' - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'),options:options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'),options:options}) } } diff --git a/src/browser/js/app/widgets/buttons/switch.js b/src/browser/js/app/widgets/buttons/switch.js index 116f5f67..971ac00f 100644 --- a/src/browser/js/app/widgets/buttons/switch.js +++ b/src/browser/js/app/widgets/buttons/switch.js @@ -75,11 +75,11 @@ module.exports = class Switch extends _widgets_base { this.widget.find('.on').removeClass('on') this.widget.find('.value').eq(i).addClass('on') if (options.send) this.sendValue(this.value) - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) } else { this.widget.find('.on').removeClass('on') this.value = undefined - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) } }} diff --git a/src/browser/js/app/widgets/buttons/toggle.js b/src/browser/js/app/widgets/buttons/toggle.js index b8a09ce0..dd49baf4 100644 --- a/src/browser/js/app/widgets/buttons/toggle.js +++ b/src/browser/js/app/widgets/buttons/toggle.js @@ -79,7 +79,7 @@ module.exports = class Toggle extends _widgets_base { if (options.send) this.sendValue() } - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) } diff --git a/src/browser/js/app/widgets/common/_canvas_base.js b/src/browser/js/app/widgets/common/_canvas_base.js index f46e6dcd..9df6db68 100644 --- a/src/browser/js/app/widgets/common/_canvas_base.js +++ b/src/browser/js/app/widgets/common/_canvas_base.js @@ -66,6 +66,9 @@ module.exports = class _canvas_base extends _widgets_base { this.colors.fg = style.getPropertyValue('--color-fg') this.colors.faded = style.getPropertyValue('--color-faded') this.colors.light = style.getPropertyValue('--color-light') + this.fontSize = parseFloat(style.getPropertyValue("font-size")) + this.fontFamily = style.getPropertyValue("font-family") + this.textAlign = style.getPropertyValue("text-align") } requestAnimationFrame(this.draw.bind(this)) diff --git a/src/browser/js/app/widgets/containers/modal.js b/src/browser/js/app/widgets/containers/modal.js index c35f5fb5..4b8e88b8 100644 --- a/src/browser/js/app/widgets/containers/modal.js +++ b/src/browser/js/app/widgets/containers/modal.js @@ -120,7 +120,7 @@ module.exports = class Modal extends Panel { if (!this.init && this.value) this.init = true if (options.send) this.sendValue() - if (options.sync) this.light.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) + if (options.sync) this.light.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) } diff --git a/src/browser/js/app/widgets/containers/panel.js b/src/browser/js/app/widgets/containers/panel.js index 64a0547a..23e92dd1 100644 --- a/src/browser/js/app/widgets/containers/panel.js +++ b/src/browser/js/app/widgets/containers/panel.js @@ -188,7 +188,7 @@ module.exports = class Panel extends _widgets_base { $(window).resize() if (options.send) this.sendValue() - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options}) } } diff --git a/src/browser/js/app/widgets/containers/tab.js b/src/browser/js/app/widgets/containers/tab.js index 9d92b2a5..c3f0cf60 100644 --- a/src/browser/js/app/widgets/containers/tab.js +++ b/src/browser/js/app/widgets/containers/tab.js @@ -52,7 +52,7 @@ module.exports = class Tab extends Panel { var $body = $('body') - this.widget.on('sync.detached', (e)=>{ + this.widget.on('change.detached', (e)=>{ if (this.detached) $body.trigger(e) }) diff --git a/src/browser/js/app/widgets/maths/formula.js b/src/browser/js/app/widgets/maths/formula.js index e7c014ac..ce3686a4 100644 --- a/src/browser/js/app/widgets/maths/formula.js +++ b/src/browser/js/app/widgets/maths/formula.js @@ -132,7 +132,7 @@ module.exports = class Formula extends _widgets_base { this.showValue() - if (e.options.sync && this.conditionState) this.widget.trigger({type: 'sync',id: this.getProp('id'),widget: this.widget, linkId: this.getProp('linkId'), options: e.options}) + if (e.options.sync && this.conditionState) this.widget.trigger({type: 'change',id: this.getProp('id'),widget: this.widget, linkId: this.getProp('linkId'), options: e.options}) if (e.options.send && this.conditionState) this.sendValue() } catch(err) { diff --git a/src/browser/js/app/widgets/matrices/_matrices_base.js b/src/browser/js/app/widgets/matrices/_matrices_base.js index 48530cc3..88130ab4 100644 --- a/src/browser/js/app/widgets/matrices/_matrices_base.js +++ b/src/browser/js/app/widgets/matrices/_matrices_base.js @@ -10,11 +10,11 @@ module.exports = class _matrices_base extends _widgets_base { this.start = parseInt(this.getProp('start')) - this.widget.on('sync',(e)=>{ + this.widget.on('change',(e)=>{ if (e.id==this.getProp('id')) return this.value[e.widget.parent().index()] = e.widget.abstract.getValue() - this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget,options:e.options}) + this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget,options:e.options}) }) diff --git a/src/browser/js/app/widgets/pads/multixy.js b/src/browser/js/app/widgets/pads/multixy.js index e089d093..d33a843f 100644 --- a/src/browser/js/app/widgets/pads/multixy.js +++ b/src/browser/js/app/widgets/pads/multixy.js @@ -146,7 +146,7 @@ module.exports = class MultiXy extends _pads_base { }) - this.wrapper.on('sync',(e)=>{ + this.wrapper.on('change',(e)=>{ e.stopPropagation() this.setValue(this.getValue(), e.options) }) @@ -247,7 +247,7 @@ module.exports = class MultiXy extends _pads_base { } if (options.send) this.sendValue() - if (options.sync) this.widget.trigger({type:'sync', id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) + if (options.sync) this.widget.trigger({type:'change', id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) } diff --git a/src/browser/js/app/widgets/pads/rgb.js b/src/browser/js/app/widgets/pads/rgb.js index 862045cf..9297d096 100644 --- a/src/browser/js/app/widgets/pads/rgb.js +++ b/src/browser/js/app/widgets/pads/rgb.js @@ -112,11 +112,11 @@ module.exports = class Rgb extends _pads_base { this.hueWrapper.append(this.faders.h.widget) - this.wrapper.on('sync',(e)=>{ + this.wrapper.on('change',(e)=>{ e.stopPropagation() }) - this.faders.h.widget.on('sync',(e)=>{ + this.faders.h.widget.on('change',(e)=>{ e.stopPropagation() this.dragHandle(true) }) @@ -185,7 +185,7 @@ module.exports = class Rgb extends _pads_base { this.value = v if (options.send) this.sendValue() - if (options.sync) this.widget.trigger({type:'sync', id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) + if (options.sync) this.widget.trigger({type:'change', id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) this.update({dragged:options.dragged, nohue:options.nohue || (v[0]==v[1]&&v[1]==v[2])}) diff --git a/src/browser/js/app/widgets/pads/xy.js b/src/browser/js/app/widgets/pads/xy.js index 88416fa7..5169c74a 100644 --- a/src/browser/js/app/widgets/pads/xy.js +++ b/src/browser/js/app/widgets/pads/xy.js @@ -111,7 +111,7 @@ module.exports = class Xy extends _pads_base { this.wrapper.append(this.faders.x.widget) this.wrapper.append(this.faders.y.widget) - this.wrapper.on('sync',(e)=>{ + this.wrapper.on('change',(e)=>{ e.stopPropagation() }) @@ -177,7 +177,7 @@ module.exports = class Xy extends _pads_base { ] if (options.send) this.sendValue() - if (options.sync) this.widget.trigger({type:'sync', id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) + if (options.sync) this.widget.trigger({type:'change', id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) this.draw() diff --git a/src/browser/js/app/widgets/sliders/_sliders_base.js b/src/browser/js/app/widgets/sliders/_sliders_base.js index 5bc35dad..e7f50222 100644 --- a/src/browser/js/app/widgets/sliders/_sliders_base.js +++ b/src/browser/js/app/widgets/sliders/_sliders_base.js @@ -193,7 +193,7 @@ module.exports = class _sliders_base extends _canvas_base { this.showValue() - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) if (options.send) this.sendValue(v) } diff --git a/src/browser/js/app/widgets/sliders/encoder.js b/src/browser/js/app/widgets/sliders/encoder.js index 3db3ad5c..9bef9df1 100644 --- a/src/browser/js/app/widgets/sliders/encoder.js +++ b/src/browser/js/app/widgets/sliders/encoder.js @@ -104,7 +104,7 @@ module.exports = class Encoder extends _widgets_base { this.previousValue = this.ticks/2 - this.wrapper.on('sync',(e)=>{ + this.wrapper.on('change',(e)=>{ e.stopPropagation() var value = this.knob.getValue() @@ -199,7 +199,7 @@ module.exports = class Encoder extends _widgets_base { } - if (options.sync && match) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) + if (options.sync && match) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) if (options.send && match && !(!this.getProp('snap') && options.draginit)) this.sendValue() if (options.dragged || options.draginit) this.updateDisplay(options.draginit) diff --git a/src/browser/js/app/widgets/switchers/_switchers_base.js b/src/browser/js/app/widgets/switchers/_switchers_base.js index 3cfa5d40..80ad4063 100644 --- a/src/browser/js/app/widgets/switchers/_switchers_base.js +++ b/src/browser/js/app/widgets/switchers/_switchers_base.js @@ -105,7 +105,7 @@ module.exports = class _switchers_base extends _widgets_base { } } - if (options.sync) this.widget.trigger({type:'sync',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) + if (options.sync) this.widget.trigger({type:'change',id:this.getProp('id'),widget:this.widget, linkId:this.getProp('linkId'), options:options}) if (options.send) this.sendValue() } diff --git a/src/browser/js/app/widgets/switchers/crossfader.js b/src/browser/js/app/widgets/switchers/crossfader.js index d37f44ef..ed3fbdbd 100644 --- a/src/browser/js/app/widgets/switchers/crossfader.js +++ b/src/browser/js/app/widgets/switchers/crossfader.js @@ -33,7 +33,7 @@ module.exports = class Crossfader extends Switcher { this.widget.append($('
').append(this.fader.widget)) - this.fader.widget.on('sync', (e)=>{ + this.fader.widget.on('change', (e)=>{ e.stopPropagation() diff --git a/src/browser/js/app/widgets/switchers/switcher.js b/src/browser/js/app/widgets/switchers/switcher.js index 0356a8ea..a5a72972 100644 --- a/src/browser/js/app/widgets/switchers/switcher.js +++ b/src/browser/js/app/widgets/switchers/switcher.js @@ -56,7 +56,7 @@ module.exports = class Switcher extends _switchers_base { this.widget.append(this.switch.widget) - this.switch.widget.on('sync', (e)=>{ + this.switch.widget.on('change', (e)=>{ e.stopPropagation()