diff --git a/src/defaults/video.ts b/src/defaults/video.ts index 4eaf1a1..bc1bb2b 100644 --- a/src/defaults/video.ts +++ b/src/defaults/video.ts @@ -216,13 +216,6 @@ export function flyKeyframe(id: number): VideoState.USK.UpstreamKeyerFlyKeyframe } } -export const FlyKeyProperties: VideoState.USK.UpstreamKeyerFlySettings = { - isASet: false, - isBSet: false, - isAtKeyFrame: Enums.IsAtKeyFrame.None, - runToInfiniteIndex: Enums.FlyKeyDirection.CentreOfKey, -} - export const SuperSourceBox: VideoState.SuperSource.SuperSourceBox = { enabled: false, source: defaultInput, diff --git a/src/resolvers/upstreamKeyers/flyKey.ts b/src/resolvers/upstreamKeyers/flyKey.ts deleted file mode 100644 index b1b8b6e..0000000 --- a/src/resolvers/upstreamKeyers/flyKey.ts +++ /dev/null @@ -1,55 +0,0 @@ -import { Commands as AtemCommands, Enums, VideoState } from 'atem-connection' -import { diffObject, fillDefaults, getAllKeysNumber } from '../../util' -import * as Defaults from '../../defaults' -import { PartialDeep } from 'type-fest' - -type FlyFramesState = [ - VideoState.USK.UpstreamKeyerFlyKeyframe | undefined, - VideoState.USK.UpstreamKeyerFlyKeyframe | undefined -] - -export function resolveFlyKeyerFramesState( - mixEffectId: number, - upstreamKeyerId: number, - oldState: PartialDeep, - newState: PartialDeep -): Array { - const commands: Array = [] - - for (const index of getAllKeysNumber(oldState, newState)) { - const newKeyframe = fillDefaults(Defaults.Video.flyKeyframe(index), oldState?.[index]) - const oldKeyframe = fillDefaults(Defaults.Video.flyKeyframe(index), newState?.[index]) - - const props = diffObject(oldKeyframe, newKeyframe) - const command = new AtemCommands.MixEffectKeyFlyKeyframeCommand(mixEffectId, upstreamKeyerId, index) - if (command.updateProps(props)) { - commands.push(command) - } - } - - return commands -} - -export function resolveFlyPropertiesState( - mixEffectId: number, - upstreamKeyerId: number, - oldState: Partial | undefined, - newState: PartialDeep | undefined -): Array { - const commands: Array = [] - - if (!oldState && !newState) return commands - - const oldKeyProps = fillDefaults(Defaults.Video.FlyKeyProperties, oldState) - const newKeyProps = fillDefaults(Defaults.Video.FlyKeyProperties, newState) - - if (oldKeyProps.isAtKeyFrame !== newKeyProps.isAtKeyFrame) { - const keyframe: Enums.FlyKeyKeyFrame = newKeyProps.isAtKeyFrame as number - - commands.push( - new AtemCommands.MixEffectKeyRunToCommand(mixEffectId, upstreamKeyerId, keyframe, newKeyProps.runToInfiniteIndex) - ) - } - - return commands -} diff --git a/src/resolvers/upstreamKeyers/index.ts b/src/resolvers/upstreamKeyers/index.ts index c5d8ceb..d712ef0 100644 --- a/src/resolvers/upstreamKeyers/index.ts +++ b/src/resolvers/upstreamKeyers/index.ts @@ -8,7 +8,6 @@ import { getAllKeysNumber, diffObject, fillDefaults } from '../../util' import { ExtendedMixEffect } from '../../state' import { PartialDeep } from 'type-fest' import * as Defaults from '../../defaults' -import { resolveFlyKeyerFramesState, resolveFlyPropertiesState } from './flyKey' export function resolveUpstreamKeyerState( mixEffectId: number, @@ -33,13 +32,6 @@ export function resolveUpstreamKeyerState( commands.push(...resolveLumaKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer)) commands.push(...resolvePatternKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer)) - commands.push( - ...resolveFlyKeyerFramesState(mixEffectId, upstreamKeyerId, oldKeyer.flyKeyframes, newKeyer.flyKeyframes) - ) - commands.push( - ...resolveFlyPropertiesState(mixEffectId, upstreamKeyerId, oldKeyer.flyProperties, newKeyer.flyProperties) - ) - if (oldKeyer.fillSource !== newKeyer.fillSource) { commands.push( new AtemCommands.MixEffectKeyFillSourceSetCommand(mixEffectId, upstreamKeyerId, newKeyer.fillSource)