diff --git a/CHANGELOG.md b/CHANGELOG.md index cf192336..7bba59ad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/resources/docs/docs/client-options.md b/resources/docs/docs/client-options.md index bebd020c..7f399a4d 100644 --- a/resources/docs/docs/client-options.md +++ b/resources/docs/docs/client-options.md @@ -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: diff --git a/src/client/globals.js b/src/client/globals.js index bca196b4..3026be85 100644 --- a/src/client/globals.js +++ b/src/client/globals.js @@ -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 diff --git a/src/client/ipc/callbacks.js b/src/client/ipc/callbacks.js index 10fe5095..63a0a154 100644 --- a/src/client/ipc/callbacks.js +++ b/src/client/ipc/callbacks.js @@ -58,6 +58,9 @@ module.exports = { }, stateSend:function(){ + + if (CLIENT_SYNC === 0) return + notifications.add({ icon: 'wifi', message: locales('loading_newclient') diff --git a/src/client/osc.js b/src/client/osc.js index f2519f3d..af53201a 100644 --- a/src/client/osc.js +++ b/src/client/osc.js @@ -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)