From 7109aca37b60ea507d8a730517b1b45ffd296dff Mon Sep 17 00:00:00 2001 From: Information Systems Technology Date: Wed, 24 Feb 2021 14:49:07 -0800 Subject: [PATCH 1/4] Minor optimize from WING module --- index.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 385cf04..4be3927 100644 --- a/index.js +++ b/index.js @@ -690,7 +690,7 @@ instance.prototype.init_strips = function () { } // add new channel type to dropdown choices - if (fadeID in fadeActions) { + if (fadeActions[fadeID] !== undefined) { fadeActions[fadeID].options[0].choices.push({ id: chID + '/', label: stripDef[i].description + " " + stripDef[i].min + "-" + stripDef[i].max @@ -929,7 +929,7 @@ instance.prototype.init_strips = function () { // add channel type to send actions if (stripDef[i].hasLevel) { sendID = 'send'; - if (sendID in sendActions) { + if (sendActions[sendID] !== undefined) { sendActions[sendID].options[0].choices.push({ id: chID + '/', label: sendLabel(stripDef[i].description, stripDef[i].min, stripDef[i].max) @@ -1503,7 +1503,7 @@ instance.prototype.init_osc = function() { var leaf = node.split('/').pop(); // debug("received ", message, "from", info); - if (node in self.xStat) { + if (self.xStat[node] !== undefined) { var v = args[0].value; switch (leaf) { case 'on': From 345d671f7fb077f8175fb4f0e1f62db54e208d02 Mon Sep 17 00:00:00 2001 From: Information Systems Technology Date: Sun, 7 Mar 2021 09:15:15 -0800 Subject: [PATCH 2/4] Preload tweaks --- index.js | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/index.js b/index.js index 4be3927..76f8c6e 100644 --- a/index.js +++ b/index.js @@ -38,6 +38,8 @@ function instance(system, id, config) { self.fLevels[161] = []; self.blinkingFB = {}; self.crossFades = {}; + self.PollCount = 9; + self.PollTimeout = 400; self.needStats = true; self.setConstants(); @@ -1422,7 +1424,7 @@ instance.prototype.pollStats = function () { var stillNeed = false; var counter = 0; var timeNow = Date.now(); - var timeOut = timeNow - 100; + var timeOut = timeNow - self.PollTimeout; var id; for (id in self.xStat) { @@ -1433,7 +1435,7 @@ instance.prototype.pollStats = function () { self.debug("sending " + id); self.xStat[id].polled = timeNow; counter++; - if (counter > 5) { + if (counter > self.PollCount) { break; } } @@ -1442,6 +1444,9 @@ instance.prototype.pollStats = function () { if (!stillNeed) { self.status(self.STATUS_OK,"Mixer Status loaded"); + var c = Object.keys(self.xStat).length; + var d = (timeNow - self.timeStart) / 1000; + self.log('info', 'Sync complete (' + c + '@' + (c / d).toFixed(1) + ')'); } self.needStats = stillNeed; }; @@ -1453,6 +1458,7 @@ instance.prototype.firstPoll = function () { self.sendOSC('/xinfo',[]); self.sendOSC('/-snap/name',[]); self.sendOSC('/-snap/index',[]); + self.timeStart = Date.now(); self.pollStats(); self.pulse(); }; @@ -1576,6 +1582,7 @@ instance.prototype.init_osc = function() { self.oscPort.on('ready', function() { self.status(self.STATUS_WARNING,"Loading status"); + self.log('info', 'Sync started'); self.firstPoll(); self.heartbeat = setInterval( function () { self.pulse(); }, 9500); self.blinker = setInterval( function() { self.blink(); }, 1000); @@ -1983,12 +1990,13 @@ instance.prototype.action = function(action) { // returns a 'new' float value // or undefined for store or crossfade function fadeTo(cmd, opt) { + var stat = self.xStat[cmd] var node = cmd.split('/').pop(); var opTicks = parseInt(opt.ticks); - var steps = self.xStat[cmd].fSteps; + var steps = stat.fSteps; var span = parseFloat(opt.duration); - var oldVal = self.xStat[cmd][node]; - var oldIdx = self.xStat[cmd].idx; + var oldVal = stat[node]; + var oldIdx = stat.idx; var byVal = opTicks * steps / 100; var newIdx = Math.min(steps-1,Math.max(0, oldIdx + Math.round(byVal))); var slot = opt.store == 'me' ? cmd : opt.store; @@ -2005,7 +2013,7 @@ instance.prototype.action = function(action) { break; case '_s': // store if (slot) { // sanity check - self.tempStore[slot] = self.xStat[cmd][node]; + self.tempStore[slot] = stat[node]; } r = -1; // the 'store' actions are internal to this module only From 3d7c19da4125568368817f2a3ba4a2008324234c Mon Sep 17 00:00:00 2001 From: Information Systems Technology Date: Sun, 7 Mar 2021 09:18:37 -0800 Subject: [PATCH 3/4] Docs --- package.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 0b89b3b..bfbce47 100644 --- a/package.json +++ b/package.json @@ -3,13 +3,13 @@ "legacy": [ "xair" ], - "version": "1.6.1", + "version": "1.6.2", "api_version": "1.0.0", "keywords": [ - "Audio" + "Audio","Mixer","Console" ], "manufacturer": "Behringer/Midas", - "product": "XR/MR", + "product": ["XR/MR", "XAir","XR12","XR16","X18","XR18"], "shortname": "xair", "description": "Module to control Midas MR and Behringer XR series mixers", "main": "index.js", From e890584a5b447a4edb82b6a8479506c34606458b Mon Sep 17 00:00:00 2001 From: Information Systems Technology Date: Sun, 7 Mar 2021 12:13:41 -0800 Subject: [PATCH 4/4] Fix # of bus for solo --- solodef.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/solodef.json b/solodef.json index 6aeefbb..8e55996 100644 --- a/solodef.json +++ b/solodef.json @@ -28,7 +28,7 @@ "description": "Bus Master", "actID": "bus", "min": 1, - "max": 4, + "max": 6, "offset": 39 }, {