settings: add "--state" (#349)

This commit is contained in:
jean-emmanuel 2018-08-04 17:05:04 +02:00
parent 5a2ec0ea84
commit 9cd107fd5c
5 changed files with 35 additions and 0 deletions

View file

@ -133,7 +133,24 @@ module.exports = {
},
sessionOpened: function(data, clientId) {
if (settings.read('stateFile')) {
var send = true
for (var id in ipc.clients) {
// only make the client send its osc state if there are no other active clients
if (id !== clientId && ipc.clients[id].connected()) {
send = false
}
}
var state = {
state: settings.read('stateFile'),
send: send
}
ipc.send('stateLoad', state, clientId)
}
ipc.send('stateSend', null, null, clientId)
},
savingSession: function(data, clientId) {