- now storing path and widgets id references at init for faster cross-app synchronization
This commit is contained in:
parent
2d673310dd
commit
32e9fe7de6
3 changed files with 9 additions and 3 deletions
|
|
@ -1,7 +1,8 @@
|
|||
|
||||
ipc.on('receiveOsc',function(data){
|
||||
// fetch id
|
||||
var path = data.address;
|
||||
var id = $('[path="'+path+'"]').attr('widgetId');
|
||||
var id = __widgetsIds__[path]
|
||||
|
||||
// update
|
||||
if (__widgets__[id]!=undefined) {
|
||||
|
|
|
|||
|
|
@ -34,6 +34,7 @@ init = function(callback) {
|
|||
|
||||
|
||||
|
||||
|
||||
// Tabs...
|
||||
$('.tablist a').click(function(){
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ parsetabs = function(tabs,parent,sub){
|
|||
}
|
||||
|
||||
__widgets__ = {}
|
||||
__widgetsIds__ = {}
|
||||
|
||||
parsewidgets = function(widgets,parent) {
|
||||
|
||||
|
|
@ -55,16 +56,19 @@ parsewidgets = function(widgets,parent) {
|
|||
</div>\
|
||||
');
|
||||
|
||||
|
||||
// create widget
|
||||
var widgetInner = createWidget[type](widgetData,parent)
|
||||
widgetInner.type = widgetData.type || 'fader'
|
||||
widgetInner.type = type
|
||||
|
||||
// store widget reference for cross widget sync
|
||||
widget.append(widgetInner)
|
||||
if (__widgets__[widgetId]==undefined) {
|
||||
__widgets__[widgetId] = []
|
||||
}
|
||||
__widgets__[widgetId].push(widgetInner)
|
||||
|
||||
// store path vs widget id for faster cross-app sync
|
||||
__widgetsIds__[widgetData.path ] = widgetId
|
||||
|
||||
parent.append(widget);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue