Skip to content

Commit de4bbc5

Browse files
committed
Update NewtekTricaster.ts
The refactoring of code between 2.x and 3.x broke the support for NewTek Tricaster. I don't have access to an Tricaster but have tested this with SocketText by sending input that should be the same as from a real Tricaster.
1 parent e2b071b commit de4bbc5

File tree

1 file changed

+24
-3
lines changed

1 file changed

+24
-3
lines changed

src/sources/NewtekTricaster.ts

+24-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export class NewtekTricasterSource extends TallyInput {
2323

2424

2525
this.client.on('data', (data) => {
26+
logger(`Source: ${source.name} Tricaster data received.`, 'info-quiet');
2627
try {
2728
data = '<data>' + data.toString() + '</data>';
2829

@@ -36,6 +37,22 @@ export class NewtekTricasterSource extends TallyInput {
3637
else {
3738
let shortcut_states = Object.entries(result['data']['shortcut_states']);
3839

40+
// Clear the busses before we update based on Tricast input
41+
this.removeBusFromAllAddresses("program");
42+
this.removeBusFromAllAddresses("preview");
43+
44+
// Loop through the data and set preview and program based on received data.
45+
// Example input from page 62: https://downloads.newtek.com/LiveProductionSystems/VMC1/Automation%20and%20Integration%20Guide.pdf
46+
//
47+
// <shortcut_states>
48+
// <shortcut_state name="program_tally" value="INPUT1|BFR2|DDR3" type="" sender="" />
49+
// <shortcut_state name="preview_tally" value="INPUT7" type="" sender="" />
50+
// </shortcut_states>
51+
//
52+
// In this example, INPUT1, BFR1, DDR3 are identified as being on Program output, while INPUT7 is on Preview.
53+
//
54+
// For testing can the above data been fed into TallyArbiter via the SocketTest v3.0.0 application
55+
//
3956
for (const [name, value] of shortcut_states) {
4057
let shortcut_state = value['shortcut_state'];
4158
for (let j = 0; j < shortcut_state.length; j++) {
@@ -44,9 +61,10 @@ export class NewtekTricasterSource extends TallyInput {
4461
case 'preview_tally':
4562
let tallyValue = shortcut_state[j]['$'].value;
4663
let addresses = tallyValue.split('|');
47-
this.processTricasterTally(addresses, shortcut_state[j]['$'].name);
64+
this.processTricasterTally(source, addresses, shortcut_state[j]['$'].name);
4865
break;
4966
default:
67+
5068
break;
5169
}
5270
}
@@ -102,6 +120,8 @@ export class NewtekTricasterSource extends TallyInput {
102120

103121
for (let i = 0; i < this.tallydata_TC.length; i++) {
104122
let tricasterSourceFound = false;
123+
124+
// Add preview or program for each used Tricaster input.
105125
for (let j = 0; j < sourceArray.length; j++) {
106126
if (this.tallydata_TC[i].sourceId === sourceId) {
107127
if (this.tallydata_TC[i].address === sourceArray[j]) {
@@ -126,18 +146,19 @@ export class NewtekTricasterSource extends TallyInput {
126146
}
127147
}
128148

149+
// Remove preview or program for each not used Tricaster input, in case it was earlier used.
129150
if (!tricasterSourceFound) {
130151
//it is no longer in the bus, mark it as such
131152
switch(tallyType) {
132153
case 'preview_tally':
133154
this.tallydata_TC[i].tally1 = 0;
134155
this.tallydata_TC[i].preview = 0;
135-
this.removeBusFromAddress(sourceArray[i], "preview");
156+
this.addBusToAddress(sourceArray[i], "preview");
136157
break;
137158
case 'program_tally':
138159
this.tallydata_TC[i].tally2 = 0;
139160
this.tallydata_TC[i].program = 0;
140-
this.removeBusFromAddress(sourceArray[i], "program");
161+
this.addBusToAddress(sourceArray[i], "program");
141162
break;
142163
default:
143164
break;

0 commit comments

Comments
 (0)