From 89128542629c90d94b31a2a5c305121925aab869 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 19 Mar 2025 13:34:32 +0100 Subject: [PATCH 001/398] event/drag: prevent error when multi-touching single-touch widget --- src/client/events/drag.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/events/drag.js b/src/client/events/drag.js index 4e976251..7adef6dc 100644 --- a/src/client/events/drag.js +++ b/src/client/events/drag.js @@ -10,7 +10,7 @@ function pointerDownHandler(event) { if (!event.target._drag_multitouch) { for (var i in targets) { - if (targets[i] == event.target) return + if (targets[i] == event.target) return event } } From c0a331ece66afc6fdc1993e9889670759415fb50 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 19 Mar 2025 13:35:36 +0100 Subject: [PATCH 002/398] touchstate: misc cleanup --- src/client/widgets/mixins/touch_state.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/client/widgets/mixins/touch_state.js b/src/client/widgets/mixins/touch_state.js index e2a83b98..8b2cdbae 100644 --- a/src/client/widgets/mixins/touch_state.js +++ b/src/client/widgets/mixins/touch_state.js @@ -6,6 +6,8 @@ module.exports = (self, options)=>{ self.setValueTouchedQueue = undefined self.on('draginit',(e)=>{ + self.setValueTouchedQueue = undefined + if (self.shouldDrag && !self.shouldDrag(e)) { e.cancelDragEvent = true return @@ -34,6 +36,7 @@ module.exports = (self, options)=>{ self.onRemove = ()=>{ if (self.touched > 0) { + self.setValueTouchedQueue = undefined self.trigger('touch', {stopPropagation: true, touch: 0}) } self.__proto__.onRemove.call(self) From 973654b2d7501d79a6ed3bf7235cde35e9d9d1f2 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 19 Mar 2025 13:35:52 +0100 Subject: [PATCH 003/398] multixy: fix touch state vs feedback filtering order (dragend event handler sorting) --- src/client/widgets/pads/multixy.js | 34 +++++++++++++++--------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/client/widgets/pads/multixy.js b/src/client/widgets/pads/multixy.js index 3747ec9a..3c1037b1 100644 --- a/src/client/widgets/pads/multixy.js +++ b/src/client/widgets/pads/multixy.js @@ -111,6 +111,23 @@ class MultiXy extends Pad { this.padsCoords = [] this.touchMap = {} + this.on('dragend',(e)=>{ + + var i = this.touchMap[e.pointerId] + + if (!i) return + + e.stopPropagation = true + + this.pads[i].touched = 0 + this.pads[i].trigger('dragend', e) + + this.trigger('touch', {stopPropagation: true, touch: [parseInt(this.touchMap[e.pointerId]), 0]}) + + delete this.touchMap[e.pointerId] + + }, {element: this.widget, multitouch: true}) + touchstate(this, {element: this.widget, multitouch: true}) this.on('draginit',(e)=>{ @@ -148,23 +165,6 @@ class MultiXy extends Pad { }, {element: this.widget, multitouch: true}) - this.on('dragend',(e)=>{ - - var i = this.touchMap[e.pointerId] - - if (!i) return - - e.stopPropagation = true - - this.pads[i].touched = 0 - this.pads[i].trigger('dragend', e) - - this.trigger('touch', {stopPropagation: true, touch: [parseInt(this.touchMap[e.pointerId]), 0]}) - - delete this.touchMap[e.pointerId] - - }, {element: this.widget, multitouch: true}) - this.on('value-changed',(e)=>{ if (e.widget == this) return e.stopPropagation = true From 8d763866044dbd2688433bdd169088085c1797b8 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 19 Mar 2025 13:46:55 +0100 Subject: [PATCH 004/398] log: update --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 603fcc82..07c56084 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,14 @@ # Changelog +## 1.28.3 + +- bug fixes + - multixy: correclty handle incoming feedback values and simultaneous touch releases + ## 1.28.2 - bug fixes - - regression in feedback handling (unfixes multixy/range simultaneous spring issue temporarily) + - regression in feedback handling (unfixes multixy simultaneous spring issue temporarily) ## 1.28.1 @@ -21,7 +26,7 @@ - broken cli when `ELECTRON_RUN_AS_NODE` is set - inspector: input bug when a code editor was focused using the tab key - inspector: prevent editing non-editable widgets (e.g matrix items) when clicking on their ids in error logs - - multixy/range: simultaneous touch releases not working correctly when `spring` is set and feedback values are received shortly after being sent + - multixy: simultaneous touch releases not working correctly when `spring` is set and feedback values are received shortly after being sent - widgets - fader: add `touchZone` property to allow restricting interaction to a part of the widget From aede97cf24cec670463a3244b4f991b5b244432b Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 19 Mar 2025 13:47:09 +0100 Subject: [PATCH 005/398] package: 1.28.3 all right --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 3c208417..83878c2b 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.28.2", + "version": "1.28.3", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From 790d83433daa6b377ddc7f31e48684785cd07397 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 19 Mar 2025 17:50:19 +0100 Subject: [PATCH 006/398] misc: prevent sidepanels from catching events on 1px-wide zone at the left/right of the workspace --- src/scss/ui/workspaces.scss | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/scss/ui/workspaces.scss b/src/scss/ui/workspaces.scss index 926d4608..7db8b4c0 100644 --- a/src/scss/ui/workspaces.scss +++ b/src/scss/ui/workspaces.scss @@ -254,6 +254,10 @@ osc-panel-container { } } + &.disabled { + pointer-events: none; + } + &.disabled .toggle-button { display: none; } From 7d0d368a787ade403d77164f28e7b773c2b96604 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 19 Mar 2025 17:52:27 +0100 Subject: [PATCH 007/398] script: let console.log take multiple args and format objects correctly --- src/client/widgets/vm.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/client/widgets/vm.js b/src/client/widgets/vm.js index 76948391..3befa004 100644 --- a/src/client/widgets/vm.js +++ b/src/client/widgets/vm.js @@ -77,8 +77,9 @@ class Vm { this.sandbox.contentWindow.console = { ...console, - log: (msg)=>{ - this.getWidget().log(msg) + log: (...msg)=>{ + msg = msg.map(m => typeof m == 'object' ? JSON.stringify(m) : m) + this.getWidget().log(msg.join(' ')) } } From fae6614d4ef51c4956e80164cbf40db9bacb5074 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 19 Mar 2025 22:57:46 +0100 Subject: [PATCH 008/398] multixy: set npoints to minimum 1 to avoid errors --- CHANGELOG.md | 5 +++++ src/client/widgets/pads/multixy.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 07c56084..ddffd97c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.28.4 + +- bug fixes + - multixy: error when `points` is `0` (or empty array) + ## 1.28.3 - bug fixes diff --git a/src/client/widgets/pads/multixy.js b/src/client/widgets/pads/multixy.js index 3c1037b1..b7e7c07d 100644 --- a/src/client/widgets/pads/multixy.js +++ b/src/client/widgets/pads/multixy.js @@ -74,7 +74,7 @@ class MultiXy extends Pad { super(options) - this.npoints = Array.isArray(this.getProp('points')) ? this.getProp('points').length : this.getProp('points') || 0 + this.npoints = Math.max(Array.isArray(this.getProp('points')) ? this.getProp('points').length : this.getProp('points') || 1, 1) this.preventChildrenTouchState = true this.pads = [] From be90e0293560435324610fa4c7ce1eba874dc406 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 20 Mar 2025 09:14:13 +0100 Subject: [PATCH 009/398] multixy: better npoints safe check --- src/client/widgets/pads/multixy.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/widgets/pads/multixy.js b/src/client/widgets/pads/multixy.js index b7e7c07d..b2c19be5 100644 --- a/src/client/widgets/pads/multixy.js +++ b/src/client/widgets/pads/multixy.js @@ -74,7 +74,9 @@ class MultiXy extends Pad { super(options) - this.npoints = Math.max(Array.isArray(this.getProp('points')) ? this.getProp('points').length : this.getProp('points') || 1, 1) + this.npoints = Array.isArray(this.getProp('points')) ? this.getProp('points').length : parseInt(this.getProp('points')) + + if (isNaN(this.npoints) || this.points < 1) this.npoints = 1 this.preventChildrenTouchState = true this.pads = [] From 5b8047889bb14f8f27ab315b3d52c53262db9b28 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 20 Mar 2025 12:11:36 +0100 Subject: [PATCH 010/398] events: a few more errors to suppress --- src/client/events/drag.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/events/drag.js b/src/client/events/drag.js index 7adef6dc..e0bcced1 100644 --- a/src/client/events/drag.js +++ b/src/client/events/drag.js @@ -6,7 +6,7 @@ var targets = {}, function pointerDownHandler(event) { - if (event.capturedByEditor || event.touchPunch) return + if (event.capturedByEditor || event.touchPunch) return event if (!event.target._drag_multitouch) { for (var i in targets) { @@ -18,7 +18,7 @@ function pointerDownHandler(event) { var target = closestDragContainer(event.target) - if (!target) return + if (!target) return event if (event.traversingStack) { From e001d3be10c22d2491d85049aed7313e661af443 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 21 Mar 2025 09:20:22 +0100 Subject: [PATCH 011/398] package: v1.28.4 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 83878c2b..d655f30e 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.28.3", + "version": "1.28.4", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From 4d30880d0f74b544a2b25090de0780c0524d01e3 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 21 Mar 2025 09:23:44 +0100 Subject: [PATCH 012/398] /!\ events: groundwork for containers onTouch scripts: Drag events are now reverse-bubbling (from parents to child) to allow containers to monitor/control interaction inside them --- resources/docs/docs/widgets/canvas.md | 1 + resources/docs/docs/widgets/scripting.md | 10 ++++++- src/client/events/drag.js | 37 ++++++++++++++++++++++-- src/client/widgets/containers/panel.js | 33 +++++++++++++++++++++ src/client/widgets/containers/root.js | 3 +- src/client/widgets/pads/multixy.js | 4 --- 6 files changed, 79 insertions(+), 9 deletions(-) diff --git a/resources/docs/docs/widgets/canvas.md b/resources/docs/docs/widgets/canvas.md index 80695f42..5ae9bb0d 100644 --- a/resources/docs/docs/widgets/canvas.md +++ b/resources/docs/docs/widgets/canvas.md @@ -42,6 +42,7 @@ This script has access to the same variables and functions as the `script` prope - `targetTagName`: tag name of the html element under the pointer - `offsetX`, `offsetY`: touch coordinates in pixels, relative to the html element under the pointer - `movementX`, `movementY`: movement of the pointer in pixels since the last event + - `pageX`, `pageY`: touch coordinates in pixels, relative to the page - `pointerId`: unique identifier used to differentiate fingers in multitouch situation - `altKey`, `ctrlKey`, `shiftKey`: keyboard modifier states - `force`: amount of pressure applied to the touch surface between `0` and `1` (see [Touch.force](https://developer.mozilla.org/en-US/docs/Web/API/Touch/force)). Equals `0` if the API is not supported or if no pressure information is found. diff --git a/resources/docs/docs/widgets/scripting.md b/resources/docs/docs/widgets/scripting.md index f806cc2c..1e7aecb3 100644 --- a/resources/docs/docs/widgets/scripting.md +++ b/resources/docs/docs/widgets/scripting.md @@ -78,7 +78,15 @@ This script has access to the same variables and functions as the `script` prope - `type`: `"start"` or `"stop"` - `handle`: `undefined` if the event concerns the widget, `integer` if it concerns one of it's handles (`multixy` and `range` widgets only) -Note: the [canvas](../canvas/) widgets exposes more informations in its `onTouch` script. +[Canvas](../canvas/) and containers expose more informations in their `onTouch` script. + +??? infos "Containers onTouch" + + Containers (root, panel, etc) can monitor touch events happening inside them, it works like with [Canvas](../canvas/#ontouch), with a few differences: + + - setting `event.preventDefault` to `true` will prevent the event from reaching widgets in the container ('start' and 'move' events only) + - setting `event.allowScroll` to `true` will allow touch scrolling where it would normally be prevented ('start' event only) + - `width` and `height` are undefined ### `onDraw` diff --git a/src/client/events/drag.js b/src/client/events/drag.js index e0bcced1..f21ce235 100644 --- a/src/client/events/drag.js +++ b/src/client/events/drag.js @@ -15,6 +15,7 @@ function pointerDownHandler(event) { } event = normalizeDragEvent(event) + event.stopPropagation = true var target = closestDragContainer(event.target) @@ -113,6 +114,7 @@ function pointerMoveHandler(event) { function pointerUpHandler(event) { event = normalizeDragEvent(event, previousPointers[event.pointerId]) + event.stopPropagation = true triggerWidgetEvent(targets[event.pointerId], 'dragend', event) @@ -157,6 +159,7 @@ function pointerUpFilter(event) { function mouseDownCapture(event) { if (event.pointerType === 'touch') return + event.stopPropagation() // event.pointerId = 'mouse' pointerDownHandler(event) } @@ -213,6 +216,9 @@ domObserver.deactivate = ()=>{ function touchDownCapture(event) { var preventDefault = true + + event.stopPropagation() + for (var i in event.changedTouches) { if (isNaN(i) || !event.changedTouches[i]) continue var touchEvent = event.changedTouches[i] @@ -225,7 +231,8 @@ function touchDownCapture(event) { touchEvent = pointerDownHandler(touchEvent) - if (touchEvent.cancelDragEvent) preventDefault = false + // allow scroll if drag is cancelled or widget is a container + if (touchEvent.cancelDragEvent || touchEvent.allowScroll) preventDefault = false } if (preventDefault) event.preventDefault() } @@ -261,6 +268,20 @@ function touchUpCapture(event) { } + +function ancestorDragContainers(target) { + var containers = [], + container = target + while (container !== null) { + if (container._drag_widget) { + containers.splice(0, 0, container._drag_widget) + if (container._drag_widget.root) break + } + container = container.parentNode + } + return containers +} + function closestDragContainer(target) { var container = target while (container !== null) { @@ -276,8 +297,18 @@ function closestDragContainer(target) { // Callback trigger function triggerWidgetEvent(target, name, event) { - var container = closestDragContainer(target) - if (container) container._drag_widget.trigger(name, event) + + // trigger drag events from parent to child + var widgets = ancestorDragContainers(target), + widget + + for (widget of widgets) { + widget.trigger(name, event) + if (event.preventDefault) break + } + + // if child is a container, let it scroll + if (widget && widget.scroll) event.allowScroll = true } // init diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index 703a6238..f0a00b9b 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -45,6 +45,9 @@ class Panel extends Container() { children: { widgets: {type: 'array', value: [], help: 'Each element of the array must be a widget object. A panel cannot contain widgets and tabs simultaneously.'}, tabs: {type: 'array', value: [], help: 'Each element of the array must be a tab object. A panel cannot contain widgets and tabs simultaneously'}, + }, + scripting: { + onTouch: {type: 'script', value: '', editor:'javascript', help: ['Script executed when the session is touched and released, and when the pointer moves when the widget is touched. See documentation.',]}, } }) @@ -267,6 +270,12 @@ class Panel extends Container() { if (this.getProp('traversing')) this.setTraversing() + if (this.getProp('onTouch')) { + this.on('draginit',(e)=>this.onTouch(e, 'start'), {element: this.container, multitouch: true}) + this.on('drag',(e)=>this.onTouch(e, 'move'), {element: this.container, multitouch: true}) + this.on('dragend',(e)=>this.onTouch(e, 'stop'), {element: this.container, multitouch: true}) + } + } createNavigation() { @@ -348,6 +357,30 @@ class Panel extends Container() { } + onTouch(e, name) { + + var event = {...e} + delete event.firstTarget + + event.targetName = event.target.getAttribute('name') + event.targetTagName = event.target.tagName + + var w = widgetManager.getWidgetByElement(event.target) + if (w) event.target = w === this ? 'this' : w.getProp('id') + else event.target = null + + event.type = name + + this.scripts.onTouch.run({ + value: this.value, + event: event + }, {sync: true, send: true}) + + if (name != 'stop' && event.preventDefault) e.preventDefault = true + if (event.allowScroll) e.allowScroll = true + + } + onPropChanged(propName, options, oldPropValue) { if (super.onPropChanged(...arguments)) return true diff --git a/src/client/widgets/containers/root.js b/src/client/widgets/containers/root.js index 16aa480b..3e131a28 100644 --- a/src/client/widgets/containers/root.js +++ b/src/client/widgets/containers/root.js @@ -47,6 +47,7 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro super(options) this.widget.classList.add('root') + this.root = true this.checkMenuVisibility() @@ -61,7 +62,7 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro if (READ_ONLY) return mainMenu = mainMenu || require('../../ui/main-menu') - + if (this.getProp('hideMenu')) { mainMenu.container.style.display = 'none' } else { diff --git a/src/client/widgets/pads/multixy.js b/src/client/widgets/pads/multixy.js index b2c19be5..eaad5713 100644 --- a/src/client/widgets/pads/multixy.js +++ b/src/client/widgets/pads/multixy.js @@ -119,8 +119,6 @@ class MultiXy extends Pad { if (!i) return - e.stopPropagation = true - this.pads[i].touched = 0 this.pads[i].trigger('dragend', e) @@ -146,8 +144,6 @@ class MultiXy extends Pad { if (!id) return - e.stopPropagation = true - this.trigger('touch', {stopPropagation: true, touch: [parseInt(id), 1]}) this.pads[id].trigger('draginit', e) From a7370204922f8b3cc56514bda3debbdc0c22efea Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 21 Mar 2025 09:47:12 +0100 Subject: [PATCH 013/398] drag: change tranversering gesture reference container to let traversing containers onTouch see move events (unless captured by a nested traversing container) --- src/client/events/drag.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/events/drag.js b/src/client/events/drag.js index f21ce235..45d860d9 100644 --- a/src/client/events/drag.js +++ b/src/client/events/drag.js @@ -385,7 +385,7 @@ module.exports = { if (event.ctrlKey) return if (!event.traversingStack) event.traversingStack = {firstType: '', stack: []} event.traversingStack.stack.push({ - container: element, + container: element.parentNode, mode: traversing, type: traversingType }) From 69a8d4b576c5a34d43c90acd7afafa53dd7a39af Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 21 Mar 2025 14:46:17 +0100 Subject: [PATCH 014/398] drag: let containers see all move events during traversing gestures --- resources/docs/docs/widgets/scripting.md | 6 ++++ src/client/events/drag.js | 38 +++++++++++++++++++----- src/client/widgets/common/container.js | 2 ++ 3 files changed, 38 insertions(+), 8 deletions(-) diff --git a/resources/docs/docs/widgets/scripting.md b/resources/docs/docs/widgets/scripting.md index 1e7aecb3..d769f3d3 100644 --- a/resources/docs/docs/widgets/scripting.md +++ b/resources/docs/docs/widgets/scripting.md @@ -88,6 +88,12 @@ This script has access to the same variables and functions as the `script` prope - setting `event.allowScroll` to `true` will allow touch scrolling where it would normally be prevented ('start' event only) - `width` and `height` are undefined + Containers with `traversing` enabled change how touch events are emitted: + + - a new 'stop' event is emitted whenever the gestures exits a touchable widget + - a new 'start' event is emitted whenever the gestures enters a touchable widget + + ### `onDraw` See [canvas](../canvas/). diff --git a/src/client/events/drag.js b/src/client/events/drag.js index 45d860d9..a60b0e5e 100644 --- a/src/client/events/drag.js +++ b/src/client/events/drag.js @@ -26,13 +26,16 @@ function pointerDownHandler(event) { var widget = target._drag_widget, local = event.traversingStack.stack[event.traversingStack.stack.length - 1] - if (widget.getProp) event.traversingStack.firstType = widget.getProp('type') + if (widget.getProp) { + // if first touched widget is a container, wait until another widget is touched while moving + event.traversingStack.firstType = widget.isContainer ? '?' : widget.getProp('type') + } if (local.mode === TRAVERSING_SAMEWIDGET) { if (local.type === '') { local.type = event.traversingStack.firstType } - event.traversing = local.type === event.traversingStack.firstType + event.traversing = local.type === event.traversingStack.firstType || event.traversingStack.firstType === '?' } else { event.traversing = true } @@ -68,7 +71,10 @@ function pointerMoveHandler(event) { if (target) target = closestDragContainer(target) - var local = null + var local = null, + containersOnly = false, + backupTarget = target + if (target && event.traversingStack) { for (var i = event.traversingStack.stack.length - 1; i > -1; i--) { if (event.traversingStack.stack[i].container.contains(target)) { @@ -78,8 +84,9 @@ function pointerMoveHandler(event) { } if (!local) { target = null - } else if (local.mode === TRAVERSING_SAMEWIDGET && local.type) { + } else if (local.mode === TRAVERSING_SAMEWIDGET) { var widget = target._drag_widget + if (local.type === '?' && widget.getProp && !widget.isContainer) local.type = widget.getProp('type') if (widget.getProp && local.type !== widget.getProp('type')) target = null } } @@ -91,13 +98,27 @@ function pointerMoveHandler(event) { resetEventOffset(event, target) } - if (previousTarget !== target) { + if (previousTarget !== target && !containersOnly) { triggerWidgetEvent(previousTarget, 'dragend', event) } - if (target && event.traversing) { - triggerWidgetEvent(target, previousTarget !== target ? 'draginit' : 'drag', event) + if (target) { + + if (previousTarget === target) { + + triggerWidgetEvent(target, 'drag', event) + + } else { + triggerWidgetEvent(target, 'draginit', event) + + } + + } else { + + // notify container of move events if no draggable widget is under the pointer + triggerWidgetEvent(backupTarget, 'drag', event, true) + } targets[event.pointerId] = target @@ -296,13 +317,14 @@ function closestDragContainer(target) { // Callback trigger -function triggerWidgetEvent(target, name, event) { +function triggerWidgetEvent(target, name, event, containersOnly) { // trigger drag events from parent to child var widgets = ancestorDragContainers(target), widget for (widget of widgets) { + if (containersOnly && !widget.isContainer) continue widget.trigger(name, event) if (event.preventDefault) break } diff --git a/src/client/widgets/common/container.js b/src/client/widgets/common/container.js index 22bc36f3..6eec5906 100644 --- a/src/client/widgets/common/container.js +++ b/src/client/widgets/common/container.js @@ -6,6 +6,8 @@ var Container = (Class=Widget)=> class extends Class { super(options) + this.isContainer = true + this.on('widget-created', (e)=>{ if (e.widget.parent === this) { From de39b2fbed2a8bbe51d708aec84738dc309bc350 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 21 Mar 2025 14:49:53 +0100 Subject: [PATCH 015/398] inspector: hide ace mobile menu --- src/scss/ui/inspector.scss | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/scss/ui/inspector.scss b/src/scss/ui/inspector.scss index 3392dc79..d05c2063 100644 --- a/src/scss/ui/inspector.scss +++ b/src/scss/ui/inspector.scss @@ -274,6 +274,9 @@ osc-inspector-field .ace_editor { .ace_print-margin { display: none; } + .ace_mobile-menu { + display: none; + } .ace_cursor { color: var(--color-accent); From 0b3590278ced3a5ca776901e8f89cc4f6b6f1016 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 21 Mar 2025 15:32:33 +0100 Subject: [PATCH 016/398] drag: handle 2-fingers / ctrlKey inertia at widget level and allow changing event inertia in containers onTouch --- src/client/events/drag.js | 9 ++------- src/client/widgets/containers/panel.js | 2 ++ src/client/widgets/pads/multixy.js | 2 +- src/client/widgets/sliders/encoder.js | 5 +++-- src/client/widgets/sliders/fader.js | 6 +++--- src/client/widgets/sliders/knob.js | 6 ++++-- src/client/widgets/sliders/range.js | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/client/events/drag.js b/src/client/events/drag.js index a60b0e5e..fa1a5a20 100644 --- a/src/client/events/drag.js +++ b/src/client/events/drag.js @@ -262,15 +262,10 @@ function touchMoveCapture(event) { for (var i in event.changedTouches) { if (isNaN(i) || !event.changedTouches[i]) continue var touchEvent = event.changedTouches[i] - - var fingers = 0 + touchEvent.fingers = 0 for (var j in event.touches) { if (event.touches[j].target && event.touches[j].target.isSameNode(touchEvent.target)) { - fingers += 1 - if (fingers == 2) { - touchEvent.inertia = 10 - break - } + touchEvent.fingers += 1 } } diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index f0a00b9b..0b53a43d 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -376,6 +376,8 @@ class Panel extends Container() { event: event }, {sync: true, send: true}) + e.inertia = event.inertia + if (name != 'stop' && event.preventDefault) e.preventDefault = true if (event.allowScroll) e.allowScroll = true diff --git a/src/client/widgets/pads/multixy.js b/src/client/widgets/pads/multixy.js index eaad5713..6665ae69 100644 --- a/src/client/widgets/pads/multixy.js +++ b/src/client/widgets/pads/multixy.js @@ -157,7 +157,7 @@ class MultiXy extends Pad { if (!i) return - e.inertia = 1 // cancel mutlifinger inertia + e.fingers = 1 // cancel mutlifinger inertia this.pads[i].trigger('drag', e) diff --git a/src/client/widgets/sliders/encoder.js b/src/client/widgets/sliders/encoder.js index f63c13a7..4d95c953 100644 --- a/src/client/widgets/sliders/encoder.js +++ b/src/client/widgets/sliders/encoder.js @@ -112,10 +112,11 @@ module.exports = class Encoder extends StaticProperties(Knob, {angle: 360, range dragHandle(e) { // knob.js without clipping + extra case for snap + var inertia = e.fingers > 1 || e.ctrlKey ? 10 : e.inertia if ((this.getProp('mode') === 'vertical' && !e.traversing)) { // vertical - this.setPercent(this.percent + (-100 * e.movementY / this.height) * this.getProp('sensitivity') / e.inertia) + this.setPercent(this.percent + (-100 * e.movementY / this.height) * this.getProp('sensitivity') / inertia) } else { // snap or circular @@ -124,7 +125,7 @@ module.exports = class Encoder extends StaticProperties(Knob, {angle: 360, range var diff = this.angleToPercent(this.coordsToAngle(offsetX, offsetY), true) - this.angleToPercent(this.coordsToAngle(this.lastOffsetX, this.lastOffsetY), true) if (Math.abs(diff) < 50 && diff !== 0) { - diff = diff * this.getProp('sensitivity') / e.inertia + diff = diff * this.getProp('sensitivity') / inertia this.setPercent(this.percent + diff) } diff --git a/src/client/widgets/sliders/fader.js b/src/client/widgets/sliders/fader.js index 561f2ed2..16860286 100644 --- a/src/client/widgets/sliders/fader.js +++ b/src/client/widgets/sliders/fader.js @@ -108,10 +108,10 @@ class Fader extends Slider { var padding = this.gaugePadding if (this.getProp('design') === 'compact') padding += this.cssVars.knobSize / 2 - + var inertia = e.fingers > 1 || e.ctrlKey ? 10 : e.inertia this.percent = this.getProp('horizontal')? - this.percent + ( e.movementX / (this.width - padding * 2)) * 100 / e.inertia * this.getProp('sensitivity'): - this.percent + (-e.movementY / (this.height - padding * 2)) * 100 / e.inertia * this.getProp('sensitivity') + this.percent + ( e.movementX / (this.width - padding * 2)) * 100 / inertia * this.getProp('sensitivity'): + this.percent + (-e.movementY / (this.height - padding * 2)) * 100 / inertia * this.getProp('sensitivity') this.setValue(this.percentToValue(this.percent), {send:true,sync:true,dragged:true}) diff --git a/src/client/widgets/sliders/knob.js b/src/client/widgets/sliders/knob.js index 1a89901e..4afd621a 100644 --- a/src/client/widgets/sliders/knob.js +++ b/src/client/widgets/sliders/knob.js @@ -102,9 +102,11 @@ class Knob extends Slider { dragHandle(e) { + var inertia = e.fingers > 1 || e.ctrlKey ? 10 : e.inertia + if ((this.getProp('mode') === 'vertical' && !e.traversing)) { // vertical - this.percent = -100 * (e.movementY / e.inertia * this.getProp('sensitivity')) / this.minDimension + this.percent + this.percent = -100 * (e.movementY / inertia * this.getProp('sensitivity')) / this.minDimension + this.percent } else { // snap or circular @@ -115,7 +117,7 @@ class Knob extends Slider { this.percent = this.angleToPercent(this.coordsToAngle(offsetX, offsetY)) } else { var diff = this.angleToPercent(this.coordsToAngle(offsetX, offsetY), true) - this.angleToPercent(this.coordsToAngle(this.lastOffsetX, this.lastOffsetY), true) - if (Math.abs(diff) < 50 && diff !== 0) this.percent += (diff * 360 / this.maxAngle) * this.getProp('sensitivity') / e.inertia + if (Math.abs(diff) < 50 && diff !== 0) this.percent += (diff * 360 / this.maxAngle) * this.getProp('sensitivity') / inertia } this.lastOffsetX = offsetX diff --git a/src/client/widgets/sliders/range.js b/src/client/widgets/sliders/range.js index e0493062..d89ae3e3 100644 --- a/src/client/widgets/sliders/range.js +++ b/src/client/widgets/sliders/range.js @@ -162,7 +162,7 @@ class Range extends Fader { if (!i) return - e.inertia = 1 // cancel multifinger inertia + e.fingers = 1 // cancel multifinger inertia if (e.shiftKey) { this.faders[0].trigger('drag', e) From 69fbefdb735d096f11a700005e04597043ac6729 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 21 Mar 2025 15:38:58 +0100 Subject: [PATCH 017/398] drag: safe user custom inertia and docs --- resources/docs/docs/widgets/scripting.md | 1 + src/client/widgets/containers/panel.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/docs/docs/widgets/scripting.md b/resources/docs/docs/widgets/scripting.md index d769f3d3..4d1e9dbf 100644 --- a/resources/docs/docs/widgets/scripting.md +++ b/resources/docs/docs/widgets/scripting.md @@ -86,6 +86,7 @@ This script has access to the same variables and functions as the `script` prope - setting `event.preventDefault` to `true` will prevent the event from reaching widgets in the container ('start' and 'move' events only) - setting `event.allowScroll` to `true` will allow touch scrolling where it would normally be prevented ('start' event only) + - setting `event.inertia` will affect 'move' events (works like widget `sensitivity` in reverse (1 = normal, 10 = slow move)) - `width` and `height` are undefined Containers with `traversing` enabled change how touch events are emitted: diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index 0b53a43d..8d57d7e9 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -376,7 +376,7 @@ class Panel extends Container() { event: event }, {sync: true, send: true}) - e.inertia = event.inertia + e.inertia = parseFloat(event.inertia) || 1 if (name != 'stop' && event.preventDefault) e.preventDefault = true if (event.allowScroll) e.allowScroll = true From 38d6dbbd3dd62281bee3d33b55892e469f23a455 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 21 Mar 2025 15:41:05 +0100 Subject: [PATCH 018/398] log: latest changes --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ddffd97c..9ada0f25 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.29.0 + +- widgets + - add `onTouch` to all container widgets + - allow starting a traversing gesture outside a touchable widget + ## 1.28.4 - bug fixes From e645a98a5e50b38e9be8bd861fc596f6349c906b Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 21 Mar 2025 18:51:37 +0100 Subject: [PATCH 019/398] package: cut a beta release --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index d655f30e..f08a8da0 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.28.4", + "version": "1.29.0-beta1", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From 240835319444eb0cd2f89afbf1b6aba789790a04 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 21 Mar 2025 18:54:11 +0100 Subject: [PATCH 020/398] docs: update --- .../docs/docs/widgets/properties-reference.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index fa195d3d..e9d99e42 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -253,6 +253,12 @@ | --- | --- | --- | --- | |
value#
| `integer`|
`array` | "" | If the panel contains tabs, its value defines which tab is selected selected (by index, starting with 0).

If the panel contains widgets and `scroll` is `true`, its value is an array that contains the scrolling state between 0 and 1 for the x and y axis. | + === "scripting" + + | property | type |default | description | + | --- | --- | --- | --- | + |
onTouch#
| `script` | "" | Script executed when the session is touched and released, and when the pointer moves when the widget is touched. See documentation. | + === "children" | property | type |default | description | @@ -303,6 +309,12 @@ | --- | --- | --- | --- | | | `integer` | "" | Defines the modal's state:`0` for closed, `1` for opened | + === "scripting" + + | property | type |default | description | + | --- | --- | --- | --- | + | | `script` | "" | Script executed when the session is touched and released, and when the pointer moves when the widget is touched. See documentation. | + === "children" | property | type |default | description | @@ -362,6 +374,12 @@ | --- | --- | --- | --- | |
value#
| `integer`|
`array` | "" | If the panel contains tabs, its value defines which tab is selected selected (by index, starting with 0).

If the panel contains widgets and `scroll` is `true`, its value is an array that contains the scrolling state between 0 and 1 for the x and y axis. | + === "scripting" + + | property | type |default | description | + | --- | --- | --- | --- | + |
onTouch#
| `script` | "" | Script executed when the session is touched and released, and when the pointer moves when the widget is touched. See documentation. | + === "children" | property | type |default | description | @@ -470,6 +488,7 @@ | property | type |default | description | | --- | --- | --- | --- | + |
onTouch#
| `script` | "" | Script executed when the session is touched and released, and when the pointer moves when the widget is touched. See documentation. | |
onPreload#
| `script` | "" | Script executed before any other widget is created. See documentation. | === "children" @@ -509,6 +528,12 @@ | --- | --- | --- | --- | |
value#
| `integer`|
`array` | "" | If the panel contains tabs, its value defines which tab is selected selected (by index, starting with 0).

If the panel contains widgets and `scroll` is `true`, its value is an array that contains the scrolling state between 0 and 1 for the x and y axis. | + === "scripting" + + | property | type |default | description | + | --- | --- | --- | --- | + |
onTouch#
| `script` | "" | Script executed when the session is touched and released, and when the pointer moves when the widget is touched. See documentation. | + === "children" | property | type |default | description | From bbfe558353a3e2cb55d0e87738da6d81057757c5 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sat, 22 Mar 2025 15:01:20 +0100 Subject: [PATCH 021/398] multixy: typo in npoints fix --- CHANGELOG.md | 5 +++++ src/client/widgets/pads/multixy.js | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ada0f25..e3050a9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,11 @@ - add `onTouch` to all container widgets - allow starting a traversing gesture outside a touchable widget +## 1.28.5 + +- bug fixes + - multixy: error when `points` is `0` (or empty array) (again) + ## 1.28.4 - bug fixes diff --git a/src/client/widgets/pads/multixy.js b/src/client/widgets/pads/multixy.js index 6665ae69..011ea99e 100644 --- a/src/client/widgets/pads/multixy.js +++ b/src/client/widgets/pads/multixy.js @@ -76,7 +76,7 @@ class MultiXy extends Pad { this.npoints = Array.isArray(this.getProp('points')) ? this.getProp('points').length : parseInt(this.getProp('points')) - if (isNaN(this.npoints) || this.points < 1) this.npoints = 1 + if (isNaN(this.npoints) || this.npoints < 1) this.npoints = 1 this.preventChildrenTouchState = true this.pads = [] From 636b58c39a25b8b2a49cd4abdc6006f298f67dec Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sat, 22 Mar 2025 15:05:26 +0100 Subject: [PATCH 022/398] package: bump beta --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f08a8da0..5951d730 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.0-beta1", + "version": "1.29.0-beta2", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From 58febaeb9f3b79c62be835343b4eb2b243b29dcc Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 23 Mar 2025 01:15:27 +0100 Subject: [PATCH 023/398] panel: avoid error in onTouch if event has no target --- src/client/widgets/containers/panel.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index 8d57d7e9..61a85211 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -362,8 +362,8 @@ class Panel extends Container() { var event = {...e} delete event.firstTarget - event.targetName = event.target.getAttribute('name') - event.targetTagName = event.target.tagName + event.targetName = event.target ? event.target.getAttribute('name') : '' + event.targetTagName = event.target ? event.target.tagName : '' var w = widgetManager.getWidgetByElement(event.target) if (w) event.target = w === this ? 'this' : w.getProp('id') From 9f006ad42ef1595e22d7fb8f209093431522119a Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 23 Mar 2025 01:18:23 +0100 Subject: [PATCH 024/398] canvas: consistent onTouch method with Panel --- src/client/widgets/pads/canvas.js | 60 +++++++++++++++---------------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index 9ef4dec0..f350116e 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -93,38 +93,9 @@ class CanvasWidget extends Canvas { } }) - var touchCb = (e, type)=>{ - - var event = {...e} - delete event.firstTarget - event.targetName = event.target.getAttribute('name') - event.targetTagName = event.target.tagName - var w = widgetManager.getWidgetByElement(event.target) - if (w) event.target = w === this ? 'this' : w.getProp('id') - else event.target = null - event.type = type - - this.scripts.onTouch.run({ - value: this.value, - width: this.width, - height: this.height, - event: event, - }, {sync: true, send: true}) - - this.batchDraw() - } - - this.on('draginit',(e)=>{ - touchCb(e, 'start') - }, {element: this.container, multitouch: true}) - - this.on('drag',(e)=>{ - touchCb(e, 'move') - }, {element: this.container, multitouch: true}) - - this.on('dragend',(e)=>{ - touchCb(e, 'stop') - }, {element: this.container, multitouch: true}) + this.on('draginit',(e)=>this.onTouch(e, 'start'), {element: this.container, multitouch: true}) + this.on('drag',(e)=>this.onTouch(e, 'move'), {element: this.container, multitouch: true}) + this.on('dragend',(e)=>this.onTouch(e, 'stop'), {element: this.container, multitouch: true}) } @@ -138,6 +109,31 @@ class CanvasWidget extends Canvas { } + onTouch(e, name) { + + var event = {...e} + delete event.firstTarget + + event.targetName = event.target ? event.target.getAttribute('name') : '' + event.targetTagName = event.target ? event.target.tagName : '' + + var w = widgetManager.getWidgetByElement(event.target) + if (w) event.target = w === this ? 'this' : w.getProp('id') + else event.target = null + + event.type = name + + this.scripts.onTouch.run({ + value: this.value, + width: this.width, + height: this.height, + event: event, + }, {sync: true, send: true}) + + this.batchDraw() + + } + setValue(v, options={}) { if (Array.isArray(v)) { From 5c662ed7ae2e3bc9be124f645ddaf3e57ae4fa1a Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 23 Mar 2025 12:12:30 +0100 Subject: [PATCH 025/398] fader: dynamic knobSize --- CHANGELOG.md | 1 + src/client/widgets/common/canvas.js | 1 + src/client/widgets/sliders/slider.js | 4 +++- 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e3050a9f..ffc0c195 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - widgets - add `onTouch` to all container widgets - allow starting a traversing gesture outside a touchable widget + - fader: make `knobSize` dynamic ## 1.28.5 diff --git a/src/client/widgets/common/canvas.js b/src/client/widgets/common/canvas.js index cc3a1995..869abc61 100644 --- a/src/client/widgets/common/canvas.js +++ b/src/client/widgets/common/canvas.js @@ -198,6 +198,7 @@ class Canvas extends Widget { case 'alphaFillOn': case 'colorBg': case 'pointSize': + case 'knobSize': fastdom.measure(()=>{ this.cacheCanvasStyle() fastdom.mutate(()=>{ diff --git a/src/client/widgets/sliders/slider.js b/src/client/widgets/sliders/slider.js index 00182e12..d8a8d46b 100644 --- a/src/client/widgets/sliders/slider.js +++ b/src/client/widgets/sliders/slider.js @@ -291,6 +291,7 @@ class Slider extends Canvas { if (this.getProp('spring') && !this.touched) this.setValue(this.getSpringValue(), {...options}) return case 'colorKnob': + case 'knobSize': this.setCssVariables() return @@ -312,7 +313,8 @@ Slider.dynamicProps = Slider.prototype.constructor.dynamicProps 'spring', 'sensitivity', 'default', - 'colorKnob' + 'colorKnob', + 'knobSize' ]) module.exports = Slider From 720799633b56e29261b05ed573a0e268a7a7b54a Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 23 Mar 2025 12:18:12 +0100 Subject: [PATCH 026/398] lint: indent fix --- src/client/widgets/pads/canvas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index f350116e..1b330cae 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -132,7 +132,7 @@ class CanvasWidget extends Canvas { this.batchDraw() - } + } setValue(v, options={}) { From c26c5aaed201f11724009139d5343e8032849bcf Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 25 Mar 2025 09:07:48 +0100 Subject: [PATCH 027/398] widget base class: deeper defaults extend to allow simpler overrides --- src/client/widgets/common/widget.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 0f044eee..fdd1e219 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -162,9 +162,12 @@ class Widget extends EventEmitter { if (obj[i] === null) delete this[i] else { if (this[i] === undefined) this[i] = {} - Object.assign(this[i], obj[i]) for (let j in obj[i]) { if (obj[i][j] === null) delete this[i][j] + else { + if (!this[i][j]) this[i][j] = {} + Object.assign(this[i][j], obj[i][j]) + } } } } From b5e4add8559aa25f92d9f6d53a60d7c8656b8ac3 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 25 Mar 2025 09:09:22 +0100 Subject: [PATCH 028/398] eq/plot/visualizer/text/led: unhide interaction property (defaults to false) to allow custom container touch handling --- src/client/widgets/graphs/eq.js | 2 +- src/client/widgets/graphs/plot.js | 4 ++-- src/client/widgets/graphs/visualizer.js | 4 ++-- src/client/widgets/indicators/led.js | 7 +++---- src/client/widgets/indicators/text.js | 7 +++---- 5 files changed, 11 insertions(+), 13 deletions(-) diff --git a/src/client/widgets/graphs/eq.js b/src/client/widgets/graphs/eq.js index 6a67dd06..29098b5f 100644 --- a/src/client/widgets/graphs/eq.js +++ b/src/client/widgets/graphs/eq.js @@ -14,7 +14,7 @@ class Eq extends StaticProperties(Plot, {logScaleX: false, logScaleY:false, smoo return super.defaults().extend({ widget: { - interaction: null + interaction: {value: false} }, class_specific: { filters: {type: 'array', value: '', help: [ diff --git a/src/client/widgets/graphs/plot.js b/src/client/widgets/graphs/plot.js index 98587bde..07a7a010 100644 --- a/src/client/widgets/graphs/plot.js +++ b/src/client/widgets/graphs/plot.js @@ -3,7 +3,7 @@ var {mapToScale} = require('../utils'), html = require('nanohtml'), StaticProperties = require('../mixins/static_properties') -module.exports = class Plot extends StaticProperties(Canvas, {bypass: true, interaction: false}) { +module.exports = class Plot extends StaticProperties(Canvas, {bypass: true}) { static description() { @@ -15,7 +15,7 @@ module.exports = class Plot extends StaticProperties(Canvas, {bypass: true, inte return super.defaults().extend({ widget: { - interaction: null + interaction: {value: false} }, style: { _separator_plot_style: 'Plot style', diff --git a/src/client/widgets/graphs/visualizer.js b/src/client/widgets/graphs/visualizer.js index 8cb2eece..92d495b0 100644 --- a/src/client/widgets/graphs/visualizer.js +++ b/src/client/widgets/graphs/visualizer.js @@ -4,7 +4,7 @@ var {clip} = require('../utils'), canvasQueue = require('../common/queue') -class Visualizer extends StaticProperties(Plot, {rangeX: {min: '', max: ''}, dots: false, smooth: false, interaction: false}) { +class Visualizer extends StaticProperties(Plot, {rangeX: {min: '', max: ''}, dots: false, smooth: false}) { static description() { @@ -16,7 +16,7 @@ class Visualizer extends StaticProperties(Plot, {rangeX: {min: '', max: ''}, dot return super.defaults().extend({ widget: { - interaction: null + interaction: {value: false} }, style: { bars: null, diff --git a/src/client/widgets/indicators/led.js b/src/client/widgets/indicators/led.js index 422347de..4014e86f 100644 --- a/src/client/widgets/indicators/led.js +++ b/src/client/widgets/indicators/led.js @@ -1,9 +1,8 @@ var {mapToScale} = require('../utils'), Widget = require('../common/widget'), - html = require('nanohtml'), - StaticProperties = require('../mixins/static_properties') + html = require('nanohtml') -module.exports = class Led extends StaticProperties(Widget, {interaction: false}) { +module.exports = class Led extends Widget { static description() { @@ -15,7 +14,7 @@ module.exports = class Led extends StaticProperties(Widget, {interaction: false} return super.defaults().extend({ widget: { - interaction: null + interaction: {value: false} }, class_specific: { mode: {type: 'string', value: 'intensity', choices: ['intensity', 'color'], help: 'Defines how value is interpreted (see `value`)'}, diff --git a/src/client/widgets/indicators/text.js b/src/client/widgets/indicators/text.js index 61df9d6a..1647a5c6 100644 --- a/src/client/widgets/indicators/text.js +++ b/src/client/widgets/indicators/text.js @@ -1,9 +1,8 @@ var {iconify} = require('../../ui/utils'), Widget = require('../common/widget'), - html = require('nanohtml'), - StaticProperties = require('../mixins/static_properties') + html = require('nanohtml') -module.exports = class Text extends StaticProperties(Widget, {interaction: false}) { +module.exports = class Text extends Widget { static description() { @@ -15,7 +14,7 @@ module.exports = class Text extends StaticProperties(Widget, {interaction: false return super.defaults().extend({ widget: { - interaction: null + interaction: {value: false} }, style: { _separator_text_style: 'Text style', From 1595370be050a7dc6f100f4624088160f695f9c8 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 26 Mar 2025 13:23:27 +0100 Subject: [PATCH 029/398] docs update --- .../docs/docs/widgets/properties-reference.md | 36 +++++++++++++++++-- resources/docs/docs/widgets/scripting.md | 4 +-- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index e9d99e42..156d4cb1 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -590,6 +590,12 @@ ??? api "
plot#
" XY coordinates plot. + === "widget" + + | property | type |default | description | + | --- | --- | --- | --- | + |
interaction#
| `boolean` | false | Set to `false` to disable pointer interactions. | + === "style" | property | type |default | description | @@ -624,6 +630,12 @@ ??? api "
eq#
" Draws logarithmic frequency response from an array of filter objects. + === "widget" + + | property | type |default | description | + | --- | --- | --- | --- | + |
interaction#
| `boolean` | false | Set to `false` to disable pointer interactions. | + === "style" | property | type |default | description | @@ -658,6 +670,12 @@ ??? api "
visualizer#
" Display its value over time. + === "widget" + + | property | type |default | description | + | --- | --- | --- | --- | + |
interaction#
| `boolean` | false | Set to `false` to disable pointer interactions. | + === "style" | property | type |default | description | @@ -694,6 +712,12 @@ ??? api "
led#
" Intensity display. + === "widget" + + | property | type |default | description | + | --- | --- | --- | --- | + |
interaction#
| `boolean` | false | Set to `false` to disable pointer interactions. | + === "led" | property | type |default | description | @@ -712,6 +736,12 @@ ??? api "
text#
" Display text. + === "widget" + + | property | type |default | description | + | --- | --- | --- | --- | + |
interaction#
| `boolean` | false | Set to `false` to disable pointer interactions. | + === "style" | property | type |default | description | @@ -846,7 +876,7 @@ | --- | --- | --- | --- | |
css#
| `string` | "" | CSS rules. See documentation.

Some style-related properties can be set or read from css using css variables:
- `--color-background`: `colorBg`
- `--color-widget`: `colorWidget`
- `--color-fill`: `colorFill`
- `--color-stroke`: `colorStroke`
- `--color-text`: `colorText`
- `--widget-padding`: `padding`
- `--line-width`: `lineWidth`
- `--border-radius`: `borderRadius`
- `--alpha-fill-on`: `alphaFillOn`
- `--alpha-fill-off`: `alphaFillOff`
- `--alpha-stroke`: `alphaStroke`
- `--alpha-pips`: `alphaPips`
- `--alpha-pips-text`: `alphaPipsText`

Canvas-based widget have their computed width and height available as css variables (read-only):
- `--widget-width`
- `--widget-height` | |
design#
| `string` | "default" | Design style

Choices: `default`, `round`, `compact` | - |
knobSize#
| `number` | "auto" | Fader knob size | + |
knobSize#
| `number` | "auto" | Fader knob size | |
colorKnob#
| `string` | "auto" | Fader knob color | |
horizontal#
| `boolean` | false | Set to `true` to display the fader horizontally | |
pips#
| `boolean` | false | Set to `true` to show range breakpoints (ignored if `design` is `compact`) | @@ -922,7 +952,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
mode#
| `string` | "circular" | - `circular`: relative move in circular motion
- `snap`: snap to touch position and move in vertical motion
- `vertical`: relative move in vertical motion

Choices: `circular`, `snap`, `vertical` | - |
doubleTap#
| `boolean` | false | Set to `true` to make the fader reset to its `default` value when receiving a double tap.

Can also be an osc address, in which case the widget will just send an osc message (`/ `) | + |
doubleTap#
| `boolean` | false | Set to `true` to make the fader reset to its `default` value when receiving a double tap.

Can also be an osc address, in which case the widget will just send an osc message (`/ `)

Choices: `false`, `true`, `script` | |
range#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the breakpoints of the fader's scale:
- keys can be percentages and/or `min` / `max`
- values can be `number` or `object` if a custom label is needed

Example: (`{min:{"-inf": 0}, "50%": 0.25, max: {"+inf": 1}}`) | |
logScale#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale. Set to `-1` for exponential scale. | |
sensitivity#
| `number` | 1 | When set between 0 and 1, reduces the encoder's verbosity | @@ -947,7 +977,7 @@ | --- | --- | --- | --- | |
css#
| `string` | "" | CSS rules. See documentation.

Some style-related properties can be set or read from css using css variables:
- `--color-background`: `colorBg`
- `--color-widget`: `colorWidget`
- `--color-fill`: `colorFill`
- `--color-stroke`: `colorStroke`
- `--color-text`: `colorText`
- `--widget-padding`: `padding`
- `--line-width`: `lineWidth`
- `--border-radius`: `borderRadius`
- `--alpha-fill-on`: `alphaFillOn`
- `--alpha-fill-off`: `alphaFillOff`
- `--alpha-stroke`: `alphaStroke`
- `--alpha-pips`: `alphaPips`
- `--alpha-pips-text`: `alphaPipsText`

Canvas-based widget have their computed width and height available as css variables (read-only):
- `--widget-width`
- `--widget-height` | |
design#
| `string` | "default" | Design style

Choices: `default`, `round`, `compact` | - |
knobSize#
| `number` | "auto" | Fader knob size | + |
knobSize#
| `number` | "auto" | Fader knob size | |
colorKnob#
| `string` | "auto" | Fader knob color | |
horizontal#
| `boolean` | false | Set to `true` to display the fader horizontally | |
pips#
| `boolean` | false | Set to `true` to show range breakpoints (ignored if `design` is `compact`) | diff --git a/resources/docs/docs/widgets/scripting.md b/resources/docs/docs/widgets/scripting.md index 4d1e9dbf..a585f8e8 100644 --- a/resources/docs/docs/widgets/scripting.md +++ b/resources/docs/docs/widgets/scripting.md @@ -91,8 +91,8 @@ This script has access to the same variables and functions as the `script` prope Containers with `traversing` enabled change how touch events are emitted: - - a new 'stop' event is emitted whenever the gestures exits a touchable widget - - a new 'start' event is emitted whenever the gestures enters a touchable widget + - a new 'stop' event is emitted whenever the pointer exits a touchable widget while pressed. + - a new 'start' event is emitted whenever the pointer enters a touchable widget while pressed. ### `onDraw` From bdf3ad19584e2e7f421a09a0e16e93e12700ffbe Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 2 Apr 2025 10:19:35 +0200 Subject: [PATCH 030/398] misc: on win32 display full error when failing to list disks --- src/server/callbacks.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/callbacks.js b/src/server/callbacks.js index 8b9b0c67..34bff3a4 100644 --- a/src/server/callbacks.js +++ b/src/server/callbacks.js @@ -516,7 +516,9 @@ module.exports = { if (error) { - ipc.send('notify', {class: 'error', message: 'Failed to list available drives.'}, clientId) + ipc.send('notify', {class: 'error', message: 'Failed to list available drives (see server console).'}, clientId) + console.error('(ERROR) Failed to list available drives.') + console.error(error.stack) } else { From 6fa3f9862ea537ed43fb8c7280362ca0a0357da0 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 2 Apr 2025 10:27:15 +0200 Subject: [PATCH 031/398] panel: expose useful event.firstTarget --- resources/docs/docs/widgets/scripting.md | 3 +++ src/client/widgets/containers/panel.js | 10 +++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/resources/docs/docs/widgets/scripting.md b/resources/docs/docs/widgets/scripting.md index a585f8e8..1d26fab0 100644 --- a/resources/docs/docs/widgets/scripting.md +++ b/resources/docs/docs/widgets/scripting.md @@ -82,8 +82,11 @@ This script has access to the same variables and functions as the `script` prope ??? infos "Containers onTouch" + *Currently only available in v1.29.0-beta* + Containers (root, panel, etc) can monitor touch events happening inside them, it works like with [Canvas](../canvas/#ontouch), with a few differences: + - `event.firstTarget` will return the id of the first touched widget - setting `event.preventDefault` to `true` will prevent the event from reaching widgets in the container ('start' and 'move' events only) - setting `event.allowScroll` to `true` will allow touch scrolling where it would normally be prevented ('start' event only) - setting `event.inertia` will affect 'move' events (works like widget `sensitivity` in reverse (1 = normal, 10 = slow move)) diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index 61a85211..f4e51441 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -359,16 +359,20 @@ class Panel extends Container() { onTouch(e, name) { - var event = {...e} - delete event.firstTarget + var event = {...e}, + w event.targetName = event.target ? event.target.getAttribute('name') : '' event.targetTagName = event.target ? event.target.tagName : '' - var w = widgetManager.getWidgetByElement(event.target) + w = widgetManager.getWidgetByElement(event.target) if (w) event.target = w === this ? 'this' : w.getProp('id') else event.target = null + w = widgetManager.getWidgetByElement(event.firstTarget) + if (w) event.firstTarget = w === this ? 'this' : w.getProp('id') + else event.firstTarget = null + event.type = name this.scripts.onTouch.run({ From afc7d677e5f587c3135f1f1954ca48cc59953f4f Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 3 Apr 2025 15:20:19 +0200 Subject: [PATCH 032/398] win: attempt to use powershell to lst drives --- src/server/callbacks.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/server/callbacks.js b/src/server/callbacks.js index 34bff3a4..c8a3ac95 100644 --- a/src/server/callbacks.js +++ b/src/server/callbacks.js @@ -512,7 +512,8 @@ module.exports = { // Drive list hack on windows if (data.path.length === 2 && data.path[1] === '..' && (data.path[0].match(/^[A-Z]:\\$/) || data.path[0] === '\\')) { - child_process.exec('wmic logicaldisk get name', (error, stdout) => { + // child_process.exec('wmic logicaldisk get name', (error, stdout) => { + child_process.exec('(get-wmiobject win32_volume | ? { $_.DriveType -eq 3 } | % { get-psdrive $_.DriveLetter[0] }).Root', {shell: 'powershell.exe'}, (error, stdout) => { if (error) { @@ -524,7 +525,7 @@ module.exports = { ipc.send('listDir', { path: '\\', - files: stdout.split('\r\r\n') + files: stdout.split(' ') .filter(value => /[A-Za-z]:/.test(value)) .map(value => {return {name: value.trim(), folder: true}}) }, clientId) From 36c89648b8711475e35f13a908f0824f4c7fac04 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 3 Apr 2025 15:39:33 +0200 Subject: [PATCH 033/398] win: fix drive listing --- CHANGELOG.md | 3 +++ src/server/callbacks.js | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffc0c195..a6399e1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 1.29.0 +- bug fixes + - file browser: drive listing failing on recent windows + - widgets - add `onTouch` to all container widgets - allow starting a traversing gesture outside a touchable widget diff --git a/src/server/callbacks.js b/src/server/callbacks.js index c8a3ac95..2234877d 100644 --- a/src/server/callbacks.js +++ b/src/server/callbacks.js @@ -512,8 +512,7 @@ module.exports = { // Drive list hack on windows if (data.path.length === 2 && data.path[1] === '..' && (data.path[0].match(/^[A-Z]:\\$/) || data.path[0] === '\\')) { - // child_process.exec('wmic logicaldisk get name', (error, stdout) => { - child_process.exec('(get-wmiobject win32_volume | ? { $_.DriveType -eq 3 } | % { get-psdrive $_.DriveLetter[0] }).Root', {shell: 'powershell.exe'}, (error, stdout) => { + child_process.exec('(get-wmiobject win32_volume | ? { $_.DriveType -eq 3 } | % { get-psdrive $_.DriveLetter[0] }).Root -join " "', {shell: 'powershell.exe'}, (error, stdout) => { if (error) { From c65d4ed648d3ec0993b241560add4dcad5908040 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 3 Apr 2025 15:40:06 +0200 Subject: [PATCH 034/398] package: beta3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5951d730..27df2ff8 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.0-beta2", + "version": "1.29.0-beta3", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From 98e5670011495cae2dac5f6787d30d505311702a Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 8 Apr 2025 10:32:34 +0200 Subject: [PATCH 035/398] root: `hideMenu` not working when `--read-only` is set --- CHANGELOG.md | 1 + src/client/widgets/containers/root.js | 2 -- 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a6399e1d..fb2ee1fe 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - bug fixes - file browser: drive listing failing on recent windows + - root: `hideMenu` not working when `--read-only` is set - widgets - add `onTouch` to all container widgets diff --git a/src/client/widgets/containers/root.js b/src/client/widgets/containers/root.js index 3e131a28..6cf72481 100644 --- a/src/client/widgets/containers/root.js +++ b/src/client/widgets/containers/root.js @@ -59,8 +59,6 @@ class Root extends StaticProperties(Panel, {visible: true, label: false, id: 'ro checkMenuVisibility() { - if (READ_ONLY) return - mainMenu = mainMenu || require('../../ui/main-menu') if (this.getProp('hideMenu')) { From dc9f1435e32a988080dccca4d2497cfe06fb611d Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 8 Apr 2025 10:48:46 +0200 Subject: [PATCH 036/398] misc: combining `--read-only` and `--fullscreen` now disables `F11` on built-in client --- CHANGELOG.md | 1 + src/client/globals.js | 1 + src/client/ui/main-menu.js | 1 + src/server/server.js | 1 + 4 files changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index fb2ee1fe..db481d78 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - bug fixes - file browser: drive listing failing on recent windows - root: `hideMenu` not working when `--read-only` is set + - combining `--read-only` and `--fullscreen` now disables `F11` on built-in client - widgets - add `onTouch` to all container widgets diff --git a/src/client/globals.js b/src/client/globals.js index fe12c67d..4503ceee 100644 --- a/src/client/globals.js +++ b/src/client/globals.js @@ -14,6 +14,7 @@ window.PACKAGE = require('../../package.json') window.LOADING = null window.READ_ONLY = window.READ_ONLY || false +window.KIOSK = window.KIOSK || false window.GRIDWIDTH_CSS = parseInt(getComputedStyle(document.documentElement).getPropertyValue('--grid-width')) window.GRIDWIDTH = GRIDWIDTH_CSS diff --git a/src/client/ui/main-menu.js b/src/client/ui/main-menu.js index 0d72b001..4f7c906b 100644 --- a/src/client/ui/main-menu.js +++ b/src/client/ui/main-menu.js @@ -210,6 +210,7 @@ var menuEntries = [ }, { label: locales('fullscreen'), + disabled: KIOSK && navigator.userAgent.match(/OpenStageControl/), // built-in electron client only class: ()=>{return 'toggle ' + (fullscreen.isFullscreen ? 'on' : 'off')}, action: ()=>{ if (fullscreen.isEnabled) fullscreen.toggle() diff --git a/src/server/server.js b/src/server/server.js index c1c01279..604a825b 100644 --- a/src/server/server.js +++ b/src/server/server.js @@ -104,6 +104,7 @@ function httpRoute(req, res) { window.IP=${JSON.stringify(ip)} window.ENV=${JSON.stringify(clientOptions)} window.READ_ONLY=${JSON.stringify(settings.read('read-only'))} + window.KIOSK=${settings.read('read-only') && settings.read('fullscreen') ? 'true' : 'false'} window.AUTH=\`${(req.headers.authorization || '').replace('Basic ', '').replace('/', '_')}\` `)) .pipe(res) From 4487b6bc4f8f9cf292cca9226f01580027d6ade8 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 8 Apr 2025 11:08:42 +0200 Subject: [PATCH 037/398] ranger: missing call for pips drawing --- CHANGELOG.md | 1 + src/client/widgets/sliders/range.js | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index db481d78..a3187378 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,7 @@ - file browser: drive listing failing on recent windows - root: `hideMenu` not working when `--read-only` is set - combining `--read-only` and `--fullscreen` now disables `F11` on built-in client + - regression breaking `pips` for range widget - widgets - add `onTouch` to all container widgets diff --git a/src/client/widgets/sliders/range.js b/src/client/widgets/sliders/range.js index d89ae3e3..19c65d58 100644 --- a/src/client/widgets/sliders/range.js +++ b/src/client/widgets/sliders/range.js @@ -384,6 +384,11 @@ class Range extends Fader { } + if (this.shouldDrawPips) { + this.drawPips() + this.shouldDrawPips = false + } + if (this.getProp('pips')) { this.ctx.globalAlpha = 1 this.ctx.drawImage(this.pips, 0, 0) From bc52244c0b42c93b94cde0e4866ae3f55078b1e3 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 8 Apr 2025 11:10:06 +0200 Subject: [PATCH 038/398] package: v1.29.0 --- package.json | 2 +- resources/docs/docs/widgets/scripting.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/package.json b/package.json index 27df2ff8..5d47ac92 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.0-beta3", + "version": "1.29.0", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/resources/docs/docs/widgets/scripting.md b/resources/docs/docs/widgets/scripting.md index 1d26fab0..6860ec0f 100644 --- a/resources/docs/docs/widgets/scripting.md +++ b/resources/docs/docs/widgets/scripting.md @@ -82,8 +82,6 @@ This script has access to the same variables and functions as the `script` prope ??? infos "Containers onTouch" - *Currently only available in v1.29.0-beta* - Containers (root, panel, etc) can monitor touch events happening inside them, it works like with [Canvas](../canvas/#ontouch), with a few differences: - `event.firstTarget` will return the id of the first touched widget From 4c9eecd0afa907276bf1bbd8ec450c2f995b7632 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 17 Apr 2025 09:07:59 +0200 Subject: [PATCH 039/398] scripting: `setFocus` not working on iOS --- CHANGELOG.md | 6 ++++++ src/client/widgets/scripts/script-vm.js | 4 +--- src/scss/reset.scss | 3 +++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a3187378..04d235b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog + +## 1.29.1 + +- bug fixes + - scripting: `setFocus` not working on iOS + ## 1.29.0 - bug fixes diff --git a/src/client/widgets/scripts/script-vm.js b/src/client/widgets/scripts/script-vm.js index c8a00837..a3b791e0 100644 --- a/src/client/widgets/scripts/script-vm.js +++ b/src/client/widgets/scripts/script-vm.js @@ -445,9 +445,7 @@ class ScriptVm extends Vm { var widgets = this.resolveId(id) if (widgets.length) { - setTimeout(()=>{ - if (widgets[0].focus) widgets[0].focus() - }) + if (widgets[0].focus) widgets[0].focus() } } diff --git a/src/scss/reset.scss b/src/scss/reset.scss index d4d9a88a..58543393 100644 --- a/src/scss/reset.scss +++ b/src/scss/reset.scss @@ -20,4 +20,7 @@ select, input, textarea { -webkit-appearance:none; -moz-appearance:none; appearance:none; + -webkit-user-select: auto; + -moz-user-select: auto; + user-select: auto; } From 5abaf7fbb31cc840b61edd2ee6ba6c260572aa5f Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 20 Apr 2025 10:34:20 +0200 Subject: [PATCH 040/398] fader/range: really check if pips are ready to be drawn before drawing them --- CHANGELOG.md | 1 + src/client/widgets/sliders/fader.js | 2 +- src/client/widgets/sliders/range.js | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 04d235b1..b7c7c52d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - bug fixes - scripting: `setFocus` not working on iOS + - fader/range: drawing error with `pips` enabled ## 1.29.0 diff --git a/src/client/widgets/sliders/fader.js b/src/client/widgets/sliders/fader.js index 16860286..9798dceb 100644 --- a/src/client/widgets/sliders/fader.js +++ b/src/client/widgets/sliders/fader.js @@ -390,7 +390,7 @@ class Fader extends Slider { this.shouldDrawPips = false } - if (this.getProp('pips') && !compact) { + if (this.pips) { this.ctx.globalAlpha = 1 this.ctx.drawImage(this.pips, 0, 0) if (!compact) this.clearRect = [this.clearRect, [m + knobWidth / 2, 0, 12 * PXSCALE + this.pipsTextSize, height]] diff --git a/src/client/widgets/sliders/range.js b/src/client/widgets/sliders/range.js index 19c65d58..7c76d0a9 100644 --- a/src/client/widgets/sliders/range.js +++ b/src/client/widgets/sliders/range.js @@ -389,7 +389,7 @@ class Range extends Fader { this.shouldDrawPips = false } - if (this.getProp('pips')) { + if (this.pips) { this.ctx.globalAlpha = 1 this.ctx.drawImage(this.pips, 0, 0) if (!compact) this.clearRect = [this.clearRect, [m + knobWidth / 2, 0, 12 * PXSCALE + this.pipsTextSize, height]] From c124c3826fdd47dd8677ecaeb0b92a8a5adab6b2 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 20 Apr 2025 10:35:04 +0200 Subject: [PATCH 041/398] fader/range: reuse pips offscreen canvas instead of creating a new one --- src/client/widgets/sliders/fader.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/widgets/sliders/fader.js b/src/client/widgets/sliders/fader.js index 9798dceb..1bb983dd 100644 --- a/src/client/widgets/sliders/fader.js +++ b/src/client/widgets/sliders/fader.js @@ -401,7 +401,7 @@ class Fader extends Slider { drawPips() { - this.pips = this.canvas.cloneNode() + this.pips = this.pips || this.canvas.cloneNode() this.pips.width = this.getProp('horizontal') ? this.height : this.width this.pips.height = !this.getProp('horizontal') ? this.height : this.width this.pipsTextSize = this.fontSize From 950f862f2c9bd0a8c575c19e984fa1cc6d8fb7b5 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 20 Apr 2025 11:24:11 +0200 Subject: [PATCH 042/398] package: bump --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5d47ac92..165b469f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.0", + "version": "1.29.1", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From ccba528cbf5eba470e4ff86af3964d4e7dbc5b2f Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 20 Apr 2025 11:24:18 +0200 Subject: [PATCH 043/398] package: update package-lock --- package-lock.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index fbc07eeb..f0a6aed4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "open-stage-control", - "version": "1.27.4", + "version": "1.29.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "open-stage-control", - "version": "1.27.4", + "version": "1.29.1", "hasInstallScript": true, "license": "GPL-3.0", "dependencies": { From c092951052ef91c8773e32f94f2283546b2dbb84 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 20 Apr 2025 15:23:48 +0200 Subject: [PATCH 044/398] canvas: more safe check before drawing --- src/client/widgets/common/canvas.js | 5 ++++- src/client/widgets/sliders/fader.js | 2 +- src/client/widgets/sliders/range.js | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/client/widgets/common/canvas.js b/src/client/widgets/common/canvas.js index 869abc61..614283d8 100644 --- a/src/client/widgets/common/canvas.js +++ b/src/client/widgets/common/canvas.js @@ -101,7 +101,10 @@ class Canvas extends Widget { this.hasSize = true this.setVisibility() } - this.draw() + + if (this.width > 0 && this.height > 0 && this.visible) { + this.draw() + } }) diff --git a/src/client/widgets/sliders/fader.js b/src/client/widgets/sliders/fader.js index 1bb983dd..38d1aa34 100644 --- a/src/client/widgets/sliders/fader.js +++ b/src/client/widgets/sliders/fader.js @@ -390,7 +390,7 @@ class Fader extends Slider { this.shouldDrawPips = false } - if (this.pips) { + if (this.pips && this.pips.width && this.pips.height) { this.ctx.globalAlpha = 1 this.ctx.drawImage(this.pips, 0, 0) if (!compact) this.clearRect = [this.clearRect, [m + knobWidth / 2, 0, 12 * PXSCALE + this.pipsTextSize, height]] diff --git a/src/client/widgets/sliders/range.js b/src/client/widgets/sliders/range.js index 7c76d0a9..722a437c 100644 --- a/src/client/widgets/sliders/range.js +++ b/src/client/widgets/sliders/range.js @@ -389,7 +389,7 @@ class Range extends Fader { this.shouldDrawPips = false } - if (this.pips) { + if (this.pips && this.pips.width && this.pips.height) { this.ctx.globalAlpha = 1 this.ctx.drawImage(this.pips, 0, 0) if (!compact) this.clearRect = [this.clearRect, [m + knobWidth / 2, 0, 12 * PXSCALE + this.pipsTextSize, height]] From c037064f5722d384ef34f44fcf1b658f1ae37920 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 20 Apr 2025 15:24:35 +0200 Subject: [PATCH 045/398] package: v1.29.2 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 165b469f..cbd7d32a 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.1", + "version": "1.29.2", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From 4fdcfd7f05fffe5297f4ff89598cf263f6bd63c8 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sun, 20 Apr 2025 15:25:02 +0200 Subject: [PATCH 046/398] log: update --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index b7c7c52d..ca291536 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,7 @@ # Changelog -## 1.29.1 +## 1.29.1 / 1.29.2 - bug fixes - scripting: `setFocus` not working on iOS From 6a055c620bcf010150e18a849556be4df0c9d35e Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 5 May 2025 14:41:24 +0200 Subject: [PATCH 047/398] frame: add allow property --- CHANGELOG.md | 4 ++++ src/client/widgets/frames/frame.js | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index ca291536..fca94d3e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.29.3 + +- widgets + - add `allow` property ## 1.29.1 / 1.29.2 diff --git a/src/client/widgets/frames/frame.js b/src/client/widgets/frames/frame.js index 519d97e9..d3d2f654 100644 --- a/src/client/widgets/frames/frame.js +++ b/src/client/widgets/frames/frame.js @@ -14,6 +14,11 @@ class Frame extends StaticProperties(Widget, {bypass: true}) { static defaults() { return super.defaults().extend({ + class_specific: { + allow: {type: 'string', value: '', help: [ + 'Content for the iframe element\'s allow attribute', + ]}, + }, value: { value: {type: 'string', value: '', help: [ 'External web page URL.', @@ -40,6 +45,9 @@ class Frame extends StaticProperties(Widget, {bypass: true}) { if (!this.getProp('border')) this.container.classList.add('noborder') this.frame = DOM.get(this.widget, '.frame')[0] + + if (this.getProp('allow')) this.frame.setAttribute('allow', this.getProp('allow')) + this.errorText = html`${locales('iframe_unauthorized')}` this.errorTextMounted = false From 6c2e500135a058492667d03d12ffa75dbd0f7665 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 5 May 2025 14:41:41 +0200 Subject: [PATCH 048/398] log: mising widget type --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fca94d3e..e2a32ac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## 1.29.3 - widgets - - add `allow` property + - frame: add `allow` property ## 1.29.1 / 1.29.2 From c860bc1959fb7b41b6e0a6fdebd736abed041e06 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 7 May 2025 09:42:12 +0200 Subject: [PATCH 049/398] widget: ignore invalid properties (avoid recreating if matrix/clone child has an override for an invalid property) --- src/client/widgets/common/widget.js | 7 ++++++- src/client/widgets/index.js | 1 + 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index fdd1e219..1cc8383f 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -939,7 +939,12 @@ class Widget extends EventEmitter { if (!this.isDynamicProp(propName)) { - if (widget && this.contains(widget)) { + if (this.constructor._defaults[propName] === undefined) { + + // ignore invalid properties + continue + + } else if (widget && this.contains(widget)) { this.errorProp(propName, '@{}', `a container can't use its child's properties to define non-dynamic properties.`) continue diff --git a/src/client/widgets/index.js b/src/client/widgets/index.js index 38d3bc28..b0e5ce0c 100644 --- a/src/client/widgets/index.js +++ b/src/client/widgets/index.js @@ -69,5 +69,6 @@ module.exports.categories = { var defaults = {} for (var k in module.exports.widgets) { defaults[k] = module.exports.widgets[k].defaults() + module.exports.widgets[k]._defaults = defaults } module.exports.defaults = defaults From b071189c65e0cce46db0918a3acafd960dd61fc0 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 7 May 2025 11:21:40 +0200 Subject: [PATCH 050/398] matrix: make `quantity` a dynamic property to avoid losing widget state when it changes --- CHANGELOG.md | 1 + src/client/widgets/containers/matrix.js | 50 ++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e2a32ac2..f5b7ae1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - widgets - frame: add `allow` property + - matrix: make `quantity` a dynamic property to avoid losing widget state when it changes ## 1.29.1 / 1.29.2 diff --git a/src/client/widgets/containers/matrix.js b/src/client/widgets/containers/matrix.js index fd720879..9d158d01 100644 --- a/src/client/widgets/containers/matrix.js +++ b/src/client/widgets/containers/matrix.js @@ -1,7 +1,9 @@ var Panel = require('./panel'), parser = require('../../parser'), {deepCopy} = require('../../utils'), - Session = require('../../managers/session/session') + Session = require('../../managers/session/session'), + widgetManager = require('../../managers/widgets') + class Matrix extends Panel { @@ -125,6 +127,51 @@ class Matrix extends Panel { switch (propName) { + case 'quantity': + + if (oldPropValue > this.getProp('quantity')) { + + for (var i = oldPropValue - 1; i >= this.getProp('quantity'); i--) { + if (this.widget.contains(this.children[i].container)) { + this.widget.removeChild(this.children[i].container) + } + widgetManager.removeWidgets(this.children[i].getAllChildren().concat(this.children[i])) + } + + } else { + + this.cachedProps.props = this.resolveProp('props', undefined, true) + + for (var i = oldPropValue; i < this.getProp('quantity'); i++) { + + var props = deepCopy(this.getProp('props')[i]) + var data = this.defaultProps(i) + + if (typeof props === 'object' && props !== null) { + Object.assign(data, props) + } + + data = JSON.parse(JSON.stringify(data).replace(/(JS|#|OSC|@|VAR)_\{/g, '$1{')) + + Session.converters['1.13.2'].widget(data) + + var widget = parser.parse({ + data: data, + parentNode: this.widget, + parent: this + }) + + widget._index = i + widget.container.classList.add('not-editable') + widget._not_editable = true + + } + + } + + + return + case 'props': for (let i = this.children.length - 1; i >= 0; i--) { @@ -224,6 +271,7 @@ Matrix.parsersContexts.props = { } Matrix.dynamicProps = Matrix.prototype.constructor.dynamicProps.concat( + 'quantity', 'props' ) From f49fb43ec3a67433fdfc021fe048a771dd595f71 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 7 May 2025 11:26:58 +0200 Subject: [PATCH 051/398] lint: var -> let --- src/client/widgets/containers/matrix.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/widgets/containers/matrix.js b/src/client/widgets/containers/matrix.js index 9d158d01..d4f83a5b 100644 --- a/src/client/widgets/containers/matrix.js +++ b/src/client/widgets/containers/matrix.js @@ -131,7 +131,7 @@ class Matrix extends Panel { if (oldPropValue > this.getProp('quantity')) { - for (var i = oldPropValue - 1; i >= this.getProp('quantity'); i--) { + for (let i = oldPropValue - 1; i >= this.getProp('quantity'); i--) { if (this.widget.contains(this.children[i].container)) { this.widget.removeChild(this.children[i].container) } @@ -142,7 +142,7 @@ class Matrix extends Panel { this.cachedProps.props = this.resolveProp('props', undefined, true) - for (var i = oldPropValue; i < this.getProp('quantity'); i++) { + for (let i = oldPropValue; i < this.getProp('quantity'); i++) { var props = deepCopy(this.getProp('props')[i]) var data = this.defaultProps(i) From 460d8718c9176aa27df7139301a36ab293f2a323 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 13 May 2025 09:21:40 +0200 Subject: [PATCH 052/398] docs: remote control detail --- resources/docs/docs/remote-control.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/docs/docs/remote-control.md b/resources/docs/docs/remote-control.md index de66127b..a25fb9db 100644 --- a/resources/docs/docs/remote-control.md +++ b/resources/docs/docs/remote-control.md @@ -1,6 +1,6 @@ # Remote control -When osc messages are received, the default behavior is to update the value of all widgets that match the address and preArgs. Additionally, Open Stage Control responds to some general osc commands. +When osc messages are received, the default behavior is to update the value of all widgets that match the address and preArgs. Additionally, Open Stage Control clients respond to some general osc commands. !!! note "Multi-client setup" These commands are interpreted by each client connected to the server so there might be more than one reply. Using a custom module is the only way to send a message to a single client. From 870d3e34457d482e1983bca0e38a76c5f9e74f18 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 13 May 2025 09:44:16 +0200 Subject: [PATCH 053/398] patchbay: missing preArgs implementation --- CHANGELOG.md | 1 + src/client/widgets/containers/patchbay.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f5b7ae1d..9a2dd648 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - widgets - frame: add `allow` property - matrix: make `quantity` a dynamic property to avoid losing widget state when it changes + - patchbay: missing `preArgs` implementation ## 1.29.1 / 1.29.2 diff --git a/src/client/widgets/containers/patchbay.js b/src/client/widgets/containers/patchbay.js index e01dc307..22f789f1 100644 --- a/src/client/widgets/containers/patchbay.js +++ b/src/client/widgets/containers/patchbay.js @@ -167,11 +167,12 @@ class PatchBay extends Container(Canvas) { let w = parser.parse({ data: { type: 'patchbaynode', + comments: this.inputs[k], // TODO: using comment prop to smuggle input identifier, ok but could be more elegant id: this.getProp('id') + '/' + this.inputs[k], address: '#{@{parent.address} == "auto" ? "/" + @{parent.id} : @{parent.address}}', target: '@{parent.target}', ignoreDefaults: '@{parent.ignoreDefaults}', - preArgs: this.inputs[k], + preArgs: '#{@{parent.preArgs} == "" ? @{this.comments} : Array.isArray(@{parent.preArgs}) ? @{parent.preArgs}.concat(@{this.comments}) : [@{parent.preArgs}, @{this.comments}]}', bypass: '@{parent.bypass}', label: k }, From 45b8794bf612270a139e6294e8563ed128d07f68 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 13 May 2025 10:04:16 +0200 Subject: [PATCH 054/398] docs: update --- resources/docs/docs/widgets/properties-reference.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index 156d4cb1..7f997a2c 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -365,7 +365,7 @@ |
variables#
| `*` | "@\{parent.variables}" | Defines one or more arbitrary variables that can be inherited by children widgets | |
traversing#
| `boolean` | false | Set to `true` to enable traversing gestures in this widget. Set to `smart` to limit affected widgets by the type of the first touched widget

Choices: `false`, `true`, `smart` | |
widgetType#
| `string` | "button" | Defines the type of the widgets in the matrix | - |
quantity#
| `number` | 4 | Defines the number of widgets in the matrix | + |
quantity#
| `number` | 4 | Defines the number of widgets in the matrix | |
props#
| `object` | \{
 "label": "#{$}"
}
| Defines a set of property to override the widgets' defaults.

JS{} and #{} blocks in this field are resolved with an extra variable representing each widget's index: `$` (e.g. `#{$}`)

Advanced syntax blocks (@{}, OSC{}, JS{}, VAR{} and #{}) are resolved at the matrix' scope (ie @{this.variables} returns the matrix' variables property)

Advanced syntax blocks can be passed to children without being resolved at the matrix' scope by adding an underscore before the opening bracket.

Note: unless overridden, children inherit from the matrix' `id` and osc properties (`id` and `address` are appended with `/$`) | === "value" @@ -545,6 +545,12 @@ ??? api "
frame#
" Embed a web page in a frame. Note: some websites do not allow this. + === "frame" + + | property | type |default | description | + | --- | --- | --- | --- | + |
allow#
| `string` | "" | Content for the iframe element's allow attribute | + === "value" | property | type |default | description | From f5ee7f5df1b6eb25532652a216828e1a3f3d37c0 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 13 May 2025 10:04:28 +0200 Subject: [PATCH 055/398] package: 1.29.3 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index cbd7d32a..137236ce 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.2", + "version": "1.29.3", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From 32c3bf2abd755e5a422d06eabfdcb0248f10b3dc Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 16 May 2025 11:23:41 +0200 Subject: [PATCH 056/398] widget: regression breaking widget recreation routine (all properties seen as invalid because of wrong default property cache) --- src/client/widgets/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/widgets/index.js b/src/client/widgets/index.js index b0e5ce0c..288eb2c3 100644 --- a/src/client/widgets/index.js +++ b/src/client/widgets/index.js @@ -69,6 +69,6 @@ module.exports.categories = { var defaults = {} for (var k in module.exports.widgets) { defaults[k] = module.exports.widgets[k].defaults() - module.exports.widgets[k]._defaults = defaults + module.exports.widgets[k]._defaults = defaults[k]._props() } module.exports.defaults = defaults From 296ba343c4daad5c9ce3936677c71218698e3927 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 16 May 2025 11:26:59 +0200 Subject: [PATCH 057/398] package: hot patched 1.29.4 on the way --- CHANGELOG.md | 5 +++++ package.json | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a2dd648..65cba26a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.29.4 + +- bug fixes + - regression (1.29.3) breaking some widget recreation routines + ## 1.29.3 - widgets diff --git a/package.json b/package.json index 137236ce..c4972a38 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.3", + "version": "1.29.4", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From e7ffec8c031a61adba4357054bc65c6a668ffb68 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 16 May 2025 16:00:05 +0200 Subject: [PATCH 058/398] keyboard: regression (1.27.5) breaking `velocity` property --- CHANGELOG.md | 8 +++++++- src/client/widgets/basics/button.js | 4 ++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65cba26a..0eb2eea7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,9 +1,15 @@ # Changelog +## 1.29.5 + +- bug fixes + - keyboard: regression (1.27.5) breaking `velocity` property + + ## 1.29.4 - bug fixes - - regression (1.29.3) breaking some widget recreation routines + - regression (1.29.3) breaking some widget recreation routines ## 1.29.3 diff --git a/src/client/widgets/basics/button.js b/src/client/widgets/basics/button.js index 6f116cae..b14aeefc 100644 --- a/src/client/widgets/basics/button.js +++ b/src/client/widgets/basics/button.js @@ -99,7 +99,7 @@ class Button extends Widget { this.parsersLocalScope.touchCoords = [e.offsetX / this.buttonSize[0], 1 - e.offsetY / this.buttonSize[1]] } - this.setValue(this.getProp('on'), {sync: true, send: true, local:true}) + this.setValue(this.getProp('on'), {sync: true, send: true, local:true, y: e.offsetY}) if (tap) this.container.classList.add('active') @@ -117,7 +117,7 @@ class Button extends Widget { this.parsersLocalScope.touchCoords = [e.offsetX / this.buttonSize[0], 1 - e.offsetY / this.buttonSize[1]] } - this.setValue(this.getProp('on'), {sync: true, send: true, local:true}) + this.setValue(this.getProp('on'), {sync: true, send: true, local:true, y: e.offsetY}) if (tap) this.container.classList.add('active') From e5d5d0aa0634222470ba188b206de9fb3ad24e1b Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 19 May 2025 15:28:13 +0200 Subject: [PATCH 059/398] code editor: fix available globals for onResize --- src/client/ui/ui-code-editor.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/ui/ui-code-editor.js b/src/client/ui/ui-code-editor.js index 4c8dcabd..83dc0f5f 100644 --- a/src/client/ui/ui-code-editor.js +++ b/src/client/ui/ui-code-editor.js @@ -207,7 +207,11 @@ class CodeEditor { globals = this.widget.getProp('type') === 'canvas' ? {value: true, height: true, width: true, event: true} : {value: true, event: true, handle: true} + } else if (this.name === 'onResize') { + globals = {value: true, height: true, width: true, cssVars: true} } + + globals.locals = true globals.console = true globals.JS = true From 54b7bf7a630058a3b47785a474d1bc9f82ad6d32 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 19 May 2025 17:19:53 +0200 Subject: [PATCH 060/398] code editor: correctly detect tab-focus to reset scroll / cursor position --- CHANGELOG.md | 1 + src/client/ui/ui-code-editor.js | 8 ++++++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0eb2eea7..e9dcca1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - bug fixes - keyboard: regression (1.27.5) breaking `velocity` property + - editor: retain scroll position in code editors ## 1.29.4 diff --git a/src/client/ui/ui-code-editor.js b/src/client/ui/ui-code-editor.js index 83dc0f5f..087d09ae 100644 --- a/src/client/ui/ui-code-editor.js +++ b/src/client/ui/ui-code-editor.js @@ -153,8 +153,12 @@ class CodeEditor { this.editor.dirty = true }) - var pos = this.editor.getCursorPosition() - if (pos.row === undefined || pos.column === undefined) this.editor.gotoLine(0) + setTimeout(()=>{ + var pos = this.editor.getCursorPosition() + if (pos.row === undefined || pos.column === undefined) { + this.editor.gotoLine(0) + } + }) this.typing = false setCommandEnabled(this.editor, 'indent', false) From 84cba42d866131b45af6dd76eeb949a870f05cc8 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sat, 24 May 2025 13:22:29 +0200 Subject: [PATCH 061/398] cli: regression (1.28) preventing from setting options from a terminal on windows --- CHANGELOG.md | 1 + src/server/settings.js | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e9dcca1e..becc280f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - bug fixes - keyboard: regression (1.27.5) breaking `velocity` property - editor: retain scroll position in code editors + - cli: regression (1.28) preventing from setting options from a terminal on windows ## 1.29.4 diff --git a/src/server/settings.js b/src/server/settings.js index 89c7c87a..2039d1a3 100644 --- a/src/server/settings.js +++ b/src/server/settings.js @@ -13,7 +13,7 @@ var path = require('path'), // rmeove all args before the first actual cli arg while (argv.length) { - if (argv[0][0] != '-' || argv[0][0] == '--') { + if (argv[0][0] != '-' || argv[0] == '--') { argv.splice(0, 1) } else if (argv[0][0] == '-' ) { break From aa666f0738022ad99302a7fce025a85d69b4395b Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sat, 24 May 2025 13:23:00 +0200 Subject: [PATCH 062/398] package: v1.29.5 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index c4972a38..fa6a7cf4 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.4", + "version": "1.29.5", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From faba19e94cad715dac92ee27f5d9f2a96eea51d1 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Sat, 7 Jun 2025 13:56:20 +0200 Subject: [PATCH 063/398] matrix: sanitise quantity property (avoid error when NaN or < 0) --- CHANGELOG.md | 5 +++++ src/client/widgets/containers/matrix.js | 15 ++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index becc280f..d0543d23 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.29.6 + +- bug fixes + - matrix: prevent error when `quantity` is invalid + ## 1.29.5 - bug fixes diff --git a/src/client/widgets/containers/matrix.js b/src/client/widgets/containers/matrix.js index d4f83a5b..48d35d55 100644 --- a/src/client/widgets/containers/matrix.js +++ b/src/client/widgets/containers/matrix.js @@ -66,7 +66,9 @@ class Matrix extends Panel { if (parser.widgets[this.getProp('widgetType')]) { - for (let i = 0; i < this.getProp('quantity'); i++) { + var quantity = Math.max(parseInt(this.getProp('quantity')) || 0, 0) + + for (let i = 0; i < quantity; i++) { var props = deepCopy(this.getProp('props')[i]) var data = this.defaultProps(i) @@ -129,9 +131,12 @@ class Matrix extends Panel { case 'quantity': - if (oldPropValue > this.getProp('quantity')) { + var quantity = Math.max(parseInt(this.getProp('quantity')) || 0, 0) + oldPropValue = Math.max(parseInt(oldPropValue) || 0, 0) - for (let i = oldPropValue - 1; i >= this.getProp('quantity'); i--) { + if (oldPropValue > quantity) { + + for (let i = oldPropValue - 1; i >= quantity; i--) { if (this.widget.contains(this.children[i].container)) { this.widget.removeChild(this.children[i].container) } @@ -142,7 +147,7 @@ class Matrix extends Panel { this.cachedProps.props = this.resolveProp('props', undefined, true) - for (let i = oldPropValue; i < this.getProp('quantity'); i++) { + for (let i = oldPropValue; i < quantity; i++) { var props = deepCopy(this.getProp('props')[i]) var data = this.defaultProps(i) @@ -227,7 +232,7 @@ class Matrix extends Panel { propValue = propValue !== undefined ? propValue : this.props[propName] var data = [], - quantity = this.resolveProp('quantity', undefined, false, false, false) + quantity = Math.max(parseInt(this.resolveProp('quantity', undefined, false, false, false)) || 0, 0) if (typeof propValue === 'object' && propValue !== null && !Array.isArray(propValue)) { for (let i = 0; i < quantity; i++) { From 69c52921c44c1981c658823e34d1f7a81fc10f30 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 12 Jun 2025 12:41:09 +0200 Subject: [PATCH 064/398] pads: send value when setting spring to true, but only if there's a value change --- CHANGELOG.md | 1 + src/client/widgets/pads/multixy.js | 2 +- src/client/widgets/pads/xy.js | 6 +++++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d0543d23..da34696a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - bug fixes - matrix: prevent error when `quantity` is invalid + - multixy/xy: send value when setting `spring` to `true` (only if current value is different than spring value) ## 1.29.5 diff --git a/src/client/widgets/pads/multixy.js b/src/client/widgets/pads/multixy.js index 011ea99e..185c7cfc 100644 --- a/src/client/widgets/pads/multixy.js +++ b/src/client/widgets/pads/multixy.js @@ -402,7 +402,7 @@ class MultiXy extends Pad { case 'spring': case 'pointSize': case 'axisLock': - this.updatePadsAttr() + this.updatePadsAttr(options) return } diff --git a/src/client/widgets/pads/xy.js b/src/client/widgets/pads/xy.js index 76225f9b..f5b17b51 100644 --- a/src/client/widgets/pads/xy.js +++ b/src/client/widgets/pads/xy.js @@ -281,7 +281,11 @@ module.exports = class Xy extends Pad { this.batchDraw() return case 'spring': - if (this.getProp('spring') && !this.touched) this.setValue([this.faders.x.getSpringValue(),this.faders.y.getSpringValue()], {...options}) + if (this.getProp('spring') && !this.touched) { + var x = this.faders.x.getSpringValue(), + y = this.faders.y.getSpringValue() + if (x !== this.value[0] || y !== this.value[1]) this.setValue([x, y], {...options}) + } return } From dedb82bb864d83b1089b3ed2480be4d78d858ac6 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 23 Jun 2025 13:54:27 +0200 Subject: [PATCH 065/398] multixy/xy: add `stepsX` and `stepsY` properties --- CHANGELOG.md | 3 +++ src/client/widgets/pads/multixy.js | 8 ++++++-- src/client/widgets/pads/xy.js | 12 ++++++++---- 3 files changed, 17 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da34696a..5b072ee7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,9 @@ - matrix: prevent error when `quantity` is invalid - multixy/xy: send value when setting `spring` to `true` (only if current value is different than spring value) +- widgets + - multixy/xy: add `stepsX` and `stepsY` properties + ## 1.29.5 - bug fixes diff --git a/src/client/widgets/pads/multixy.js b/src/client/widgets/pads/multixy.js index 185c7cfc..30e5457d 100644 --- a/src/client/widgets/pads/multixy.js +++ b/src/client/widgets/pads/multixy.js @@ -47,10 +47,12 @@ class MultiXy extends Pad { 'If set to `true`, touching anywhere on the widget\'s surface will make them snap to the touching coordinates', ]}, spring: {type: 'boolean', value: false, help: 'When set to `true`, the widget will go back to its default value when released'}, - rangeX: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the x axis'}, - rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'}, + rangeX: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the x axis (see fader)'}, + rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis (see fader)'}, logScaleX: {type: 'boolean|number', value: false, help: 'Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale.'}, logScaleY: {type: 'boolean|number', value: false, help: 'Set to `true` to use logarithmic scale for the y axis. Set to `-1` for exponential scale.'}, + stepsX: {type: 'number|array|string', value: false, help: 'Defines `steps` for the x axis (see fader)'}, + stepsY: {type: 'number|array|string', value: false, help: 'Defines `steps` for the x axis (see fader)'}, axisLock: {type: 'string', value: '', choices: ['', 'x', 'y', 'auto'], help: [ 'Restrict movements to one of the axes only.', 'When left empty, holding `Shift` while dragging will lock the pad according the first movement. `auto` will do the opposite.' @@ -93,6 +95,8 @@ class MultiXy extends Pad { decimals:this.getProp('decimals'), logScaleX:this.getProp('logScaleX'), logScaleY:this.getProp('logScaleY'), + stepsX:this.getProp('stepsX'), + stepsY:this.getProp('stepsY'), axisLock:this.getProp('axisLock'), pointSize: 'auto', pips: false, diff --git a/src/client/widgets/pads/xy.js b/src/client/widgets/pads/xy.js index f5b17b51..3826c892 100644 --- a/src/client/widgets/pads/xy.js +++ b/src/client/widgets/pads/xy.js @@ -29,10 +29,12 @@ module.exports = class Xy extends Pad { 'If set to `true`, touching anywhere on the widget\'s surface will make them snap to the touching coordinates', ]}, spring: {type: 'boolean', value: false, help: 'When set to `true`, the widget will go back to its default value when released'}, - rangeX: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the x axis'}, - rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis'}, + rangeX: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the x axis (see fader)'}, + rangeY: {type: 'object', value: {min:0,max:1}, help: 'Defines the min and max values for the y axis (see fader)'}, logScaleX: {type: 'boolean|number', value: false, help: 'Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale.'}, logScaleY: {type: 'boolean|number', value: false, help: 'Set to `true` to use logarithmic scale for the y axis. Set to `-1` for exponential scale.'}, + stepsX: {type: 'number|array|string', value: false, help: 'Defines `steps` for the x axis (see fader)'}, + stepsY: {type: 'number|array|string', value: false, help: 'Defines `steps` for the x axis (see fader)'}, axisLock: {type: 'string', value: '', choices: ['', 'x', 'y', 'auto'], help: [ 'Restrict movements to one of the axes only unless `Shift` is held.', 'When left empty, holding `Shift` while dragging will lock the pad according the first movement. `auto` will do the opposite.' @@ -70,6 +72,7 @@ module.exports = class Xy extends Pad { decimals:this.getProp('decimals'), logScale:this.getProp('logScaleX'), sensitivity: this.getProp('sensitivity'), + steps: this.getProp('stepsX'), }, parent: this}), y: new Fader({props:{ ...faderDefaults, @@ -82,6 +85,7 @@ module.exports = class Xy extends Pad { decimals:this.getProp('decimals'), logScale:this.getProp('logScaleY'), sensitivity: this.getProp('sensitivity'), + steps: this.getProp('stepsY'), }, parent: this}), } @@ -223,8 +227,8 @@ module.exports = class Xy extends Pad { if (!this.visible) return var pointSize = this.pointSize, - x = this.faders.x.percentToCoord(this.faders.x.percent), - y = this.faders.y.percentToCoord(this.faders.y.percent), + x = this.faders.x.percentToCoord(this.faders.x.valueToPercent(this.faders.x.value)), + y = this.faders.y.percentToCoord(this.faders.y.valueToPercent(this.faders.y.value)), ephemeral = this.getProp('ephemeral') this.clear() From 802e1780b12dbf6fb2499ea00d8cadd2e6e82b1a Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 26 Jun 2025 15:30:13 +0200 Subject: [PATCH 066/398] docs: canvas: ctx.clear() is not a thing --- src/client/widgets/pads/canvas.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index 1b330cae..ce0d96c6 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -20,7 +20,7 @@ class CanvasWidget extends Canvas { 'When calling `set()` from a script, submitted value should be an array only if `valueLength` is greater than 1.' ]}, autoClear: {type: 'boolean', value: true, help: [ - 'If set to `false`, the canvas context won\'t be cleared automatically and `ctx.clear()` will need to be called in `onDraw`.' + 'If set to `false`, the canvas context won\'t be cleared automatically and `ctx.clearRect()` will need to be called in `onDraw`.' ]}, continuous: {type: 'boolean|number', value: false, help: [ 'If set to `true`, `onDraw` will be called at each frame, otherwise it will be called only when the widget is touched and when it receives a value.', From 379031379e9087158632de222fb74800e5669de9 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 27 Jun 2025 09:55:19 +0200 Subject: [PATCH 067/398] docs: update --- README.md | 2 +- resources/docs/docs/credits.md | 2 +- .../docs/docs/widgets/properties-reference.md | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 280b04ee..cecaf628 100644 --- a/README.md +++ b/README.md @@ -11,5 +11,5 @@ Open Stage Control ---- -Copyleft © Jean-Emmanuel Doucet @ [AMMD](http://ammd.net) 2014-2022. +Copyleft © Jean-Emmanuel Doucet 2014-2025. This program is a free software released under the [GNU/GPL3](ttps://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE) license. diff --git a/resources/docs/docs/credits.md b/resources/docs/docs/credits.md index bbdeb473..73425ad7 100644 --- a/resources/docs/docs/credits.md +++ b/resources/docs/docs/credits.md @@ -1,6 +1,6 @@ ## License -Copyleft © Jean-Emmanuel Doucet @ [AMMD](http://ammd.net) 2014-2022. +Copyleft © Jean-Emmanuel Doucet 2014-2025. This program is a free software released under the [GNU/GPL3](https://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE) license. ## Dependencies diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index 7f997a2c..9898b64f 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -776,10 +776,12 @@ | --- | --- | --- | --- | |
snap#
| `boolean` | false | By default, the points are dragged from their initial position.

If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates | |
spring#
| `boolean` | false | When set to `true`, the widget will go back to its default value when released | - |
rangeX#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis | - |
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | + |
rangeX#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis (see fader) | + |
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis (see fader) | |
logScaleX#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale. | |
logScaleY#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis. Set to `-1` for exponential scale. | + |
stepsX#
| `number`|
`array`|
`string` | false | Defines `steps` for the x axis (see fader) | + |
stepsY#
| `number`|
`array`|
`string` | false | Defines `steps` for the x axis (see fader) | |
axisLock#
| `string` | "" | Restrict movements to one of the axes only unless `Shift` is held.

When left empty, holding `Shift` while dragging will lock the pad according the first movement. `auto` will do the opposite.

Choices: ``, `x`, `y`, `auto` | |
doubleTap#
| `boolean`|
`string` | false | Set to `true` to make the knob reset to its `default` value when receiving a double tap.

Can be an osc address, in which case the widget will just send an osc message with no value (but `preArgs` included).

If set to "script", `onTouch` will be called with `event.type` set to `doubleTap`.

Choices: `false`, `true`, `script` | |
sensitivity#
| `number` | 1 | Defines the pad's sensitivity when `snap` is `false` | @@ -830,10 +832,12 @@ |
pointsAttr#
| `object` | [] | Defines per-point properties that are otherwise inherited from the multixy. Must be an array of objects (one per point) that may contain the following keys:
- visible (visibility and interactability)
- colorFill (background color)
- colorStroke (outline color)
- colorText (label color)
- color (shorthand for colorFill and colorStroke)
- alphaFillOn (background opacity)
- pointSize
- label | |
snap#
| `boolean` | false | By default, the points are dragged from their initial position.

If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates | |
spring#
| `boolean` | false | When set to `true`, the widget will go back to its default value when released | - |
rangeX#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis | - |
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | + |
rangeX#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis (see fader) | + |
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis (see fader) | |
logScaleX#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale. | |
logScaleY#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis. Set to `-1` for exponential scale. | + |
stepsX#
| `number`|
`array`|
`string` | false | Defines `steps` for the x axis (see fader) | + |
stepsY#
| `number`|
`array`|
`string` | false | Defines `steps` for the x axis (see fader) | |
axisLock#
| `string` | "" | Restrict movements to one of the axes only.

When left empty, holding `Shift` while dragging will lock the pad according the first movement. `auto` will do the opposite.

Choices: ``, `x`, `y`, `auto` | |
doubleTap#
| `boolean`|
`string` | false | Set to `true` to make the knob reset to its `default` value when receiving a double tap.

Can be an osc address, in which case the widget will just send an osc message with no value (but `preArgs` included).

If set to "script", `onTouch` will be called with `event.type` set to `doubleTap`.

Choices: `false`, `true`, `script` | |
sensitivity#
| `number` | 1 | Defines the pad's sensitivity when `snap` is `false` | @@ -859,7 +863,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
valueLength#
| `number` | 1 | Defines the number of values accepted by the widget (minimum 1). Incoming messages that don't comply will be ignored

When calling `set()` from a script, submitted value should be an array only if `valueLength` is greater than 1. | - |
autoClear#
| `boolean` | true | If set to `false`, the canvas context won't be cleared automatically and `ctx.clear()` will need to be called in `onDraw`. | + |
autoClear#
| `boolean` | true | If set to `false`, the canvas context won't be cleared automatically and `ctx.clearRect()` will need to be called in `onDraw`. | |
continuous#
| `boolean`|
`number` | false | If set to `true`, `onDraw` will be called at each frame, otherwise it will be called only when the widget is touched and when it receives a value.

Can be a number between 1 and 60 to specify the framerate (default: 30 fps). | === "scripting" From 5e06f5cf947201c22865a1dece5b0949debf0daa Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 27 Jun 2025 09:55:32 +0200 Subject: [PATCH 068/398] package: 1.29.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fa6a7cf4..b819dbcb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.5", + "version": "1.29.6", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From 0666d4677e599bdae084c402ae0170659171528d Mon Sep 17 00:00:00 2001 From: wicast Date: Tue, 8 Jul 2025 11:00:47 +0800 Subject: [PATCH 069/398] feat: add tray icon --- src/server/index.js | 10 +++++++ src/server/tray.js | 69 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 src/server/tray.js diff --git a/src/server/index.js b/src/server/index.js index ed1ef705..50e47f7b 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -5,6 +5,7 @@ var dev = process.argv[0].includes('node_modules'), docsServer, app = null, launcher = null, + tray = null, clientWindows = [], serverProcess = null, node = false @@ -221,6 +222,15 @@ function startLauncher() { process.stderr.write = stderrWrite if (process.log) process.log = processLog }) + + tray = require('./tray')({ + window: launcher, + openClient: openClient, + app: app, + startServer: startServerProcess, + stopServer: stopServerProcess + }) + }) let processLog = process.log, diff --git a/src/server/tray.js b/src/server/tray.js new file mode 100644 index 00000000..cca4275c --- /dev/null +++ b/src/server/tray.js @@ -0,0 +1,69 @@ +var { Menu, Tray, ipcMain } = require('electron') + +var tray = null, + contextMenu = null, + hideInTray = false, + isServerRunning = false + +module.exports = function (options = {}) { + + ipcMain.on('start', function (e, options) { + isServerRunning = true + resetMenu(isServerRunning) + }) + + ipcMain.on('stop', function (e, options) { + isServerRunning = false + resetMenu(isServerRunning) + }) + + tray = new Tray(__dirname + '/../assets/logo.png') + contextMenu = Menu.buildFromTemplate([ + { + label: 'Open/Hide', click: () => { + if (hideInTray) { + options.window.show() + hideInTray = false + } else { + options.window.hide() + hideInTray = true + } + } + }, + { + label: 'Start/Stop', + click: () => { + console.log(isServerRunning) + if (isServerRunning) { + ipcMain.emit('stop'); + } else { + ipcMain.emit('start'); + } + } + }, + { + label: 'New Window', click: () => { + if (isServerRunning) { + options.openClient() + } + }, + enabled: isServerRunning + }, + { type: 'separator' }, + { label: 'Quit', click: () => { void options.app.quit(); } }, + ]); + tray.setContextMenu(contextMenu) + tray.setToolTip('Open Stage Control') + + return tray + +} + +function resetMenu(isServerRunning) { + contextMenu.items.forEach(item => { + if (item.label === 'New Window') { + item.enabled = isServerRunning + } + }) + tray.setContextMenu(contextMenu) +} \ No newline at end of file From a89f24d2f138c661520688727449f73aa51df9fe Mon Sep 17 00:00:00 2001 From: wicast Date: Tue, 8 Jul 2025 11:53:37 +0800 Subject: [PATCH 070/398] fix: macos tray icon size --- resources/images/logo_16x16.png | Bin 0 -> 931 bytes scripts/copy-assets.js | 4 ++++ src/server/tray.js | 7 +++++-- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 resources/images/logo_16x16.png diff --git a/resources/images/logo_16x16.png b/resources/images/logo_16x16.png new file mode 100644 index 0000000000000000000000000000000000000000..d6670a2ac34cfa2d5830bb546baad96b4dd95e9e GIT binary patch literal 931 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!Lb6AYF9SoB8UsT^3j@P1pisjL z28L1t28LG&3=CE?7#PG0=IjczVPIg?3GfMVRaDhhR0AR%MHMXtC3Sfvbp>S&AgQRT zqoAw_6bEt@R5XFgAf%F-E=UUysc3<;fTXmbNJUG}*3TiK(Ys`xo~^&Sp^aDZ+?2(S z6Xx6u@7|xXk&#nhy)dK=QZLsi$@z%fKYSsi4u zsLzLm>#t$pLB z0MG8Ij4hS^nwe8vxLF-jS;KC9`(N)OJ|q9VP4PTSW`+YBVirc|6zVX~JXMprcH!&Z zuUzrxDhiW}SKrJsy?xs{wDDQx;>&kUeJHJ8;Bot1NvRH#5JNMC9x#cD!C{XNHG{0 z7@6uCnClu?gculG8CY5wT51~@SQ!|kU2U&N(U6;;l9^VCTZ4Fq{b8U64Y&;@nYpRO zC5gEOXnITxt&EHzmYmEfJr2|(3DOgspH@mmtT}V`<;yx PP!WTttDnm{r-UW|_M$kQ literal 0 HcmV?d00001 diff --git a/scripts/copy-assets.js b/scripts/copy-assets.js index 73ad3e70..65c2df23 100644 --- a/scripts/copy-assets.js +++ b/scripts/copy-assets.js @@ -14,6 +14,10 @@ var cpr = require('cpr'), ['../node_modules/ace-builds/src-min/worker-javascript.js', '../app/client/workers/worker-javascript.js'], ] +if (process.platform === 'darwin') { + files.push(['../resources/images/logo_16x16.png', '../app/assets/logo_16x16.png']) +} + for (var i in files) { cpr(...files[i].map(f => path.resolve(__dirname + '/' + f)), { overwrite: true diff --git a/src/server/tray.js b/src/server/tray.js index cca4275c..79e63542 100644 --- a/src/server/tray.js +++ b/src/server/tray.js @@ -17,7 +17,11 @@ module.exports = function (options = {}) { resetMenu(isServerRunning) }) - tray = new Tray(__dirname + '/../assets/logo.png') + var icon = __dirname + '/../assets/logo.png' + if (process.platform === 'darwin') { + var icon = __dirname + '/../assets/logo_16x16.png' + } + tray = new Tray(icon) contextMenu = Menu.buildFromTemplate([ { label: 'Open/Hide', click: () => { @@ -33,7 +37,6 @@ module.exports = function (options = {}) { { label: 'Start/Stop', click: () => { - console.log(isServerRunning) if (isServerRunning) { ipcMain.emit('stop'); } else { From 2532ab67643bf4f5af76a8cc0b2b2e36429ab74f Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 8 Jul 2025 09:43:48 +0200 Subject: [PATCH 071/398] build: use sass instead of node-sass to fix mac builds --- package.json | 2 +- scripts/build-css.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b819dbcb..d60c7d7d 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "nanomorph": "5.4.3", "node-forge": "1.3.1", "node-mouse": "0.0.2", - "node-sass": "9.0.0", "nodemon": "2.0.16", "nosleep.js": "0.12.0", "open": "8.4.0", @@ -67,6 +66,7 @@ "qrcode": "1.5.1", "replacestream": "4.0.3", "sanitize-html": "1.27.5", + "sass": "1.89.2", "scope-css": "1.2.1", "screenfull": "5.2.0", "semver": "7.3.7", diff --git a/scripts/build-css.js b/scripts/build-css.js index 0e697159..c828cdb5 100644 --- a/scripts/build-css.js +++ b/scripts/build-css.js @@ -1,4 +1,4 @@ -var sass = require('node-sass'), +var sass = require('sass'), path = require('path'), fs = require('fs') @@ -10,7 +10,8 @@ fs.readdirSync(indir + '/themes/').forEach(file => { if (file.includes('.scss') && file !== 'default.scss') { let result = sass.renderSync({ file: indir + '/themes/' + file, - outputStyle: 'compressed' + outputStyle: 'compressed', + silenceDeprecations: ['mixed-decls', 'slash-div', 'import', 'legacy-js-api'] }) fs.writeFileSync(outdir + '/themes/' + file.split('/').pop().replace('scss', 'css'), result.css) @@ -22,7 +23,8 @@ var result = sass.renderSync({ file: indir + '/index.scss', outFile: outdir + '/open-stage-control.css', outputStyle: 'compressed', - sourceMap: true + sourceMap: true, + silenceDeprecations: ['mixed-decls', 'slash-div', 'import', 'legacy-js-api'] }) fs.writeFileSync(outdir + '/open-stage-control.css', result.css) From 3b887d7a152463b09de43c1d1b12d428f87d9978 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 8 Jul 2025 09:44:50 +0200 Subject: [PATCH 072/398] package-lock: update --- package-lock.json | 399 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 388 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0a6aed4..4a480a40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "open-stage-control", - "version": "1.29.1", + "version": "1.29.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "open-stage-control", - "version": "1.29.1", + "version": "1.29.6", "hasInstallScript": true, "license": "GPL-3.0", "dependencies": { @@ -57,6 +57,7 @@ "qrcode": "1.5.1", "replacestream": "4.0.3", "sanitize-html": "1.27.5", + "sass": "^1.89.2", "scope-css": "1.2.1", "screenfull": "5.2.0", "semver": "7.3.7", @@ -3011,6 +3012,300 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@parcel/watcher": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", + "integrity": "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.5.1", + "@parcel/watcher-darwin-arm64": "2.5.1", + "@parcel/watcher-darwin-x64": "2.5.1", + "@parcel/watcher-freebsd-x64": "2.5.1", + "@parcel/watcher-linux-arm-glibc": "2.5.1", + "@parcel/watcher-linux-arm-musl": "2.5.1", + "@parcel/watcher-linux-arm64-glibc": "2.5.1", + "@parcel/watcher-linux-arm64-musl": "2.5.1", + "@parcel/watcher-linux-x64-glibc": "2.5.1", + "@parcel/watcher-linux-x64-musl": "2.5.1", + "@parcel/watcher-win32-arm64": "2.5.1", + "@parcel/watcher-win32-ia32": "2.5.1", + "@parcel/watcher-win32-x64": "2.5.1" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz", + "integrity": "sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz", + "integrity": "sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz", + "integrity": "sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz", + "integrity": "sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz", + "integrity": "sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz", + "integrity": "sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz", + "integrity": "sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz", + "integrity": "sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz", + "integrity": "sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz", + "integrity": "sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz", + "integrity": "sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz", + "integrity": "sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz", + "integrity": "sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "optional": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/@serialport/binding-abstract": { "version": "9.2.4", "license": "MIT", @@ -3907,10 +4202,11 @@ "license": "MIT" }, "node_modules/braces": { - "version": "3.0.2", - "license": "MIT", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -6168,8 +6464,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "license": "MIT", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -6964,6 +7261,11 @@ "version": "1.0.1", "license": "ISC" }, + "node_modules/immutable": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.3.tgz", + "integrity": "sha512-+chQdDfvscSF1SJqv2gn4SRO2ZyS3xL3r7IW/wWEEzrzLisnOlKiQu5ytC/BVNcS15C39WT2Hg/bjKjDMcu+zg==" + }, "node_modules/import-fresh": { "version": "3.3.0", "license": "MIT", @@ -7202,7 +7504,8 @@ }, "node_modules/is-number": { "version": "7.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "engines": { "node": ">=0.12.0" } @@ -7867,6 +8170,19 @@ "source-map": "^0.5.6" } }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "optional": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/miller-rabin": { "version": "4.0.1", "license": "MIT", @@ -8259,6 +8575,12 @@ "node": ">=10" } }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "optional": true + }, "node_modules/node-forge": { "version": "1.3.1", "license": "(BSD-3-Clause OR GPL-2.0)", @@ -9219,8 +9541,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.2.3", - "license": "MIT", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "engines": { "node": ">=8.6" }, @@ -9919,6 +10242,25 @@ "postcss": "^7.0.27" } }, + "node_modules/sass": { + "version": "1.89.2", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.89.2.tgz", + "integrity": "sha512-xCmtksBKd/jdJ9Bt9p7nPKiuqrlBMBuuGkQlkhZjjQk3Ty48lv93k5Dq6OPkKt4XwxDJ7tvlfrTa1MPA9bf+QA==", + "dependencies": { + "chokidar": "^4.0.0", + "immutable": "^5.0.2", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + }, + "optionalDependencies": { + "@parcel/watcher": "^2.4.1" + } + }, "node_modules/sass-graph": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-4.0.1.tgz", @@ -9936,6 +10278,32 @@ "node": ">=12" } }, + "node_modules/sass/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/sass/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/scope-css": { "version": "1.2.1", "license": "MIT", @@ -10261,6 +10629,14 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-support": { "version": "0.5.21", "license": "MIT", @@ -10782,7 +11158,8 @@ }, "node_modules/to-regex-range": { "version": "5.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dependencies": { "is-number": "^7.0.0" }, From b23c062e07f04a3e7ea0d0af0cd0309429356d48 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 27 Jun 2025 09:55:19 +0200 Subject: [PATCH 073/398] docs: update --- README.md | 2 +- resources/docs/docs/credits.md | 2 +- .../docs/docs/widgets/properties-reference.md | 14 +++++++++----- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 280b04ee..cecaf628 100644 --- a/README.md +++ b/README.md @@ -11,5 +11,5 @@ Open Stage Control ---- -Copyleft © Jean-Emmanuel Doucet @ [AMMD](http://ammd.net) 2014-2022. +Copyleft © Jean-Emmanuel Doucet 2014-2025. This program is a free software released under the [GNU/GPL3](ttps://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE) license. diff --git a/resources/docs/docs/credits.md b/resources/docs/docs/credits.md index bbdeb473..73425ad7 100644 --- a/resources/docs/docs/credits.md +++ b/resources/docs/docs/credits.md @@ -1,6 +1,6 @@ ## License -Copyleft © Jean-Emmanuel Doucet @ [AMMD](http://ammd.net) 2014-2022. +Copyleft © Jean-Emmanuel Doucet 2014-2025. This program is a free software released under the [GNU/GPL3](https://github.com/jean-emmanuel/open-stage-control/blob/master/LICENSE) license. ## Dependencies diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index 7f997a2c..9898b64f 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -776,10 +776,12 @@ | --- | --- | --- | --- | |
snap#
| `boolean` | false | By default, the points are dragged from their initial position.

If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates | |
spring#
| `boolean` | false | When set to `true`, the widget will go back to its default value when released | - |
rangeX#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis | - |
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | + |
rangeX#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis (see fader) | + |
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis (see fader) | |
logScaleX#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale. | |
logScaleY#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis. Set to `-1` for exponential scale. | + |
stepsX#
| `number`|
`array`|
`string` | false | Defines `steps` for the x axis (see fader) | + |
stepsY#
| `number`|
`array`|
`string` | false | Defines `steps` for the x axis (see fader) | |
axisLock#
| `string` | "" | Restrict movements to one of the axes only unless `Shift` is held.

When left empty, holding `Shift` while dragging will lock the pad according the first movement. `auto` will do the opposite.

Choices: ``, `x`, `y`, `auto` | |
doubleTap#
| `boolean`|
`string` | false | Set to `true` to make the knob reset to its `default` value when receiving a double tap.

Can be an osc address, in which case the widget will just send an osc message with no value (but `preArgs` included).

If set to "script", `onTouch` will be called with `event.type` set to `doubleTap`.

Choices: `false`, `true`, `script` | |
sensitivity#
| `number` | 1 | Defines the pad's sensitivity when `snap` is `false` | @@ -830,10 +832,12 @@ |
pointsAttr#
| `object` | [] | Defines per-point properties that are otherwise inherited from the multixy. Must be an array of objects (one per point) that may contain the following keys:
- visible (visibility and interactability)
- colorFill (background color)
- colorStroke (outline color)
- colorText (label color)
- color (shorthand for colorFill and colorStroke)
- alphaFillOn (background opacity)
- pointSize
- label | |
snap#
| `boolean` | false | By default, the points are dragged from their initial position.

If set to `true`, touching anywhere on the widget's surface will make them snap to the touching coordinates | |
spring#
| `boolean` | false | When set to `true`, the widget will go back to its default value when released | - |
rangeX#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis | - |
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis | + |
rangeX#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the x axis (see fader) | + |
rangeY#
| `object` | \{
 "min": 0,
 "max": 1
}
| Defines the min and max values for the y axis (see fader) | |
logScaleX#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the x axis. Set to `-1` for exponential scale. | |
logScaleY#
| `boolean`|
`number` | false | Set to `true` to use logarithmic scale for the y axis. Set to `-1` for exponential scale. | + |
stepsX#
| `number`|
`array`|
`string` | false | Defines `steps` for the x axis (see fader) | + |
stepsY#
| `number`|
`array`|
`string` | false | Defines `steps` for the x axis (see fader) | |
axisLock#
| `string` | "" | Restrict movements to one of the axes only.

When left empty, holding `Shift` while dragging will lock the pad according the first movement. `auto` will do the opposite.

Choices: ``, `x`, `y`, `auto` | |
doubleTap#
| `boolean`|
`string` | false | Set to `true` to make the knob reset to its `default` value when receiving a double tap.

Can be an osc address, in which case the widget will just send an osc message with no value (but `preArgs` included).

If set to "script", `onTouch` will be called with `event.type` set to `doubleTap`.

Choices: `false`, `true`, `script` | |
sensitivity#
| `number` | 1 | Defines the pad's sensitivity when `snap` is `false` | @@ -859,7 +863,7 @@ | property | type |default | description | | --- | --- | --- | --- | |
valueLength#
| `number` | 1 | Defines the number of values accepted by the widget (minimum 1). Incoming messages that don't comply will be ignored

When calling `set()` from a script, submitted value should be an array only if `valueLength` is greater than 1. | - |
autoClear#
| `boolean` | true | If set to `false`, the canvas context won't be cleared automatically and `ctx.clear()` will need to be called in `onDraw`. | + |
autoClear#
| `boolean` | true | If set to `false`, the canvas context won't be cleared automatically and `ctx.clearRect()` will need to be called in `onDraw`. | |
continuous#
| `boolean`|
`number` | false | If set to `true`, `onDraw` will be called at each frame, otherwise it will be called only when the widget is touched and when it receives a value.

Can be a number between 1 and 60 to specify the framerate (default: 30 fps). | === "scripting" From 55618fe5c37e1b75c93ede40e749381ace161045 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Fri, 27 Jun 2025 09:55:32 +0200 Subject: [PATCH 074/398] package: 1.29.6 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index fa6a7cf4..b819dbcb 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.5", + "version": "1.29.6", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" From bde7039d257abef965ceb74720b52c90026dacd1 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 8 Jul 2025 09:43:48 +0200 Subject: [PATCH 075/398] build: use sass instead of node-sass to fix mac builds --- package.json | 2 +- scripts/build-css.js | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index b819dbcb..d60c7d7d 100644 --- a/package.json +++ b/package.json @@ -58,7 +58,6 @@ "nanomorph": "5.4.3", "node-forge": "1.3.1", "node-mouse": "0.0.2", - "node-sass": "9.0.0", "nodemon": "2.0.16", "nosleep.js": "0.12.0", "open": "8.4.0", @@ -67,6 +66,7 @@ "qrcode": "1.5.1", "replacestream": "4.0.3", "sanitize-html": "1.27.5", + "sass": "1.89.2", "scope-css": "1.2.1", "screenfull": "5.2.0", "semver": "7.3.7", diff --git a/scripts/build-css.js b/scripts/build-css.js index 0e697159..c828cdb5 100644 --- a/scripts/build-css.js +++ b/scripts/build-css.js @@ -1,4 +1,4 @@ -var sass = require('node-sass'), +var sass = require('sass'), path = require('path'), fs = require('fs') @@ -10,7 +10,8 @@ fs.readdirSync(indir + '/themes/').forEach(file => { if (file.includes('.scss') && file !== 'default.scss') { let result = sass.renderSync({ file: indir + '/themes/' + file, - outputStyle: 'compressed' + outputStyle: 'compressed', + silenceDeprecations: ['mixed-decls', 'slash-div', 'import', 'legacy-js-api'] }) fs.writeFileSync(outdir + '/themes/' + file.split('/').pop().replace('scss', 'css'), result.css) @@ -22,7 +23,8 @@ var result = sass.renderSync({ file: indir + '/index.scss', outFile: outdir + '/open-stage-control.css', outputStyle: 'compressed', - sourceMap: true + sourceMap: true, + silenceDeprecations: ['mixed-decls', 'slash-div', 'import', 'legacy-js-api'] }) fs.writeFileSync(outdir + '/open-stage-control.css', result.css) From aa2d5029bec0960d8eae3387ad777cd319528ea5 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 8 Jul 2025 09:44:50 +0200 Subject: [PATCH 076/398] package-lock: update --- package-lock.json | 399 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 388 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index f0a6aed4..4a480a40 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "open-stage-control", - "version": "1.29.1", + "version": "1.29.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "open-stage-control", - "version": "1.29.1", + "version": "1.29.6", "hasInstallScript": true, "license": "GPL-3.0", "dependencies": { @@ -57,6 +57,7 @@ "qrcode": "1.5.1", "replacestream": "4.0.3", "sanitize-html": "1.27.5", + "sass": "^1.89.2", "scope-css": "1.2.1", "screenfull": "5.2.0", "semver": "7.3.7", @@ -3011,6 +3012,300 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@parcel/watcher": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz", + "integrity": "sha512-dfUnCxiN9H4ap84DvD2ubjw+3vUNpstxa0TneY/Paat8a3R4uQZDLSvWjmznAY/DoahqTHl9V46HF/Zs3F29pg==", + "hasInstallScript": true, + "optional": true, + "dependencies": { + "detect-libc": "^1.0.3", + "is-glob": "^4.0.3", + "micromatch": "^4.0.5", + "node-addon-api": "^7.0.0" + }, + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + }, + "optionalDependencies": { + "@parcel/watcher-android-arm64": "2.5.1", + "@parcel/watcher-darwin-arm64": "2.5.1", + "@parcel/watcher-darwin-x64": "2.5.1", + "@parcel/watcher-freebsd-x64": "2.5.1", + "@parcel/watcher-linux-arm-glibc": "2.5.1", + "@parcel/watcher-linux-arm-musl": "2.5.1", + "@parcel/watcher-linux-arm64-glibc": "2.5.1", + "@parcel/watcher-linux-arm64-musl": "2.5.1", + "@parcel/watcher-linux-x64-glibc": "2.5.1", + "@parcel/watcher-linux-x64-musl": "2.5.1", + "@parcel/watcher-win32-arm64": "2.5.1", + "@parcel/watcher-win32-ia32": "2.5.1", + "@parcel/watcher-win32-x64": "2.5.1" + } + }, + "node_modules/@parcel/watcher-android-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.1.tgz", + "integrity": "sha512-KF8+j9nNbUN8vzOFDpRMsaKBHZ/mcjEjMToVMJOhTozkDonQFFrRcfdLWn6yWKCmJKmdVxSgHiYvTCef4/qcBA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-arm64/-/watcher-darwin-arm64-2.5.1.tgz", + "integrity": "sha512-eAzPv5osDmZyBhou8PoF4i6RQXAfeKL9tjb3QzYuccXFMQU0ruIc/POh30ePnaOyD1UXdlKguHBmsTs53tVoPw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-darwin-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-darwin-x64/-/watcher-darwin-x64-2.5.1.tgz", + "integrity": "sha512-1ZXDthrnNmwv10A0/3AJNZ9JGlzrF82i3gNQcWOzd7nJ8aj+ILyW1MTxVk35Db0u91oD5Nlk9MBiujMlwmeXZg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-freebsd-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-freebsd-x64/-/watcher-freebsd-x64-2.5.1.tgz", + "integrity": "sha512-SI4eljM7Flp9yPuKi8W0ird8TI/JK6CSxju3NojVI6BjHsTyK7zxA9urjVjEKJ5MBYC+bLmMcbAWlZ+rFkLpJQ==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-glibc/-/watcher-linux-arm-glibc-2.5.1.tgz", + "integrity": "sha512-RCdZlEyTs8geyBkkcnPWvtXLY44BCeZKmGYRtSgtwwnHR4dxfHRG3gR99XdMEdQ7KeiDdasJwwvNSF5jKtDwdA==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm-musl/-/watcher-linux-arm-musl-2.5.1.tgz", + "integrity": "sha512-6E+m/Mm1t1yhB8X412stiKFG3XykmgdIOqhjWj+VL8oHkKABfu/gjFj8DvLrYVHSBNC+/u5PeNrujiSQ1zwd1Q==", + "cpu": [ + "arm" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-glibc/-/watcher-linux-arm64-glibc-2.5.1.tgz", + "integrity": "sha512-LrGp+f02yU3BN9A+DGuY3v3bmnFUggAITBGriZHUREfNEzZh/GO06FF5u2kx8x+GBEUYfyTGamol4j3m9ANe8w==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-arm64-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-arm64-musl/-/watcher-linux-arm64-musl-2.5.1.tgz", + "integrity": "sha512-cFOjABi92pMYRXS7AcQv9/M1YuKRw8SZniCDw0ssQb/noPkRzA+HBDkwmyOJYp5wXcsTrhxO0zq1U11cK9jsFg==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-glibc": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-glibc/-/watcher-linux-x64-glibc-2.5.1.tgz", + "integrity": "sha512-GcESn8NZySmfwlTsIur+49yDqSny2IhPeZfXunQi48DMugKeZ7uy1FX83pO0X22sHntJ4Ub+9k34XQCX+oHt2A==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-linux-x64-musl": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-linux-x64-musl/-/watcher-linux-x64-musl-2.5.1.tgz", + "integrity": "sha512-n0E2EQbatQ3bXhcH2D1XIAANAcTZkQICBPVaxMeaCVBtOpBZpWJuf7LwyWPSBDITb7In8mqQgJ7gH8CILCURXg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-arm64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-arm64/-/watcher-win32-arm64-2.5.1.tgz", + "integrity": "sha512-RFzklRvmc3PkjKjry3hLF9wD7ppR4AKcWNzH7kXR7GUe0Igb3Nz8fyPwtZCSquGrhU5HhUNDr/mKBqj7tqA2Vw==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-ia32": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-ia32/-/watcher-win32-ia32-2.5.1.tgz", + "integrity": "sha512-c2KkcVN+NJmuA7CGlaGD1qJh1cLfDnQsHjE89E60vUEMlqduHGCdCLJCID5geFVM0dOtA3ZiIO8BoEQmzQVfpQ==", + "cpu": [ + "ia32" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher-win32-x64": { + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/@parcel/watcher-win32-x64/-/watcher-win32-x64-2.5.1.tgz", + "integrity": "sha512-9lHBdJITeNR++EvSQVUcaZoWupyHfXe1jZvGZ06O/5MflPcuPLtEphScIBL+AiCWBO46tDSHzWyD0uDmmZqsgA==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/parcel" + } + }, + "node_modules/@parcel/watcher/node_modules/detect-libc": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-1.0.3.tgz", + "integrity": "sha512-pGjwhsmsp4kL2RTz08wcOlGN83otlqHeD/Z5T8GXZB+/YcpQ/dgo+lbU8ZsGxV0HIvqqxo9l7mqYwyYMD9bKDg==", + "optional": true, + "bin": { + "detect-libc": "bin/detect-libc.js" + }, + "engines": { + "node": ">=0.10" + } + }, "node_modules/@serialport/binding-abstract": { "version": "9.2.4", "license": "MIT", @@ -3907,10 +4202,11 @@ "license": "MIT" }, "node_modules/braces": { - "version": "3.0.2", - "license": "MIT", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", + "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", "dependencies": { - "fill-range": "^7.0.1" + "fill-range": "^7.1.1" }, "engines": { "node": ">=8" @@ -6168,8 +6464,9 @@ } }, "node_modules/fill-range": { - "version": "7.0.1", - "license": "MIT", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", + "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", "dependencies": { "to-regex-range": "^5.0.1" }, @@ -6964,6 +7261,11 @@ "version": "1.0.1", "license": "ISC" }, + "node_modules/immutable": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/immutable/-/immutable-5.1.3.tgz", + "integrity": "sha512-+chQdDfvscSF1SJqv2gn4SRO2ZyS3xL3r7IW/wWEEzrzLisnOlKiQu5ytC/BVNcS15C39WT2Hg/bjKjDMcu+zg==" + }, "node_modules/import-fresh": { "version": "3.3.0", "license": "MIT", @@ -7202,7 +7504,8 @@ }, "node_modules/is-number": { "version": "7.0.0", - "license": "MIT", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "engines": { "node": ">=0.12.0" } @@ -7867,6 +8170,19 @@ "source-map": "^0.5.6" } }, + "node_modules/micromatch": { + "version": "4.0.8", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz", + "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==", + "optional": true, + "dependencies": { + "braces": "^3.0.3", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" + } + }, "node_modules/miller-rabin": { "version": "4.0.1", "license": "MIT", @@ -8259,6 +8575,12 @@ "node": ">=10" } }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "optional": true + }, "node_modules/node-forge": { "version": "1.3.1", "license": "(BSD-3-Clause OR GPL-2.0)", @@ -9219,8 +9541,9 @@ "license": "ISC" }, "node_modules/picomatch": { - "version": "2.2.3", - "license": "MIT", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", "engines": { "node": ">=8.6" }, @@ -9919,6 +10242,25 @@ "postcss": "^7.0.27" } }, + "node_modules/sass": { + "version": "1.89.2", + "resolved": "https://registry.npmjs.org/sass/-/sass-1.89.2.tgz", + "integrity": "sha512-xCmtksBKd/jdJ9Bt9p7nPKiuqrlBMBuuGkQlkhZjjQk3Ty48lv93k5Dq6OPkKt4XwxDJ7tvlfrTa1MPA9bf+QA==", + "dependencies": { + "chokidar": "^4.0.0", + "immutable": "^5.0.2", + "source-map-js": ">=0.6.2 <2.0.0" + }, + "bin": { + "sass": "sass.js" + }, + "engines": { + "node": ">=14.0.0" + }, + "optionalDependencies": { + "@parcel/watcher": "^2.4.1" + } + }, "node_modules/sass-graph": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/sass-graph/-/sass-graph-4.0.1.tgz", @@ -9936,6 +10278,32 @@ "node": ">=12" } }, + "node_modules/sass/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/sass/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/scope-css": { "version": "1.2.1", "license": "MIT", @@ -10261,6 +10629,14 @@ "node": ">=0.10.0" } }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-support": { "version": "0.5.21", "license": "MIT", @@ -10782,7 +11158,8 @@ }, "node_modules/to-regex-range": { "version": "5.0.1", - "license": "MIT", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dependencies": { "is-number": "^7.0.0" }, From a5d5586dc367f9d8be3b193b392c414c74a43297 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 8 Jul 2025 16:58:02 +0200 Subject: [PATCH 077/398] tray: code lint, retina icon for mac, keep alive launcher and tray when closing if there's a client window --- .../images/{logo_16x16.png => logo_tray.png} | Bin resources/images/logo_tray@x2.png | Bin 0 -> 1688 bytes scripts/copy-assets.js | 2 + src/server/index.js | 24 +++- src/server/tray.js | 111 ++++++++++-------- 5 files changed, 85 insertions(+), 52 deletions(-) rename resources/images/{logo_16x16.png => logo_tray.png} (100%) create mode 100644 resources/images/logo_tray@x2.png diff --git a/resources/images/logo_16x16.png b/resources/images/logo_tray.png similarity index 100% rename from resources/images/logo_16x16.png rename to resources/images/logo_tray.png diff --git a/resources/images/logo_tray@x2.png b/resources/images/logo_tray@x2.png new file mode 100644 index 0000000000000000000000000000000000000000..c3c4f0c64225c3409ebabefe20c365e491489eca GIT binary patch literal 1688 zcmV;J250$+P)b%78FWQhbW?9;ba!ELWdL_~cP?peYja~^aAhuUa%Y?FJQ@H11|>;E zK~z|Ut(RSF99I>`fA`Mr&U(Ec_S!D79mny3x z@-VwoyLRGDn*YgzkvoZbzs-q1diqs}RHiP-K8BD9#EY z2Bj(-Pp8vHCHsnv2qY5Sn;l{AQ-W`xsI7=C%%k{CQ7az2df~$KT@mQ*?e$%`Hunth z3{bW9OF>o5rvND2m_;dPy>0Rc@nUOJ{m+MnhKdyvXh|mHev`L=U1gc(53;Fy7mc6Z zMQ!^I0@ZPZlmIBl!CabW{?Zv{&YfUp_yl%w)gKtJ4f)k8S4I{#B+${(l~9^|7w9Z| zx@G5=*w+6v!PtH4Ik5)j;yjmzjxhfIZ&9{g7N@1dp0Tmi*ewZ^JU0?;=tV=D4I5;q1}cn#Yu+>!B}PrdAUe)i~orcND0IS%>E6aboE$6p=wKCxt=PdY;Nl_i_D zyLHDlmYF>H$BK=w3cGR`Ir;)qr;d5+#^QA-RZ2Y^_vBL1CvoWZD3!7{bLl_WRz`YJQxeiGY|a z3%%@wmG%1`LaZy5Kn@_kFyjdW(fWICUi$p*gHkxQm4@wx8LWsfg+lM0q0QiGp zT0j5gdqzNy)I%x9jGObGTq#b-s(=~*G62)3-@{yThnCJqzJ*T@ePZK6N1T9;qi(x7iE3Z53FY8l`A?1I<8d zbHkoBBN;$z>-JhrcRrvrlnTv9v?+nVYDEK4Zey{{yjNZ|UjQu-a*x`IifS!q$xWwG zcIir>xTuQ$of8vhZg`|WK9+ZOCOaL;yJZppdL&M$e#@$f_jYiKCd-*AmUDAn(Lr%h zL+nYX&yBB&+Ikn0QY8KW?DiCe#9tjn56AI`Vn{9Eb~VqaftAl<+?>Z+%6M|=Yh2aK?tPg)_2FYKJs)mmXzYa<*}|`DD~F59d5(R>DI2U zMrmpL5b8-Fep}^_kO6gAS>j+h+i!&p36zmcCId?a`h--wK<)t5N@)zr`H@0000settings.options[x].launcher !== false).length / 2), node:true, color:'#151a24', id: 'launcher'}) require('@electron/remote/main').enable(launcher.webContents) - launcher.on('close', ()=>{ - process.stdout.write = stdoutWrite - process.stderr.write = stderrWrite - if (process.log) process.log = processLog - }) tray = require('./tray')({ window: launcher, @@ -231,6 +226,25 @@ function startLauncher() { stopServer: stopServerProcess }) + launcher.on('will-close', ()=>{ + if (clientWindows.length) { + launcher.hide() + e.preventDefault() + } + }) + + launcher.on('close', (e)=>{ + if (clientWindows.length) { + launcher.hide() + e.preventDefault() + return + } + process.stdout.write = stdoutWrite + process.stderr.write = stderrWrite + if (process.log) process.log = processLog + tray.destroy() + }) + }) let processLog = process.log, diff --git a/src/server/tray.js b/src/server/tray.js index 79e63542..bb49d4a6 100644 --- a/src/server/tray.js +++ b/src/server/tray.js @@ -1,72 +1,89 @@ -var { Menu, Tray, ipcMain } = require('electron') - -var tray = null, +var {Menu, Tray, ipcMain} = require('electron'), + settings = require('./settings'), + tray = null, contextMenu = null, - hideInTray = false, isServerRunning = false -module.exports = function (options = {}) { - - ipcMain.on('start', function (e, options) { - isServerRunning = true - resetMenu(isServerRunning) - }) - - ipcMain.on('stop', function (e, options) { - isServerRunning = false - resetMenu(isServerRunning) - }) +module.exports = function(options = {}) { var icon = __dirname + '/../assets/logo.png' if (process.platform === 'darwin') { - var icon = __dirname + '/../assets/logo_16x16.png' + icon = __dirname + '/../assets/logo_tray.png' } + tray = new Tray(icon) contextMenu = Menu.buildFromTemplate([ { - label: 'Open/Hide', click: () => { - if (hideInTray) { - options.window.show() - hideInTray = false - } else { - options.window.hide() - hideInTray = true - } + label: 'Show launcher', + id: 'show', + click: ()=>{ + options.window.show() } }, { - label: 'Start/Stop', - click: () => { - if (isServerRunning) { - ipcMain.emit('stop'); - } else { - ipcMain.emit('start'); - } + label: 'Hide launcher', + id: 'hide', + click: ()=>{ + options.window.hide() } }, { - label: 'New Window', click: () => { + label: 'Start server', + id: 'start', + click: ()=>{ + ipcMain.emit('start') + } + }, + { + label: 'Stop server', + id: 'stop', + click: ()=>{ + ipcMain.emit('stop') + } + }, + { + label: 'New client window', + id: 'new', + click: ()=> { if (isServerRunning) { options.openClient() } - }, - enabled: isServerRunning + } }, - { type: 'separator' }, - { label: 'Quit', click: () => { void options.app.quit(); } }, - ]); + { + type: 'separator' + }, + { + label: 'Quit', + role: 'Quit' + }, + ]) + tray.setContextMenu(contextMenu) - tray.setToolTip('Open Stage Control') + tray.setToolTip(settings.infos.productName) + + function updateMenu(){ + contextMenu.getMenuItemById('start').visible = !isServerRunning + contextMenu.getMenuItemById('stop').visible = isServerRunning + contextMenu.getMenuItemById('show').visible = !options.window.isVisible() + contextMenu.getMenuItemById('hide').visible = options.window.isVisible() + contextMenu.getMenuItemById('new').visible = isServerRunning + tray.setContextMenu(contextMenu) + } + + ipcMain.on('start', function(e, options) { + isServerRunning = true + updateMenu() + }) + + ipcMain.on('stop', function(e, options) { + isServerRunning = false + updateMenu() + }) + + options.window.on('show', updateMenu) + options.window.on('hide', updateMenu) return tray } - -function resetMenu(isServerRunning) { - contextMenu.items.forEach(item => { - if (item.label === 'New Window') { - item.enabled = isServerRunning - } - }) - tray.setContextMenu(contextMenu) -} \ No newline at end of file From 687564cb6fd6a96368a4afdb443845bc622ae95e Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 15 Jul 2025 11:47:43 +0200 Subject: [PATCH 078/398] switch: fix border radius inheritance --- src/scss/widgets/basics.scss | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/scss/widgets/basics.scss b/src/scss/widgets/basics.scss index 6624b9ae..388a85db 100644 --- a/src/scss/widgets/basics.scss +++ b/src/scss/widgets/basics.scss @@ -164,6 +164,23 @@ } } + &.layout-vertical value:first-child { + border-top-left-radius: var(--border-radius); + border-top-right-radius: var(--border-radius) + } + &.layout-vertical value:last-child { + border-bottom-left-radius: var(--border-radius); + border-bottom-right-radius: var(--border-radius) + } + &.layout-horizontal value:first-child { + border-bottom-left-radius: var(--border-radius); + border-top-left-radius: var(--border-radius) + } + &.layout-horizontal value:last-child { + border-bottom-right-radius: var(--border-radius); + border-top-right-radius: var(--border-radius) + } + &.wrap value { white-space: pre-wrap; word-break: break-all; From 01e447ac60d69b76bea544301ca416505bed1365 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 15 Jul 2025 12:36:14 +0200 Subject: [PATCH 079/398] menu: make popup menu inherit border radius --- src/client/widgets/basics/menu.js | 1 + src/scss/widgets/basics.scss | 42 ++++++++++++++++++++++++------- 2 files changed, 34 insertions(+), 9 deletions(-) diff --git a/src/client/widgets/basics/menu.js b/src/client/widgets/basics/menu.js index c35f5024..8ba4a543 100644 --- a/src/client/widgets/basics/menu.js +++ b/src/client/widgets/basics/menu.js @@ -263,6 +263,7 @@ class Menu extends MenuBase { this.container.classList.toggle('circular', layout === 'circular') this.container.classList.toggle('grid', layout === 'grid') this.container.classList.toggle('vertical', layout === 'vertical') + this.container.classList.toggle('horizontal', layout === 'horizontal') if (layout === 'grid') { var template = this.getProp('gridTemplate') || Math.round(this.values.length / 2) diff --git a/src/scss/widgets/basics.scss b/src/scss/widgets/basics.scss index 388a85db..b872b927 100644 --- a/src/scss/widgets/basics.scss +++ b/src/scss/widgets/basics.scss @@ -165,20 +165,20 @@ } &.layout-vertical value:first-child { - border-top-left-radius: var(--border-radius); - border-top-right-radius: var(--border-radius) + border-top-left-radius: inherit; + border-top-right-radius: inherit; } &.layout-vertical value:last-child { - border-bottom-left-radius: var(--border-radius); - border-bottom-right-radius: var(--border-radius) + border-bottom-left-radius: inherit; + border-bottom-right-radius: inherit; } &.layout-horizontal value:first-child { - border-bottom-left-radius: var(--border-radius); - border-top-left-radius: var(--border-radius) + border-bottom-left-radius: inherit; + border-top-left-radius: inherit; } &.layout-horizontal value:last-child { - border-bottom-right-radius: var(--border-radius); - border-top-right-radius: var(--border-radius) + border-bottom-right-radius: inherit; + border-top-right-radius: inherit; } &.wrap value { @@ -412,7 +412,7 @@ width:var(--size-box-w); height:var(--size-box-h); - + border-radius: inherit; display: flex; flex-direction: row; @@ -460,14 +460,38 @@ display: grid; grid-template-columns: repeat(var(--grid-columns), 1fr); + .item { + border-radius: inherit; + } } &.vertical menu { flex-direction: column; + .item:first-child { + border-top-left-radius: inherit; + border-top-right-radius: inherit; + } + .item:last-child { + border-bottom-left-radius: inherit; + border-bottom-right-radius: inherit; + } + } + &.horizontal menu { + + .item:first-child { + border-bottom-left-radius: inherit; + border-top-left-radius: inherit; + } + .item:last-child { + border-bottom-right-radius: inherit; + border-top-right-radius: inherit; + } + + } } From 1ade3d4392097197608722fd4f7e24311ea8d8b9 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 16 Jul 2025 14:04:45 +0200 Subject: [PATCH 080/398] fader: make compact design honor borderRadius --- src/client/widgets/common/widget.js | 2 +- src/client/widgets/sliders/fader.js | 79 ++++++++++++++++++++++------- 2 files changed, 62 insertions(+), 19 deletions(-) diff --git a/src/client/widgets/common/widget.js b/src/client/widgets/common/widget.js index 1cc8383f..d2543f7e 100644 --- a/src/client/widgets/common/widget.js +++ b/src/client/widgets/common/widget.js @@ -1368,7 +1368,7 @@ Widget.cssVariables = [ {js: 'colorText', css: '--color-text'}, {js: 'padding', css: '--widget-padding', toCss: x=>parseFloat(x) + 'rem', toJs: x=>parseFloat(x) * PXSCALE}, {js: 'lineWidth', css: '--line-width', toCss: x=>parseFloat(x) + 'rem', toJs: x=>parseFloat(x) * PXSCALE}, - {js: 'borderRadius', css: '--border-radius', toCss: x=>parseFloat(x) == x ? x + 'rem' : x}, + {js: 'borderRadius', css: '--border-radius', toCss: x=>parseFloat(x) == x ? x + 'rem' : x, toJs: x=>parseFloat(x)}, {js: 'alphaFillOn', css: '--alpha-fill-on', toCss: x=>parseFloat(x), toJs: x=>parseFloat(x)}, {js: 'alphaFillOff', css: '--alpha-fill-off', toCss: x=>parseFloat(x), toJs: x=>parseFloat(x)}, {js: 'alphaStroke', css: '--alpha-stroke', toCss: x=>parseFloat(x), toJs: x=>parseFloat(x)}, diff --git a/src/client/widgets/sliders/fader.js b/src/client/widgets/sliders/fader.js index 38d1aa34..96171ff1 100644 --- a/src/client/widgets/sliders/fader.js +++ b/src/client/widgets/sliders/fader.js @@ -298,24 +298,6 @@ class Fader extends Slider { if (compact) { - // stroke - if (this.cssVars.lineWidth) { - - this.ctx.globalAlpha = this.cssVars.alphaStroke - this.ctx.strokeStyle = this.cssVars.colorStroke - - this.ctx.beginPath() - this.ctx.moveTo(0, 0) - this.ctx.lineTo(width, 0) - this.ctx.lineTo(width, height) - this.ctx.lineTo(0, height) - this.ctx.closePath() - this.ctx.lineWidth = 2 * this.cssVars.lineWidth - this.ctx.stroke() - - } - - // flat knob this.ctx.globalAlpha = 1 @@ -326,6 +308,67 @@ class Fader extends Slider { this.ctx.rect(this.gaugePadding, d, width - this.gaugePadding * 2, knobHeight) this.ctx.fill() + + // stroke + if (this.cssVars.lineWidth) { + + this.ctx.globalAlpha = this.cssVars.alphaStroke + this.ctx.strokeStyle = this.cssVars.colorStroke + + let x, y, w, h, + rad = PXSCALE * this.cssVars.borderRadius + + if (rad > 0) { + // bordeRadius: clip gauge & knob + x = this.gaugePadding + y = this.gaugePadding + w = width - this.gaugePadding * 2 + h = height - this.gaugePadding * 2 + this.ctx.beginPath() + this.ctx.moveTo(x + rad, y) + this.ctx.arcTo(x + w, y, x + w, y + h, rad) + this.ctx.arcTo(x + w, y + h, x, y + h, rad) + this.ctx.arcTo(x, y + h, x, y, rad) + this.ctx.arcTo(x, y, x + w, y, rad) + this.ctx.closePath() + + var tmpOp = this.ctx.globalCompositeOperation + this.ctx.globalCompositeOperation = 'destination-in' + this.ctx.globalAlpha = 1 + this.ctx.fill() + this.ctx.globalCompositeOperation = tmpOp + this.ctx.globalAlpha = this.cssVars.alphaStroke + } + + + // draw stroke + x = 0.5 * this.cssVars.lineWidth + y = 0.5 * this.cssVars.lineWidth + w = width - this.cssVars.lineWidth + h = height - this.cssVars.lineWidth + + this.ctx.beginPath() + if (rad > 0) { + this.ctx.moveTo(x + rad, y) + this.ctx.arcTo(x + w, y, x + w, y + h, rad) + this.ctx.arcTo(x + w, y + h, x, y + h, rad) + this.ctx.arcTo(x, y + h, x, y, rad) + this.ctx.arcTo(x, y, x + w, y, rad) + } else { + this.ctx.moveTo(x, y) + this.ctx.lineTo(x + w, y) + this.ctx.lineTo(x + w, y + h) + this.ctx.lineTo(x, y + h) + } + + this.ctx.closePath() + this.ctx.lineWidth = this.cssVars.lineWidth + this.ctx.stroke() + + } + + + this.clearRect = [0, 0, width, height] From 63cfcb1b1d81a5cf509f5617199cb106e714cffd Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 16 Jul 2025 14:20:50 +0200 Subject: [PATCH 081/398] fader: compact radius tweaks --- src/client/widgets/sliders/fader.js | 50 ++++++++++++++--------------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/src/client/widgets/sliders/fader.js b/src/client/widgets/sliders/fader.js index 96171ff1..aae63baa 100644 --- a/src/client/widgets/sliders/fader.js +++ b/src/client/widgets/sliders/fader.js @@ -308,6 +308,30 @@ class Fader extends Slider { this.ctx.rect(this.gaugePadding, d, width - this.gaugePadding * 2, knobHeight) this.ctx.fill() + let x, y, w, h, + rad = PXSCALE * this.cssVars.borderRadius + + // border radius: clip gauge & knob + if (rad > 0) { + x = this.gaugePadding + y = this.gaugePadding + w = width - this.gaugePadding * 2 + h = height - this.gaugePadding * 2 + this.ctx.beginPath() + this.ctx.moveTo(x + rad, y) + this.ctx.arcTo(x + w, y, x + w, y + h, rad) + this.ctx.arcTo(x + w, y + h, x, y + h, rad) + this.ctx.arcTo(x, y + h, x, y, rad) + this.ctx.arcTo(x, y, x + w, y, rad) + this.ctx.closePath() + + var tmpOp = this.ctx.globalCompositeOperation + this.ctx.globalCompositeOperation = 'destination-in' + this.ctx.fillStyle = '#ffffff' + this.ctx.globalAlpha = 1 + this.ctx.fill() + this.ctx.globalCompositeOperation = tmpOp + } // stroke if (this.cssVars.lineWidth) { @@ -315,32 +339,6 @@ class Fader extends Slider { this.ctx.globalAlpha = this.cssVars.alphaStroke this.ctx.strokeStyle = this.cssVars.colorStroke - let x, y, w, h, - rad = PXSCALE * this.cssVars.borderRadius - - if (rad > 0) { - // bordeRadius: clip gauge & knob - x = this.gaugePadding - y = this.gaugePadding - w = width - this.gaugePadding * 2 - h = height - this.gaugePadding * 2 - this.ctx.beginPath() - this.ctx.moveTo(x + rad, y) - this.ctx.arcTo(x + w, y, x + w, y + h, rad) - this.ctx.arcTo(x + w, y + h, x, y + h, rad) - this.ctx.arcTo(x, y + h, x, y, rad) - this.ctx.arcTo(x, y, x + w, y, rad) - this.ctx.closePath() - - var tmpOp = this.ctx.globalCompositeOperation - this.ctx.globalCompositeOperation = 'destination-in' - this.ctx.globalAlpha = 1 - this.ctx.fill() - this.ctx.globalCompositeOperation = tmpOp - this.ctx.globalAlpha = this.cssVars.alphaStroke - } - - // draw stroke x = 0.5 * this.cssVars.lineWidth y = 0.5 * this.cssVars.lineWidth From bf1e4ec2e75af40f425e8878976ac6d15500e226 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 16 Jul 2025 14:23:20 +0200 Subject: [PATCH 082/398] fader: limit radius --- src/client/widgets/sliders/fader.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/client/widgets/sliders/fader.js b/src/client/widgets/sliders/fader.js index aae63baa..c8658ab5 100644 --- a/src/client/widgets/sliders/fader.js +++ b/src/client/widgets/sliders/fader.js @@ -313,6 +313,7 @@ class Fader extends Slider { // border radius: clip gauge & knob if (rad > 0) { + rad = Math.min(Math.min(height, width) / 2, rad) x = this.gaugePadding y = this.gaugePadding w = width - this.gaugePadding * 2 From 9176e0caa2afd45012b6b1fe3e086965e1cabfcc Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 16 Jul 2025 14:30:17 +0200 Subject: [PATCH 083/398] log: border radius update --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b072ee7..108df21c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - bug fixes - matrix: prevent error when `quantity` is invalid - multixy/xy: send value when setting `spring` to `true` (only if current value is different than spring value) + - switch/menu/fader: more consistent rendering when `borderRadius` is set - widgets - multixy/xy: add `stepsX` and `stepsY` properties From f29be8cc75bb73881d4e8f7ff15a2a260dbc9c7a Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 16 Jul 2025 16:03:24 +0200 Subject: [PATCH 084/398] docs: update --- resources/docs/docs/widgets/properties-reference.md | 2 ++ src/client/widgets/sliders/fader.js | 1 + 2 files changed, 3 insertions(+) diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index 9898b64f..9abc2a70 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -884,6 +884,7 @@ | property | type |default | description | | --- | --- | --- | --- | + |
borderRadius#
| `number` | "auto" | Border radius expressed as a number (same for all corners, applies only for compact design). | |
css#
| `string` | "" | CSS rules. See documentation.

Some style-related properties can be set or read from css using css variables:
- `--color-background`: `colorBg`
- `--color-widget`: `colorWidget`
- `--color-fill`: `colorFill`
- `--color-stroke`: `colorStroke`
- `--color-text`: `colorText`
- `--widget-padding`: `padding`
- `--line-width`: `lineWidth`
- `--border-radius`: `borderRadius`
- `--alpha-fill-on`: `alphaFillOn`
- `--alpha-fill-off`: `alphaFillOff`
- `--alpha-stroke`: `alphaStroke`
- `--alpha-pips`: `alphaPips`
- `--alpha-pips-text`: `alphaPipsText`

Canvas-based widget have their computed width and height available as css variables (read-only):
- `--widget-width`
- `--widget-height` | |
design#
| `string` | "default" | Design style

Choices: `default`, `round`, `compact` | |
knobSize#
| `number` | "auto" | Fader knob size | @@ -985,6 +986,7 @@ | property | type |default | description | | --- | --- | --- | --- | + |
borderRadius#
| `number` | "auto" | Border radius expressed as a number (same for all corners, applies only for compact design). | |
css#
| `string` | "" | CSS rules. See documentation.

Some style-related properties can be set or read from css using css variables:
- `--color-background`: `colorBg`
- `--color-widget`: `colorWidget`
- `--color-fill`: `colorFill`
- `--color-stroke`: `colorStroke`
- `--color-text`: `colorText`
- `--widget-padding`: `padding`
- `--line-width`: `lineWidth`
- `--border-radius`: `borderRadius`
- `--alpha-fill-on`: `alphaFillOn`
- `--alpha-fill-off`: `alphaFillOff`
- `--alpha-stroke`: `alphaStroke`
- `--alpha-pips`: `alphaPips`
- `--alpha-pips-text`: `alphaPipsText`

Canvas-based widget have their computed width and height available as css variables (read-only):
- `--widget-width`
- `--widget-height` | |
design#
| `string` | "default" | Design style

Choices: `default`, `round`, `compact` | |
knobSize#
| `number` | "auto" | Fader knob size | diff --git a/src/client/widgets/sliders/fader.js b/src/client/widgets/sliders/fader.js index c8658ab5..ed2cc4af 100644 --- a/src/client/widgets/sliders/fader.js +++ b/src/client/widgets/sliders/fader.js @@ -62,6 +62,7 @@ class Fader extends Slider { }) defaults.scripting.onTouch = {type: 'script', value: '', editor:'javascript', help: ['Script executed when the widget is touched and released. See documentation.',]} + defaults.style.borderRadius= {type: 'number', value: 'auto', help: 'Border radius expressed as a number (same for all corners, applies only for compact design).'} return defaults From 14f8a0bf29e98d5a55fb823c061320b6bf5cbfb5 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 16 Jul 2025 20:02:30 +0200 Subject: [PATCH 085/398] midi: allow arm64/darwin midi --- src/server/midi.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/server/midi.js b/src/server/midi.js index de2ffd22..8146f7c4 100644 --- a/src/server/midi.js +++ b/src/server/midi.js @@ -13,9 +13,14 @@ var pythonOptions = { } var midiBinaries = { - linux: 'osc-midi-linux', - darwin: 'osc-midi-osx', - win32: 'osc-midi-windows.exe' + x64: { + linux: 'osc-midi-linux', + darwin: 'osc-midi-osx', + win32: 'osc-midi-windows.exe' + }, + arm64:{ + darwin: 'osc-midi-osx', + } } var expectMidiBinaries = false, @@ -25,8 +30,8 @@ try { } catch(e) {} var pythonPathOverride -if (process.arch === 'x64' && midiBinaries[process.platform]) { - var p = path.resolve(__dirname, midiBinaries[process.platform]) +if (midiBinaries[process.arch] && midiBinaries[process.arch][process.platform]) { + var p = path.resolve(__dirname,midiBinaries[process.arch][process.platform]) if (fs.existsSync(p)) { pythonPathOverride = p } else if (expectMidiBinaries) { From f119189fe1d989dd8f3f30767066206c30a48bf0 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 16 Jul 2025 23:44:09 +0200 Subject: [PATCH 086/398] package: silicon bins ! --- .travis.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0e77bad3..2f7c3412 100644 --- a/.travis.yml +++ b/.travis.yml @@ -28,6 +28,7 @@ before_deploy: - export VERSION=$(sed -nE 's/^\s*"version":\ "(.*?)",$/\1/p' package.json) - npm run build-docs - npm run package -- --all + - PLATFORM=darwin;ARCH=arm64; npm run package - npm run package-node - cd $TRAVIS_BUILD_DIR/dist/open-stage-control-linux-x64/resources/app/server/ - wget https://github.com/jean-emmanuel/open-stage-control-midi/releases/latest/download/osc-midi-linux && chmod +x osc-midi-linux && echo "true" > osc-midi.json @@ -35,8 +36,8 @@ before_deploy: - wget https://github.com/jean-emmanuel/open-stage-control-midi/releases/latest/download/osc-midi-windows.exe && chmod +x osc-midi-windows.exe && echo "true" > osc-midi.json - cd $TRAVIS_BUILD_DIR/dist/open-stage-control-darwin-x64/open-stage-control.app/Contents/Resources/app/server - wget https://github.com/jean-emmanuel/open-stage-control-midi/releases/latest/download/osc-midi-osx && chmod +x osc-midi-osx && echo "true" > osc-midi.json - # - cd $TRAVIS_BUILD_DIR/dist/open-stage-control-darwin-arm64/open-stage-control.app/Contents/Resources/app/server - # - wget https://github.com/jean-emmanuel/open-stage-control-midi/releases/latest/download/osc-midi-osx && chmod +x osc-midi-osx && echo "true" > osc-midi.json + - cd $TRAVIS_BUILD_DIR/dist/open-stage-control-darwin-arm64/open-stage-control.app/Contents/Resources/app/server + - wget https://github.com/jean-emmanuel/open-stage-control-midi/releases/latest/download/osc-midi-osx && chmod +x osc-midi-osx && echo "true" > osc-midi.json - cd $TRAVIS_BUILD_DIR - mkdir dist/packages - npm run deb64 @@ -48,7 +49,7 @@ before_deploy: - mv open-stage-control-linux-x64/*.rpm packages/ - mv open-stage-control-linux-x64 open-stage-control_${VERSION}_linux-x64 - zip -q -r --symlinks packages/open-stage-control_${VERSION}_osx-x64.zip open-stage-control-darwin-x64/open-stage-control.app - # - zip -q -r --symlinks packages/open-stage-control_${VERSION}_osx-arm64.zip open-stage-control-darwin-arm64/open-stage-control.app + - zip -q -r --symlinks packages/open-stage-control_${VERSION}_osx-arm64.zip open-stage-control-darwin-arm64/open-stage-control.app - zip -q -r packages/open-stage-control_${VERSION}_node.zip open-stage-control_${VERSION}_node - zip -q -r packages/open-stage-control_${VERSION}_win32-x64.zip open-stage-control_${VERSION}_win32-x64 - zip -q -r packages/open-stage-control_${VERSION}_linux-x64.zip open-stage-control_${VERSION}_linux-x64 From 374ef680284d5868a3b6307fb8e86a17acc79a6d Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 17 Jul 2025 10:18:26 +0200 Subject: [PATCH 087/398] log: silicon builds --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 108df21c..11d9f676 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,9 @@ - widgets - multixy/xy: add `stepsX` and `stepsY` properties +- misc + - native silicon buids (osx-arm64) + ## 1.29.5 - bug fixes From 015736486c22d1edf6c11e02912ca2be0a076ba1 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:02:41 +0200 Subject: [PATCH 088/398] tray: only quit if server is stopped; hide in tray when starting minimzed --- src/launcher/toolbar.js | 2 +- src/server/electron-window.js | 7 +------ src/server/index.js | 27 ++++++++++++++++++++------- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/launcher/toolbar.js b/src/launcher/toolbar.js index ee623b60..fa3208d4 100644 --- a/src/launcher/toolbar.js +++ b/src/launcher/toolbar.js @@ -116,7 +116,7 @@ menu.append(new MenuItem({type: 'submenu' , label: 'Launcher', submenu: [ } }), new MenuItem({ - label: 'Start minimized', + label: 'Start hidden (in tray)', type: 'checkbox', checked: settings.remote.read('startMinimized'), click: (e)=>{ diff --git a/src/server/electron-window.js b/src/server/electron-window.js index 77786bc0..b0231faa 100644 --- a/src/server/electron-window.js +++ b/src/server/electron-window.js @@ -61,13 +61,8 @@ module.exports = function(options={}) { window.setBounds(geometry) window.once('ready-to-show', ()=>{ - window.show() if (options.id === 'launcher' && settings.read('startMinimized')) { - if (process.platform === 'darwin') { - window.hide() - } else { - window.minimize() - } + window.hide() } }) diff --git a/src/server/index.js b/src/server/index.js index 7c74cca6..c222b065 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -177,20 +177,27 @@ function stopServerProcess() { if (settings.read('no-gui')) { if (serverProcess) serverProcess.kill('SIGINT') + serverProcess = null return } - var toClose = [...clientWindows].filter(w=>w && !w.isDestroyed()), + var toClose = clientWindows.filter(w=>w && !w.isDestroyed()), closed = 0 - if (toClose.length === 0) serverProcess.kill('SIGINT') + if (toClose.length === 0) { + serverProcess.kill('SIGINT') + serverProcess = null + } for (var w of toClose) { w.on('closed', ()=>{ closed++ if (closed === toClose.length) { clientWindows = [] - if (serverProcess) serverProcess.kill('SIGINT') + if (serverProcess) { + serverProcess.kill('SIGINT') + serverProcess = null + } } }) w.close() @@ -227,14 +234,14 @@ function startLauncher() { }) launcher.on('will-close', ()=>{ - if (clientWindows.length) { + if (clientWindows.some(w=>w && !w.isDestroyed())) { launcher.hide() e.preventDefault() } }) launcher.on('close', (e)=>{ - if (clientWindows.length) { + if (clientWindows.some(w=>w && !w.isDestroyed()) && serverProcess) { launcher.hide() e.preventDefault() return @@ -345,13 +352,19 @@ if (settings.read('docs')) { app.on('ready', ()=>{ process.on('SIGINT', function() { - if (serverProcess) serverProcess.kill('SIGINT') + if (serverProcess) { + serverProcess.kill('SIGINT') + serverProcess = null + } process.exit(0) }) }) app.on('before-quit',()=>{ - if (serverProcess) serverProcess.kill('SIGINT') + if (serverProcess) { + serverProcess.kill('SIGINT') + serverProcess = null + } }) From 65ebe938de99f5aae31c4507cbc91a4d81319bc8 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:11:03 +0200 Subject: [PATCH 089/398] docs: tray icon menu --- resources/docs/docs/user-interface/launcher.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/resources/docs/docs/user-interface/launcher.md b/resources/docs/docs/user-interface/launcher.md index 13640d63..c3e356de 100644 --- a/resources/docs/docs/user-interface/launcher.md +++ b/resources/docs/docs/user-interface/launcher.md @@ -12,8 +12,10 @@ - Clear: clear console - Autoscroll: enable/disable console autoscroll - Check for update at startup: enable/disable this feature -- Autostart: start the server automatically when launcher is started -- Always on top: pin the launcher window above other the windows +- Launcher + - Autostart: start the server automatically when launcher is started + - Start hidden: starts the launcher hidden in tray + - Always on top: pin the launcher window above other the windows The "play/stop" icon can be used to start and stop the server without opening the menu. @@ -25,6 +27,10 @@ Each server option is displayed here. When clicking on an option's label, a shor The console displays various information, runtime errors and server debug messages. +## Tray icon + +The launcher comes with a system tray icon that keeps the launcher alive when closed if there is at least one client window opened or if the server is running. Its context menu can be used to toggle the launcher's visibility and access some of the launcher's menu actions. + ## Keyboard shortcuts === "Linux" From 89b82d3c9b869432149bc486219897971c1318bf Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:12:49 +0200 Subject: [PATCH 090/398] log: tray menu should have wait for 1.30 --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 11d9f676..fc6ca7b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.29.7 + +- launcher + - add tray icon and menu (landed in 1.29.6 accidentally) + + ## 1.29.6 - bug fixes From 5cf59ea97ce80abfe64c361b2396f64764946651 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:24:50 +0200 Subject: [PATCH 091/398] tray: make it optional and disabled by default --- src/launcher/toolbar.js | 26 +++++++++++++++++--------- src/server/electron-window.js | 6 +++++- src/server/index.js | 35 ++++++++++++++++++++--------------- 3 files changed, 42 insertions(+), 25 deletions(-) diff --git a/src/launcher/toolbar.js b/src/launcher/toolbar.js index fa3208d4..15a2fcd4 100644 --- a/src/launcher/toolbar.js +++ b/src/launcher/toolbar.js @@ -115,14 +115,6 @@ menu.append(new MenuItem({type: 'submenu' , label: 'Launcher', submenu: [ remote.getCurrentWindow().setAlwaysOnTop(e.checked) } }), - new MenuItem({ - label: 'Start hidden (in tray)', - type: 'checkbox', - checked: settings.remote.read('startMinimized'), - click: (e)=>{ - settings.remote.write('startMinimized', e.checked) - } - }), new MenuItem({ label: 'Always on top', type: 'checkbox', @@ -131,7 +123,23 @@ menu.append(new MenuItem({type: 'submenu' , label: 'Launcher', submenu: [ settings.remote.write('alwaysOnTop', e.checked) remote.getCurrentWindow().setAlwaysOnTop(e.checked) } - }) + }), + new MenuItem({ + label: 'Use tray icon', + type: 'checkbox', + checked: settings.remote.read('useTray'), + click: (e)=>{ + settings.remote.write('useTray', e.checked) + } + }), + new MenuItem({ + label: 'Start minimized', + type: 'checkbox', + checked: settings.remote.read('startMinimized'), + click: (e)=>{ + settings.remote.write('startMinimized', e.checked) + } + }), ]})) menu.append(new MenuItem({ type: 'separator' diff --git a/src/server/electron-window.js b/src/server/electron-window.js index b0231faa..3808dedb 100644 --- a/src/server/electron-window.js +++ b/src/server/electron-window.js @@ -62,7 +62,11 @@ module.exports = function(options={}) { window.once('ready-to-show', ()=>{ if (options.id === 'launcher' && settings.read('startMinimized')) { - window.hide() + if (settings.read('useTray') || process.platform === 'darwin') { + window.hide() + } else { + window.minimize() + } } }) diff --git a/src/server/index.js b/src/server/index.js index c222b065..cb530568 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -225,23 +225,28 @@ function startLauncher() { launcher = require('./electron-window')({address:address, shortcuts:dev, width:680, height:(40 + 200 + 20 + 24 * Object.keys(settings.options).filter(x=>settings.options[x].launcher !== false).length / 2), node:true, color:'#151a24', id: 'launcher'}) require('@electron/remote/main').enable(launcher.webContents) - tray = require('./tray')({ - window: launcher, - openClient: openClient, - app: app, - startServer: startServerProcess, - stopServer: stopServerProcess - }) + if (settings.read('useTray')) { + + tray = require('./tray')({ + window: launcher, + openClient: openClient, + app: app, + startServer: startServerProcess, + stopServer: stopServerProcess + }) + + launcher.on('will-close', ()=>{ + if (clientWindows.some(w=>w && !w.isDestroyed())) { + launcher.hide() + e.preventDefault() + } + }) + + } - launcher.on('will-close', ()=>{ - if (clientWindows.some(w=>w && !w.isDestroyed())) { - launcher.hide() - e.preventDefault() - } - }) launcher.on('close', (e)=>{ - if (clientWindows.some(w=>w && !w.isDestroyed()) && serverProcess) { + if (tray && clientWindows.some(w=>w && !w.isDestroyed()) && serverProcess) { launcher.hide() e.preventDefault() return @@ -249,7 +254,7 @@ function startLauncher() { process.stdout.write = stdoutWrite process.stderr.write = stderrWrite if (process.log) process.log = processLog - tray.destroy() + if (tray) tray.destroy() }) }) From 28c0877dc9d75cb0617403b7e7853d17eb0aedf1 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:34:30 +0200 Subject: [PATCH 092/398] launcher: add hide action if using tray --- src/launcher/toolbar.js | 10 ++++++++++ src/server/electron-window.js | 3 +++ src/server/index.js | 7 +++++++ 3 files changed, 20 insertions(+) diff --git a/src/launcher/toolbar.js b/src/launcher/toolbar.js index 15a2fcd4..22a8de25 100644 --- a/src/launcher/toolbar.js +++ b/src/launcher/toolbar.js @@ -157,6 +157,16 @@ menu.append(new MenuItem({ openDocs() } })) + +if (settings.remote.read('useTray')) { + menu.append(new MenuItem({ + label: 'Hide', + click: ()=>{ + ipcRenderer.send('hide') + } + })) +} + menu.append(new MenuItem({ role: 'Quit' })) diff --git a/src/server/electron-window.js b/src/server/electron-window.js index 3808dedb..18a7caad 100644 --- a/src/server/electron-window.js +++ b/src/server/electron-window.js @@ -65,8 +65,11 @@ module.exports = function(options={}) { if (settings.read('useTray') || process.platform === 'darwin') { window.hide() } else { + window.show() window.minimize() } + } else { + window.show() } }) diff --git a/src/server/index.js b/src/server/index.js index cb530568..f15ec7c6 100644 --- a/src/server/index.js +++ b/src/server/index.js @@ -303,6 +303,13 @@ function startLauncher() { showQRCode() }) + + + ipcMain.on('hide',function(e, options){ + + launcher.hide() + + }) } From 0de9f239c8d7c6a874c72ac606398b773f565220 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 22 Jul 2025 19:58:29 +0200 Subject: [PATCH 093/398] docs: tray things --- CHANGELOG.md | 2 +- resources/docs/docs/user-interface/launcher.md | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc6ca7b8..de8395e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,7 @@ ## 1.29.7 - launcher - - add tray icon and menu (landed in 1.29.6 accidentally) + - add tray icon and menu (landed in 1.29.6 accidentally), disabled by default (can be enabled from the launcher's menu) ## 1.29.6 diff --git a/resources/docs/docs/user-interface/launcher.md b/resources/docs/docs/user-interface/launcher.md index c3e356de..304aa33b 100644 --- a/resources/docs/docs/user-interface/launcher.md +++ b/resources/docs/docs/user-interface/launcher.md @@ -14,12 +14,13 @@ - Check for update at startup: enable/disable this feature - Launcher - Autostart: start the server automatically when launcher is started - - Start hidden: starts the launcher hidden in tray - Always on top: pin the launcher window above other the windows + - Use tray: enable tray icon and menu + - Start minimized: starts the launcher minimized (or hidden in tray) The "play/stop" icon can be used to start and stop the server without opening the menu. -## 2. Configuration form +## 2. Configuration form Each server option is displayed here. When clicking on an option's label, a short help will be printed in the console. When an option is not correctly set, its label will turn to orange and an error message will be printed in the console. @@ -29,7 +30,7 @@ The console displays various information, runtime errors and server debug messag ## Tray icon -The launcher comes with a system tray icon that keeps the launcher alive when closed if there is at least one client window opened or if the server is running. Its context menu can be used to toggle the launcher's visibility and access some of the launcher's menu actions. +If `Use tray` is set, the launcher comes with a system tray icon that keeps the launcher alive when closed if there is at least one client window opened or if the server is running. Its context menu can be used to toggle the launcher's visibility and access some of the launcher's menu actions. ## Keyboard shortcuts From 83fd78e322881102de82dbabe2ff9a078631a1e3 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 23 Jul 2025 08:17:09 +0200 Subject: [PATCH 094/398] tray: fix (?) quit menu action --- src/server/tray.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/server/tray.js b/src/server/tray.js index bb49d4a6..1d150eb9 100644 --- a/src/server/tray.js +++ b/src/server/tray.js @@ -55,7 +55,9 @@ module.exports = function(options = {}) { }, { label: 'Quit', - role: 'Quit' + click: ()=>{ + options.app.quit() + } }, ]) From 84bf487169777c812e34bd2bb7f4dffae38f8f8c Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 23 Jul 2025 08:33:30 +0200 Subject: [PATCH 095/398] package: 1.29.7 & doc update --- package.json | 2 +- .../docs/docs/getting-started/introduction.md | 19 +++++++++++---- .../getting-started/running-from-sources.md | 23 +++++++++++++++---- 3 files changed, 34 insertions(+), 10 deletions(-) diff --git a/package.json b/package.json index d60c7d7d..7e352089 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.6", + "version": "1.29.7", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/resources/docs/docs/getting-started/introduction.md b/resources/docs/docs/getting-started/introduction.md index b1a9171d..9c82bfd4 100644 --- a/resources/docs/docs/getting-started/introduction.md +++ b/resources/docs/docs/getting-started/introduction.md @@ -25,7 +25,7 @@ iOS devices must be of version `10.3` or higher. ## Installation -??? example "Linux 64bit" +=== "Linux 64bit" **Ubuntu / Debian** @@ -41,19 +41,28 @@ iOS devices must be of version `10.3` or higher. - Extract it in the location of your choice - The file inside it named `open-stage-control` is the app's main executable -??? example "Mac 64bit" +=== "Mac 64bit" - - [Download](/download) `open-stage-control-VERSION-osx.zip` + - [Download](/download) `open-stage-control-VERSION-osx-x64.zip` - Extract it in the location of your choice - Drag `open-stage-control.app` in your `Application` folder -??? example "Windows 64bit" + +=== "Mac Silicon (arm)" + + - [Download](/download) `open-stage-control-VERSION-osx-arm.zip` + - Extract it in the location of your choice + - Drag `open-stage-control.app` in your `Application` folder + + See [https://disable-gatekeeper.github.io/](https://disable-gatekeeper.github.io/) to workaround the "damaged and can't be opened" error. + +=== "Windows 64bit" - [Download](/download) `open-stage-control-VERSION-win32-x64.zip` - Extract it in the location of your choice - The file inside it named `open-stage-control.exe` is the app's main executable -??? example "Other systems" +=== "Other systems" - Install [Node.js](https://nodejs.org/en/download/package-manager/) - Download `open-stage-control-VERSION-node.zip` diff --git a/resources/docs/docs/getting-started/running-from-sources.md b/resources/docs/docs/getting-started/running-from-sources.md index aab53eba..20951cc3 100644 --- a/resources/docs/docs/getting-started/running-from-sources.md +++ b/resources/docs/docs/getting-started/running-from-sources.md @@ -87,8 +87,23 @@ This will build the app in `dist/open-stage-control-PLATFORM-ARCH`. Building the app for windows from a linux system requires wine to be installed. -## Debian/Ubuntu installer +## Debian / Ubuntu and RPM installers -``` -npm run deb64 -``` +=== "Debian / Ubuntu" + + ``` + npm run deb64 + ``` + +=== "RPM" + + ``` + npm run rpm + ``` + + +## Build script on Mac Silicon + +This user-contributed script can be used to build open stage control on recent Macs: + +https://github.com/rewgs/osc-as From f38bcb9ea05f9de684852ede94a56f4c7726928b Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 5 Aug 2025 15:31:12 +0200 Subject: [PATCH 096/398] client: add title client option --- CHANGELOG.md | 5 +++++ package.json | 2 +- resources/docs/docs/client-options.md | 1 + src/client/globals.js | 2 +- src/client/ipc/callbacks.js | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index de8395e9..6872f2e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 1.29.8 + +- client + - add `title` client option + ## 1.29.7 - launcher diff --git a/package.json b/package.json index 7e352089..53e3d61f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.7", + "version": "1.29.8", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/resources/docs/docs/client-options.md b/resources/docs/docs/client-options.md index 41b046ae..d653890f 100644 --- a/resources/docs/docs/client-options.md +++ b/resources/docs/docs/client-options.md @@ -18,6 +18,7 @@ Client options can be set either with the server's `--client-options` option, or | altTraversing | 1 / 0 | 0 | set to 1 to enable an alternative traversing behavior for toggle buttons (traversing gestures on toggle buttons will change their values in only one way depending on the first touched button's state) | | virtualKeyboard | 1 / 0 | 0 | (desktop only) set to 1 to enable the virtual keyboard by default | | notifications | 1 / 0 | 1 | set to 0 to hide notifications by default | +| title | string | '' | replace window title | Example: diff --git a/src/client/globals.js b/src/client/globals.js index 4503ceee..c5213fc4 100644 --- a/src/client/globals.js +++ b/src/client/globals.js @@ -43,4 +43,4 @@ window.JSON.parseFlex = require('json5').parse window.DOM = require('./dom') -window.TITLE = PACKAGE.productName + ' v' + PACKAGE.version +window.TITLE = ENV.title || (PACKAGE.productName + ' v' + PACKAGE.version) diff --git a/src/client/ipc/callbacks.js b/src/client/ipc/callbacks.js index b6dff81f..e8134030 100644 --- a/src/client/ipc/callbacks.js +++ b/src/client/ipc/callbacks.js @@ -155,6 +155,8 @@ module.exports = { setTitle: function(data) { + if (ENV.title) return + document.title = TITLE + (data ? ' (' + data + ')' : '') }, From 5b9bcd63ce58c568e9deb8b46d0877eca13a9a74 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Mon, 11 Aug 2025 13:52:31 +0200 Subject: [PATCH 097/398] firefox: `onTouch` error when the cursor goes outside the page --- CHANGELOG.md | 3 +++ src/client/widgets/containers/panel.js | 3 ++- src/client/widgets/pads/canvas.js | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6872f2e1..f634f95c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,9 @@ ## 1.29.8 +- bug fixes + - firefox: `onTouch` error when the cursor goes outside the page + - client - add `title` client option diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index f4e51441..fdb8e93d 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -362,7 +362,8 @@ class Panel extends Container() { var event = {...e}, w - event.targetName = event.target ? event.target.getAttribute('name') : '' + // NOTE: in firefox target.getAttribute is undefined when the cursor is outside the page + event.targetName = event.target && event.target.getAttribute ? event.target.getAttribute('name') : '' event.targetTagName = event.target ? event.target.tagName : '' w = widgetManager.getWidgetByElement(event.target) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index ce0d96c6..123c913c 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -114,7 +114,8 @@ class CanvasWidget extends Canvas { var event = {...e} delete event.firstTarget - event.targetName = event.target ? event.target.getAttribute('name') : '' + // NOTE: in firefox target.getAttribute is undefined when the cursor is outside the page + event.targetName = event.target && event.target.getAttribute ? event.target.getAttribute('name') : '' event.targetTagName = event.target ? event.target.tagName : '' var w = widgetManager.getWidgetByElement(event.target) From 7d38418a66083aa2afc69615ed71f330798d8019 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 12 Aug 2025 09:20:26 +0200 Subject: [PATCH 098/398] dropdown: fix label init, make it dynamic prop, refresh it when values are parsed --- CHANGELOG.md | 1 + src/client/widgets/basics/dropdown.js | 9 +++++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f634f95c..483f28bd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ - bug fixes - firefox: `onTouch` error when the cursor goes outside the page + - dropdown: label not initialized until a value is set - client - add `title` client option diff --git a/src/client/widgets/basics/dropdown.js b/src/client/widgets/basics/dropdown.js index bb1a2769..36a99e66 100644 --- a/src/client/widgets/basics/dropdown.js +++ b/src/client/widgets/basics/dropdown.js @@ -83,6 +83,8 @@ class Dropdown extends MenuBase { `) } + this.setValue(this.value) + } setValue(v,options={}) { @@ -120,7 +122,9 @@ class Dropdown extends MenuBase { this.parseValues() this.setValue(this.value) return - + case 'label': + this.setLabel() + return } return ret @@ -130,7 +134,8 @@ class Dropdown extends MenuBase { } Dropdown.dynamicProps = Dropdown.prototype.constructor.dynamicProps.concat( - 'values' + 'values', + 'label' ) From c450c6133cc272a9871fc783926de9c0e6062d46 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 12 Aug 2025 14:31:18 +0200 Subject: [PATCH 099/398] editor: fix colorpicker dragend handler (dragend doesn't bubble up anymore, it needs to be caught for all 3 subwidgets) --- CHANGELOG.md | 1 + src/client/ui/ui-colorpicker.js | 7 +++++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 483f28bd..a109bdf2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ - bug fixes - firefox: `onTouch` error when the cursor goes outside the page - dropdown: label not initialized until a value is set + - editor: regression (1.29.0) preventing color changes made with the color to be undoable unless validaed with the enter key - client - add `title` client option diff --git a/src/client/ui/ui-colorpicker.js b/src/client/ui/ui-colorpicker.js index 43e3cbbd..7e4c851b 100644 --- a/src/client/ui/ui-colorpicker.js +++ b/src/client/ui/ui-colorpicker.js @@ -37,10 +37,13 @@ class ColorPicker extends UiWidget { this.trigger('change', {preventHistory: true}) }) - this.rgb.on('dragend', (e)=>{ + var dragEndCb = (e)=>{ this.value = chroma(this.rgb.value).hex() this.trigger('change') - }) + } + this.rgb.pad.on('dragend', dragEndCb) + this.rgb.hue.on('dragend', dragEndCb) + this.rgb.alpha.on('dragend', dragEndCb) this.opened = 0 From 3b792d24312ed8420bb4878da35b475110348c28 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 13 Aug 2025 22:21:43 +0200 Subject: [PATCH 100/398] rgb: fix long standing (presumably) issue with touchstate, affecting editor' colorpicker as well --- CHANGELOG.md | 2 ++ src/client/widgets/pads/rgb.js | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a109bdf2..4fb0837c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,8 @@ - firefox: `onTouch` error when the cursor goes outside the page - dropdown: label not initialized until a value is set - editor: regression (1.29.0) preventing color changes made with the color to be undoable unless validaed with the enter key + - editor: color picker interaction issue in near #000000 + - rgb: incoming values were not queued when during user interaction - client - add `title` client option diff --git a/src/client/widgets/pads/rgb.js b/src/client/widgets/pads/rgb.js index 9576814a..6e5d1369 100644 --- a/src/client/widgets/pads/rgb.js +++ b/src/client/widgets/pads/rgb.js @@ -110,9 +110,6 @@ module.exports = class Rgb extends Widget { initValue[3] = this.getProp('rangeAlpha').min } - - touchstate(this, {element: this.widget, multitouch: true, ignoreCustomBindings: true}) - if (this.getProp('spring')) { this.on('dragend', (e)=>{ @@ -124,6 +121,7 @@ module.exports = class Rgb extends Widget { } + touchstate(this, {element: this.widget, multitouch: true, ignoreCustomBindings: false}) this.hsb = {h:0,s:0,b:0} From d70df6fb6db52f50eee2ef8b00306c9316bb2752 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 14 Aug 2025 09:02:43 +0200 Subject: [PATCH 101/398] docs: update --- resources/docs/docs/widgets/properties-reference.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/docs/docs/widgets/properties-reference.md b/resources/docs/docs/widgets/properties-reference.md index 9abc2a70..3fb510b9 100644 --- a/resources/docs/docs/widgets/properties-reference.md +++ b/resources/docs/docs/widgets/properties-reference.md @@ -135,7 +135,7 @@ | property | type |default | description | | --- | --- | --- | --- | - | | `string`|
`boolean` | "auto" | Displayed text (defaults to current value). Keywords `%key` and `%value` will be replaced by the widget's selected key/value. | + | | `string`|
`boolean` | "auto" | Displayed text (defaults to current value). Keywords `%key` and `%value` will be replaced by the widget's selected key/value. | | | `boolean` | "true" | Set to `false` to hide the dropdown icon | | | `string` | "center" | Set to `left` or `right` to change text alignment (otherwise center)

Choices: `center`, `left`, `right` | From 7fd668bdf93756ef97b5e00ee2d3d8aecb3470fd Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 14 Aug 2025 09:08:00 +0200 Subject: [PATCH 102/398] travis: focal fails now --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 2f7c3412..c7985b53 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,6 @@ anHsudo: required language: node_js -dist: focal +dist: jammy node_js: - "16" before_install: From f2189e29ce065cb86dc3bbdb9fd53e621d458dbd Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Thu, 14 Aug 2025 14:13:33 +0200 Subject: [PATCH 103/398] firefox: better fix for out of page events --- src/client/events/utils.js | 2 +- src/client/widgets/containers/panel.js | 3 +-- src/client/widgets/pads/canvas.js | 3 +-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/client/events/utils.js b/src/client/events/utils.js index e1260bed..f824ebf0 100644 --- a/src/client/events/utils.js +++ b/src/client/events/utils.js @@ -10,7 +10,7 @@ module.exports = { return { - target: e.target, + target: e.target === document ? null : e.target, // firefox passes document when outside the page firstTarget: null, offsetX: e.offsetX, offsetY: e.offsetY, diff --git a/src/client/widgets/containers/panel.js b/src/client/widgets/containers/panel.js index fdb8e93d..f4e51441 100644 --- a/src/client/widgets/containers/panel.js +++ b/src/client/widgets/containers/panel.js @@ -362,8 +362,7 @@ class Panel extends Container() { var event = {...e}, w - // NOTE: in firefox target.getAttribute is undefined when the cursor is outside the page - event.targetName = event.target && event.target.getAttribute ? event.target.getAttribute('name') : '' + event.targetName = event.target ? event.target.getAttribute('name') : '' event.targetTagName = event.target ? event.target.tagName : '' w = widgetManager.getWidgetByElement(event.target) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index 123c913c..ce0d96c6 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -114,8 +114,7 @@ class CanvasWidget extends Canvas { var event = {...e} delete event.firstTarget - // NOTE: in firefox target.getAttribute is undefined when the cursor is outside the page - event.targetName = event.target && event.target.getAttribute ? event.target.getAttribute('name') : '' + event.targetName = event.target ? event.target.getAttribute('name') : '' event.targetTagName = event.target ? event.target.tagName : '' var w = widgetManager.getWidgetByElement(event.target) From 4cde746a74156dfe570999bb474cce886148d471 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 27 Aug 2025 22:47:13 +0200 Subject: [PATCH 104/398] server: fix resolving absolute file urls containing the remote-root path --- CHANGELOG.md | 6 ++++++ src/server/server.js | 12 ++++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4fb0837c..70c2cc19 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 1.29.9 + +- bug fixes + - server: fix resolving absolute file urls containing the remote-root path + + ## 1.29.8 - bug fixes diff --git a/src/server/server.js b/src/server/server.js index 604a825b..692f7b33 100644 --- a/src/server/server.js +++ b/src/server/server.js @@ -43,9 +43,11 @@ if (settings.read('client-options')) { } } -var resolveDirs = theme.files.map(x=>path.dirname(x)) +var resolveDirs = theme.files.map(x=>path.dirname(x)), + remoteRoot = settings.read('remote-root') + resolveDirs = resolveDirs.filter((x, index)=>{return resolveDirs.indexOf(x) === index}) -resolveDirs.push(settings.read('remote-root') || '') // remote-root / absolute +resolveDirs.push(remoteRoot || '') // remote-root / absolute function resolvePath(url, clientId) { @@ -60,6 +62,12 @@ function resolvePath(url, clientId) { for (var i = sessionPath ? -1 : 0; i < resolveDirs.length; i++) { var p = i === -1 ? sessionPath : resolveDirs[i] + + if (i == resolveDirs.length - 1 && remoteRoot) { + // strip out remote-root path from request url when resolving against it + url = url.replace(settings.read('remote-root'), '') + } + p = path.resolve(path.join(p, url)) if (fs.existsSync(p)) return p From 93ba5d739711aaf2b697cec10b3e4564bccbe394 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 9 Sep 2025 15:04:05 +0200 Subject: [PATCH 105/398] canvas: add webgl2 context type as an option --- package.json | 2 +- src/client/widgets/common/canvas.js | 2 +- src/client/widgets/pads/canvas.js | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 53e3d61f..ada8292c 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "open-stage-control", "productName": "Open Stage Control", "description": "Libre and modular OSC / MIDI controller", - "version": "1.29.8", + "version": "1.29.9-dev", "author": { "name": "Jean-Emmanuel Doucet", "email": "jean-emmanuel@ammd.net" diff --git a/src/client/widgets/common/canvas.js b/src/client/widgets/common/canvas.js index 614283d8..2f63a62e 100644 --- a/src/client/widgets/common/canvas.js +++ b/src/client/widgets/common/canvas.js @@ -30,7 +30,7 @@ class Canvas extends Widget { this.canvas = DOM.get(this.container, 'canvas')[0] - this.ctx = this.canvas.getContext('2d',{ + this.ctx = this.canvas.getContext(this.getProp('contextType') || '2d',{ desynchronized: !ELECTRON_NOGPU && ENV.desynccanvas ? true : false, alpha: true }) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index ce0d96c6..ff6ee96d 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -15,6 +15,7 @@ class CanvasWidget extends Canvas { var defaults = super.defaults().extend({ class_specific: { + contextType: {type: 'string', value: '2d', choices: ['2d', 'webgl2'], help: 'Context type for the canvas'}, valueLength: {type: 'number', value: 1, help:[ 'Defines the number of values accepted by the widget (minimum 1). Incoming messages that don\'t comply will be ignored', 'When calling `set()` from a script, submitted value should be an array only if `valueLength` is greater than 1.' From 291b1a07521bccca68a83aab440a07a2a8efb985 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 9 Sep 2025 17:02:28 +0200 Subject: [PATCH 106/398] canvas: autoClear is only for 2d mode --- src/client/widgets/pads/canvas.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index ff6ee96d..c9c668d6 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -21,7 +21,7 @@ class CanvasWidget extends Canvas { 'When calling `set()` from a script, submitted value should be an array only if `valueLength` is greater than 1.' ]}, autoClear: {type: 'boolean', value: true, help: [ - 'If set to `false`, the canvas context won\'t be cleared automatically and `ctx.clearRect()` will need to be called in `onDraw`.' + 'If set to `false`, the canvas context won\'t be cleared automatically and `ctx.clearRect()` will need to be called in `onDraw`. Ignored if `contextType` is different from `2d`.' ]}, continuous: {type: 'boolean|number', value: false, help: [ 'If set to `true`, `onDraw` will be called at each frame, otherwise it will be called only when the widget is touched and when it receives a value.', @@ -156,7 +156,7 @@ class CanvasWidget extends Canvas { if (!this.getProp('onDraw')) return - if (this.getProp('autoClear')) { + if (this.getProp('autoClear') && this.getProp('contextType') === '2d') { this.clear() this.ctx.beginPath() } From 5b38c79318ef7d9dc54d06dae1edb58ad497dc37 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Tue, 9 Sep 2025 17:02:28 +0200 Subject: [PATCH 107/398] canvas: autoClear is only for 2d mode --- src/client/widgets/pads/canvas.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/client/widgets/pads/canvas.js b/src/client/widgets/pads/canvas.js index ff6ee96d..c9c668d6 100644 --- a/src/client/widgets/pads/canvas.js +++ b/src/client/widgets/pads/canvas.js @@ -21,7 +21,7 @@ class CanvasWidget extends Canvas { 'When calling `set()` from a script, submitted value should be an array only if `valueLength` is greater than 1.' ]}, autoClear: {type: 'boolean', value: true, help: [ - 'If set to `false`, the canvas context won\'t be cleared automatically and `ctx.clearRect()` will need to be called in `onDraw`.' + 'If set to `false`, the canvas context won\'t be cleared automatically and `ctx.clearRect()` will need to be called in `onDraw`. Ignored if `contextType` is different from `2d`.' ]}, continuous: {type: 'boolean|number', value: false, help: [ 'If set to `true`, `onDraw` will be called at each frame, otherwise it will be called only when the widget is touched and when it receives a value.', @@ -156,7 +156,7 @@ class CanvasWidget extends Canvas { if (!this.getProp('onDraw')) return - if (this.getProp('autoClear')) { + if (this.getProp('autoClear') && this.getProp('contextType') === '2d') { this.clear() this.ctx.beginPath() } From bdfade96a7c264185953727dca35ca7aeb89a783 Mon Sep 17 00:00:00 2001 From: jean-emmanuel Date: Wed, 10 Sep 2025 01:45:54 +0200 Subject: [PATCH 108/398] build: migrate build system to rollup & rm app/ from repository --- .babelrc | 13 --- .gitignore | 16 +--- app/assets/themes/.gitignore | 2 - app/client/.gitignore | 2 - app/docs/.htaccess | 1 - app/launcher/.gitignore | 2 - app/server/.keep | 0 package.json | 33 ++++---- scripts/build-client.js | 98 --------------------- scripts/build-css.js | 2 + scripts/build-launcher.js | 16 ---- scripts/build-server.js | 27 ------ scripts/build.js | 49 ----------- scripts/client.plugin-watch.js | 40 +++++++++ scripts/client.rollup.config.js | 99 ++++++++++++++++++++++ scripts/copy-assets.js | 65 -------------- scripts/launcher.rollup.config.js | 47 ++++++++++ scripts/license-header.txt | 7 ++ scripts/package-node.js | 6 +- scripts/server.rollup.config.js | 58 +++++++++++++ {app => src/app}/index.js | 0 src/client/ui/context-menu.js | 2 +- src/client/ui/notifications.js | 2 +- src/client/ui/ui-code-editor.js | 10 +-- src/client/ui/ui-colorpicker.js | 2 +- src/client/ui/ui-console.js | 12 +-- src/client/ui/ui-dragresize.js | 2 +- src/client/ui/ui-filebrowser.js | 2 +- src/client/ui/ui-fileupload.js | 2 +- src/client/ui/ui-inspector-field.js | 2 +- src/client/ui/ui-inspector.js | 2 +- src/client/ui/ui-keyboard.js | 2 +- src/client/ui/ui-modal.js | 2 +- src/client/ui/ui-selectarea.js | 2 +- src/client/ui/ui-tree.js | 2 +- src/client/widgets/basics/button.js | 2 +- src/client/widgets/basics/dropdown.js | 2 +- src/client/widgets/basics/file.js | 2 +- src/client/widgets/basics/input.js | 2 +- src/client/widgets/basics/menu.js | 2 +- src/client/widgets/basics/switch.js | 2 +- src/client/widgets/basics/textarea.js | 2 +- src/client/widgets/common/canvas.js | 2 +- src/client/widgets/common/widget.js | 2 +- src/client/widgets/containers/clone.js | 2 +- src/client/widgets/containers/fragment.js | 2 +- src/client/widgets/containers/modal.js | 2 +- src/client/widgets/containers/panel.js | 2 +- src/client/widgets/containers/patchbay.js | 2 +- src/client/widgets/frames/frame.js | 2 +- src/client/widgets/frames/html.js | 2 +- src/client/widgets/frames/image.js | 2 +- src/client/widgets/frames/svg.js | 2 +- src/client/widgets/graphs/plot.js | 2 +- src/client/widgets/indicators/led.js | 2 +- src/client/widgets/indicators/text.js | 2 +- src/client/widgets/pads/canvas.js | 2 +- src/client/widgets/pads/pad.js | 2 +- src/client/widgets/pads/rgb.js | 2 +- src/client/widgets/scripts/gyro-archive.js | 2 +- src/client/widgets/sliders/range.js | 2 +- src/client/widgets/sliders/slider.js | 2 +- src/launcher/main.js | 2 +- src/launcher/settings.js | 2 +- src/launcher/terminal.js | 2 +- 65 files changed, 327 insertions(+), 362 deletions(-) delete mode 100644 .babelrc delete mode 100644 app/assets/themes/.gitignore delete mode 100644 app/client/.gitignore delete mode 100644 app/docs/.htaccess delete mode 100644 app/launcher/.gitignore delete mode 100644 app/server/.keep delete mode 100644 scripts/build-client.js delete mode 100644 scripts/build-launcher.js delete mode 100644 scripts/build-server.js delete mode 100644 scripts/build.js create mode 100644 scripts/client.plugin-watch.js create mode 100644 scripts/client.rollup.config.js delete mode 100644 scripts/copy-assets.js create mode 100644 scripts/launcher.rollup.config.js create mode 100644 scripts/license-header.txt create mode 100644 scripts/server.rollup.config.js rename {app => src/app}/index.js (100%) diff --git a/.babelrc b/.babelrc deleted file mode 100644 index c591efcc..00000000 --- a/.babelrc +++ /dev/null @@ -1,13 +0,0 @@ -{ - "presets": [ - ["@babel/env", { - "targets": { - "ios": "10.3", - "chrome": "60" - }, - "useBuiltIns": "usage", - "corejs": 3 - }] - ], - "plugins": ["@babel/plugin-proposal-object-rest-spread"] -} diff --git a/.gitignore b/.gitignore index a619f6df..40ce7479 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,4 @@ -node_modules -dist -app/LICENSE -app/assets/fonts/* -app/assets/*.css* -app/assets/*.png -app/client/*.js* -app/launcher/*.js* -app/server/* -app/docs/* -!app/docs/.htaccess -!app/server/.keep -app/package.json +node_modules/ +dist/ +/app/ *.pyc diff --git a/app/assets/themes/.gitignore b/app/assets/themes/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/app/assets/themes/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/app/client/.gitignore b/app/client/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/app/client/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/app/docs/.htaccess b/app/docs/.htaccess deleted file mode 100644 index de377bfe..00000000 --- a/app/docs/.htaccess +++ /dev/null @@ -1 +0,0 @@ -ErrorDocument 404 /404.html diff --git a/app/launcher/.gitignore b/app/launcher/.gitignore deleted file mode 100644 index d6b7ef32..00000000 --- a/app/launcher/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -* -!.gitignore diff --git a/app/server/.keep b/app/server/.keep deleted file mode 100644 index e69de29b..00000000 diff --git a/package.json b/package.json index ada8292c..76033892 100644 --- a/package.json +++ b/package.json @@ -21,17 +21,18 @@ "license": "GPL-3.0", "dependencies": { "@babel/core": "7.18.0", - "@babel/eslint-parser": "7.17.0", - "@babel/plugin-proposal-object-rest-spread": "7.18.0", - "@babel/polyfill": "7.12.1", "@babel/preset-env": "7.18.0", "@electron/remote": "2.0.8", + "@rollup/plugin-babel": "^6.0.4", + "@rollup/plugin-commonjs": "^28.0.6", + "@rollup/plugin-json": "^6.1.0", + "@rollup/plugin-node-resolve": "^16.0.1", + "@rollup/plugin-terser": "^0.4.4", "ace-builds": "1.39.0", "ansi-html": "0.0.9", "babelify": "10.0.0", "balanced-match": "2.0.0", "bonjour": "github:jean-emmanuel/bonjour", - "browserify": "17.0.0", "chokidar": "3.5.3", "chroma-js": "2.4.2", "core-js": "3.22.5", @@ -65,6 +66,10 @@ "python-shell": "3.0.1", "qrcode": "1.5.1", "replacestream": "4.0.3", + "rollup": "4.50.1", + "rollup-plugin-copy": "3.5.0", + "rollup-plugin-license": "^3.6.0", + "rollup-plugin-node-externals": "^8.1.1", "sanitize-html": "1.27.5", "sass": "1.89.2", "scope-css": "1.2.1", @@ -74,9 +79,6 @@ "sortablejs": "1.15.0", "source-map-support": "0.5.21", "stacktrace-js": "2.0.2", - "through": "2.3.8", - "uglifyify": "5.0.2", - "webworkify": "1.5.0", "ws": "8.6.0", "yargs": "17.5.1" }, @@ -88,21 +90,20 @@ "scripts": { "postinstall": "echo '\\033[36m=> Dependencies installed successfully. Run \"npm run build\" to build the assets.\\033[0m\n'", "start": "electron app/", - "build": "npm run build-css && npm run build-js && node scripts/copy-assets.js && echo '\\033[36m=> JS and CSS assets built successfully. Run \"npm run package\" to build an executable or \"npm start\" to run the app.\\033[0m\n'", + "build": "npm run build-css && npm run build-js && echo '\\033[36m=> JS and CSS assets built successfully. Run \"npm run package\" to build an executable or \"npm start\" to run the app.\\033[0m\n'", "package": "node scripts/package.js", "package-node": "node scripts/package-node.js", "deb64": "electron-installer-debian --src dist/open-stage-control-linux-x64/ --arch amd64 --dest dist/open-stage-control-linux-x64/ --icon resources/images/logo.png", "rpm64": "electron-installer-redhat --src dist/open-stage-control-linux-x64/ --arch x86_64 --dest dist/open-stage-control-linux-x64/ --icon resources/images/logo.png", "build-css": "node scripts/build-css.js", - "build-js": "npm run build-launcher-js && npm run build-client-js && npm run build-server-js", - "build-client-js": "node scripts/build-client.js", - "build-launcher-js": "node scripts/build-launcher.js", - "build-server-js": "node scripts/build-server.js", - "watch-client": "npm run build-client-js -- --watch", - "watch-browser": "npm run build-client-js -- --watch", "watch-css": "nodemon --watch src/scss -e scss -x \"npm run build-css -- --reload\"", - "watch-server": "nodemon --watch src/server/ -e js -x \"npm run build-server-js\"", - "watch-launcher": "nodemon --watch src/launcher/ -e js -x \"npm run build-launcher-js\"", + "build-js": "npm run build-launcher-js && npm run build-client-js && npm run build-server-js", + "build-client-js": "rollup -c scripts/client.rollup.config.js", + "watch-client": "npm run build-client-js -- --watch", + "build-server-js": "rollup -c scripts/server.rollup.config.js", + "watch-server": "npm run build-server-js -- --watch", + "build-launcher-js": "rollup -c scripts/launcher.rollup.config.js", + "watch-launcher": "npm run build-launcherr-js -- --watch", "build-docs": "node scripts/build-widgets-reference.js > resources/docs/docs/widgets/properties-reference.md && cd resources && python3 -m mkdocs build", "test": "eslint src && npm run build && node tests/test.js" }, diff --git a/scripts/build-client.js b/scripts/build-client.js deleted file mode 100644 index f6e4b64b..00000000 --- a/scripts/build-client.js +++ /dev/null @@ -1,98 +0,0 @@ -var build = require('./build'), - path = require('path'), - babelify = require('babelify'), - nanohtml = require('nanohtml'), - watch = process.argv.includes('--watch'), - through = require('through'), - minimatch = require('minimatch') - - -var ignores = ['**/*.min.js', '**/jquery.ui.js', 'gyronorm.complete.min.js'], - transformWrapper = function(transform){ - return function(file, opts){ - if (ignores.some(pattern => minimatch(file, pattern))) { - return through() - } else { - return transform(file, opts) - } - } - } - -var transforms = [ - [transformWrapper(nanohtml)], - [transformWrapper(babelify)] -] - -console.warn('\033[36m=> Building compressed client scripts...\033[0m') -transforms.push([transformWrapper(require('uglifyify')), {global: true, safari10: true}]) - -var bundle = build({ - input: '../src/client/index.js', - output: '../app/client/open-stage-control-client.js', - options: { - debug: true, - insertGlobals: false, - noParse: ['**/*.min.js', '**/jquery.ui.js'], - cache: {}, - packageCache: {}, - }, - plugins: watch ? [require('watchify')] : [], - transforms: transforms, - ignore: [ - 'postcss' // only needed by sanitize-html if