-
Notifications
You must be signed in to change notification settings - Fork 2
/
index.js
1671 lines (1540 loc) · 67.8 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
var util = require('util')
var rest = require('node-rest-client').Client
function eventmaster(ip) {
var self = this
self.ip = ip
self.rest = new rest()
if (ip == undefined) {
console.error('NO IP SPECIFIED FOR EVENTMASTER')
return
}
return self
}
/**
* Query the E2 directly
* @param {} method
* @param {} params
* @param {} cb
*/
eventmaster.prototype.query = function (method, params, cb) {
var self = this
var args = {
data: {
method: method,
params: params,
jsonrpc: '2.0',
id: '0',
},
headers: {
'Content-Type': 'application/json',
},
}
return self.rest.post('http://' + self.ip + ':9999/jsonrpc', args, function (data, response) {
if (cb !== undefined && typeof cb === 'function') {
if (data.result !== undefined && data.result.success == 0) {
cb(null, data.result.response)
} else {
cb(true, data)
}
}
})
}
/**
allTrans
• Definition
– It executes the “allTrans” command.
– If multi-operator mode is enabled, all-trans will affect only on those destinations which are selected for operator.
• Request:
– param: {"transTime": 40} - integer value, will be applied to all armed destinations. (optional)
• Multi-Operator Mode:
– New parameters are introduced to cater multi-operator mode along with above parameters.
– These parameters are used only when one or more operators are enabled.
– params: {"operatorId": y} (for normal operator)
o “operatorId”— operator index (For current release only 0,1,2 are indexes).
o If user still want to use “super-operator” mode, password is required which is passed as a parameter.
– params: {"password": "xyz"} (for super operator)
o password— Super user password saved. When this is passed, actions will be performed as no operator is enabled.
• Response:
– response: null
– success: (0=success, anything else is an error)
• Example
– {"params":{}, "method":"allTrans", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"transTime": 40}, "method":"allTrans", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"operatorId" : 1}, "method":"allTrans", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"password" : "123"}, "method":"allTrans", "id":"1234", "jsonrpc":"2.0"}
* @param {} type
* @param {} params
* @param {} cb
*/
eventmaster.prototype.allTrans = function (type, params, cb) {
var self = this
switch (type) {
case 'operator':
return self.query('allTrans', { operatorId: params }, cb)
case 'super_user':
return self.query('allTrans', { password: params }, cb)
default:
return self.query('allTrans', {}, cb)
}
}
/**
cut
• Definition
– It executes the “Cut” command.
– If multi-operator mode is enabled, cut will affect only on those destinations which are selected for operator.
• Request:
– params: {} - It doesn’t require any parameter.
• Multi-Operator Mode:
– New parameters are introduced to cater multi-operator mode along with above parameters.
– These parameters are used only when one or more operators are enabled.
– params: {"operatorId": y} (for normal operator)
o “operatorId”— operator index (For current release only 0,1,2 are indexes).
o If user still want to use “super-operator” mode, password is required which is passed as a parameter.
– params: {"password": "xyz"} (for super operator)
o password— Super user password saved. When this is passed, actions will be performed as no operator is enabled.
• Multi-Operator Mode:
– New parameters are introduced to cater multi-operator mode along with above parameters.
– These parameters are used only when one or more operators are enabled.
– params: {"operatorId": y} (for normal operator)
o “operatorId”— operator index (For current release only 0,1,2 are indexes).
o If user still want to use “super-operator” mode, password is required which is passed as a parameter.
– params: {"password": "xyz"} (for super operator)
o password— Super user password saved. When this is passed, actions will be performed as no operator is enabled.
• Response:
– response: null
– success: (0=success, anything else is an error)
• Example
– {"params":{}, "method":"cut", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"operatorId" : 1}, "method":"cut", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"password" : "123"}, "method":"cut", "id":"1234", "jsonrpc":"2.0"}
* @param {} type
* @param {} params
* @param {} cb
*/
eventmaster.prototype.cut = function (type, params, cb) {
var self = this
switch (type) {
case 'operator':
return self.query('cut', { operatorId: params }, cb)
case 'super_user':
return self.query('cut', { password: params }, cb)
default:
return self.query('cut', {}, cb)
}
}
/**
resetFrameSettings
• Definition
– Expose ALL reset types on Event Master processor with different options.
• Request:
– params: {"reset":x},
“x” can be 0 – 5
o 0: Soft reset.
o 1: Factory reset.
o 2: Factory reset (save IP).
o 3: Factory reset (save IP/EDID).
o 4: Factory reset (save VPID).
o 5: Power Down.
• Response:
– response: null
– success: (0=success, anything else is an error)
• Example
– {"params":{"reset": 0}, "method":"resetFrameSettings", "id":"1234", "jsonrpc":"2.0"}
* @param {} resetKind
* @param {} cb
*/
eventmaster.prototype.resetFrameSettings = function (resetKind, cb) {
var self = this
return self.query('resetFrameSettings', { reset: resetKind }, cb)
}
/**
powerStatus
• • Definition:
– This queries the power plug status of the Event Master processor. (There can be 1 or 2 power slots in Event Master processor).
• • Request:
– params: {} - It doesn’t require any parameter.
• • Response:
– response: {FrameId1 :{ PwrStatus1, PwrStatus2},{FrameId2 :{ PwrStatus1, PwrStatus2}
o PwrStatus1 gives the power status of the 1st slot in Event Master processor with frame id FrameId1, FrameId2.
o PwrStatus2 gives the power status of the 2nd slot in Event Master processor with frame id FrameId1, FrameId2.
o 0: Power supply module is not present.
o 1: Power supply module is present, but there is no power cable.
o 2: Power supply module is present, and the cable is plugged in, but there is no DC current.
o 3: Power supply module is present, and everything is OK.
– success: (0=success, anything else is an error)
• • Example:
– {"params":{}, "method":"powerStatus", "id":"1234", "jsonrpc":"2.0"}
* @param {} cb
*/
eventmaster.prototype.powerStatus = function (cb) {
var self = this
return self.query('powerStatus', {}, cb)
}
/**
listPresets
• Definition:
– This queries the list of Presets on a particular destination or on the system.
• Request:
– params: {"ScreenDest":x , "AuxDest":x},
“x” can be:
o –2: Do not include any destinations of this type. (Has priority over particular id, if passed as a parameter.)
o –1: Do not care (All presets). (Has priority over particular id, if passed as a parameter.)
o 0–999: want to see the presets with the destination this particular id in it or array of ids. Eg. "ScreenDestination":[{"id": 2}, {"id": 3}]
• Response:
– response: Array of: [{"id": 0, "Name": "Preset3.00", "LockMode": 0, "presetSno": 3.00}, {"id": 1, "Name": "Preset4.00", "LockMode": 0, "presetSno": 4.00}]
o Response contains the array of presets. Above response contains id, name, lock mode preset serial number of the all the presets.
– success: (0=success, anything else is an error)
• Example:
– {"params":{"ScreenDest": 0}, "method":"listPresets", "id":"1234", "jsonrpc":"2.0"}
* @param {} ScreenDest
* @param {} AuxDest
* @param {} cb
*/
eventmaster.prototype.listPresets = function (ScreenDest, AuxDest, cb) {
var self = this
if (ScreenDest == null) ScreenDest = -1
if (AuxDest == null) AuxDest = -1
return self.query('listPresets', { ScreenDest: ScreenDest, AuxDest: AuxDest }, cb)
}
/**
listDestinationsForPreset
• Definition:
– Lists the content of a Preset.
• Request:
– params: {“id”:x },
“x” can be:
o –1: List all Presets.
o 0–999: list only that specific Preset.
• Response:
– response: Array of: [{"id": 0, "Name": "Preset3.00", "LockMode": 0, "presetSno": 3.00, "ScreenDest":[{"id": 0}, {"id": 3}],"AuxDest":[{"id": 0}, {"id": 1}]}]
o Response contains the array of Presets.
– success: (0=success, anything else is an error)
• Example:
– { "params":{"id": 0}, "method":"listDestinationsForPreset", "id":"1234", "jsonrpc":"2.0"}
* @param {} presetId
*/
eventmaster.prototype.listDestinationsForPreset = function (presetId) {
var self = this
if (presetId == null) presetId = -1
return self.query('listDestinationsForPreset', { id: presetId }, cb)
}
/**
savePreset
• Definition:
– Creates a Preset on the Event Master processor.
• Request:
– params: {"presetName": "NewPreset", "ScreenDestination":[{"id": 2}, {"id": 3}], "AuxDestination":[{"id": 1}, {"id": 2}]}
– params: {"presetName": "NewPreset", "serialNo": 1.01, "saveFromProgram":1, "ScreenDestination":[{"id": 2}, {"id": 3}], "AuxDestination":[{"id": 1}, {"id": 2}]}
o “presetName”—Name of the Preset to save.
o ScreenDestinations—ScreenDest id for the Preset to be created.
o AuxDestinations—AuxDest id for the Preset to be created.
o ScreenDestination, AuxDestinations are optional parameters. If user didn’t provide it, Preset will be saved for selected destinations.
o serialNo- serial number for the preset to be saved. If preset exist, it will be overwritten. (Optional). Only 2-Digit decimal points are recommended, If user provides more than 2 decimal point then the number may be round off to 2-digit decimal point.
saveFromProgram - This flag is set to 1 if preset to be saved from program, else default will be saved from preview. (Optional)
• Multi-Operator Mode:
– New parameters are introduced to cater multi-operator mode along with above parameters.
– These parameters are used only when one or more operators are enabled.
– params: {"presetName": "NewPreset", "operatorId": y} (for normal operator)
o “operatorId”— operator index (For current release only 0,1,2 are indexes).
o If user still want to use “super-operator” mode, password is required which is passed as a parameter.
– params: {"presetName": "NewPreset", "password": "xyz"} (for super operator)
o password— Super user password saved. When this is passed, actions will be performed as no operator is enabled.
• Response:
– response: null
– success: (0=success, anything else is an error)
• Example:
– {"params": {"presetName": "NewPreset"}, "method":"savePreset", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"presetName": "NewPreset", "ScreenDestination": {"id": 0},"AuxDestination":{"id": 0}}, "method":"savePreset", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"presetName": "NewPreset", "serialNo": 1.01, "saveFromProgram":1}, "method":"savePreset", "id":"1234", "jsonrpc":"2.0"}
– For normal operator
{"params": {"presetName": "NewPreset", "serialNo": 5.00, "operatorId": 2}, "method":"savePreset", "id":"1234", "jsonrpc":"2.0"}
– For super operator
{"params": {"presetName": "NewPreset", "operatorId": 2}, "method":"savePreset", "id":"1234", "jsonrpc":"2.0"}
Key points regarding Preset, which are same for rename, activate, and delete:
– “id”—id of the preset.
– “presetSno”—preset serial number. User can provide floating point number if required. Eg. "presetSno": 1.01, "presetSno": 1.00, "presetSno": 1, "presetSno": 1.1, "presetSno": 1.10.
Kindly note that 1.1 and 1.10 or 1.00 and 1 are same.
* @param {} presetName
* @param {} ScreenDestinationsArray
* @param {} AuxDestinationsArray
* @param {} type
* @param {} params
* @param {} cb
*/
eventmaster.prototype.savePreset = function (
presetName,
ScreenDestinationsArray,
AuxDestinationsArray,
type,
params,
cb
) {
var self = this
switch (type) {
case 'operator':
return self.query(
'savePreset',
{
presetName: presetName,
ScreenDestination: ScreenDestinationsArray,
AuxDestination: AuxDestinationsArray,
operatorId: params,
},
cb
)
case 'super_user':
return self.query(
'savePreset',
{
presetName: presetName,
ScreenDestination: ScreenDestinationsArray,
AuxDestination: AuxDestinationsArray,
password: params,
},
cb
)
default:
return self.query(
'savePreset',
{
presetName: presetName,
ScreenDestination: ScreenDestinationsArray,
AuxDestination: AuxDestinationsArray,
},
cb
)
}
}
/**
renamePreset
• Definition:
– Rename a Preset on the Event Master processor. User can rename Preset with id, Preset serial number, or Preset name.
– Send any one of the parameters to rename Preset.
• Request params:
– params: {"id": x, "newPresetName": "NewPresetName"}
– params: {"presetSno": x.y, "newPresetName": "NewPresetName"}
– params: {"presetName": "OldPresetName", "newPresetName": "NewPresetName"}
o “newPresetName”—New Preset name to set.
• Response:
– response: null
– success: (0=success, anything else is an error)
• Example:
– {"params": {"id": 0, "newPresetName": " newPresetName "}, "method":"renamePreset", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"presetName": "NewPreset", "newPresetName": "NewPresetName"}, "method":"renamePreset", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"presetSno": 1.00, "newPresetName": " newPresetName "}, "method":"renamePreset", "id":"1234", "jsonrpc":"2.0"}
* @param {} presetId
* @param {} newPresetName
* @param {} cb
*/
eventmaster.prototype.renamePresetById = function (presetId, newPresetName, cb) {
var self = this
return self.query('renamePreset', { id: presetId, newPresetName: newPresetName }, cb)
}
/**
* @param {} presetSno
* @param {} newPresetName
* @param {} cb
*/
eventmaster.prototype.renamePresetBySno = function (presetSno, newPresetName, cb) {
var self = this
return self.query('renamePreset', { presetSno: presetSno, newPresetName: newPresetName }, cb)
}
/**
* @param {} presetName
* @param {} newPresetName
* @param {} cb
*/
eventmaster.prototype.renamePresetByName = function (presetName, newPresetName, cb) {
var self = this
return self.query('renamePreset', { presetName: presetName, newPresetName: newPresetName }, cb)
}
/**
activateSourceMainBackup
• Definition: – This API configure backups on inputs and backgrounds.
• Request params: {"inputId":8, "Backup1": {"SrcType": 1, "SourceId": 1}, "Backup2": {"SrcType": 0, "SourceId": 0}, "Backup3": {"SrcType": 1, "SourceId": 0}, "BackUpState":1}
o inputId: index of input/Background for which backup needs to be configured.
o Backup1/Backup2/Backup3:
o SrcType: 0 for input, 1 for Stills.
o SourceId: Index of input/background or Still.
o BackupState: Backup id which needs to be set for backup of the main input. -1 to set primary and is default (If not provided then primary will be activated)
• Response: – response: null – success: (0=success, anything else is an error)
• Example: – {"params":{"inputId":8, "Backup1": {"SrcType": 1, "SourceId": 1}, "Backup2": {"SrcType": 0, "SourceId": 0}, "Backup3": {"SrcType": 1, "SourceId": 0}, "BackUpState":1}, "method":"activateSourceMainBackup", "id":"1234", "jsonrpc":"2.0"}
*/
eventmaster.prototype.activateSourceMainBackup = function (
inputId,
Backup1_SrcType,
Backup1_SourceId,
Backup2_SrcType,
Backup2_SourceId,
Backup3_SrcType,
Backup3_SourceId,
BackUpState,
cb
) {
var self = this
return self.query(
'activateSourceMainBackup',
{
inputId: inputId,
Backup1: { SrcType: Backup1_SrcType, SourceId: Backup1_SourceId },
Backup2: { SrcType: Backup2_SrcType, SourceId: Backup2_SourceId },
Backup3: { SrcType: Backup3_SrcType, SourceId: Backup3_SourceId },
BackUpState: BackUpState,
},
cb
)
}
/**
activatePreset
• Definition:
– Recall a Preset on the Event Master processor. User can recall Preset with id, Preset serial number, or Preset name.
– Send any one of the parameters to recall Preset.
• Request params:
– params: {"id": x, "type": x}
– params: {"presetSno": x.y, "type": x}
– params: {"presetName": "PresetName"}
o “type”—0 to recall in preview (default), 1 to recall in program. This is not a mandatory parameter but should be given when the user wants to recall a Preset in program.
• Multi-Operator Mode:
– New parameters are introduced to cater multi-operator mode along with above parameters.
– These parameters are used only when one or more operators are enabled.
– params: {"id": x, "operatorId": y} (for normal operator)
o “operatorId”— operator index (For current release only 0,1,2 are indexes).
o If user still want to use “super-operator” mode, password is required which is passed as a parameter.
– params: {"id": x, "password": "xyz" } (for super operator)
o password— Super user password saved. When this is passed, actions will be performed as no operator is enabled.
• Response:
– response: null
– success: (0=success, anything else is an error)
• Example:
– {"params": {"id": 0, "type": 0}, "method":"activatePreset", "id":"1234", "jsonrpc":"2.0"} //Recall in preview with id 0.
– {"params": {"presetName": "abc" }, "method":"activatePreset", "id":"1234", "jsonrpc":"2.0"} //Recall in preview with preset name “abc”.
– {"params": {"presetSno": 1.00, "type": 1}, "method":"activatePreset", "id":"1234", "jsonrpc":"2.0"} //Recall in program with presetSno 1.
– For super operator
{"params": {"id": 6, "password": "123"}, "method":"activatePreset", "id":"1234", "jsonrpc":"2.0"}
– For normal operator
{"params": {"id": 5, "operatorId": 2}, "method":"activatePreset", "id":"1234", "jsonrpc":"2.0"}
* @param {} presetId
* @param {} recallInProgramInt
* @param {} type
* @param {} params
* @param {} cb
*/
eventmaster.prototype.activatePresetById = function (presetId, recallInProgramInt, type, params, cb) {
var self = this
switch (type) {
case 'operator':
return self.query('activatePreset', { id: presetId, type: recallInProgramInt, operatorId: params }, cb)
case 'super_user':
return self.query('activatePreset', { id: presetId, type: recallInProgramInt, password: params }, cb)
default:
return self.query('activatePreset', { id: presetId, type: recallInProgramInt }, cb)
}
}
/**
* @param {} presetSno
* @param {} recallInProgramInt
* @param {} type
* @param {} params
* @param {} cb
*/
eventmaster.prototype.activatePresetBySno = function (presetSno, recallInProgramInt, type, params, cb) {
var self = this
switch (type) {
case 'operator':
return self.query('activatePreset', { presetSno: presetSno, type: recallInProgramInt, operatorId: params }, cb)
case 'super_user':
return self.query('activatePreset', { presetSno: presetSno, type: recallInProgramInt, password: params }, cb)
default:
return self.query('activatePreset', { presetSno: presetSno, type: recallInProgramInt }, cb)
}
}
/**
* @param {} presetName
* @param {} recallInProgramInt
* @param {} cb
*/
eventmaster.prototype.activatePresetByName = function (presetName, recallInProgramInt, type, params, cb) {
var self = this
switch (type) {
case 'operator':
return self.query(
'activatePreset',
{
presetName: presetName,
type: recallInProgramInt,
operatorId: params,
},
cb
)
case 'super_user':
return self.query('activatePreset', { presetName: presetName, type: recallInProgramInt, password: params }, cb)
default:
return self.query('activatePreset', { presetName: presetName, type: recallInProgramInt }, cb)
}
}
/**
recallNextPreset
• Definition:
– Recall the next Preset on the Event Master processor.
No parameter is required.
– Make sure that the user has at least recalled one Preset. Web app recalls the next Preset from the last Preset recalled.
• Request:
– params: {}
• Response:
– response: null
– success: (0=success, anything else is an error)
– An error is shown if there was no last recalled Preset or if there is no next Preset in the list.
• Example:
– {"params": {}, "method":"recallNextPreset", "id":"1234", "jsonrpc":"2.0"}
* @param {} cb
*/
eventmaster.prototype.recallNextPreset = function (cb) {
var self = this
return self.query('recallNextPreset', {}, cb)
}
/**
deletePreset
• Definition:
– Delete a Preset on the Event Master processor.
User can delete Preset with id, Preset serial number, or Preset name.
– Send any one of the parameters to delete Preset.
• Request:
– params: {"id": x}
– params: {"presetSno": x.y}
– params: {"presetName": "PresetName"}
• Multi-Operator Mode:
– New parameters are introduced to cater multi-operator mode along with above parameters.
– These parameters are used only when one or more operators are enabled.
– params: {"id": x, "operatorId": y} (for normal operator)
o “operatorId”— operator index (For current release only 0,1,2 are indexes).
o If user still want to use “super-operator” mode, password is required which is passed as a parameter.
– params: {"id": x, "password": "xyz"} (for super operator)
o password— Super user password saved. When this is passed, actions will be performed as no operator is enabled.
• Response:
– response: null
– success: (0=success, anything else is an error)
• Example:
– {"params": {"id": 1}, "method":"deletePreset", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"presetSno": 1.00}, "method":"deletePreset", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"presetName": "Preset 5.00"}, "method":"deletePreset", "id":"1234", "jsonrpc":"2.0"}
– For super operator
{"params": {"id": 6, "password": "123"}, "method":"deletePreset", "id":"1234", "jsonrpc":"2.0"}
– For normal operator
{"params": {"id": 5, "operatorId": 2}, "method":"deletePreset", "id":"1234", "jsonrpc":"2.0"}
* @param {} presetId
* @param {} type
* @param {} params
* @param {} cb
*/
eventmaster.prototype.deletePresetById = function (presetId, type, params, cb) {
var self = this
switch (type) {
case 'operator':
return self.query('deletePreset', { id: presetId, operatorId: params }, cb)
case 'super_user':
return self.query('deletePreset', { id: presetId, password: params }, cb)
default:
return self.query('deletePreset', { id: presetId }, cb)
}
}
/**
* @param {} presetSno
* @param {} type
* @param {} params
* @param {} cb
*/
eventmaster.prototype.deletePresetBySno = function (presetSno, type, params, cb) {
var self = this
switch (type) {
case 'operator':
return self.query('deletePreset', { presetSno: presetSno, operatorId: params }, cb)
case 'super_user':
return self.query('deletePreset', { presetSno: presetSno, password: params }, cb)
default:
return self.query('deletePreset', { presetSno: presetSno }, cb)
}
}
/**
* @param {} presetName
* @param {} type
* @param {} params
* @param {} cb
*/
eventmaster.prototype.deletePresetByName = function (presetName, type, params, cb) {
var self = this
switch (type) {
case 'operator':
return self.query('deletePreset', { presetName: presetName, operatorId: params }, cb)
case 'super_user':
return self.query('deletePreset', { presetName: presetName, password: params }, cb)
default:
return self.query('deletePreset', { presetName: presetName }, cb)
}
}
/**
listDestinations
• Definition:
– This API lists all the destinations with properties such as layers, outputs, id, size, and name.
• Request:
– params: {"type": x}
o 0—Show all the destinations.
0 is the default value for the type parameter.
o 1—Only screen destinations.
o 2—Only aux destinations.
• Response:
– response: Array of : {"ScreenDestination":[{"id": 0, "Name": "Dest1", "HSize": 3840, "VSize": 1080, "Layers": 1,"DestOutMapColl":[{"id": 0"DestOutMap":[{"id": 0, "Name": "Out1", "HPos": 0, "VPos": 0, "HSize": 1920, "VSize":1080, "Freeze": 0},{"id": 1, "Name": "Out2", "HPos": 1920, "VPos": 0, "HSize": 1920, "VSize":1080, "Freeze": 1}]}]}],"AuxDestination":[{"id": 0, "AuxStreamMode": 4}, {"id": 1, "AuxStreamMode": 4}]}”
– success: (0=success, anything else is an error)
• • Example:
– {"params": {"type": 0}, "method":"listDestinations", "id":"1234", "jsonrpc":"2.0"}
* @param {} type
* @param {} cb
*/
eventmaster.prototype.listDestinations = function (type, cb) {
var self = this
return self.query('listDestinations', { type: type }, cb)
}
/**
listSources
• Definition:
– This API lists all the input sources with properties.
• Request:
– params: {"type": x}
o 0—Show all the input sources.
0 is the default value for the type parameter.
o 1—Only background sources.
• Response:
– - response: Array of : {"id": 0, "Name": "InSource1", "HSize": 3840, "VSize": 1080, "SrcType": 0, "InputCfgIndex": -1, "StillIndex": 0, "DestIndex": -1, "UserKeyIndex": -1, "Mode3D": 0, "Freeze": 1, "Capacity": 2, "InputCfgVideoStatus": 4}
success: (0=success, anything else is an error)
– Parameter to look for is “InputCfgVideoStatus”. Possible values:
0 = Invalid; there is sync, but cannot acquire / lock mismatch
1 = Valid; Video is OK
2 = MismatchFormat; Format mismatch between input cfg and connector(s)
3 = OutOfRange; connector capacity is too low to acquire format
4 = NoSync; no video
–
• Example:
– {"params": {"type": 0}, "method":"listSources", "id":"1234", "jsonrpc":"2.0"}
* @param {} type
* @param {} cb
*/
eventmaster.prototype.listSources = function (type, cb) {
var self = this
return self.query('listSources', { type: type }, cb)
}
/**
activateCue
• Definition:
– This API to .
• Requestparams:
• Response:
– : null
– success: (0=success, anything else is an error)
• Example:
– {"params": {"id": 1}, "method":"activateCue", "id":"1234", "jsonrpc":"2.0"} //Play – no parame or type 0
– {"params": {"type": 1}, "method":"activateCue", "id":"1234", "jsonrpc":"2.0"} //Pause – type 1
– {"params": {"type": 2}, "method":"activateCue", "id":"1234", "jsonrpc":"2.0"} //Stop – type 2
* @param {} id
* @param {} type
* @param {} cb
*/
eventmaster.prototype.activateCueById = function (id, type, cb) {
var self = this
return self.query('activateCue', { id: id, type: type }, cb)
}
/**
* @param {} cueName
* @param {} type
* @param {} cb
*/
eventmaster.prototype.activateCueByCueName = function (cueName, type, cb) {
var self = this
return self.query('activateCue', { cueName: cueName, type: type }, cb)
}
/**
* @param {} cueSerialNo
* @param {} type
* @param {} cb
*/
eventmaster.prototype.activateCueByCueSerialNo = function (cueSerialNo, type, cb) {
var self = this
return self.query('activateCue', { cueSerialNo: cueSerialNo, type: type }, cb)
}
/**
listCues
• Definition:
– This API to .
• Requestparams:
• Response:
– : null
– success: (0=success, anything else is an error)
• Example:
– {"params": {"id": 1}, "method":"listCues", "id":"1234", "jsonrpc":"2.0"} //Play – no parame or type 0
– {"params": {"type": 1}, "method":"listCues", "id":"1234", "jsonrpc":"2.0"} //Pause – type 1
– {"params": {"type": 2}, "method":"listCues", "id":"1234", "jsonrpc":"2.0"} //Stop – type 2
* @param {} type
* @param {} cb
*/
eventmaster.prototype.listCues = function (type, cb) {
var self = this
if (type == null) type = 0
return self.query('listCues', { type: type }, cb)
}
/**
activateDestGroup
• Definition
- Recall a DestGroup on the Event Master processor. User can recall DestGroup with id, DestGroup serial number, or DestGroup name.
-
– Send any one of the parameters to recall DestGroup.
• Request params:
– params: {"id": x}
– params: {"destGrpSno": x.y}
– params: {"destGrName": "GroupName"}
o id – Index of the Destination group.
o destGrpSno – Destination group serial number
o destGrName – Destnation group name.
• Response:
– Response: null
– success: (0=success, anything else is an error)
• Example:
– {"params": {"id": 0}, "method":"activateDestGroup", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"destGrpName": "abc" }, "method":"activateDestGroup", "id":"1234", "jsonrpc":"2.0"}
– {"params": {"destGrpSno": 1.00}, "method":"activateDestGroup", "id":"1234", "jsonrpc":"2.0"}
* @param {} id
* @param {} cb
*/
eventmaster.prototype.activateDestGroup = function (id, cb) {
var self = this
return self.query('activateDestGroup', { id: id }, cb)
}
/**
3dControl
• Definition:
– This API provides the option to modify 3d Controls.
• Request:
– params: {“id” : id, "type": x, "syncSource": y, "syncInvert": z}
o id – Index of the input config.
o type – "x" can be: 0 – Type Off. 0 is the default value for the type parameter. 1 – Type Sequentia.
o syncSource – "y" can be: 1 – mini-Din 1, 2 – mini-Din 2, 3 – mini-Din 3, 4 – mini-Din 4. Default value is 1.
o syncInvert – "z" can be: 0 – Type Off. 0 is the default value for the syncInvert. 1 – Type Invert.
o To reset, do not provide any parameter except "id".
• Response:
– response: {"id": 0, "Name": "InSource1", "HSize": 3840, "VSize": 1080, "Src-Type": 0, "InputCfgIndex": -1, "StillIndex": 0, "DestIndex": -1, "UserKeyIndex": -1, "Mode3D": 0, "Freeze": 1, "Capacity": 2, "InputCfgVideoStatus": 4}
– success: (0=success, anything else is an error)
• Example:
– {"params": {"id": 1, "type": 0, "syncSource": 1, "syncInvert": 0}, "method":"3dControl", "id":"1234", "jsonrpc":"2.0"}
* @param {} id
* @param {} type
* @param {} syncSource
* @param {} syncInvert
* @param {} cb
*/
eventmaster.prototype.control3d = function (id, type, syncSource, syncInvert, cb) {
var self = this
return self.query('3dControl', { id: id, type: type, syncSource: syncSource, syncInvert: syncInvert }, cb)
}
/**
listContent
• Definition:
– This API shows the content of a screen destination.
• Request:
– params: {"id": x}
o “id”—Screen destination index.
• Response:
{"jsonrpc":"2.0","result":{"success":0,"response":{"id":0,"Name":"ScreenDest1","IsActive":1,"BGLyr":[{"id":0,"LastBGSourceIndex":-1,"BGShowMatte":1,"BGColor":{"id":0,"Red":0,"Green":0,"Blue":0}},{"id":1,"LastBGSourceIndex":-1,"BGShowMatte":1,"BGColor":{"id":0,"Red":0,"Green":0,"Blue":0}}],"Layers":[{"id":0,"Name":"Layer1-A","LastSrcIdx":-1,"PvwMode":0,"PgmMode":0,"LinkLayerId":0,"LinkDestId":0,"Capacity":1,"PvwZOrder":0,"PgmZOrder":0,"Freeze":0,"ScalingMode":2,"Window":[{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080},{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080}],"Source":[{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080},{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080}],"Mask":[{"id":0,"Top":0,"Left":0,"Right":0,"Bottom":0},{"id":0,"Top":0,"Left":0,"Right":0,"Bottom":0}]},{"id":1,"Name":"Layer1-B","LastSrcIdx":-1,"PvwMode":0,"PgmMode":0,"LinkLayerId":1,"LinkDestId":0,"Capacity":1,"PvwZOrder":0,"PgmZOrder":0,"Freeze":0,"ScalingMode":2,"Window":[{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080},{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080}],"Source":[{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080},{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080}],"Mask":[{"id":0,"Top":0,"Left":0,"Right":0,"Bottom":0},{"id":0,"Top":0,"Left":0,"Right":0,"Bottom":0}]}],"Transition":[{"id":0,"TransTime":30,"TransPos":0,"ArmMode":1},{"id":1,"TransTime":30,"TransPos":0,"ArmMode":0}],"OutputCfg":[{"id":0,"Name":"HDMIOutput1","OutputAOI":[{"id":0,"TestPattern":[{"id":0,"TestPatternMode":0}]}]}]}},"id":"1234"}
o id—index of screen destination.
o Name—Name of Screen Destination.
o BGLyr—Background layer index, Last source index of background.
“id”:0 affects the Background in Program. “id”:1 affects the Background in Preview.
o LastBGSoureIndex—This is –1 if no background is dropped, else this is index of last background dropped on screen destination.
o BGShowMatte—This is if BG to be matte or not.
o BGColor—This is background color.
o Layers—Lists layers on screen destination with its properties.
o Transition—This property of screen destination contains the transition time (from time to move from preview to program).
o LinkLayerId: Link/Global Layer Index
o LinkDestId: Link Destination Index
– success: (0=success, anything else is an error)
• Example:
– {"params": {"id": 0}, "method":"listContent", "id":"1234", "jsonrpc":"2.0"}
* @param {} id
* @param {} cb
*/
eventmaster.prototype.listContent = function (id, cb) {
var self = this
return self.query('listContent', { id: id }, cb)
}
/**
listSuperDestContent
• Definition:
– This API shows the content of a super screen destination.
• Request:
– params: {"id": x}
o “id”—Super/Link Screen destination index.
• Response:
{"jsonrpc":"2.0","result":{"success":0,"response":{"id":0,"Name":"SuperDest1","HDimention":1,"VDimention":1,"HSize":1920,"VSize":1080,"GlobalLayers":2,"DestCollection":[{"id":0,"DestType":1,"DestXmlId":0,"Name":"ScreenDest1"}],"GlobalLayerCollection":{"GlobalLayer":[{"id":0,"Name":"SuperLayer1-A","SuperLayerLinkedState":1,"LinkLayer":[{"LinkLayerXmlId":0,"DestXmlId":0}]},{"id":1,"Name":"SuperLayer1-B","SuperLayerLinkedState":1,"LinkLayer":[{"LinkLayerXmlId":1,"DestXmlId":0}]}]}}},"id":"1234"}
o id—index of super screen destination.
o Name—Name of super Screen Destination.
o HDimention — Horizontal dimension of super screen destination
o VDimention — Vertical dimension of super screen destination
o HSize: Horizontal size of super screen destination
o VSize: Vertical size of super screen destination
o GlobalLayers —Count of global Layer.
o DestCollection —Array of screen destination with index and name of screen destination and destination type.
o GlobalLayerCollection — Array of global layer with information of index, name of link layer.
o SuperLayerLinkedState — State of super/Link Layer.
o LinkLayerXmlId: Link Layer Index
o DestXmlId: Link layer part of screen Destination Index.
– success: (0=success, anything else is an error)
• Example:
– {"params": {"id": 0}, "method":"listSuperDestContent", "id":"1234", "jsonrpc":"2.0"}
* @param {} id
* @param {} cb
*/
eventmaster.prototype.listSuperDestContent = function (id, cb) {
var self = this
return self.query('listSuperDestContent', { id: id }, cb)
}
/**
listSuperAuxContent
• Definition:
– This API shows the content of a super aux destination.
• Request:
– params: {"id": x}
o “id”—Super Aux destination index.
• Response:
{"jsonrpc":"2.0","result":{"success":0,"response":{"id":0,"Name":"SuperAux1","HDimention":2,"VDimention":1,"HSize":3840,"VSize":1080,"AuxDestCollection":[{"id":0,"DestType":0,"DestXmlId":0,"Name":"AuxDest1"},{"id":1,"DestType":0,"DestXmlId":1,"Name":"AuxDest2"}]}},"id":"1234"}
o id—index of super aux destination.
o Name—Name of super aux Destination.
o HDimention — Horizontal dimension of super aux destination
o VDimention — Vertical dimension of super aux destination
o HSize: Horizontal size of super aux destination
o VSize: Vertical size of super aux destination
o AuxDestCollection —Array of aux destination with index and name of aux destination and destination type.
– success: (0=success, anything else is an error)
• Example:
– {"params": {"id": 0}, "method":"listSuperAuxContent", "id":"1234", "jsonrpc":"2.0"}
* @param {} id
* @param {} cb
*/
eventmaster.prototype.listSuperAuxContent = function (id, cb) {
var self = this
return self.query('listSuperAuxContent', { id: id }, cb)
}
/**
changeContent
• Definition:
– This API changes the content of a screen destination by putting background and layers in it.
• Request:
– params: {"id":0, "TestPattern" :5, "BGLyr":[{"id":0,"LastBGSourceIndex":0,"BGShowMatte":0, "BGColor":[{"id":0,"Red":0,"Green":0,"Blue":0}]},{"id":1,"LastBGSourceIndex":0, "BGShowMatte":0,"BGColor":[{"id":0,"Red":0,"Green":0,"Blue":0}]}],"Layers": [{"id":0,"LastSrcIdx":0,"Window":{"HPos":0,"VPos":0,"HSize":400,"VSize":300}, "Source":{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080}, "Mask":{ "Left":0.01, "Right":10.1, "Top":0.0,"Bottom":0.0},"PvwMode":1,"PgmMode":0,"Freeze":0, "PgmZOrder":0,"PvwZOrder":0}]}
o id—Screen destination index.
o BGLyr—Background layer index, Last source index of background.
“id”:0 affects the Background in Program. “id”:1 affects the Background in Preview.
o Layers—Layer information.
o Window—Layer window size.
o Source—Source info and size.
o Mask—Crop the visible part of the layer.
o PvwMode—Set 1 if you want the content in preview. (Default)
o PgmMode—Set 1 if you want the content in program.
o TestPattern – Provide test pattern id
• Response:
– response: null
– success: (0=success, anything else is an error)
• Example:
– {"jsonrpc":"2.0","result":{"success":0,"response":{"id":0,"Name":"ScreenDest1","BGLyr":[{"id":0,"LastBGSourceIndex":-1,"BGShowMatte":1,"BGColor":{"id":0,"Red":0,"Green":0,"Blue":0}},{"id":1,"LastBGSourceIndex":-1,"BGShowMatte":1,"BGColor":{"id":0,"Red":0,"Green":0,"Blue":0}}],"Layers":[{"id":0,"Name":"Layer1-A","LastSrcIdx":1,"PvwMode":1,"PgmMode":0,"Capacity":1,"PvwZOrder":0,"PgmZOrder":0,"Freeze":0,"Window":[{"HPos":514,"VPos":289,"HSize":892,"VSize":502},{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080}],"Source":[{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080},{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080}],"Mask":[{"id":0,"Top":0,"Left":0,"Right":0,"Bottom":0},{"id":0,"Top":0,"Left":0,"Right":0,"Bottom":0}]},{"id":1,"Name":"Layer1-B","LastSrcIdx":-1,"PvwMode":0,"PgmMode":0,"Capacity":1,"PvwZOrder":0,"PgmZOrder":0,"Freeze":0,"Window":[{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080},{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080}],"Source":[{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080},{"HPos":0,"VPos":0,"HSize":1920,"VSize":1080}],"Mask":[{"id":0,"Top":0,"Left":0,"Right":0,"Bottom":0},{"id":0,"Top":0,"Left":0,"Right":0,"Bottom":0}]}],"Transition":[{"id":0,"TransTime":30,"TransPos":0},{"id":1,"TransTime":30,"TransPos":0}],"OutputCfg":[{"id":0,"Name":"Output1","OutputAOI":[{"id":0,"TestPattern":[{"id":0,"TestPatternMode":0}]}]}]}},"id":"1234"}
– {"params":{"id":0, "TestPattern" :5 }, "method":"changeContent", "id":"1234", "jsonrpc":"2.0"}
* @param {} screenDestIndex
* @param {} bgLayer
* @param {} Layers
* @param {} cb
*/
eventmaster.prototype.changeContent = function (screenDestIndex, bgLayer, Layers, cb) {
var self = this
return self.query('changeContent', { id: screenDestIndex, BGLyr: bgLayer, Layers: Layers }, cb)
}
/*
changeSuperDestContent
• Definition:
– This API changes layer parameters for each super layer in all screen destination that are part of a super destination.
• Request:
– Params: {"id":0,"GlobalLayers”: [{"id":0,"Window":{"HPos":0,"VPos":0,"HSize":700,"VSize":300}}]}
o id—Super Screen destination index.
o GlobalLayers — Array of Global Layers with index, H/V position and H/V size.
• Response:
– response: null
– success: (0=success, anything else is an error)
• Example:
– {"params":{"id":0,"GlobalLayers":[{"id":0,"Window":{"HPos":0,"VPos":0,"HSize":700,"VSize":300}}]},
"method":"changeSuperDestContent", "id":"1234", "jsonrpc":"2.0"}
*/
/*
changeSuperAuxContent
• Definition:
– This API changes sources for any aux destination which is part of super aux.
• Request:
– Params: {"id":0,"Destinations”: [{"id":0, "Name": "AuxDest1”, "PvwLastSrcIndex": 0 , "PgmLastSrcIndex":0}]}
o id—Super Aux destination index.
o Destinations — Array of Aux destination with index, Name of aux destination to be renamed, Preview source and Program source to be modified in aux destination.
• Response:
– response: null
– success: (0=success, anything else is an error)
• Example:
– {"params":{"id":0,"Destinations":[{"id":0, "Name": "AuxDest1" , "PvwLastSrcIndex": 0 , "PgmLastSrcIndex":0}]}, "method":"changeSuperAuxContent", "id":"1234", "jsonrpc":"2.0"}
*/
/**
freezeDestSources
• Definition:
– This API Freezes/Unfreezes the sources.
• Request:
– params: {"type": x, "id": y, "screengroup": z ,"mode": 0/1}
o type—type of source.
o 0—Input source.
o 1—Background source.
o 2—ScreenDestination.
o 3—AuxDestination.
– id—Index of the source.
– Screengroup—For future use. Always set to 0.
– Mode—0 : UnFreeze, 1 : Freeze.
• Response:
– response: null
– success: (0=success, anything else is an error)
• Example:
– {"params": {"type": 0, "id": 0, "screengroup": 0 ,"mode": 1}, "method":"freezeDestSource", "id":"1234", "jsonrpc":"2.0"}
* @param {} type
* @param {} id
* @param {} screenGroup
* @param {} mode
* @param {} cb
*/
eventmaster.prototype.freezeDestSource = function (type, id, screenGroup, mode, cb) {
var self = this
return self.query('freezeDestSource', { type: type, id: id, screengroup: screenGroup, mode: mode }, cb)
}
/**
listStill
• Definition:
– This API lists all the stills with properties such as id, Name, H/V size, LockMode, StillState, PngState, File size.
• Request:
– params: {}
• Response:
– response: Array of : [{"id":0,"Name":"StillStore1","LockMode":0,"HSize":{"Min":0,"Max":99999,"$t":1920},"VSize":{"Min":0, "Max":99999,"$t":1080},"StillState":{"Min":0,"Max":4,"$t":3},"PngState":{"Min":0,"Max":2,"$t":0},"FileSize":{"Min":0,"Max":100000,"$t":9331.2}}]
o id—Index of still store.
o Name—Name of still store.
o LockMode—For future use. Always set to 0.
o H/V size—Horizontal and vertical size, Min, max and current value. It shows the current value.