@@ -23,6 +23,7 @@ export class NewtekTricasterSource extends TallyInput {
23
23
24
24
25
25
this . client . on ( 'data' , ( data ) => {
26
+ logger ( `Source: ${ source . name } Tricaster data received.` , 'info-quiet' ) ;
26
27
try {
27
28
data = '<data>' + data . toString ( ) + '</data>' ;
28
29
@@ -36,6 +37,22 @@ export class NewtekTricasterSource extends TallyInput {
36
37
else {
37
38
let shortcut_states = Object . entries ( result [ 'data' ] [ 'shortcut_states' ] ) ;
38
39
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
+ //
39
56
for ( const [ name , value ] of shortcut_states ) {
40
57
let shortcut_state = value [ 'shortcut_state' ] ;
41
58
for ( let j = 0 ; j < shortcut_state . length ; j ++ ) {
@@ -44,9 +61,10 @@ export class NewtekTricasterSource extends TallyInput {
44
61
case 'preview_tally' :
45
62
let tallyValue = shortcut_state [ j ] [ '$' ] . value ;
46
63
let addresses = tallyValue . split ( '|' ) ;
47
- this . processTricasterTally ( addresses , shortcut_state [ j ] [ '$' ] . name ) ;
64
+ this . processTricasterTally ( source , addresses , shortcut_state [ j ] [ '$' ] . name ) ;
48
65
break ;
49
66
default :
67
+
50
68
break ;
51
69
}
52
70
}
@@ -102,6 +120,8 @@ export class NewtekTricasterSource extends TallyInput {
102
120
103
121
for ( let i = 0 ; i < this . tallydata_TC . length ; i ++ ) {
104
122
let tricasterSourceFound = false ;
123
+
124
+ // Add preview or program for each used Tricaster input.
105
125
for ( let j = 0 ; j < sourceArray . length ; j ++ ) {
106
126
if ( this . tallydata_TC [ i ] . sourceId === sourceId ) {
107
127
if ( this . tallydata_TC [ i ] . address === sourceArray [ j ] ) {
@@ -126,18 +146,19 @@ export class NewtekTricasterSource extends TallyInput {
126
146
}
127
147
}
128
148
149
+ // Remove preview or program for each not used Tricaster input, in case it was earlier used.
129
150
if ( ! tricasterSourceFound ) {
130
151
//it is no longer in the bus, mark it as such
131
152
switch ( tallyType ) {
132
153
case 'preview_tally' :
133
154
this . tallydata_TC [ i ] . tally1 = 0 ;
134
155
this . tallydata_TC [ i ] . preview = 0 ;
135
- this . removeBusFromAddress ( sourceArray [ i ] , "preview" ) ;
156
+ this . addBusToAddress ( sourceArray [ i ] , "preview" ) ;
136
157
break ;
137
158
case 'program_tally' :
138
159
this . tallydata_TC [ i ] . tally2 = 0 ;
139
160
this . tallydata_TC [ i ] . program = 0 ;
140
- this . removeBusFromAddress ( sourceArray [ i ] , "program" ) ;
161
+ this . addBusToAddress ( sourceArray [ i ] , "program" ) ;
141
162
break ;
142
163
default :
143
164
break ;
0 commit comments