client-options: add client-sync option to allow disabling client synchronization

This commit is contained in:
jean-emmanuel 2022-10-17 20:17:16 +02:00
parent 5df9c436b2
commit 1eec9833f0
5 changed files with 14 additions and 2 deletions

View file

@ -7,7 +7,7 @@
- canvas: iOS: trigger `onTouch` when `event.force`, `event.altitudeAngle` or `event.azimuthAngle` updates
- knob: add `snap-alt` mode (snap mode that allows jumping between range.min and range.max)
- all: add `borderRadius` property
- scripting
- add `updateCanvas()` function (forces a canvas widget to redraw)
@ -17,6 +17,9 @@
- midi
- on Mac, name virtual ports after the device name to avoid confusion
- server
- client-options: add `client-sync` option to allow disabling client synchronization
## 1.17.0
- bug fixes

View file

@ -14,6 +14,7 @@ Client options can be set either with the server's `--client-options` option, or
| id | string | *random_id* | client's unique id (use with caution: two clients should never have the same id) |
| usePercents | 1 / 0 | 0 | sets the editor's "relative units" option |
| noFocus | 1 / 0 | 0 | (built-in client only) prevent the client window from taking focus unless a text input or a dropdown is clicked |
| clientSync | 1 / 0 | 1 | set to 0 to prevent the client from syncing with other clients |
Example:

View file

@ -28,6 +28,7 @@ document.documentElement.style.setProperty('font-size', PXSCALE + 'px')
window.DOUBLE_TAP_TIME = ENV.doubletap ? parseInt(ENV.doubletap) : 375
window.CLIENT_SYNC = parseInt(ENV.clientSync) === 0 ? 0 : 1
window.JSON.parseFlex = require('json5').parse

View file

@ -58,6 +58,9 @@ module.exports = {
},
stateSend:function(){
if (CLIENT_SYNC === 0) return
notifications.add({
icon: 'wifi',
message: locales('loading_newclient')

View file

@ -27,6 +27,8 @@ var Osc = class Osc extends EventEmitter {
} else {
if (CLIENT_SYNC === 0) data.noSync = 1
ipc.send('sendOsc', data)
}
@ -35,7 +37,7 @@ var Osc = class Osc extends EventEmitter {
sync(data) {
ipc.send('syncOsc', data)
if (CLIENT_SYNC) ipc.send('syncOsc', data)
}
@ -65,6 +67,8 @@ var Osc = class Osc extends EventEmitter {
receive(data){
if (data._rawTarget && CLIENT_SYNC === 0) return
if (typeof this.remoteControl.exists === 'function' && this.remoteControl.exists(data.address)) this.remoteControl.exec(data.address, data.args)
var [widgets, restArgs] = widgetManager.getWidgetByAddressAndArgs(data.address, data.args)