Skip to content

Commit bd3aeaa

Browse files
authored
Merge pull request #1354 from bbc/upstream/feat-move-next-in-quickloop
2 parents 462f20f + b87cd9f commit bd3aeaa

File tree

17 files changed

+197
-34
lines changed

17 files changed

+197
-34
lines changed

meteor/server/api/userActions.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ class ServerUserActionAPI
191191
eventTime: Time,
192192
rundownPlaylistId: RundownPlaylistId,
193193
partDelta: number,
194-
segmentDelta: number
194+
segmentDelta: number,
195+
ignoreQuickLoop: boolean | null
195196
) {
196197
return ServerClientAPI.runUserActionInLogForPlaylistOnWorker(
197198
this,
@@ -208,6 +209,7 @@ class ServerUserActionAPI
208209
playlistId: rundownPlaylistId,
209210
partDelta: partDelta,
210211
segmentDelta: segmentDelta,
212+
ignoreQuickLoop: ignoreQuickLoop ?? undefined,
211213
}
212214
)
213215
}

meteor/server/migration/upgrades/defaultSystemActionTriggers.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintDefaultCoreSystemTriggers = {
281281
],
282282
parts: 1,
283283
segments: 0,
284+
ignoreQuickLoop: false,
284285
},
285286
},
286287
triggers: {
@@ -305,6 +306,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintDefaultCoreSystemTriggers = {
305306
],
306307
parts: 0,
307308
segments: 1,
309+
ignoreQuickLoop: false,
308310
},
309311
},
310312
triggers: {
@@ -329,6 +331,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintDefaultCoreSystemTriggers = {
329331
],
330332
parts: -1,
331333
segments: 0,
334+
ignoreQuickLoop: false,
332335
},
333336
},
334337
triggers: {
@@ -353,6 +356,7 @@ export const DEFAULT_CORE_TRIGGERS: IBlueprintDefaultCoreSystemTriggers = {
353356
],
354357
parts: 0,
355358
segments: -1,
359+
ignoreQuickLoop: false,
356360
},
357361
},
358362
triggers: {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export interface IActionExecutionContext
3131
// getNextShowStyleConfig(): Readonly<{ [key: string]: ConfigItemValue }>
3232

3333
/** Move the next part through the rundown. Can move by either a number of parts, or segments in either direction. */
34-
moveNextPart(partDelta: number, segmentDelta: number): Promise<void>
34+
moveNextPart(partDelta: number, segmentDelta: number, ignoreQuickloop?: boolean): Promise<void>
3535
/** Set flag to perform take after executing the current action. Returns state of the flag after each call. */
3636
takeAfterExecuteAction(take: boolean): Promise<boolean>
3737
/** Inform core that a take out of the current partinstance should be blocked until the specified time */

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,5 +76,5 @@ export interface IOnSetAsNextContext extends IShowStyleUserContext, IEventContex
7676
* Multiple calls of this inside one call to `onSetAsNext` will replace earlier calls.
7777
* @returns Whether a new Part was found using the provided offset
7878
*/
79-
moveNextPart(partDelta: number, segmentDelta: number): Promise<boolean>
79+
moveNextPart(partDelta: number, segmentDelta: number, ignoreQuickLoop?: boolean): Promise<boolean>
8080
}

packages/blueprints-integration/src/triggers.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -230,6 +230,13 @@ export interface IMoveNextAction extends ITriggeredActionBase {
230230
* @memberof IMoveNextAction
231231
*/
232232
parts: number
233+
/**
234+
* When moving the next part it should ignore any of the boundaries set by the QuickLoop feature
235+
*
236+
* @type {boolean}
237+
* @memberof IMoveNextAction
238+
*/
239+
ignoreQuickLoop: boolean
233240
}
234241

235242
export interface ICreateSnapshotForDebugAction extends ITriggeredActionBase {

packages/corelib/src/worker/studio.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ export interface StopPiecesOnSourceLayersProps extends RundownPlayoutPropsBase {
231231
export interface MoveNextPartProps extends RundownPlayoutPropsBase {
232232
partDelta: number
233233
segmentDelta: number
234+
ignoreQuickLoop?: boolean
234235
}
235236
export type ActivateHoldProps = RundownPlayoutPropsBase
236237
export type DeactivateHoldProps = RundownPlayoutPropsBase

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export class OnSetAsNextContext
121121
return this.partAndPieceInstanceService.removePieceInstances('next', pieceInstanceIds)
122122
}
123123

124-
async moveNextPart(partDelta: number, segmentDelta: number): Promise<boolean> {
124+
async moveNextPart(partDelta: number, segmentDelta: number, ignoreQuickLoop?: boolean): Promise<boolean> {
125125
if (typeof partDelta !== 'number') throw new Error('partDelta must be a number')
126126
if (typeof segmentDelta !== 'number') throw new Error('segmentDelta must be a number')
127127

@@ -132,7 +132,13 @@ export class OnSetAsNextContext
132132
}
133133

134134
this.pendingMoveNextPart = {
135-
selectedPart: selectNewPartWithOffsets(this.jobContext, this.playoutModel, partDelta, segmentDelta),
135+
selectedPart: selectNewPartWithOffsets(
136+
this.jobContext,
137+
this.playoutModel,
138+
partDelta,
139+
segmentDelta,
140+
ignoreQuickLoop
141+
),
136142
}
137143

138144
return !!this.pendingMoveNextPart.selectedPart

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,8 +157,14 @@ export class ActionExecutionContext extends ShowStyleUserContext implements IAct
157157
return this.partAndPieceInstanceService.queuePart(rawPart, rawPieces)
158158
}
159159

160-
async moveNextPart(partDelta: number, segmentDelta: number): Promise<void> {
161-
const selectedPart = selectNewPartWithOffsets(this._context, this._playoutModel, partDelta, segmentDelta)
160+
async moveNextPart(partDelta: number, segmentDelta: number, ignoreQuickloop?: boolean): Promise<void> {
161+
const selectedPart = selectNewPartWithOffsets(
162+
this._context,
163+
this._playoutModel,
164+
partDelta,
165+
segmentDelta,
166+
ignoreQuickloop
167+
)
162168
if (selectedPart) await setNextPartFromPart(this._context, this._playoutModel, selectedPart, true)
163169
}
164170

packages/job-worker/src/playout/model/PlayoutModel.ts

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,25 @@ export interface PlayoutModelReadonly extends StudioPlayoutModelBaseReadonly {
167167
*/
168168
getRundownIds(): RundownId[]
169169

170+
/**
171+
* Returns any segmentId's that are found between 2 quickloop markers, none will be returned if
172+
* the end is before the start.
173+
* @param start A quickloop marker
174+
* @param end A quickloop marker
175+
*/
176+
getSegmentsBetweenQuickLoopMarker(start: QuickLoopMarker, end: QuickLoopMarker): SegmentId[]
177+
178+
/**
179+
* Returns any segmentId's that are found between 2 quickloop markers, none will be returned if
180+
* the end is before the start.
181+
* @param start A quickloop marker
182+
* @param end A quickloop marker
183+
*/
184+
getPartsBetweenQuickLoopMarker(
185+
start: QuickLoopMarker,
186+
end: QuickLoopMarker
187+
): { parts: PartId[]; segments: SegmentId[] }
188+
170189
/**
171190
* Search for a PieceInstance in the RundownPlaylist
172191
* @param id Id of the PieceInstance
@@ -350,14 +369,6 @@ export interface PlayoutModel extends PlayoutModelReadonly, StudioPlayoutModelBa
350369
*/
351370
setQuickLoopMarker(type: 'start' | 'end', marker: QuickLoopMarker | null): void
352371

353-
/**
354-
* Returns any segmentId's that are found between 2 quickloop markers, none will be returned if
355-
* the end is before the start.
356-
* @param start A quickloop marker
357-
* @param end A quickloop marker
358-
*/
359-
getSegmentsBetweenQuickLoopMarker(start: QuickLoopMarker, end: QuickLoopMarker): SegmentId[]
360-
361372
calculatePartTimings(
362373
fromPartInstance: PlayoutPartInstanceModel | null,
363374
toPartInstance: PlayoutPartInstanceModel,

packages/job-worker/src/playout/model/implementation/PlayoutModelImpl.ts

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -240,6 +240,16 @@ export class PlayoutModelReadonlyImpl implements PlayoutModelReadonly {
240240
return undefined
241241
}
242242

243+
getSegmentsBetweenQuickLoopMarker(start: QuickLoopMarker, end: QuickLoopMarker): SegmentId[] {
244+
return this.quickLoopService.getSegmentsBetweenMarkers(start, end)
245+
}
246+
getPartsBetweenQuickLoopMarker(
247+
start: QuickLoopMarker,
248+
end: QuickLoopMarker
249+
): { parts: PartId[]; segments: SegmentId[] } {
250+
return this.quickLoopService.getPartsBetweenMarkers(start, end)
251+
}
252+
243253
#isMultiGatewayMode: boolean | undefined = undefined
244254
public get isMultiGatewayMode(): boolean {
245255
if (this.#isMultiGatewayMode === undefined) {
@@ -828,10 +838,6 @@ export class PlayoutModelImpl extends PlayoutModelReadonlyImpl implements Playou
828838
this.#playlistHasChanged = true
829839
}
830840

831-
getSegmentsBetweenQuickLoopMarker(start: QuickLoopMarker, end: QuickLoopMarker): SegmentId[] {
832-
return this.quickLoopService.getSegmentsBetweenMarkers(start, end)
833-
}
834-
835841
/** Notifications */
836842

837843
async getAllNotifications(

0 commit comments

Comments
 (0)