fix OSC bug where multiple props on the same widget cannot be updated if they share the same address

This commit is contained in:
Martin Hermant 2018-10-18 16:35:33 +02:00 • committed by jean-emmanuel
parent 2d96a41c42
commit fdd95b7dfe
2 changed files with 7 additions and 2 deletions

View file

@ -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)
}
}

View file

@ -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