@@ -5,11 +5,34 @@ import {
55 PlayoutActions ,
66} from '@sofie-automation/blueprints-integration'
77import { getHash , protectString , generateTranslation as t } from '../../lib/tempLib'
8+ import { TriggeredActionId } from '@sofie-automation/corelib/dist/dataModel/Ids'
89
910let j = 0
1011
11- export const DEFAULT_CORE_TRIGGERS : IBlueprintTriggeredActions [ ] = [
12- {
12+ export enum IBlueprintDefaultCoreTriggersType {
13+ toggleShelf = 'toggleShelf' ,
14+ activateRundownPlaylist = 'activateRundownPlaylist' ,
15+ activateRundownPlaylistRehearsal = 'activateRundownPlaylistRehearsal' ,
16+ deactivateRundownPlaylist = 'deactivateRundownPlaylist' ,
17+ take = 'take' ,
18+ hold = 'hold' ,
19+ holdUndo = 'holdUndo' ,
20+ resetRundownPlaylist = 'resetRundownPlaylist' ,
21+ disableNextPiece = 'disableNextPiece' ,
22+ disableNextPieceUndo = 'disableNextPieceUndo' ,
23+ createSnapshotForDebug = 'createSnapshotForDebug' ,
24+ moveNextPart = 'moveNextPart' ,
25+ moveNextSegment = 'moveNextSegment' ,
26+ movePreviousPart = 'movePreviousPart' ,
27+ movePreviousSegment = 'movePreviousSegment' ,
28+ goToOnAirLine = 'goToOnAirLine' ,
29+ rewindSegments = 'rewindSegments' ,
30+ }
31+
32+ export type IBlueprintDefaultCoreTriggers = { [ key in IBlueprintDefaultCoreTriggersType ] : IBlueprintTriggeredActions }
33+
34+ export const DEFAULT_CORE_TRIGGERS : IBlueprintDefaultCoreTriggers = {
35+ [ IBlueprintDefaultCoreTriggersType . toggleShelf ] : {
1336 _id : 'core_toggleShelf' ,
1437 actions : {
1538 '0' : {
@@ -32,7 +55,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
3255 _rank : ++ j * 1000 ,
3356 name : t ( 'Toggle Shelf' ) ,
3457 } ,
35- {
58+ [ IBlueprintDefaultCoreTriggersType . activateRundownPlaylist ] : {
3659 _id : 'core_activateRundownPlaylist' ,
3760 actions : {
3861 '0' : {
@@ -55,7 +78,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
5578 _rank : ++ j * 1000 ,
5679 name : t ( 'Activate (On-Air)' ) ,
5780 } ,
58- {
81+ [ IBlueprintDefaultCoreTriggersType . activateRundownPlaylistRehearsal ] : {
5982 _id : 'core_activateRundownPlaylist_rehearsal' ,
6083 actions : {
6184 '0' : {
@@ -78,7 +101,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
78101 _rank : ++ j * 1000 ,
79102 name : t ( 'Activate (Rehearsal)' ) ,
80103 } ,
81- {
104+ [ IBlueprintDefaultCoreTriggersType . deactivateRundownPlaylist ] : {
82105 _id : 'core_deactivateRundownPlaylist' ,
83106 actions : {
84107 '0' : {
@@ -100,7 +123,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
100123 _rank : ++ j * 1000 ,
101124 name : t ( 'Deactivate' ) ,
102125 } ,
103- {
126+ [ IBlueprintDefaultCoreTriggersType . take ] : {
104127 _id : 'core_take' ,
105128 actions : {
106129 '0' : {
@@ -127,7 +150,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
127150 _rank : ++ j * 1000 ,
128151 name : t ( 'Take' ) ,
129152 } ,
130- {
153+ [ IBlueprintDefaultCoreTriggersType . hold ] : {
131154 _id : 'core_hold' ,
132155 actions : {
133156 '0' : {
@@ -149,7 +172,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
149172 _rank : ++ j * 1000 ,
150173 name : t ( 'Hold' ) ,
151174 } ,
152- {
175+ [ IBlueprintDefaultCoreTriggersType . holdUndo ] : {
153176 _id : 'core_hold_undo' ,
154177 actions : {
155178 '0' : {
@@ -172,7 +195,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
172195 _rank : ++ j * 1000 ,
173196 name : t ( 'Undo Hold' ) ,
174197 } ,
175- {
198+ [ IBlueprintDefaultCoreTriggersType . resetRundownPlaylist ] : {
176199 _id : 'core_reset_rundown_playlist' ,
177200 actions : {
178201 '0' : {
@@ -199,7 +222,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
199222 _rank : ++ j * 1000 ,
200223 name : t ( 'Reset Rundown' ) ,
201224 } ,
202- {
225+ [ IBlueprintDefaultCoreTriggersType . disableNextPiece ] : {
203226 _id : 'core_disable_next_piece' ,
204227 actions : {
205228 '0' : {
@@ -221,7 +244,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
221244 _rank : ++ j * 1000 ,
222245 name : t ( 'Disable the next element' ) ,
223246 } ,
224- {
247+ [ IBlueprintDefaultCoreTriggersType . disableNextPieceUndo ] : {
225248 _id : 'core_disable_next_piece_undo' ,
226249 actions : {
227250 '0' : {
@@ -244,7 +267,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
244267 _rank : ++ j * 1000 ,
245268 name : t ( 'Undo Disable the next element' ) ,
246269 } ,
247- {
270+ [ IBlueprintDefaultCoreTriggersType . createSnapshotForDebug ] : {
248271 _id : 'core_create_snapshot_for_debug' ,
249272 actions : {
250273 '0' : {
@@ -266,7 +289,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
266289 _rank : ++ j * 1000 ,
267290 name : t ( 'Store Snapshot' ) ,
268291 } ,
269- {
292+ [ IBlueprintDefaultCoreTriggersType . moveNextPart ] : {
270293 _id : 'core_move_next_part' ,
271294 actions : {
272295 '0' : {
@@ -290,7 +313,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
290313 _rank : ++ j * 1000 ,
291314 name : t ( 'Move Next forwards' ) ,
292315 } ,
293- {
316+ [ IBlueprintDefaultCoreTriggersType . moveNextSegment ] : {
294317 _id : 'core_move_next_segment' ,
295318 actions : {
296319 '0' : {
@@ -314,7 +337,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
314337 _rank : ++ j * 1000 ,
315338 name : t ( 'Move Next to the following segment' ) ,
316339 } ,
317- {
340+ [ IBlueprintDefaultCoreTriggersType . movePreviousPart ] : {
318341 _id : 'core_move_previous_part' ,
319342 actions : {
320343 '0' : {
@@ -338,7 +361,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
338361 _rank : ++ j * 1000 ,
339362 name : t ( 'Move Next backwards' ) ,
340363 } ,
341- {
364+ [ IBlueprintDefaultCoreTriggersType . movePreviousSegment ] : {
342365 _id : 'core_move_previous_segment' ,
343366 actions : {
344367 '0' : {
@@ -362,7 +385,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
362385 _rank : ++ j * 1000 ,
363386 name : t ( 'Move Next to the previous segment' ) ,
364387 } ,
365- {
388+ [ IBlueprintDefaultCoreTriggersType . goToOnAirLine ] : {
366389 _id : 'core_go_to_onAir_line' ,
367390 actions : {
368391 '0' : {
@@ -384,7 +407,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
384407 _rank : ++ j * 1000 ,
385408 name : t ( 'Go to On Air line' ) ,
386409 } ,
387- {
410+ [ IBlueprintDefaultCoreTriggersType . rewindSegments ] : {
388411 _id : 'core_rewind_segments' ,
389412 actions : {
390413 '0' : {
@@ -406,8 +429,8 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintTriggeredActions[] = [
406429 _rank : ++ j * 1000 ,
407430 name : t ( 'Rewind segments to start' ) ,
408431 } ,
409- ]
432+ }
410433
411- export const DEFAULT_CORE_TRIGGER_IDS = DEFAULT_CORE_TRIGGERS . map ( ( triggeredAction ) =>
412- protectString ( getHash ( triggeredAction . _id ) )
434+ export const DEFAULT_CORE_TRIGGER_IDS = Object . values < IBlueprintTriggeredActions > ( DEFAULT_CORE_TRIGGERS ) . map (
435+ ( triggeredAction ) => protectString < TriggeredActionId > ( getHash ( triggeredAction . _id ) )
413436)
0 commit comments