Skip to content

Commit 93069ea

Browse files
committed
feat: expose startedPlayback to blueprint contexts via getter properties
Add startedPlayback property to IRundownContext interface and implement as getters in RundownActivationContext and SyncIngestUpdateToPartInstanceContext. This provides blueprints access to playlist.startedPlayback timing data. Part of BBC-SOFIE-454
1 parent ddcafc8 commit 93069ea

File tree

3 files changed

+14
-0
lines changed

3 files changed

+14
-0
lines changed

packages/blueprints-integration/src/context/rundownContext.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,15 @@ import type { IShowStyleContext } from './showStyleContext.js'
55
import type { IExecuteTSRActionsContext } from './executeTsrActionContext.js'
66
import type { IDataStoreMethods } from './adlibActionContext.js'
77
import { ITTimersContext } from './tTimersContext.js'
8+
import type { Time } from '../common.js'
89

910
export interface IRundownContext extends IShowStyleContext {
1011
readonly rundownId: string
1112
readonly playlistId: string
1213
readonly rundown: Readonly<IBlueprintSegmentRundown>
14+
15+
/** Actual time of playback starting for the playlist (undefined if not started) */
16+
readonly startedPlayback?: Time
1317
}
1418

1519
export interface IRundownUserContext extends IUserNotesContext, IRundownContext {}

packages/job-worker/src/blueprints/context/RundownActivationContext.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import {
44
IRundownActivationContext,
55
IRundownActivationContextState,
66
TSR,
7+
Time,
78
} from '@sofie-automation/blueprints-integration'
89
import { PeripheralDeviceId } from '@sofie-automation/shared-lib/dist/core/model/Ids'
910
import { ReadonlyDeep } from 'type-fest'
@@ -58,6 +59,10 @@ export class RundownActivationContext extends RundownEventContext implements IRu
5859
return this._currentState
5960
}
6061

62+
get startedPlayback(): Time | undefined {
63+
return this._playoutModel.playlist.startedPlayback
64+
}
65+
6166
async listPlayoutDevices(): Promise<IBlueprintPlayoutDevice[]> {
6267
return listPlayoutDevices(this._context, this._playoutModel)
6368
}

packages/job-worker/src/blueprints/context/SyncIngestUpdateToPartInstanceContext.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import {
1717
IBlueprintPartInstance,
1818
SomeContent,
1919
WithTimeline,
20+
Time,
2021
} from '@sofie-automation/blueprints-integration'
2122
import { postProcessPieces, postProcessTimelineObjects } from '../postProcess.js'
2223
import {
@@ -61,6 +62,10 @@ export class SyncIngestUpdateToPartInstanceContext
6162
return Array.from(this.#changedTTimers.values())
6263
}
6364

65+
public get startedPlayback(): Time | undefined {
66+
return this.#playoutModel.playlist.startedPlayback
67+
}
68+
6469
constructor(
6570
context: JobContext,
6671
playoutModel: PlayoutModel,

0 commit comments

Comments
 (0)