@@ -5,15 +5,17 @@ import { PreviewPopUpContent } from './PreviewPopUpContent'
5
5
import {
6
6
JSONBlobParse ,
7
7
NoraPayload ,
8
+ PieceLifespan ,
8
9
PreviewType ,
9
10
ScriptContent ,
10
11
SourceLayerType ,
11
12
SplitsContent ,
12
13
SplitsContentBoxContent ,
13
14
SplitsContentBoxProperties ,
15
+ TransitionContent ,
14
16
VTContent ,
15
17
} from '@sofie-automation/blueprints-integration'
16
- import { ReadonlyObjectDeep } from 'type-fest/source/readonly-deep'
18
+ import { ReadonlyDeep , ReadonlyObjectDeep } from 'type-fest/source/readonly-deep'
17
19
import { PieceContentStatusObj } from '@sofie-automation/meteor-lib/dist/api/pieceContentStatus'
18
20
import { ITranslatableMessage } from '@sofie-automation/corelib/dist/TranslatableMessage'
19
21
import _ from 'underscore'
@@ -28,7 +30,8 @@ type VirtualElement = {
28
30
export function convertSourceLayerItemToPreview (
29
31
sourceLayerType : SourceLayerType | undefined ,
30
32
item : ReadonlyObjectDeep < PieceInstancePiece > | IAdLibListItem ,
31
- contentStatus ?: ReadonlyObjectDeep < PieceContentStatusObj >
33
+ contentStatus ?: ReadonlyObjectDeep < PieceContentStatusObj > ,
34
+ timeAsRendered ?: { in ?: number | null ; dur ?: number | null }
32
35
) : PreviewContent [ ] {
33
36
// first try to read the popup preview
34
37
if ( item . content . popUpPreview ) {
@@ -79,6 +82,14 @@ export function convertSourceLayerItemToPreview(
79
82
type : 'data' ,
80
83
content : [ ...popupPreview . preview . entries ] ,
81
84
} )
85
+ if ( popupPreview . preview . displayTiming ) {
86
+ contents . push ( {
87
+ type : 'timing' ,
88
+ timeAsRendered,
89
+ enable : 'enable' in item ? item . enable : undefined ,
90
+ lifespan : item . lifespan ,
91
+ } )
92
+ }
82
93
break
83
94
case PreviewType . VT :
84
95
if ( contentStatus ?. previewUrl ) {
@@ -194,7 +205,13 @@ export function convertSourceLayerItemToPreview(
194
205
type : 'title' ,
195
206
content : item . name ,
196
207
} ,
197
- // todo - item inpoint and duration
208
+ // note - this may have contained some NORA data before but idk the details on how to add that back
209
+ {
210
+ type : 'timing' ,
211
+ timeAsRendered,
212
+ enable : 'enable' in item ? item . enable : undefined ,
213
+ lifespan : item . lifespan ,
214
+ } ,
198
215
]
199
216
} else if ( sourceLayerType === SourceLayerType . SCRIPT ) {
200
217
const content = item . content as ScriptContent
@@ -210,6 +227,9 @@ export function convertSourceLayerItemToPreview(
210
227
} else if ( sourceLayerType === SourceLayerType . SPLITS ) {
211
228
const content = item . content as SplitsContent
212
229
return [ { type : 'boxLayout' , boxSourceConfiguration : content . boxSourceConfiguration } ]
230
+ } else if ( sourceLayerType === SourceLayerType . TRANSITION ) {
231
+ const content = item . content as TransitionContent
232
+ if ( content . preview ) return [ { type : 'image' , src : '/api/private/blueprints/assets/' + content . preview } ]
213
233
}
214
234
215
235
return [ ]
@@ -252,7 +272,7 @@ export type PreviewContent =
252
272
}
253
273
| {
254
274
type : 'boxLayout'
255
- boxSourceConfiguration : ( SplitsContentBoxContent & SplitsContentBoxProperties ) [ ]
275
+ boxSourceConfiguration : ReadonlyDeep < ( SplitsContentBoxContent & SplitsContentBoxProperties ) [ ] >
256
276
showLabels ?: boolean
257
277
backgroundArt ?: string
258
278
}
@@ -265,6 +285,12 @@ export type PreviewContent =
265
285
current : number
266
286
total ?: number
267
287
}
288
+ | {
289
+ type : 'timing'
290
+ timeAsRendered ?: { in ?: number | null ; dur ?: number | null }
291
+ enable ?: ReadonlyObjectDeep < PieceInstancePiece > [ 'enable' ]
292
+ lifespan : PieceLifespan
293
+ }
268
294
269
295
export interface IPreviewPopUpSession {
270
296
/**
0 commit comments