remote control: add /EDIT/GET, and a nosync flag in server/osc/sending method to prevent broadcasting
This commit is contained in:
parent
185d4c6b80
commit
a263233bbd
3 changed files with 22 additions and 3 deletions
|
|
@ -18,7 +18,8 @@
|
|||
- remote control
|
||||
- **removed** deprecated `/EXEX`
|
||||
- renamed `/EDIT_SOFT` to `/EDIT/MERGE`
|
||||
|
||||
- added `/EDIT/GET`
|
||||
|
||||
|
||||
## 0.21.3
|
||||
|
||||
|
|
|
|||
|
|
@ -192,7 +192,7 @@ module.exports = {
|
|||
|
||||
var targets = []
|
||||
|
||||
if (settings.read('syncTargets')) Array.prototype.push.apply(targets, settings.read('syncTargets'))
|
||||
if (settings.read('syncTargets') && !data.nosync) Array.prototype.push.apply(targets, settings.read('syncTargets'))
|
||||
if (data.target) Array.prototype.push.apply(targets, data.target)
|
||||
|
||||
|
||||
|
|
@ -226,7 +226,7 @@ module.exports = {
|
|||
|
||||
}
|
||||
|
||||
clients[clientId].broadcast.emit('receiveOsc', data)
|
||||
if (!data.nosync) clients[clientId].broadcast.emit('receiveOsc', data)
|
||||
|
||||
},
|
||||
|
||||
|
|
|
|||
|
|
@ -38,7 +38,25 @@ var callbacks = {
|
|||
updateDom(container,data,true)
|
||||
}
|
||||
},
|
||||
'/EDIT/GET': function(args) {
|
||||
|
||||
if (!Array.isArray(args) || args.length != 2) return
|
||||
|
||||
var [target, id] = args,
|
||||
widgets = widgetManager.getWidgetById(id)
|
||||
|
||||
for (var i = widgets.length - 1; i >= 0; i--) {
|
||||
return widgets[i].sendValue({
|
||||
target: [target],
|
||||
address: '/EDIT/GET',
|
||||
v: [
|
||||
id,
|
||||
JSON.stringify(widgets[i].props)
|
||||
],
|
||||
nosync: true
|
||||
})
|
||||
}
|
||||
},
|
||||
'/GET':function(args) {
|
||||
|
||||
var [target, idOrAddress, ...preArgs] = args,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue