diff --git a/src/tv2-common/cues/gfx-schema-generator.ts b/src/tv2-common/cues/gfx-schema-generator.ts index 75357a63..debec064 100644 --- a/src/tv2-common/cues/gfx-schema-generator.ts +++ b/src/tv2-common/cues/gfx-schema-generator.ts @@ -12,6 +12,11 @@ import { CueType, SharedGraphicLLayer, SharedOutputLayer, SharedSourceLayer } fr import { Tv2PieceType } from '../../tv2-constants/tv2-piece-type' import { DveLoopGenerator } from '../helpers/graphics/caspar/dve-loop-generator' +interface CasparCgDesignValues { + name: string + properties: unknown +} + const NON_BASELINE_SCHEMA: string = 'NON_BASELINE_SCHEMA' const VALID_EMPTY_SCHEMA_VALUE: string = 'N/A' @@ -19,6 +24,8 @@ export class GfxSchemaGenerator { constructor(private dveLoopGenerator: DveLoopGenerator) {} public createBaselineTimelineObjectsFromGfxDefaults(context: ShowStyleContext): TSR.TSRTimelineObjBase[] { + this.assertAllCasparCgDesignValues(context) + const schemaId: string = context.config.showStyle.GfxDefaults[0].DefaultSchema.value if (VALID_EMPTY_SCHEMA_VALUE === schemaId) { return [] @@ -32,7 +39,6 @@ export class GfxSchemaGenerator { ) return [] } - const cue: CueDefinitionGfxSchema = { type: CueType.GraphicSchema, schema: schema.VizTemplate, @@ -42,6 +48,22 @@ export class GfxSchemaGenerator { return this.createBaselineTimelineObjects(context, cue, 10) } + private assertAllCasparCgDesignValues(context: ShowStyleContext): void { + context.config.showStyle.GfxSchemaTemplates.forEach((schema) => { + if (!schema.CasparCgDesignValues) { + return + } + const casparCgDesignValues: CasparCgDesignValues[] = JSON.parse(schema.CasparCgDesignValues) + casparCgDesignValues.forEach((designValues) => { + if (designValues.name && designValues.name.includes(' ')) { + context.core.notifyUserError( + `Schema for ${schema.VizTemplate} has invalid CasparCgDesignValues. The Design ${designValues.name} has whitespace in it's name!` + ) + } + }) + }) + } + public createBlueprintPieceFromGfxSchemaCue( context: ShowStyleContext, pieces: IBlueprintPiece[], diff --git a/src/tv2-common/helpers/graphics/internal/InternalGraphic.ts b/src/tv2-common/helpers/graphics/internal/InternalGraphic.ts index aadf7897..d575ab28 100644 --- a/src/tv2-common/helpers/graphics/internal/InternalGraphic.ts +++ b/src/tv2-common/helpers/graphics/internal/InternalGraphic.ts @@ -108,7 +108,8 @@ export abstract class InternalGraphic extends Graphic { type: Tv2PieceType.GRAPHICS, outputLayer: Tv2OutputLayer.OVERLAY, partType: this.partDefinition?.type, - pieceExternalId: this.partDefinition?.externalId + pieceExternalId: this.partDefinition?.externalId, + graphicsTemplateName: this.templateName } } } diff --git a/src/tv2-common/inewsConversion/converters/ParseBody.ts b/src/tv2-common/inewsConversion/converters/ParseBody.ts index 8e8b6aa6..b22125ef 100644 --- a/src/tv2-common/inewsConversion/converters/ParseBody.ts +++ b/src/tv2-common/inewsConversion/converters/ParseBody.ts @@ -675,19 +675,20 @@ export function getSourceDefinition(typeStr: string): SourceDefinition | undefin } } else if (EVS_RED_TEXT.test(typeStr)) { const strippedToken = typeStr.match(EVS_RED_TEXT) - const id = `EVS ${strippedToken![1].toUpperCase()}` - const vo = strippedToken![2] + const name: string = `EVS ${strippedToken![1].toUpperCase()}` + const audioTrack: string = '1/2' + const vo: string = strippedToken![2] return { sourceType: SourceType.REPLAY, - id, + id: `${name} ${audioTrack}`, vo: !!vo, raw: strippedToken![0].trim(), - name: `${id}${vo ? ' ' + vo : ''}` + name: `${name}${vo ? ' ' + vo : ''}` } } else if (/EPSIO/i.test(typeStr)) { return { sourceType: SourceType.REPLAY, - id: 'EPSIO', + id: 'EPSIO 1/2', vo: true, raw: typeStr, name: 'EPSIO' diff --git a/src/tv2-common/inewsConversion/converters/__tests__/body-parser.spec.ts b/src/tv2-common/inewsConversion/converters/__tests__/body-parser.spec.ts index 235204c0..aea7e1af 100644 --- a/src/tv2-common/inewsConversion/converters/__tests__/body-parser.spec.ts +++ b/src/tv2-common/inewsConversion/converters/__tests__/body-parser.spec.ts @@ -1514,7 +1514,7 @@ describe('Body parser', () => { rawType: 'EVS 1', sourceDefinition: { sourceType: SourceType.REPLAY, - id: 'EVS 1', + id: 'EVS 1 1/2', name: 'EVS 1', raw: 'EVS 1', vo: false @@ -1541,7 +1541,7 @@ describe('Body parser', () => { rawType: 'EVS1VOV', sourceDefinition: { sourceType: SourceType.REPLAY, - id: 'EVS 1', + id: 'EVS 1 1/2', name: 'EVS 1 VOV', raw: 'EVS1VOV', vo: true @@ -1567,7 +1567,7 @@ describe('Body parser', () => { rawType: 'EVS 1 VO', sourceDefinition: { sourceType: SourceType.REPLAY, - id: 'EVS 1', + id: 'EVS 1 1/2', name: 'EVS 1 VO', raw: 'EVS 1 VO', vo: true @@ -1585,7 +1585,7 @@ describe('Body parser', () => { rawType: 'EVS 2VO', sourceDefinition: { sourceType: SourceType.REPLAY, - id: 'EVS 2', + id: 'EVS 2 1/2', name: 'EVS 2 VO', raw: 'EVS 2VO', vo: true @@ -1603,7 +1603,7 @@ describe('Body parser', () => { rawType: 'EVS3VO', sourceDefinition: { sourceType: SourceType.REPLAY, - id: 'EVS 3', + id: 'EVS 3 1/2', name: 'EVS 3 VO', raw: 'EVS3VO', vo: true @@ -1621,7 +1621,7 @@ describe('Body parser', () => { rawType: 'EVS4 VO', sourceDefinition: { sourceType: SourceType.REPLAY, - id: 'EVS 4', + id: 'EVS 4 1/2', name: 'EVS 4 VO', raw: 'EVS4 VO', vo: true @@ -2564,7 +2564,7 @@ describe('Body parser', () => { routing: { type: CueType.Routing, target: 'WALL', - INP1: { sourceType: SourceType.REPLAY, name: 'EVS 1', id: 'EVS 1', raw: 'EVS 1', vo: false }, + INP1: { sourceType: SourceType.REPLAY, name: 'EVS 1', id: 'EVS 1 1/2', raw: 'EVS 1', vo: false }, iNewsCommand: '' }, graphic: { @@ -2603,7 +2603,7 @@ describe('Body parser', () => { rawType: 'EVS 1', sourceDefinition: { sourceType: SourceType.REPLAY, - id: 'EVS 1', + id: 'EVS 1 1/2', name: 'EVS 1', raw: 'EVS 1', vo: false diff --git a/src/tv2-common/onTimelineGenerate.ts b/src/tv2-common/onTimelineGenerate.ts index 0dd17daf..93e8b1c5 100644 --- a/src/tv2-common/onTimelineGenerate.ts +++ b/src/tv2-common/onTimelineGenerate.ts @@ -73,6 +73,7 @@ export interface PieceMetaData { export interface GraphicPieceMetaData extends PieceMetaData { partType?: PartType pieceExternalId?: string + graphicsTemplateName?: string } export interface JinglePieceMetaData extends PieceMetaData { diff --git a/src/tv2-common/parts/server.ts b/src/tv2-common/parts/server.ts index 323086e5..7373c4b7 100644 --- a/src/tv2-common/parts/server.ts +++ b/src/tv2-common/parts/server.ts @@ -231,8 +231,7 @@ function getServerSelectionBlueprintPiece( sourceLayerId: layers.SourceLayer.SelectedServer, lifespan: PieceLifespan.WithinPart, metaData: { - type: Tv2PieceType.VIDEO_CLIP, - outputLayer: Tv2OutputLayer.PROGRAM, + type: Tv2PieceType.UNKNOWN, sourceName: contentServerElement.fileName, audioMode: layers.SourceLayer.SelectedServer === SharedSourceLayer.SelectedVoiceOver diff --git a/src/tv2_afvd_showstyle/__tests__/configs.ts b/src/tv2_afvd_showstyle/__tests__/configs.ts index 6c4d544c..fa9b5584 100644 --- a/src/tv2_afvd_showstyle/__tests__/configs.ts +++ b/src/tv2_afvd_showstyle/__tests__/configs.ts @@ -138,9 +138,9 @@ export const defaultStudioConfig: StudioConfig = { ), SourcesReplay: prepareConfig( [ - { id: 'EVS 1', switcherSource: 5, sisyfosLayers: ['sisyfos_source_evs_1_audio_1_2'] }, - { id: 'EVS 2', switcherSource: 5, sisyfosLayers: ['sisyfos_source_evs_2_audio_1_2'] }, - { id: 'EPSIO', switcherSource: 5, sisyfosLayers: ['sisyfos_source_epsio_audio_1_2'] } + { id: 'EVS 1 1/2', switcherSource: 5, sisyfosLayers: ['sisyfos_source_evs_1_audio_1_2'] }, + { id: 'EVS 2 1/2', switcherSource: 5, sisyfosLayers: ['sisyfos_source_evs_2_audio_1_2'] }, + { id: 'EPSIO 1/2', switcherSource: 5, sisyfosLayers: ['sisyfos_source_epsio_audio_1_2'] } ], 'SourcesDelayedPlayback', false diff --git a/src/tv2_afvd_showstyle/helpers/pieces/__tests__/grafikViz.spec.ts b/src/tv2_afvd_showstyle/helpers/pieces/__tests__/grafikViz.spec.ts index 5c1174e0..8c3e5181 100644 --- a/src/tv2_afvd_showstyle/helpers/pieces/__tests__/grafikViz.spec.ts +++ b/src/tv2_afvd_showstyle/helpers/pieces/__tests__/grafikViz.spec.ts @@ -123,7 +123,8 @@ describe('grafik piece', () => { type: Tv2PieceType.GRAPHICS, outputLayer: Tv2OutputLayer.OVERLAY, partType: PartType.Kam, - pieceExternalId: dummyPart.externalId + pieceExternalId: dummyPart.externalId, + graphicsTemplateName: 'bund' }, outputLayerId: SharedOutputLayer.OVERLAY, sourceLayerId: SourceLayer.PgmGraphicsLower, @@ -400,7 +401,8 @@ describe('grafik piece', () => { type: Tv2PieceType.GRAPHICS, outputLayer: Tv2OutputLayer.OVERLAY, partType: PartType.Kam, - pieceExternalId: dummyPart.externalId + pieceExternalId: dummyPart.externalId, + graphicsTemplateName: 'bund' }, outputLayerId: SharedOutputLayer.OVERLAY, sourceLayerId: SourceLayer.PgmGraphicsLower, @@ -550,7 +552,8 @@ describe('grafik piece', () => { type: Tv2PieceType.GRAPHICS, outputLayer: Tv2OutputLayer.OVERLAY, partType: PartType.Kam, - pieceExternalId: dummyPart.externalId + pieceExternalId: dummyPart.externalId, + graphicsTemplateName: 'direkte' }, outputLayerId: SharedOutputLayer.OVERLAY, sourceLayerId: SourceLayer.PgmGraphicsIdent, @@ -619,7 +622,8 @@ describe('grafik piece', () => { type: Tv2PieceType.GRAPHICS, outputLayer: Tv2OutputLayer.OVERLAY, partType: PartType.Kam, - pieceExternalId: dummyPart.externalId + pieceExternalId: dummyPart.externalId, + graphicsTemplateName: 'arkiv' }, outputLayerId: SharedOutputLayer.OVERLAY, sourceLayerId: SourceLayer.PgmGraphicsIdent, diff --git a/src/tv2_afvd_showstyle/helpers/pieces/__tests__/telefon.spec.ts b/src/tv2_afvd_showstyle/helpers/pieces/__tests__/telefon.spec.ts index a46ffd38..769e30e5 100644 --- a/src/tv2_afvd_showstyle/helpers/pieces/__tests__/telefon.spec.ts +++ b/src/tv2_afvd_showstyle/helpers/pieces/__tests__/telefon.spec.ts @@ -76,7 +76,8 @@ describe('telefon', () => { type: Tv2PieceType.GRAPHICS, outputLayer: Tv2OutputLayer.OVERLAY, partType: PartType.Kam, - pieceExternalId: dummyPart.externalId + pieceExternalId: dummyPart.externalId, + graphicsTemplateName: 'bund' }, content: literal>({ fileName: 'bund', diff --git a/src/tv2_afvd_studio/migrations/mappings-defaults.ts b/src/tv2_afvd_studio/migrations/mappings-defaults.ts index fd946686..09fdaa96 100644 --- a/src/tv2_afvd_studio/migrations/mappings-defaults.ts +++ b/src/tv2_afvd_studio/migrations/mappings-defaults.ts @@ -395,8 +395,8 @@ export const MAPPINGS_CASPAR: BlueprintMappings = { device: TSR.DeviceType.ABSTRACT, deviceId: 'abstract0', lookahead: LookaheadMode.PRELOAD, - lookaheadDepth: 1, - lookaheadMaxSearchDistance: -1 + lookaheadDepth: 2, + lookaheadMaxSearchDistance: 10 }), [CasparPlayerClip(1)]: literal({ device: TSR.DeviceType.CASPARCG, diff --git a/src/tv2_offtube_studio/migrations/mappings-defaults.ts b/src/tv2_offtube_studio/migrations/mappings-defaults.ts index 1c605eb8..71596e49 100644 --- a/src/tv2_offtube_studio/migrations/mappings-defaults.ts +++ b/src/tv2_offtube_studio/migrations/mappings-defaults.ts @@ -218,7 +218,7 @@ const MAPPINGS_CASPAR: BlueprintMappings = { deviceId: 'abstract0', lookahead: LookaheadMode.PRELOAD, lookaheadDepth: 1, - lookaheadMaxSearchDistance: 1 + lookaheadMaxSearchDistance: 5 }), [CasparPlayerClip(1)]: literal({ device: TSR.DeviceType.CASPARCG,