widget link fixed (broken since b1886a101c):
- the sync event now carries the linkId, required for proper link sync - incomming osc messages always trigger the sync event, thus ensuring that plots and links are well synchronized
This commit is contained in:
parent
cbb6ffcfd2
commit
0736cc4d29
9 changed files with 25 additions and 25 deletions
|
|
@ -15,7 +15,7 @@ module.exports = {
|
|||
// update
|
||||
if (WIDGETS[id]!=undefined) {
|
||||
for (i in WIDGETS[id]){
|
||||
WIDGETS[id][i].setValue(data.args,false,false)
|
||||
WIDGETS[id][i].setValue(data.args,false,true)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ module.exports.categories = {
|
|||
}
|
||||
|
||||
module.exports.sync = function() {
|
||||
$('body').off('sync.global').on('sync.global',function(e,id,widget){
|
||||
$('body').off('sync.global').on('sync.global',function(e,id,widget,linkId){
|
||||
// Widget that share the same id will update each other
|
||||
// without sending any extra osc message
|
||||
if (WIDGETS[id] && WIDGETS[id].length>1) {
|
||||
|
|
@ -73,11 +73,11 @@ module.exports.sync = function() {
|
|||
}
|
||||
// widgets that share the same linkId will update each other.
|
||||
// Updated widgets will send osc messages normally
|
||||
if (WIDGETS_LINKED[id] && WIDGETS_LINKED[id].length>1) {
|
||||
if (WIDGETS_LINKED[linkId] && WIDGETS_LINKED[linkId].length>1) {
|
||||
var v = widget.getValue()
|
||||
for (i in WIDGETS_LINKED[id]) {
|
||||
if (WIDGETS_LINKED[id][i]!=widget) {
|
||||
WIDGETS_LINKED[id][i].setValue(v,true,false)
|
||||
for (i in WIDGETS_LINKED[linkId]) {
|
||||
if (WIDGETS_LINKED[linkId][i]!=widget) {
|
||||
WIDGETS_LINKED[linkId][i].setValue(v,true,false)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ module.exports.create = function(widgetData,container) {
|
|||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
})
|
||||
|
||||
var off = 0
|
||||
|
|
@ -131,7 +131,7 @@ module.exports.create = function(widgetData,container) {
|
|||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -156,7 +156,7 @@ module.exports.create = function(widgetData,container) {
|
|||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
|
||||
})
|
||||
|
||||
|
|
@ -192,7 +192,7 @@ module.exports.create = function(widgetData,container) {
|
|||
widget.showValue(v)
|
||||
|
||||
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget])
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
if (send) widget.sendValue(v)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ module.exports.create = function(widgetData,container) {
|
|||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
})
|
||||
|
||||
|
||||
|
|
@ -119,7 +119,7 @@ module.exports.create = function(widgetData,container) {
|
|||
var v = widget.getValue(r)
|
||||
|
||||
widget.sendValue(v)
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
widget.showValue(v)
|
||||
|
||||
}
|
||||
|
|
@ -152,7 +152,7 @@ module.exports.create = function(widgetData,container) {
|
|||
var v = widget.getValue(r)
|
||||
|
||||
widget.sendValue(v)
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
widget.showValue(v)
|
||||
|
||||
})
|
||||
|
|
@ -203,7 +203,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
widget.showValue(v)
|
||||
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget])
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
if (send) widget.sendValue(v)
|
||||
}
|
||||
input.change(function(){
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ module.exports.create = function(widgetData,container) {
|
|||
if (send) widget.sendValue(v)
|
||||
}
|
||||
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget])
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
|
||||
}
|
||||
widget.sendValue = function(v) {
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ module.exports.create = function(widgetData,container) {
|
|||
var v = widget.getValue()
|
||||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -115,7 +115,7 @@ module.exports.create = function(widgetData,container) {
|
|||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
|
||||
})
|
||||
|
||||
|
|
@ -138,7 +138,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -164,7 +164,7 @@ module.exports.create = function(widgetData,container) {
|
|||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
|
||||
})
|
||||
|
||||
|
|
@ -208,7 +208,7 @@ module.exports.create = function(widgetData,container) {
|
|||
|
||||
|
||||
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget])
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
if (send) widget.sendValue(v)
|
||||
}
|
||||
widget.sendValue = function(v) {
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ module.exports.create = function(widgetData,container) {
|
|||
next()
|
||||
})
|
||||
if (send) widget.sendValue(widget.value)
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget])
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ module.exports.create = function(widgetData,container) {
|
|||
if (send) widget.sendValue(widgetData.off)
|
||||
}
|
||||
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget])
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
|
||||
}
|
||||
widget.sendValue = function(v) {
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ module.exports.create = function(widgetData,container) {
|
|||
var v = widget.getValue()
|
||||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -109,7 +109,7 @@ module.exports.create = function(widgetData,container) {
|
|||
var v = widget.getValue()
|
||||
widget.sendValue(v)
|
||||
widget.showValue(v)
|
||||
widget.trigger('sync',[widgetData.id,widget])
|
||||
widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
|
||||
})
|
||||
|
||||
|
|
@ -141,7 +141,7 @@ module.exports.create = function(widgetData,container) {
|
|||
handle.width = w
|
||||
|
||||
widget.showValue(v)
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget])
|
||||
if (sync) widget.trigger('sync',[widgetData.id,widget,widgetData.linkId])
|
||||
if (send) widget.sendValue(v)
|
||||
}
|
||||
widget.sendValue = function(v) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue