fix OSC bug where multiple props on the same widget cannot be updated if they share the same address
This commit is contained in:
parent
2d96a41c42
commit
fdd95b7dfe
2 changed files with 7 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ module.exports = class OscReceiver {
|
|||
}
|
||||
|
||||
this.parent = parent
|
||||
this.propName = propName
|
||||
this.propNames = [propName]
|
||||
this.bindedCallback = this.callback.bind(this)
|
||||
this.setAddress(address)
|
||||
|
||||
|
|
@ -29,6 +29,10 @@ module.exports = class OscReceiver {
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
addProp(propName){
|
||||
if(!this.propNames.includes(propName))this.propNames.push(propName)
|
||||
}
|
||||
|
||||
callback(args) {
|
||||
|
||||
|
|
@ -46,7 +50,7 @@ module.exports = class OscReceiver {
|
|||
} catch (err) {
|
||||
this.value = val
|
||||
}
|
||||
this.parent.updateProps([this.propName], this.parent)
|
||||
this.parent.updateProps(this.propNames, this.parent)
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -444,6 +444,7 @@ class Widget extends EventEmitter {
|
|||
}
|
||||
} else {
|
||||
this.oscReceivers[address].setAddress(resolvedAddress)
|
||||
this.oscReceivers[address].addProp(propName)
|
||||
}
|
||||
|
||||
var r = this.oscReceivers[address].value
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue