osc receivers: apply the same rule as widgets regarding midi messages (only receive if the message's origin matches one of the host widget's midi targets)

This commit is contained in:
jean-emmanuel 2022-01-22 13:09:45 +01:00
parent 26207f0e70
commit 52147ba0a6
4 changed files with 36 additions and 20 deletions

View file

@ -56,7 +56,9 @@ module.exports = class OscReceiver {
}
callback(args) {
callback(data) {
var {args} = data
if (!Array.isArray(args)) args = [args]
var preArgs = this.usePreArgs ? (this.parent.getProp('preArgs') || []) : []
@ -65,6 +67,7 @@ module.exports = class OscReceiver {
for (var i in preArgs) {
if (preArgs[i] !== args[i]) return
}
if (!osc.match(this.parent, data)) return
var value = args.slice(preArgs.length)
if (value.length < 2) value = value[0]
if (typeof value === 'string' && isJSONObject(value)) {