Skip to content

Commit 8d629c1

Browse files
authored
Merge pull request #97 from peschuster/fix/96-merge-ATEM-MEs-before-processing
Fix handling of multiple ATEM MEs
2 parents 5e4a511 + db514cf commit 8d629c1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

index.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -2602,13 +2602,18 @@ function SetUpATEMServer(sourceId) {
26022602
//console.log(state.info.capabilities);
26032603
}
26042604
else if ((path[h].indexOf('video.mixEffects') > -1) || (path[h].indexOf('video.ME') > -1) || (path[h].indexOf('video.downstreamKeyers') > -1)) {
2605+
const pgmList = [], prvList = [];
2606+
const addUniqueInput = (n, list) => {
2607+
const s = n.toString();
2608+
if (!list.includes(s)) list.push(s);
2609+
}
26052610
for (let i = 0; i < state.video.mixEffects.length; i++) {
26062611
if (source.data.me_onair.includes((i+1).toString())) {
2607-
const pgmList = AtemListVisibleInputs("program", state, i).map(n => n.toString());
2608-
const prvList = AtemListVisibleInputs("preview", state, i).map(n => n.toString());
2609-
processATEMTally(sourceId, pgmList, prvList);
2612+
AtemListVisibleInputs("program", state, i).forEach(n => addUniqueInput(n, pgmList));
2613+
AtemListVisibleInputs("preview", state, i).forEach(n => addUniqueInput(n, prvList));
26102614
}
26112615
}
2616+
processATEMTally(sourceId, pgmList, prvList);
26122617
}
26132618
}
26142619
});

0 commit comments

Comments
 (0)