headless: update new clients when they connect (by triggering a state send without osc sends in the other clients); fixes #29
This commit is contained in:
parent
5d3284c7b0
commit
bd7f56100e
4 changed files with 28 additions and 3 deletions
|
|
@ -11,6 +11,8 @@ EDITING = false
|
|||
|
||||
TRAVERSING = false
|
||||
|
||||
OSCSYNCONLY = false
|
||||
|
||||
TABS = {}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -82,10 +82,25 @@ module.exports = {
|
|||
sessionOpen: function(event,data){
|
||||
var data = data || event
|
||||
var session = JSON.parse(data)
|
||||
init(session)
|
||||
init(session,function(){
|
||||
IPC.send('sessionOpened')
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
stateSend:function(){
|
||||
var p = utils.createPopup('New client connecting...','<p><div class="spinner"></div></p>', false)
|
||||
|
||||
setTimeout(function(){
|
||||
|
||||
OSCSYNCONLY = true
|
||||
actions.stateSend()
|
||||
OSCSYNCONLY = false
|
||||
|
||||
p.close()
|
||||
},150)
|
||||
},
|
||||
|
||||
error: function(event,data){
|
||||
var data = data || event
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
module.exports = {
|
||||
|
||||
sendOsc: function(data){
|
||||
IPC.send('sendOsc', data)
|
||||
if (!OSCSYNCONLY) {
|
||||
IPC.send('sendOsc', data)
|
||||
} else {
|
||||
IPC.send('syncOsc', data)
|
||||
}
|
||||
},
|
||||
|
||||
clip: function(value,range) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue