midi: take server targets into account to determine widget matching
This commit is contained in:
parent
b5a14583f2
commit
4ccd48abe4
4 changed files with 18 additions and 4 deletions
|
|
@ -5,6 +5,7 @@
|
|||
- bug fixes
|
||||
- strip: layout issues when moving widget in a strip (min width/height still active)
|
||||
- tcp: prevent sending osc messages on udp port when the same port number is set as a tcp target
|
||||
- midi: take server default targets into account to determine widget matching
|
||||
|
||||
## 0.48.7
|
||||
|
||||
|
|
|
|||
|
|
@ -203,6 +203,12 @@ module.exports = {
|
|||
|
||||
document.title = windowTitle + (data ? ' (' + data + ')' : '')
|
||||
|
||||
},
|
||||
|
||||
serverTargets: function(data) {
|
||||
|
||||
if (data) osc.serverTargets = data
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ var Osc = class Osc extends EventEmitter {
|
|||
|
||||
this.syncOnly = false
|
||||
this.remoteControl = {}
|
||||
this.serverTargets = []
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -41,7 +42,7 @@ var Osc = class Osc extends EventEmitter {
|
|||
var [widgets, restArgs] = widgetManager.getWidgetByAddressAndArgs(data.address, data.args)
|
||||
|
||||
for (let i in widgets) {
|
||||
|
||||
|
||||
let widgetTarget = widgets[i].getProp('target'),
|
||||
match = true
|
||||
|
||||
|
|
@ -51,8 +52,12 @@ var Osc = class Osc extends EventEmitter {
|
|||
match = deepEqual(widgetTarget, data.target)
|
||||
} else if (data.host === 'midi') {
|
||||
// if the message comes from a midi port, only update widgets that send to that port
|
||||
let widgetArrayTarget = Array.isArray(widgetTarget) ? widgetTarget : [widgetTarget]
|
||||
match = widgetArrayTarget.includes(data.host + ':' + data.port)
|
||||
let widgetArrayTarget = Array.isArray(widgetTarget) ? widgetTarget : [widgetTarget],
|
||||
strTarget = data.host + ':' + data.port
|
||||
|
||||
match = widgetArrayTarget.includes(strTarget) ||
|
||||
(!widgetArrayTarget.includes(null) && this.serverTargets.includes(strTarget))
|
||||
|
||||
}
|
||||
|
||||
if (match) {
|
||||
|
|
|
|||
|
|
@ -38,7 +38,9 @@ module.exports = {
|
|||
recentSessions = recentSessions.map(function(file){return dir + '/' + file})
|
||||
}
|
||||
|
||||
ipc.send('sessionList',recentSessions,clientId)
|
||||
ipc.send('sessionList', recentSessions, clientId)
|
||||
ipc.send('serverTargets', settings.read('targets'), clientId)
|
||||
|
||||
},
|
||||
|
||||
sessionAddToHistory: function(data) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue