Skip to content
Open
1 change: 1 addition & 0 deletions meteor/__mocks__/helpers/database.ts
Original file line number Diff line number Diff line change
Expand Up @@ -899,5 +899,6 @@ export function convertToUIShowStyleBase(showStyleBase: DBShowStyleBase): UIShow
hotkeyLegend: showStyleBase.hotkeyLegend,
sourceLayers: applyAndValidateOverrides(showStyleBase.sourceLayersWithOverrides).obj,
outputLayers: applyAndValidateOverrides(showStyleBase.outputLayersWithOverrides).obj,
abChannelDisplay: showStyleBase.abChannelDisplay,
})
}
33 changes: 23 additions & 10 deletions meteor/server/migration/upgrades/showStyleBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,17 +129,28 @@ export async function runUpgradeForShowStyleBase(showStyleBaseId: ShowStyleBaseI

const result = blueprintManifest.applyConfig(blueprintContext, rawBlueprintConfig)

await ShowStyleBases.updateAsync(showStyleBaseId, {
$set: {
'sourceLayersWithOverrides.defaults': normalizeArray(result.sourceLayers, '_id'),
'outputLayersWithOverrides.defaults': normalizeArray(result.outputLayers, '_id'),
lastBlueprintConfig: {
blueprintHash: blueprint.blueprintHash,
blueprintId: blueprint._id,
blueprintConfigPresetId: showStyleBase.blueprintConfigPresetId ?? '',
config: rawBlueprintConfig,
},
const updateSet: Record<string, any> = {
'sourceLayersWithOverrides.defaults': normalizeArray(result.sourceLayers, '_id'),
'outputLayersWithOverrides.defaults': normalizeArray(result.outputLayers, '_id'),
lastBlueprintConfig: {
blueprintHash: blueprint.blueprintHash,
blueprintId: blueprint._id,
blueprintConfigPresetId: showStyleBase.blueprintConfigPresetId ?? '',
config: rawBlueprintConfig,
},
}

// Store the blueprint-defined abChannelDisplay config if provided
if (result.abChannelDisplay !== undefined) {
updateSet.blueprintAbChannelDisplay = result.abChannelDisplay
// Initialize abChannelDisplay from blueprint if not already set by user
if (!showStyleBase.abChannelDisplay) {
updateSet.abChannelDisplay = result.abChannelDisplay
}
}

await ShowStyleBases.updateAsync(showStyleBaseId, {
$set: updateSet,
})

await updateTriggeredActionsForShowStyleBaseId(showStyleBaseId, result.triggeredActions)
Expand All @@ -153,6 +164,7 @@ async function loadShowStyleAndBlueprint(showStyleBaseId: ShowStyleBaseId) {
blueprintConfigPresetId: 1,
blueprintConfigWithOverrides: 1,
lastBlueprintFixUpHash: 1,
abChannelDisplay: 1,
},
})) as
| Pick<
Expand All @@ -161,6 +173,7 @@ async function loadShowStyleAndBlueprint(showStyleBaseId: ShowStyleBaseId) {
| 'blueprintId'
| 'blueprintConfigPresetId'
| 'blueprintConfigWithOverrides'
| 'abChannelDisplay'
| 'lastBlueprintFixUpHash'
>
| undefined
Expand Down
10 changes: 9 additions & 1 deletion meteor/server/publications/showStyleUI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,20 @@ interface UIShowStyleBaseUpdateProps {
invalidateShowStyle: boolean
}

type ShowStyleBaseFields = '_id' | 'name' | 'outputLayersWithOverrides' | 'sourceLayersWithOverrides' | 'hotkeyLegend'
type ShowStyleBaseFields =
| '_id'
| 'name'
| 'outputLayersWithOverrides'
| 'sourceLayersWithOverrides'
| 'hotkeyLegend'
| 'abChannelDisplay'
const fieldSpecifier = literal<MongoFieldSpecifierOnesStrict<Pick<DBShowStyleBase, ShowStyleBaseFields>>>({
_id: 1,
name: 1,
outputLayersWithOverrides: 1,
sourceLayersWithOverrides: 1,
hotkeyLegend: 1,
abChannelDisplay: 1,
})

async function setupUIShowStyleBasePublicationObservers(
Expand Down Expand Up @@ -78,6 +85,7 @@ async function manipulateUIShowStyleBasePublicationData(
sourceLayers: resolvedSourceLayers,
outputLayers: resolvedOutputLayers,
hotkeyLegend: showStyleBase.hotkeyLegend,
abChannelDisplay: showStyleBase.abChannelDisplay,
}),
]
}
Expand Down
14 changes: 14 additions & 0 deletions packages/blueprints-integration/src/api/showStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ import type {
IBlueprintPart,
} from '../documents/index.js'
import type { IBlueprintShowStyleVariant, IOutputLayer, ISourceLayer } from '../showStyle.js'
import type { SourceLayerType } from '../content.js'
import type { TSR, OnGenerateTimelineObj, TimelineObjectCoreExt } from '../timeline.js'
import type { IBlueprintConfig } from '../common.js'
import type { ReadonlyDeep } from 'type-fest'
Expand Down Expand Up @@ -322,6 +323,19 @@ export interface BlueprintResultApplyShowStyleConfig {
outputLayers: IOutputLayer[]

triggeredActions: IBlueprintTriggeredActions[]

/** Configuration for displaying AB resolver channel assignments */
abChannelDisplay?: {
/** Source layer IDs that should show AB channel info */
sourceLayerIds: string[]
/** Configure by source layer type */
sourceLayerTypes: SourceLayerType[]
/** Only show for specific output layers (e.g., only PGM) */
outputLayerIds: string[]
/** Enable display on Director screen */
showOnDirectorScreen: boolean
// Future: showOnPresenterScreen, showOnCameraScreen when those views are implemented
}
}

export interface IShowStyleConfigPreset<TConfig = IBlueprintConfig> {
Expand Down
6 changes: 6 additions & 0 deletions packages/blueprints-integration/src/documents/piece.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ export interface IBlueprintPiece<TPrivateData = unknown, TPublicData = unknown>
* Whether to stop this piece before the 'keepalive' period of the part
*/
excludeDuringPartKeepalive?: boolean

/**
* Whether to display AB resolver channel assignment on Director screen.
* If set, overrides show style configuration for this piece.
*/
displayAbChannel?: boolean
}
export interface IBlueprintPieceDB<TPrivateData = unknown, TPublicData = unknown>
extends IBlueprintPiece<TPrivateData, TPublicData> {
Expand Down
21 changes: 21 additions & 0 deletions packages/corelib/src/dataModel/ShowStyleBase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,27 @@ export interface DBShowStyleBase {
/** Config values are used by the Blueprints */
blueprintConfigWithOverrides: ObjectWithOverrides<IBlueprintConfig>

/** Configuration for displaying AB resolver channel assignments across different screens */
abChannelDisplay?: {
/** Source layer IDs that should show AB channel info */
sourceLayerIds: string[]
/** Configure by source layer type */
sourceLayerTypes: SourceLayerType[]
/** Only show for specific output layers (e.g., only PGM) */
outputLayerIds: string[]
/** Enable display on Director screen */
showOnDirectorScreen: boolean
// Future: showOnPresenterScreen, showOnCameraScreen when those views are implemented
}

/** Blueprint default for abChannelDisplay (saved during blueprint upgrade) */
blueprintAbChannelDisplay?: {
sourceLayerIds: string[]
sourceLayerTypes: SourceLayerType[]
outputLayerIds: string[]
showOnDirectorScreen: boolean
}

_rundownVersionHash: string

/** Details on the last blueprint used to generate the defaults values for this */
Expand Down
2 changes: 2 additions & 0 deletions packages/job-worker/src/blueprints/context/lib.ts
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ export const IBlueprintPieceObjectsSampleKeys = allKeysOfObject<IBlueprintPiece>
userEditOperations: true,
userEditProperties: true,
excludeDuringPartKeepalive: true,
displayAbChannel: true,
})

// Compile a list of the keys which are allowed to be set
Expand Down Expand Up @@ -252,6 +253,7 @@ export function convertPieceToBlueprints(piece: ReadonlyDeep<PieceInstancePiece>
userEditOperations: translateUserEditsToBlueprint(piece.userEditOperations),
userEditProperties: translateUserEditPropertiesToBlueprint(piece.userEditProperties),
excludeDuringPartKeepalive: piece.excludeDuringPartKeepalive,
displayAbChannel: piece.displayAbChannel,
}

return obj
Expand Down
10 changes: 9 additions & 1 deletion packages/meteor-lib/src/api/showStyles.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
import { ShowStyleBaseId, ShowStyleVariantId, StudioId } from '@sofie-automation/corelib/dist/dataModel/Ids'
import { HotkeyDefinition, OutputLayers, SourceLayers } from '@sofie-automation/corelib/dist/dataModel/ShowStyleBase'
import {
HotkeyDefinition,
OutputLayers,
SourceLayers,
type DBShowStyleBase,
} from '@sofie-automation/corelib/dist/dataModel/ShowStyleBase'
import { DBShowStyleVariant } from '@sofie-automation/corelib/dist/dataModel/ShowStyleVariant'

export interface NewShowStylesAPI {
Expand Down Expand Up @@ -44,6 +49,9 @@ export interface UIShowStyleBase {
outputLayers: OutputLayers
/** "Layers" in the GUI */
sourceLayers: SourceLayers

/** Configuration for displaying AB resolver channels on various screens */
abChannelDisplay?: DBShowStyleBase['abChannelDisplay']
}

export interface CreateAdlibTestingRundownOption {
Expand Down
17 changes: 17 additions & 0 deletions packages/webui/public/icons/channels/0.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions packages/webui/public/icons/channels/1.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Loading