timeline-state-resolver 8.0.0-release48.2 → 8.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (153) hide show
  1. package/CHANGELOG.md +159 -0
  2. package/dist/conductor.d.ts +23 -6
  3. package/dist/conductor.d.ts.map +1 -1
  4. package/dist/conductor.js +148 -94
  5. package/dist/conductor.js.map +1 -1
  6. package/dist/devices/device.d.ts +5 -1
  7. package/dist/devices/device.d.ts.map +1 -1
  8. package/dist/devices/device.js +9 -0
  9. package/dist/devices/device.js.map +1 -1
  10. package/dist/devices/deviceContainer.d.ts +4 -1
  11. package/dist/devices/deviceContainer.d.ts.map +1 -1
  12. package/dist/devices/deviceContainer.js +8 -0
  13. package/dist/devices/deviceContainer.js.map +1 -1
  14. package/dist/devices/doOnTime.d.ts +7 -7
  15. package/dist/devices/doOnTime.d.ts.map +1 -1
  16. package/dist/devices/doOnTime.js +12 -12
  17. package/dist/devices/doOnTime.js.map +1 -1
  18. package/dist/expectedPlayoutItems.d.ts +1 -1
  19. package/dist/expectedPlayoutItems.d.ts.map +1 -1
  20. package/dist/index.js +5 -5
  21. package/dist/index.js.map +1 -1
  22. package/dist/integrations/abstract/index.d.ts +4 -4
  23. package/dist/integrations/abstract/index.d.ts.map +1 -1
  24. package/dist/integrations/abstract/index.js +13 -0
  25. package/dist/integrations/abstract/index.js.map +1 -1
  26. package/dist/integrations/atem/index.d.ts +2 -2
  27. package/dist/integrations/atem/index.d.ts.map +1 -1
  28. package/dist/integrations/atem/index.js +35 -12
  29. package/dist/integrations/atem/index.js.map +1 -1
  30. package/dist/integrations/casparCG/index.d.ts +1 -1
  31. package/dist/integrations/casparCG/index.d.ts.map +1 -1
  32. package/dist/integrations/casparCG/index.js +76 -54
  33. package/dist/integrations/casparCG/index.js.map +1 -1
  34. package/dist/integrations/httpSend/index.d.ts +3 -3
  35. package/dist/integrations/httpSend/index.d.ts.map +1 -1
  36. package/dist/integrations/httpSend/index.js +1 -0
  37. package/dist/integrations/httpSend/index.js.map +1 -1
  38. package/dist/integrations/httpWatcher/index.d.ts +1 -1
  39. package/dist/integrations/httpWatcher/index.d.ts.map +1 -1
  40. package/dist/integrations/hyperdeck/index.d.ts +2 -2
  41. package/dist/integrations/hyperdeck/index.d.ts.map +1 -1
  42. package/dist/integrations/lawo/index.d.ts +5 -6
  43. package/dist/integrations/lawo/index.d.ts.map +1 -1
  44. package/dist/integrations/lawo/index.js +2 -2
  45. package/dist/integrations/lawo/index.js.map +1 -1
  46. package/dist/integrations/multiOsc/deviceConnection.d.ts +31 -0
  47. package/dist/integrations/multiOsc/deviceConnection.d.ts.map +1 -0
  48. package/dist/integrations/multiOsc/deviceConnection.js +79 -0
  49. package/dist/integrations/multiOsc/deviceConnection.js.map +1 -0
  50. package/dist/integrations/multiOsc/index.d.ts +74 -0
  51. package/dist/integrations/multiOsc/index.d.ts.map +1 -0
  52. package/dist/integrations/multiOsc/index.js +226 -0
  53. package/dist/integrations/multiOsc/index.js.map +1 -0
  54. package/dist/integrations/obs/index.d.ts +2 -2
  55. package/dist/integrations/obs/index.d.ts.map +1 -1
  56. package/dist/integrations/osc/index.d.ts +2 -2
  57. package/dist/integrations/osc/index.d.ts.map +1 -1
  58. package/dist/integrations/osc/index.js +3 -1
  59. package/dist/integrations/osc/index.js.map +1 -1
  60. package/dist/integrations/panasonicPTZ/index.d.ts +2 -2
  61. package/dist/integrations/panasonicPTZ/index.d.ts.map +1 -1
  62. package/dist/integrations/pharos/connection.d.ts +2 -2
  63. package/dist/integrations/pharos/connection.d.ts.map +1 -1
  64. package/dist/integrations/pharos/index.d.ts +3 -3
  65. package/dist/integrations/pharos/index.d.ts.map +1 -1
  66. package/dist/integrations/quantel/index.d.ts +1 -1
  67. package/dist/integrations/quantel/index.d.ts.map +1 -1
  68. package/dist/integrations/quantel/types.d.ts +1 -1
  69. package/dist/integrations/quantel/types.d.ts.map +1 -1
  70. package/dist/integrations/shotoku/connection.d.ts +1 -1
  71. package/dist/integrations/shotoku/connection.d.ts.map +1 -1
  72. package/dist/integrations/shotoku/index.d.ts +3 -3
  73. package/dist/integrations/shotoku/index.d.ts.map +1 -1
  74. package/dist/integrations/shotoku/index.js +1 -0
  75. package/dist/integrations/shotoku/index.js.map +1 -1
  76. package/dist/integrations/singularLive/index.d.ts +2 -2
  77. package/dist/integrations/singularLive/index.d.ts.map +1 -1
  78. package/dist/integrations/sisyfos/connection.d.ts +1 -1
  79. package/dist/integrations/sisyfos/connection.d.ts.map +1 -1
  80. package/dist/integrations/sisyfos/connection.js +1 -1
  81. package/dist/integrations/sisyfos/connection.js.map +1 -1
  82. package/dist/integrations/sisyfos/index.d.ts +2 -2
  83. package/dist/integrations/sisyfos/index.d.ts.map +1 -1
  84. package/dist/integrations/sisyfos/index.js +2 -0
  85. package/dist/integrations/sisyfos/index.js.map +1 -1
  86. package/dist/integrations/sofieChef/api.d.ts +2 -2
  87. package/dist/integrations/sofieChef/api.d.ts.map +1 -1
  88. package/dist/integrations/sofieChef/index.d.ts +3 -3
  89. package/dist/integrations/sofieChef/index.d.ts.map +1 -1
  90. package/dist/integrations/tcpSend/index.d.ts +3 -3
  91. package/dist/integrations/tcpSend/index.d.ts.map +1 -1
  92. package/dist/integrations/tricaster/index.d.ts +39 -0
  93. package/dist/integrations/tricaster/index.d.ts.map +1 -0
  94. package/dist/integrations/tricaster/index.js +152 -0
  95. package/dist/integrations/tricaster/index.js.map +1 -0
  96. package/dist/integrations/tricaster/triCasterCommands.d.ts +96 -0
  97. package/dist/integrations/tricaster/triCasterCommands.d.ts.map +1 -0
  98. package/dist/integrations/tricaster/triCasterCommands.js +60 -0
  99. package/dist/integrations/tricaster/triCasterCommands.js.map +1 -0
  100. package/dist/integrations/tricaster/triCasterConnection.d.ts +28 -0
  101. package/dist/integrations/tricaster/triCasterConnection.d.ts.map +1 -0
  102. package/dist/integrations/tricaster/triCasterConnection.js +92 -0
  103. package/dist/integrations/tricaster/triCasterConnection.js.map +1 -0
  104. package/dist/integrations/tricaster/triCasterInfoParser.d.ts +16 -0
  105. package/dist/integrations/tricaster/triCasterInfoParser.d.ts.map +1 -0
  106. package/dist/integrations/tricaster/triCasterInfoParser.js +30 -0
  107. package/dist/integrations/tricaster/triCasterInfoParser.js.map +1 -0
  108. package/dist/integrations/tricaster/triCasterShortcutStateConverter.d.ts +29 -0
  109. package/dist/integrations/tricaster/triCasterShortcutStateConverter.d.ts.map +1 -0
  110. package/dist/integrations/tricaster/triCasterShortcutStateConverter.js +112 -0
  111. package/dist/integrations/tricaster/triCasterShortcutStateConverter.js.map +1 -0
  112. package/dist/integrations/tricaster/triCasterStateDiffer.d.ts +74 -0
  113. package/dist/integrations/tricaster/triCasterStateDiffer.d.ts.map +1 -0
  114. package/dist/integrations/tricaster/triCasterStateDiffer.js +313 -0
  115. package/dist/integrations/tricaster/triCasterStateDiffer.js.map +1 -0
  116. package/dist/integrations/tricaster/triCasterTimelineStateConverter.d.ts +30 -0
  117. package/dist/integrations/tricaster/triCasterTimelineStateConverter.d.ts.map +1 -0
  118. package/dist/integrations/tricaster/triCasterTimelineStateConverter.js +112 -0
  119. package/dist/integrations/tricaster/triCasterTimelineStateConverter.js.map +1 -0
  120. package/dist/integrations/tricaster/types.d.ts +9 -0
  121. package/dist/integrations/tricaster/types.d.ts.map +1 -0
  122. package/dist/integrations/tricaster/types.js +33 -0
  123. package/dist/integrations/tricaster/types.js.map +1 -0
  124. package/dist/integrations/vizMSE/index.d.ts +4 -149
  125. package/dist/integrations/vizMSE/index.d.ts.map +1 -1
  126. package/dist/integrations/vizMSE/index.js +126 -1328
  127. package/dist/integrations/vizMSE/index.js.map +1 -1
  128. package/dist/integrations/vizMSE/types.d.ts +156 -0
  129. package/dist/integrations/vizMSE/types.d.ts.map +1 -0
  130. package/dist/integrations/vizMSE/types.js +35 -0
  131. package/dist/integrations/vizMSE/types.js.map +1 -0
  132. package/dist/integrations/vizMSE/vizEngineTcpSender.d.ts +20 -0
  133. package/dist/integrations/vizMSE/vizEngineTcpSender.d.ts.map +1 -0
  134. package/dist/integrations/vizMSE/vizEngineTcpSender.js +89 -0
  135. package/dist/integrations/vizMSE/vizEngineTcpSender.js.map +1 -0
  136. package/dist/integrations/vizMSE/vizMSEManager.d.ts +198 -0
  137. package/dist/integrations/vizMSE/vizMSEManager.d.ts.map +1 -0
  138. package/dist/integrations/vizMSE/vizMSEManager.js +1126 -0
  139. package/dist/integrations/vizMSE/vizMSEManager.js.map +1 -0
  140. package/dist/integrations/vmix/$schemas/actions.json +46 -0
  141. package/dist/integrations/vmix/connection.d.ts +30 -2
  142. package/dist/integrations/vmix/connection.d.ts.map +1 -1
  143. package/dist/integrations/vmix/connection.js +34 -0
  144. package/dist/integrations/vmix/connection.js.map +1 -1
  145. package/dist/integrations/vmix/index.d.ts +11 -3
  146. package/dist/integrations/vmix/index.d.ts.map +1 -1
  147. package/dist/integrations/vmix/index.js +150 -0
  148. package/dist/integrations/vmix/index.js.map +1 -1
  149. package/dist/lib.d.ts +1 -0
  150. package/dist/lib.d.ts.map +1 -1
  151. package/dist/lib.js +5 -1
  152. package/dist/lib.js.map +1 -1
  153. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -3,6 +3,159 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [8.0.0](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/7.5.1...8.0.0) (2023-10-05)
7
+
8
+
9
+ ### Features
10
+
11
+ * atem audio routing control SOFIE-2512 ([#274](https://github.com/nrkno/tv-automation-state-timeline-resolver/issues/274)) ([de9dfd1](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/de9dfd138452794bd7ad83a2fd1e82d2849abdcd))
12
+
13
+
14
+ ### Bug Fixes
15
+
16
+ * handle some additional cases in casparCG trackedState SOFIE-2359 ([#259](https://github.com/nrkno/tv-automation-state-timeline-resolver/issues/259)) ([810959f](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/810959f06a13caef2e16fb9d90d8d8257ba1620e))
17
+
18
+ ## [8.0.0-release49.0](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/8.0.0-release48.2...8.0.0-release49.0) (2023-03-21)
19
+
20
+ ## [8.0.0-release48.2](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/7.5.0...8.0.0-release48.2) (2023-03-21)
21
+
22
+
23
+ ### Features
24
+
25
+ * SOF-1254 add TriCaster matrix support ([dbb1b26](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/dbb1b26e84a41227e3eca0fae902bf5b57ca5d8e))
26
+ * Vmix preset actions ([8b31294](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/8b3129412f3881ff9db2cd059927e5b5f3ae6caf))
27
+ * **vmix:** add support for ListRemoveAll and ListAdd commands ([4a7240f](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/4a7240f7b2819bb16f263b72d1b06b98e3c40353))
28
+ * **vmix:** add support for starting and stopping VB.NET scripts ([9f2d4ee](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/9f2d4eeeccd9ba0017fc00cfe5df18e3717ea660))
29
+
30
+
31
+ ### Bug Fixes
32
+
33
+ * allow resetting to baseline ([572118b](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/572118b94a2855598848f1daa1575bc3ccc6186a))
34
+ * casparcg doesnt resync state after server restart SOFIE-2156 ([#248](https://github.com/nrkno/tv-automation-state-timeline-resolver/issues/248)) ([13d51dc](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/13d51dca9d0587e20fb78405834adee106ae60b1))
35
+ * ensure that LIST_REMOVE_ALL and LIST_ADD are sent before most other commands ([13bf78a](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/13bf78ad650df861dc1305998dc55e9d779d77ac))
36
+ * pause List inputs before emptying them ([9abc089](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/9abc0895ae02a2dfd387551b9f3a7f495abf6282))
37
+ * properly parse multi-packet vMix TCP API responses ([754adeb](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/754adeb578e18851b6a6f1dd026e11ac12bed702))
38
+ * properly parse multi-packet vMix TCP API responses ([35ba046](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/35ba0464905e29d1f84c2c61327e321250a44e73))
39
+ * reduce amount of `setTimeout` when using `DoInTime` in `BURST` mode ([5123405](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/51234050e12156e08cc0e1a13e28ca17046e7a42))
40
+ * review comments ([cb21206](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/cb2120650f928e1bc7958136318403feb1d493ec))
41
+ * SOF-1254 control only resources that are mapped ([7892669](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/789266983a40cfc52df75fce48cb5dbce4c977f3))
42
+ * SOF-1254 improve types ([0471a7b](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/0471a7bf64f7340e83b5b6f47212003fd2586ca6))
43
+ * SOF-1254 log warning when websocket disconnected ([3d9964a](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/3d9964af7c4352c36e95824dd323cd2fe46717fd))
44
+
45
+ ## [8.0.0-release48.1](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/7.5.0-release47.6...8.0.0-release48.1) (2023-02-14)
46
+
47
+
48
+ ### Features
49
+
50
+ * Emit debug state ([516a512](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/516a51203aa0af8c0a47552ecf9c0c99cd01d0be))
51
+ * multi osc device ([b987680](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/b9876808d44543903e45ab5a1a1a2b85beed4aac))
52
+ * SOF-1135 make `createDevice` and `initDevice` abortable ([70bfef2](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/70bfef20029b8972aeb248a7c2012b5d92fb2ecc))
53
+ * SOF-1254 add TriCaster integration ([06b129e](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/06b129ecec2d87b0caaa22fda36b2b5ef953653e))
54
+
55
+
56
+ ### Bug Fixes
57
+
58
+ * change mocks to be TCP, fix vmixAPI test ([def9a21](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/def9a21719815ec20c99dabd49bfa7c553136cb0))
59
+ * improve data fragmentation handling, logging of unrecognized responses ([96cfe87](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/96cfe87f68d223ea6ef5566a31e2fd7caa9abe2e))
60
+ * multi osc device udp stateless ([af34aa0](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/af34aa023965b2e5e18b54f66478812a2488ecb8))
61
+ * use TCP for vmix api ([3c1d1f6](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/3c1d1f65042772b03e9e8284dda5b4e0feca80d9))
62
+ * **vmix:** improve vmix mock, update tests to use new mock ([265dcf1](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/265dcf1a0f4d05cc6fc549a2783f51a782bc0c26))
63
+
64
+ ## [8.0.0-release48.0](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/3.0.3...8.0.0-release48.0) (2022-12-12)
65
+
66
+ ## [3.0.3](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/3.0.2...3.0.3) (2022-12-05)
67
+
68
+ ## [3.0.2](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/3.0.0...3.0.2) (2022-11-29)
69
+
70
+
71
+ ### ⚠ BREAKING CHANGES
72
+
73
+ * drop support for node 14 (for tsr, tsr-types support remains)
74
+
75
+ ### Miscellaneous Chores
76
+
77
+ * drop support for node 14 (for tsr, tsr-types support remains) ([36c4859](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/36c48597226dd86270b06040c64c7d3518c32e87))
78
+
79
+ ## [3.0.0](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/2.3.1...3.0.0) (2022-11-21)
80
+
81
+
82
+ ### ⚠ BREAKING CHANGES
83
+
84
+ * refactor types to work better with typescript 4.7 (#227)
85
+ * resolve MSE show names to IDs using the directory
86
+
87
+ ### Features
88
+
89
+ * add vizmse actions ([f7e585c](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/f7e585c97e852ab30e9fd6d20077be906038af70))
90
+ * refactor types to work better with typescript 4.7 ([#227](https://github.com/nrkno/tv-automation-state-timeline-resolver/issues/227)) ([abe499c](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/abe499ce1da13c2d7a68333f6b1dcc8c7ea71e97))
91
+ * resolve MSE show names to IDs using the directory ([e094dda](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/e094dda7dbd14b312ff8ffef5d45a39a1e802bcf))
92
+
93
+
94
+ ### Bug Fixes
95
+
96
+ * unable to resolve show ids (bug from previous refactor) ([cdf2c62](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/cdf2c62227517e7a48a7c8c7ae102374167056cd))
97
+
98
+ ## [2.3.1](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/7.5.0-release47.3...2.3.1) (2022-11-11)
99
+
100
+
101
+ ### Features
102
+
103
+ * action manifests ([681d4c8](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/681d4c8a72fb409dba919fd13db17f3c2f168d1a))
104
+ * translations for actions ([df4cb43](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/df4cb43cf16a8e2ae34c1fe44801c5a327f9b01e))
105
+ * update for casparcg-connection rewrite ([5dfdd23](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/5dfdd2320caf89432d36513026c1259e2cf3d366))
106
+
107
+ ## [2.3.0](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/7.5.0-release47.0...2.3.0) (2022-10-28)
108
+
109
+
110
+ ### Features
111
+
112
+ * SOF-1140 handle warnings from v-connection ([a48d313](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/a48d313d20344ebd8a061c625d8ed3491df95465))
113
+
114
+
115
+ ### Bug Fixes
116
+
117
+ * SOF-1140 wrap strings in Errors to avoid mangled logs ([bca62cb](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/bca62cb7d3abd05974e79f5eece079de98a4bacf))
118
+
119
+
120
+
121
+ ## [8.0.0-release49.0](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/8.0.0-release48.2...8.0.0-release49.0) (2023-03-21)
122
+
123
+
124
+ ### ⚠ BREAKING CHANGES
125
+
126
+ * resolve MSE show names to IDs using the directory
127
+
128
+ ### Features
129
+
130
+ * Emit debug state ([516a512](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/516a51203aa0af8c0a47552ecf9c0c99cd01d0be))
131
+ * multi osc device ([b987680](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/b9876808d44543903e45ab5a1a1a2b85beed4aac))
132
+ * resolve MSE show names to IDs using the directory ([e094dda](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/e094dda7dbd14b312ff8ffef5d45a39a1e802bcf))
133
+ * SOF-1135 make `createDevice` and `initDevice` abortable ([70bfef2](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/70bfef20029b8972aeb248a7c2012b5d92fb2ecc))
134
+ * SOF-1140 handle warnings from v-connection ([a48d313](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/a48d313d20344ebd8a061c625d8ed3491df95465))
135
+ * SOF-1254 add TriCaster integration ([06b129e](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/06b129ecec2d87b0caaa22fda36b2b5ef953653e))
136
+ * SOF-1254 add TriCaster matrix support ([dbb1b26](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/dbb1b26e84a41227e3eca0fae902bf5b57ca5d8e))
137
+ * Vmix preset actions ([8b31294](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/8b3129412f3881ff9db2cd059927e5b5f3ae6caf))
138
+ * **vmix:** add support for ListRemoveAll and ListAdd commands ([4a7240f](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/4a7240f7b2819bb16f263b72d1b06b98e3c40353))
139
+ * **vmix:** add support for starting and stopping VB.NET scripts ([9f2d4ee](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/9f2d4eeeccd9ba0017fc00cfe5df18e3717ea660))
140
+
141
+
142
+ ### Bug Fixes
143
+
144
+ * allow resetting to baseline ([572118b](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/572118b94a2855598848f1daa1575bc3ccc6186a))
145
+ * ensure that LIST_REMOVE_ALL and LIST_ADD are sent before most other commands ([13bf78a](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/13bf78ad650df861dc1305998dc55e9d779d77ac))
146
+ * multi osc device udp stateless ([af34aa0](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/af34aa023965b2e5e18b54f66478812a2488ecb8))
147
+ * pause List inputs before emptying them ([9abc089](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/9abc0895ae02a2dfd387551b9f3a7f495abf6282))
148
+ * properly parse multi-packet vMix TCP API responses ([35ba046](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/35ba0464905e29d1f84c2c61327e321250a44e73))
149
+ * reduce amount of `setTimeout` when using `DoInTime` in `BURST` mode ([5123405](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/51234050e12156e08cc0e1a13e28ca17046e7a42))
150
+ * review comments ([cb21206](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/cb2120650f928e1bc7958136318403feb1d493ec))
151
+ * SOF-1140 wrap strings in Errors to avoid mangled logs ([bca62cb](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/bca62cb7d3abd05974e79f5eece079de98a4bacf))
152
+ * SOF-1254 control only resources that are mapped ([7892669](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/789266983a40cfc52df75fce48cb5dbce4c977f3))
153
+ * SOF-1254 improve types ([0471a7b](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/0471a7bf64f7340e83b5b6f47212003fd2586ca6))
154
+ * SOF-1254 log warning when websocket disconnected ([3d9964a](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/3d9964af7c4352c36e95824dd323cd2fe46717fd))
155
+ * unable to resolve show ids (bug from previous refactor) ([cdf2c62](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/cdf2c62227517e7a48a7c8c7ae102374167056cd))
156
+
157
+
158
+
6
159
  # [8.0.0-release48.2](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/7.5.0...8.0.0-release48.2) (2023-03-21)
7
160
 
8
161
 
@@ -86,7 +239,13 @@ See [Conventional Commits](https://conventionalcommits.org) for commit guideline
86
239
 
87
240
 
88
241
 
242
+ ## [7.5.1](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/7.5.0...7.5.1) (2023-09-04)
243
+
244
+ ### Bug Fixes
89
245
 
246
+ * casparcg disconnect handler may not fire ([74c1f8a](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/74c1f8ac6626bdc9c7ac2bb2737550306905f4b1))
247
+ * **sisyfos:** remove local port & terminate correctly ([c11801a](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/c11801a1f787e3fbd965416138e973c3c940d1b7))
248
+ * terminate devices fully ([028167a](https://github.com/nrkno/tv-automation-state-timeline-resolver/commit/028167ae7dbc1e2cb5f70820554068d434bed75d))
90
249
 
91
250
  # [7.5.0](https://github.com/nrkno/tv-automation-state-timeline-resolver/compare/7.5.0-release47.7...7.5.0) (2023-02-28)
92
251
 
@@ -1,6 +1,7 @@
1
+ /// <reference types="node" />
1
2
  import { EventEmitter } from 'eventemitter3';
2
3
  import { MemUsageReport } from 'threadedclass';
3
- import { Mappings, DeviceOptionsBase, Datastore, DeviceOptionsTelemetrics, TSRTimeline } from 'timeline-state-resolver-types';
4
+ import { Mappings, DeviceOptionsBase, Datastore, DeviceOptionsTelemetrics, TSRTimeline, DeviceOptionsMultiOSC } from 'timeline-state-resolver-types';
4
5
  import { FinishedTrace } from './lib';
5
6
  import { CommandWithContext } from './devices/device';
6
7
  import { DeviceContainer } from './devices/deviceContainer';
@@ -23,13 +24,15 @@ import { DeviceOptionsOBSInternal } from './integrations/obs';
23
24
  import { DeviceOptionsVizMSEInternal } from './integrations/vizMSE';
24
25
  import { DeviceOptionsShotokuInternal } from './integrations/shotoku';
25
26
  import { DeviceOptionsSofieChefInternal } from './integrations/sofieChef';
27
+ import { DeviceOptionsTriCasterInternal } from './integrations/tricaster';
28
+ import { DeviceOptionsMultiOSCInternal } from './integrations/multiOsc';
26
29
  export { DeviceContainer };
27
30
  export { CommandWithContext };
28
31
  export declare const LOOKAHEADTIME = 5000;
29
32
  export declare const PREPARETIME = 2000;
30
33
  export declare const MINTRIGGERTIME = 10;
31
34
  export declare const MINTIMEUNIT = 1;
32
- export declare type TimelineTriggerTimeResult = Array<{
35
+ export type TimelineTriggerTimeResult = Array<{
33
36
  id: string;
34
37
  time: number;
35
38
  }>;
@@ -56,9 +59,10 @@ export interface StatReport {
56
59
  timelineSizeOld: number;
57
60
  estimatedResolveTime: number;
58
61
  }
59
- export declare type ConductorEvents = {
62
+ export type ConductorEvents = {
60
63
  error: [...args: any[]];
61
64
  debug: [...args: any[]];
65
+ debugState: [...args: any[]];
62
66
  info: [...args: any[]];
63
67
  warning: [...args: any[]];
64
68
  setTimelineTriggerTime: [r: TimelineTriggerTimeResult];
@@ -67,6 +71,9 @@ export declare type ConductorEvents = {
67
71
  statReport: [report: StatReport];
68
72
  timeTrace: [trace: FinishedTrace];
69
73
  };
74
+ export declare class AbortError extends Error {
75
+ name: string;
76
+ }
70
77
  /**
71
78
  * The Conductor class serves as the main class for interacting. It contains
72
79
  * methods for setting mappings, timelines and adding/removing devices. It keeps
@@ -142,16 +149,26 @@ export declare class Conductor extends EventEmitter<ConductorEvents> {
142
149
  * Creates an uninitialised device that can be referenced by the timeline and mappings.
143
150
  * @param deviceId Id used by the mappings to reference the device.
144
151
  * @param deviceOptions The options used to initalize the device
152
+ * @param options Additional options
145
153
  * @returns A promise that resolves with the created device, or rejects with an error message.
146
154
  */
147
- createDevice(deviceId: string, deviceOptions: DeviceOptionsAnyInternal): Promise<DeviceContainer<DeviceOptionsBase<any>>>;
155
+ createDevice(deviceId: string, deviceOptions: DeviceOptionsAnyInternal, options?: {
156
+ signal?: AbortSignal;
157
+ }): Promise<DeviceContainer<DeviceOptionsBase<any>>>;
158
+ private throwIfAborted;
159
+ private createDeviceContainer;
160
+ private terminateUnwantedDevice;
148
161
  /**
149
162
  * Initialises an existing device that can be referenced by the timeline and mappings.
150
163
  * @param deviceId Id used by the mappings to reference the device.
151
164
  * @param deviceOptions The options used to initalize the device
165
+ * @param activeRundownPlaylistId Id of the current rundown playlist
166
+ * @param options Additional options
152
167
  * @returns A promise that resolves with the initialised device, or rejects with an error message.
153
168
  */
154
- initDevice(deviceId: string, deviceOptions: DeviceOptionsAnyInternal, activeRundownPlaylistId?: string): Promise<DeviceContainer<DeviceOptionsBase<any>>>;
169
+ initDevice(deviceId: string, deviceOptions: DeviceOptionsAnyInternal, activeRundownPlaylistId?: string, options?: {
170
+ signal?: AbortSignal;
171
+ }): Promise<DeviceContainer<DeviceOptionsBase<any>>>;
155
172
  /**
156
173
  * Safely remove a device
157
174
  * @param deviceId The id of the device to be removed
@@ -215,5 +232,5 @@ export declare class Conductor extends EventEmitter<ConductorEvents> {
215
232
  */
216
233
  private emitWhenActive;
217
234
  }
218
- export declare type DeviceOptionsAnyInternal = DeviceOptionsAbstractInternal | DeviceOptionsCasparCGInternal | DeviceOptionsAtemInternal | DeviceOptionsLawoInternal | DeviceOptionsHTTPSendInternal | DeviceOptionsHTTPWatcherInternal | DeviceOptionsPanasonicPTZInternal | DeviceOptionsTCPSendInternal | DeviceOptionsHyperdeckInternal | DeviceOptionsPharosInternal | DeviceOptionsOBSInternal | DeviceOptionsOSCInternal | DeviceOptionsSisyfosInternal | DeviceOptionsSofieChefInternal | DeviceOptionsQuantelInternal | DeviceOptionsSingularLiveInternal | DeviceOptionsVMixInternal | DeviceOptionsShotokuInternal | DeviceOptionsVizMSEInternal | DeviceOptionsTelemetrics;
235
+ export type DeviceOptionsAnyInternal = DeviceOptionsAbstractInternal | DeviceOptionsCasparCGInternal | DeviceOptionsAtemInternal | DeviceOptionsLawoInternal | DeviceOptionsHTTPSendInternal | DeviceOptionsHTTPWatcherInternal | DeviceOptionsPanasonicPTZInternal | DeviceOptionsTCPSendInternal | DeviceOptionsHyperdeckInternal | DeviceOptionsPharosInternal | DeviceOptionsOBSInternal | DeviceOptionsOSCInternal | DeviceOptionsMultiOSCInternal | DeviceOptionsSisyfosInternal | DeviceOptionsSofieChefInternal | DeviceOptionsQuantelInternal | DeviceOptionsSingularLiveInternal | DeviceOptionsVMixInternal | DeviceOptionsShotokuInternal | DeviceOptionsVizMSEInternal | DeviceOptionsTelemetrics | DeviceOptionsTriCasterInternal | DeviceOptionsMultiOSC;
219
236
  //# sourceMappingURL=conductor.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"conductor.d.ts","sourceRoot":"","sources":["../src/conductor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,MAAM,eAAe,CAAA;AAC5C,OAAO,EAAE,cAAc,EAA2E,MAAM,eAAe,CAAA;AAKvH,OAAO,EACN,QAAQ,EAIR,iBAAiB,EACjB,SAAS,EACT,wBAAwB,EAExB,WAAW,EAIX,MAAM,+BAA+B,CAAA;AAItC,OAAO,EAAoC,aAAa,EAAc,MAAM,OAAO,CAAA;AAEnF,OAAO,EAAE,kBAAkB,EAAgB,MAAM,kBAAkB,CAAA;AACnE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAE3D,OAAO,EAAkB,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AACvF,OAAO,EAAkB,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AACvF,OAAO,EAAkB,6BAA6B,EAAE,MAAM,yBAAyB,CAAA;AACvF,OAAO,EAAc,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC3E,OAAO,EAAc,yBAAyB,EAAE,MAAM,qBAAqB,CAAA;AAC3E,OAAO,EAAsB,iCAAiC,EAAE,MAAM,6BAA6B,CAAA;AACnG,OAAO,EAAmB,8BAA8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GED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Conductor = exports.Device = exports.MINTIMEUNIT = exports.MINTRIGGERTIME = exports.PREPARETIME = exports.LOOKAHEADTIME = exports.DeviceContainer = void 0;
3
+ exports.Conductor = exports.AbortError = exports.Device = exports.MINTIMEUNIT = exports.MINTRIGGERTIME = exports.PREPARETIME = exports.LOOKAHEADTIME = exports.DeviceContainer = void 0;
4
4
  const _ = require("underscore");
5
5
  const superfly_timeline_1 = require("superfly-timeline");
6
6
  const eventemitter3_1 = require("eventemitter3");
@@ -24,6 +24,13 @@ var device_1 = require("./devices/device");
24
24
  Object.defineProperty(exports, "Device", { enumerable: true, get: function () { return device_1.Device; } });
25
25
  const CALLBACK_WAIT_TIME = 50;
26
26
  const REMOVE_TIMEOUT = 5000;
27
+ class AbortError extends Error {
28
+ constructor() {
29
+ super(...arguments);
30
+ this.name = 'AbortError';
31
+ }
32
+ }
33
+ exports.AbortError = AbortError;
27
34
  /**
28
35
  * The Conductor class serves as the main class for interacting. It contains
29
36
  * methods for setting mappings, timelines and adding/removing devices. It keeps
@@ -210,27 +217,25 @@ class Conductor extends eventemitter3_1.EventEmitter {
210
217
  const onDeviceDebug = (...args) => {
211
218
  this.emit('debug', instanceId, ...args);
212
219
  };
220
+ const onDeviceDebugState = (...args) => {
221
+ this.emit('debugState', args);
222
+ };
213
223
  newDevice.device.on('info', onDeviceInfo).catch(console.error);
214
224
  newDevice.device.on('warning', onDeviceWarning).catch(console.error);
215
225
  newDevice.device.on('error', onDeviceError).catch(console.error);
216
226
  newDevice.device.on('debug', onDeviceDebug).catch(console.error);
227
+ newDevice.device.on('debugState', onDeviceDebugState).catch(console.error);
217
228
  const device = await this.initDevice(deviceId, deviceOptions, activeRundownPlaylistId);
218
229
  // Remove listeners, expect consumer to subscribe to them now.
219
230
  newDevice.device.removeListener('info', onDeviceInfo).catch(console.error);
220
231
  newDevice.device.removeListener('warning', onDeviceWarning).catch(console.error);
221
232
  newDevice.device.removeListener('error', onDeviceError).catch(console.error);
222
233
  newDevice.device.removeListener('debug', onDeviceDebug).catch(console.error);
234
+ newDevice.device.removeListener('debugState', onDeviceDebugState).catch(console.error);
223
235
  return device;
224
236
  }
225
237
  catch (e) {
226
- if (newDevice) {
227
- try {
228
- await newDevice.terminate();
229
- }
230
- catch (e) {
231
- this.emit('error', `Cleanup failed of aborted device "${newDevice.deviceId}": ${e}`);
232
- }
233
- }
238
+ await this.terminateUnwantedDevice(newDevice);
234
239
  this.devices.delete(deviceId);
235
240
  this.emit('error', 'conductor.addDevice', e);
236
241
  return Promise.reject(e);
@@ -240,14 +245,17 @@ class Conductor extends eventemitter3_1.EventEmitter {
240
245
  * Creates an uninitialised device that can be referenced by the timeline and mappings.
241
246
  * @param deviceId Id used by the mappings to reference the device.
242
247
  * @param deviceOptions The options used to initalize the device
248
+ * @param options Additional options
243
249
  * @returns A promise that resolves with the created device, or rejects with an error message.
244
250
  */
245
- async createDevice(deviceId, deviceOptions) {
251
+ async createDevice(deviceId, deviceOptions, options) {
246
252
  let newDevice;
253
+ const throwIfAborted = () => this.throwIfAborted(options?.signal, deviceId, 'creation');
247
254
  try {
248
255
  if (this.devices.has(deviceId)) {
249
256
  throw new Error(`Device "${deviceId}" already exists when creating device`);
250
257
  }
258
+ throwIfAborted();
251
259
  const threadedClassOptions = {
252
260
  threadUsage: deviceOptions.threadUsage || 1,
253
261
  autoRestart: false,
@@ -258,79 +266,22 @@ class Conductor extends eventemitter3_1.EventEmitter {
258
266
  const getCurrentTime = () => {
259
267
  return this.getCurrentTime();
260
268
  };
261
- if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.ABSTRACT) {
262
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/abstract/index.js', 'AbstractDevice', deviceId, deviceOptions, getCurrentTime, {
263
- ...threadedClassOptions,
264
- threadUsage: deviceOptions.isMultiThreaded ? 0.1 : 0,
265
- });
266
- }
267
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.CASPARCG) {
268
- // Add CasparCG device:
269
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/casparCG/index.js', 'CasparCGDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
270
- }
271
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.ATEM) {
272
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/atem/index.js', 'AtemDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
273
- }
274
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.HTTPSEND) {
275
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/httpSend/index.js', 'HTTPSendDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
276
- }
277
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.HTTPWATCHER) {
278
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/httpWatcher/index.js', 'HTTPWatcherDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
279
- }
280
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.LAWO) {
281
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/lawo/index.js', 'LawoDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
282
- }
283
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.TCPSEND) {
284
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/tcpSend/index.js', 'TCPSendDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
285
- }
286
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.PANASONIC_PTZ) {
287
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/panasonicPTZ/index.js', 'PanasonicPtzDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
288
- }
289
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.HYPERDECK) {
290
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/hyperdeck/index.js', 'HyperdeckDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
291
- }
292
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.PHAROS) {
293
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/pharos/index.js', 'PharosDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
294
- }
295
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.OSC) {
296
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/osc/index.js', 'OSCMessageDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
297
- }
298
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.QUANTEL) {
299
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/quantel/index.js', 'QuantelDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
300
- }
301
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.SHOTOKU) {
302
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/shotoku/index.js', 'ShotokuDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
303
- }
304
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.SISYFOS) {
305
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/sisyfos/index.js', 'SisyfosMessageDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
306
- }
307
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.VIZMSE) {
308
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/vizMSE/index.js', 'VizMSEDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
309
- }
310
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.SINGULAR_LIVE) {
311
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/singularLive/index.js', 'SingularLiveDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
312
- }
313
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.VMIX) {
314
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/vmix/index.js', 'VMixDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
315
- }
316
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.OBS) {
317
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/obs/index.js', 'OBSDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
318
- }
319
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.SOFIE_CHEF) {
320
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/sofieChef/index.js', 'SofieChefDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
321
- }
322
- else if (deviceOptions.type === timeline_state_resolver_types_1.DeviceType.TELEMETRICS) {
323
- newDevice = await deviceContainer_1.DeviceContainer.create('../../dist/integrations/telemetrics/index.js', 'TelemetricsDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
324
- }
325
- else {
326
- // @ts-ignore deviceOptions.type is of type "never"
269
+ const newDevicePromise = this.createDeviceContainer(deviceOptions, deviceId, getCurrentTime, threadedClassOptions);
270
+ if (!newDevicePromise) {
327
271
  const type = deviceOptions.type;
328
272
  return Promise.reject(`No matching device type for "${type}" ("${timeline_state_resolver_types_1.DeviceType[type]}") found in conductor`);
329
273
  }
330
- if (!newDevice) {
331
- const type = deviceOptions.type;
332
- return Promise.reject(`No device could be created for "${type}" ("${timeline_state_resolver_types_1.DeviceType[type]}")`);
333
- }
274
+ newDevice = await makeImmediatelyAbortable(async () => {
275
+ throwIfAborted();
276
+ const newDevice = await newDevicePromise;
277
+ if (options?.signal?.aborted) {
278
+ // if the promise above did not resolve before aborted,
279
+ // this executes some time after raceAbortable rejects, serving as a cleanup
280
+ await this.terminateUnwantedDevice(newDevice);
281
+ throw new AbortError(`Device "${deviceId}" creation aborted`);
282
+ }
283
+ return newDevice;
284
+ }, options?.signal);
334
285
  newDevice.device.on('resetResolver', () => this.resetResolver()).catch(console.error);
335
286
  newDevice.on('error', (context, e) => {
336
287
  this.emit('error', `deviceContainer for "${newDevice?.deviceId}" emitted an error: ${context}, ${e}`);
@@ -339,30 +290,92 @@ class Conductor extends eventemitter3_1.EventEmitter {
339
290
  if (this.devices.has(deviceId)) {
340
291
  throw new Error(`Device "${deviceId}" already exists when creating device`);
341
292
  }
293
+ throwIfAborted();
342
294
  this.devices.set(deviceId, newDevice);
343
295
  return newDevice;
344
296
  }
345
297
  catch (e) {
346
- if (newDevice) {
347
- try {
348
- await newDevice.terminate();
349
- }
350
- catch (e) {
351
- this.emit('error', `Cleanup failed of aborted device "${newDevice.deviceId}": ${e}`);
352
- }
353
- }
298
+ await this.terminateUnwantedDevice(newDevice);
354
299
  this.devices.delete(deviceId);
355
300
  this.emit('error', 'conductor.createDevice', e);
356
301
  return Promise.reject(e);
357
302
  }
358
303
  }
304
+ throwIfAborted(signal, deviceId, action) {
305
+ if (signal?.aborted) {
306
+ throw new AbortError(`Device "${deviceId}" ${action} aborted`);
307
+ }
308
+ }
309
+ createDeviceContainer(deviceOptions, deviceId, getCurrentTime, threadedClassOptions) {
310
+ switch (deviceOptions.type) {
311
+ case timeline_state_resolver_types_1.DeviceType.ABSTRACT:
312
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/abstract/index.js', 'AbstractDevice', deviceId, deviceOptions, getCurrentTime, {
313
+ ...threadedClassOptions,
314
+ threadUsage: deviceOptions.isMultiThreaded ? 0.1 : 0,
315
+ });
316
+ case timeline_state_resolver_types_1.DeviceType.CASPARCG:
317
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/casparCG/index.js', 'CasparCGDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
318
+ case timeline_state_resolver_types_1.DeviceType.ATEM:
319
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/atem/index.js', 'AtemDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
320
+ case timeline_state_resolver_types_1.DeviceType.HTTPSEND:
321
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/httpSend/index.js', 'HTTPSendDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
322
+ case timeline_state_resolver_types_1.DeviceType.HTTPWATCHER:
323
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/httpWatcher/index.js', 'HTTPWatcherDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
324
+ case timeline_state_resolver_types_1.DeviceType.LAWO:
325
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/lawo/index.js', 'LawoDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
326
+ case timeline_state_resolver_types_1.DeviceType.TCPSEND:
327
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/tcpSend/index.js', 'TCPSendDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
328
+ case timeline_state_resolver_types_1.DeviceType.PANASONIC_PTZ:
329
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/panasonicPTZ/index.js', 'PanasonicPtzDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
330
+ case timeline_state_resolver_types_1.DeviceType.HYPERDECK:
331
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/hyperdeck/index.js', 'HyperdeckDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
332
+ case timeline_state_resolver_types_1.DeviceType.PHAROS:
333
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/pharos/index.js', 'PharosDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
334
+ case timeline_state_resolver_types_1.DeviceType.OSC:
335
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/osc/index.js', 'OSCMessageDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
336
+ case timeline_state_resolver_types_1.DeviceType.QUANTEL:
337
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/quantel/index.js', 'QuantelDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
338
+ case timeline_state_resolver_types_1.DeviceType.SHOTOKU:
339
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/shotoku/index.js', 'ShotokuDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
340
+ case timeline_state_resolver_types_1.DeviceType.SISYFOS:
341
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/sisyfos/index.js', 'SisyfosMessageDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
342
+ case timeline_state_resolver_types_1.DeviceType.VIZMSE:
343
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/vizMSE/index.js', 'VizMSEDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
344
+ case timeline_state_resolver_types_1.DeviceType.SINGULAR_LIVE:
345
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/singularLive/index.js', 'SingularLiveDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
346
+ case timeline_state_resolver_types_1.DeviceType.VMIX:
347
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/vmix/index.js', 'VMixDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
348
+ case timeline_state_resolver_types_1.DeviceType.OBS:
349
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/obs/index.js', 'OBSDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
350
+ case timeline_state_resolver_types_1.DeviceType.TELEMETRICS:
351
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/telemetrics/index.js', 'TelemetricsDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
352
+ case timeline_state_resolver_types_1.DeviceType.SOFIE_CHEF:
353
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/sofieChef/index.js', 'SofieChefDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
354
+ case timeline_state_resolver_types_1.DeviceType.TRICASTER:
355
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/tricaster/index.js', 'TriCasterDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
356
+ case timeline_state_resolver_types_1.DeviceType.MULTI_OSC:
357
+ return deviceContainer_1.DeviceContainer.create('../../dist/integrations/multiOsc/index.js', 'MultiOSCMessageDevice', deviceId, deviceOptions, getCurrentTime, threadedClassOptions);
358
+ default:
359
+ (0, lib_1.assertNever)(deviceOptions);
360
+ return null;
361
+ }
362
+ }
363
+ async terminateUnwantedDevice(newDevice) {
364
+ await newDevice
365
+ ?.terminate()
366
+ .catch((e) => this.emit('error', `Cleanup failed of aborted device "${newDevice.deviceId}": ${e}`));
367
+ }
359
368
  /**
360
369
  * Initialises an existing device that can be referenced by the timeline and mappings.
361
370
  * @param deviceId Id used by the mappings to reference the device.
362
371
  * @param deviceOptions The options used to initalize the device
372
+ * @param activeRundownPlaylistId Id of the current rundown playlist
373
+ * @param options Additional options
363
374
  * @returns A promise that resolves with the initialised device, or rejects with an error message.
364
375
  */
365
- async initDevice(deviceId, deviceOptions, activeRundownPlaylistId) {
376
+ async initDevice(deviceId, deviceOptions, activeRundownPlaylistId, options) {
377
+ const throwIfAborted = () => this.throwIfAborted(options?.signal, deviceId, 'initialisation');
378
+ throwIfAborted();
366
379
  const newDevice = this.devices.get(deviceId);
367
380
  if (!newDevice) {
368
381
  throw new Error('Could not find device ' + deviceId + ', has it been created?');
@@ -371,10 +384,15 @@ class Conductor extends eventemitter3_1.EventEmitter {
371
384
  throw new Error('Device ' + deviceId + ' is already initialized!');
372
385
  }
373
386
  this.emit('info', `Initializing device ${newDevice.deviceId} (${newDevice.instanceId}) of type ${timeline_state_resolver_types_1.DeviceType[deviceOptions.type]}...`);
374
- await newDevice.init(deviceOptions.options, activeRundownPlaylistId);
375
- await newDevice.reloadProps(); // because the device name might have changed after init
376
- this.emit('info', `Device ${newDevice.deviceId} (${newDevice.instanceId}) initialized!`);
377
- return newDevice;
387
+ return makeImmediatelyAbortable(async () => {
388
+ throwIfAborted();
389
+ await newDevice.init(deviceOptions.options, activeRundownPlaylistId);
390
+ throwIfAborted();
391
+ await newDevice.reloadProps();
392
+ throwIfAborted();
393
+ this.emit('info', `Device ${newDevice.deviceId} (${newDevice.instanceId}) initialized!`);
394
+ return newDevice;
395
+ }, options?.signal);
378
396
  }
379
397
  /**
380
398
  * Safely remove a device
@@ -391,7 +409,7 @@ class Conductor extends eventemitter3_1.EventEmitter {
391
409
  }
392
410
  catch (e) {
393
411
  // An error while terminating is probably not that important, since we'll kill the instance anyway
394
- this.emit('warning', 'Error when terminating device', e);
412
+ this.emit('warning', `Error when terminating device ${e}`);
395
413
  }
396
414
  await device.terminate();
397
415
  this.devices.delete(deviceId);
@@ -1056,4 +1074,40 @@ function removeParentFromState(o) {
1056
1074
  }
1057
1075
  return o;
1058
1076
  }
1077
+ /**
1078
+ * If aborted, rejects as soon as possible, but lets the wraped function safely resolve or reject on its own
1079
+ * @param func async function to wrap
1080
+ * @param abortSignal the AbortSignal
1081
+ * @returns Promise of the same type as `func`
1082
+ */
1083
+ async function makeImmediatelyAbortable(func, abortSignal) {
1084
+ const mainPromise = func(abortSignal);
1085
+ if (!abortSignal) {
1086
+ return mainPromise;
1087
+ }
1088
+ let resolveAbortPromise;
1089
+ const abortPromise = new Promise((resolve, reject) => {
1090
+ resolveAbortPromise = () => {
1091
+ resolve();
1092
+ // @ts-expect-error removeEventListener is missing in @types/node until 16.x
1093
+ abortSignal.removeEventListener('abort', rejectPromise);
1094
+ };
1095
+ const rejectPromise = () => {
1096
+ reject(new AbortError());
1097
+ };
1098
+ // @ts-expect-error addEventListener is missing in @types/node until 16.x
1099
+ abortSignal.addEventListener('abort', rejectPromise, { once: true });
1100
+ });
1101
+ return Promise.race([mainPromise, abortPromise])
1102
+ .then((result) => {
1103
+ // only mainPromise could have resolved, so the result must be T
1104
+ resolveAbortPromise();
1105
+ return result;
1106
+ })
1107
+ .catch((reason) => {
1108
+ // mainPromise or abortPromise might have rejected; calling resolveAbortPromise in the latter case is safe
1109
+ resolveAbortPromise();
1110
+ throw reason;
1111
+ });
1112
+ }
1059
1113
  //# sourceMappingURL=conductor.js.map