File tree Expand file tree Collapse file tree 3 files changed +20
-6
lines changed
job-worker/src/playout/timeline Expand file tree Collapse file tree 3 files changed +20
-6
lines changed Original file line number Diff line number Diff line change @@ -88,9 +88,8 @@ export interface PieceInstanceWithTimings extends ReadonlyDeep<PieceInstance> {
8888 * This is a maximum end point of the pieceInstance.
8989 * If the pieceInstance also has a enable.duration or userDuration set then the shortest one will need to be used
9090 * This can be:
91- * - 'now', if it was stopped by something that does not need a preroll (or is virtual)
92- * - '#something.start + 100', if it was stopped by something that needs a preroll
93- * - '100', if not relative to now at all
91+ * - '100', if relative to the start of the part
92+ * - { offsetFromNow: 100 }, if stopped by an absolute time
9493 */
9594 resolvedEndCap ?: number | RelativeResolvedEndCap
9695 priority : number
Original file line number Diff line number Diff line change @@ -137,7 +137,7 @@ export function createPieceGroupAndCap(
137137 // If the start has been adjusted, the end needs to be updated to compensate
138138 if ( typeof pieceInstance . resolvedEndCap === 'number' ) {
139139 resolvedEndCap = pieceInstance . resolvedEndCap - ( pieceStartOffset ?? 0 )
140- } else if ( pieceInstance . resolvedEndCap ) {
140+ } else if ( pieceInstance . resolvedEndCap || controlObj . enable . end === 'now' ) {
141141 // TODO - there could already be a piece with a cap of 'now' that we could use as our end time
142142 // As the cap is for 'now', rather than try to get tsr to understand `end: 'now'`, we can create a 'now' object to tranlate it
143143 const nowObj = literal < TimelineObjRundown & OnGenerateTimelineObjExt < PieceTimelineMetadata > > ( {
@@ -157,7 +157,13 @@ export function createPieceGroupAndCap(
157157 priority : 0 ,
158158 } )
159159 capObjs . push ( nowObj )
160- resolvedEndCap = `#${ nowObj . id } .start + ${ pieceInstance . resolvedEndCap . offsetFromNow } `
160+
161+ resolvedEndCap = `#${ nowObj . id } .start + ${ pieceInstance . resolvedEndCap ?. offsetFromNow ?? 0 } `
162+
163+ // If the object has an end of now, we can remove it as it will be replaced by the `resolvedEndCap`
164+ if ( controlObj . enable . end === 'now' ) {
165+ delete controlObj . enable . end
166+ }
161167 }
162168
163169 if ( controlObj . enable . duration !== undefined || controlObj . enable . end !== undefined ) {
Original file line number Diff line number Diff line change @@ -385,7 +385,16 @@ function calculateInfinitePieceEnable(
385385
386386 // nocommit prerollDuration?
387387
388- // Ingore userDuration, it gets handled later
388+ // // If an end time has been set by a hotkey, then update the duration to be correct
389+ // if (pieceInstance.userDuration && pieceInstance.piece.enable.start !== 'now') {
390+ // if ('endRelativeToNow' in pieceInstance.userDuration) {
391+ // infiniteGroupEnable.duration =
392+ // pieceInstance.userDuration.endRelativeToNow - pieceInstance.piece.enable.start
393+ // } else {
394+ // // This should never be hit
395+ // infiniteGroupEnable.end = 'now'
396+ // }
397+ // }
389398 }
390399
391400 return {
You can’t perform that action at this time.
0 commit comments