Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

atem-state

Package Overview
Dependencies
Maintainers
1
Versions
59
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atem-state - npm Package Compare versions

Comparing version 0.11.0-nightly-feat-bitfocus-commands-20210422-213434-f4dc38e.0 to 0.12.0-nightly-latest-20210507-154730-e40a6f9.0

dist/resolvers/audio.d.ts

2

dist/atemState.d.ts
import { Commands, Enums } from 'atem-connection';
import { State as StateObject } from './state';
import { State as StateObject } from '.';
export declare class AtemState {

@@ -4,0 +4,0 @@ version: Enums.ProtocolVersion;

import { AudioState } from 'atem-connection';
export declare const Channel: AudioState.ClassicAudioChannel;
export declare const Master: AudioState.ClassicAudioMasterChannel;
export declare const Monitor: AudioState.ClassicAudioMonitorChannel;
export declare const Headphones: AudioState.ClassicAudioHeadphoneOutputChannel;
//# sourceMappingURL=classic-audio.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Headphones = exports.Monitor = exports.Master = exports.Channel = void 0;
exports.Master = exports.Channel = void 0;
exports.Channel = {

@@ -18,17 +18,2 @@ sourceType: 0,

};
exports.Monitor = {
enabled: false,
gain: 0,
mute: false,
solo: false,
soloSource: 0,
dim: false,
dimLevel: 0,
};
exports.Headphones = {
gain: 0,
programOutGain: 0,
sidetoneGain: 0,
talkbackGain: 0,
};
//# sourceMappingURL=classic-audio.js.map

@@ -1,6 +0,3 @@

export * as ClassicAudio from './classic-audio';
export * as FairlightAudio from './fairlight-audio';
export * as Audio from './classic-audio';
export * as Video from './video';
export * from './color';
export * as Multiviewer from './multiviewer';
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Multiviewer = exports.Video = exports.FairlightAudio = exports.ClassicAudio = void 0;
const tslib_1 = require("tslib");
exports.ClassicAudio = require("./classic-audio");
exports.FairlightAudio = require("./fairlight-audio");
exports.Video = exports.Audio = void 0;
exports.Audio = require("./classic-audio");
exports.Video = require("./video");
tslib_1.__exportStar(require("./color"), exports);
exports.Multiviewer = require("./multiviewer");
//# sourceMappingURL=index.js.map

@@ -7,3 +7,2 @@ import { VideoState, MediaState } from 'atem-connection';

export declare const DownstreamerKeyerProperties: Readonly<VideoState.DSK.DownstreamKeyerProperties>;
export declare const DownstreamKeyer: Readonly<VideoState.DSK.DownstreamKeyer>;
export declare const DipTransitionSettings: VideoState.DipTransitionSettings;

@@ -14,10 +13,5 @@ export declare const DVETransitionSettings: VideoState.DVETransitionSettings;

export declare const WipeTransitionSettings: VideoState.WipeTransitionSettings;
export declare const TransitionProperties: VideoState.TransitionProperties;
export declare const UpstreamKeyerMask: VideoState.USK.UpstreamKeyerMaskSettings;
export declare function UpstreamKeyer(id: number): VideoState.USK.UpstreamKeyer;
export declare const UpstreamKeyerPatternSettings: VideoState.USK.UpstreamKeyerPatternSettings;
export declare const UpstreamKeyerLumaSettings: VideoState.USK.UpstreamKeyerLumaSettings;
export declare const UpstreamKeyerChromaSettings: VideoState.USK.UpstreamKeyerChromaSettings;
export declare const UpstreamKeyerAdvancedChromaProperties: VideoState.USK.UpstreamKeyerAdvancedChromaProperties;
export declare const UpstreamKeyerAdvancedChromaSample: VideoState.USK.UpstreamKeyerAdvancedChromaSample;
export declare const UpstreamKeyerDVESettings: VideoState.USK.UpstreamKeyerDVESettings;

@@ -24,0 +18,0 @@ export declare function flyKeyframe(id: number): VideoState.USK.UpstreamKeyerFlyKeyframe;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SuperSourceBorder = exports.SuperSourceProperties = exports.SuperSourceBox = exports.flyKeyframe = exports.UpstreamKeyerDVESettings = exports.UpstreamKeyerAdvancedChromaSample = exports.UpstreamKeyerAdvancedChromaProperties = exports.UpstreamKeyerChromaSettings = exports.UpstreamKeyerLumaSettings = exports.UpstreamKeyerPatternSettings = exports.UpstreamKeyer = exports.UpstreamKeyerMask = exports.TransitionProperties = exports.WipeTransitionSettings = exports.StingerTransitionSettings = exports.MixTransitionSettings = exports.DVETransitionSettings = exports.DipTransitionSettings = exports.DownstreamKeyer = exports.DownstreamerKeyerProperties = exports.DownstreamerKeyerSources = exports.MediaPlayer = exports.defaultRate = exports.defaultInput = void 0;
exports.SuperSourceBorder = exports.SuperSourceProperties = exports.SuperSourceBox = exports.flyKeyframe = exports.UpstreamKeyerDVESettings = exports.UpstreamKeyerChromaSettings = exports.UpstreamKeyerLumaSettings = exports.UpstreamKeyerPatternSettings = exports.WipeTransitionSettings = exports.StingerTransitionSettings = exports.MixTransitionSettings = exports.DVETransitionSettings = exports.DipTransitionSettings = exports.DownstreamerKeyerProperties = exports.DownstreamerKeyerSources = exports.MediaPlayer = exports.defaultRate = exports.defaultInput = void 0;
const atem_connection_1 = require("atem-connection");

@@ -41,10 +41,2 @@ exports.defaultInput = 0; // black

};
exports.DownstreamKeyer = {
properties: exports.DownstreamerKeyerProperties,
sources: exports.DownstreamerKeyerSources,
inTransition: false,
remainingFrames: 0,
isAuto: false,
onAir: false,
};
exports.DipTransitionSettings = {

@@ -94,29 +86,6 @@ rate: exports.defaultRate,

};
exports.TransitionProperties = {
style: atem_connection_1.Enums.TransitionStyle.MIX,
selection: 1,
nextStyle: atem_connection_1.Enums.TransitionStyle.MIX,
nextSelection: 1,
};
exports.UpstreamKeyerMask = {
maskEnabled: false,
maskTop: 0,
maskBottom: 0,
maskLeft: 0,
maskRight: 0,
};
function UpstreamKeyer(id) {
return {
upstreamKeyerId: id,
mixEffectKeyType: atem_connection_1.Enums.MixEffectKeyType.Luma,
flyEnabled: false,
flyKeyframes: [undefined, undefined],
canFlyKey: false,
fillSource: 0,
cutSource: 0,
maskSettings: exports.UpstreamKeyerMask,
onAir: false,
};
}
exports.UpstreamKeyer = UpstreamKeyer;
// export const TransitionProperties: Omit<VideoState.TransitionProperties, 'nextStyle' | 'nextSelection'> = {
// style: Enums.TransitionStyle.MIX,
// selection: 1
// }
exports.UpstreamKeyerPatternSettings = {

@@ -144,25 +113,2 @@ style: atem_connection_1.Enums.Pattern.LeftToRightBar,

};
exports.UpstreamKeyerAdvancedChromaProperties = {
foregroundLevel: 0,
backgroundLevel: 0,
keyEdge: 0,
spillSuppression: 0,
flareSuppression: 0,
brightness: 0,
contrast: 0,
saturation: 0,
red: 0,
green: 0,
blue: 0,
};
exports.UpstreamKeyerAdvancedChromaSample = {
enableCursor: false,
preview: false,
cursorX: 0,
cursorY: 0,
cursorSize: 0,
sampledY: 0,
sampledCb: 0,
sampledCr: 0,
};
exports.UpstreamKeyerDVESettings = {

@@ -169,0 +115,0 @@ borderEnabled: false,

import { Commands as AtemCommands, VideoState } from 'atem-connection';
import { PartialDeep } from 'type-fest';
import { State as StateObject } from '../state';
export declare function resolveDownstreamKeyerState(oldState: PartialDeep<StateObject>, newState: PartialDeep<StateObject>): Array<AtemCommands.ISerializableCommand>;
import { State as StateObject } from '../';
export declare function resolveDownstreamKeyerState(oldState: StateObject, newState: StateObject): Array<AtemCommands.ISerializableCommand>;
export declare function resolveDownstreamKeyerPropertiesState(index: number, oldDsk: VideoState.DSK.DownstreamKeyer, newDsk: VideoState.DSK.DownstreamKeyer): Array<AtemCommands.ISerializableCommand>;
export declare function resolveDownstreamKeyerMaskState(index: number, oldDsk: VideoState.DSK.DownstreamKeyer, newDsk: VideoState.DSK.DownstreamKeyer): Array<AtemCommands.ISerializableCommand>;
//# sourceMappingURL=downstreamKeyer.d.ts.map

@@ -5,14 +5,13 @@ "use strict";

const atem_connection_1 = require("atem-connection");
const Defaults = require("../defaults");
const __1 = require("../");
const util_1 = require("../util");
function resolveDownstreamKeyerState(oldState, newState) {
var _a, _b, _c, _d, _e, _f, _g, _h;
const commands = [];
for (const index of util_1.getAllKeysNumber((_a = oldState.video) === null || _a === void 0 ? void 0 : _a.downstreamKeyers, (_b = newState.video) === null || _b === void 0 ? void 0 : _b.downstreamKeyers)) {
const oldDsk = util_1.fillDefaults(Defaults.Video.DownstreamKeyer, (_d = (_c = oldState.video) === null || _c === void 0 ? void 0 : _c.downstreamKeyers) === null || _d === void 0 ? void 0 : _d[index]);
const newDsk = util_1.fillDefaults(Defaults.Video.DownstreamKeyer, (_f = (_e = newState.video) === null || _e === void 0 ? void 0 : _e.downstreamKeyers) === null || _f === void 0 ? void 0 : _f[index]);
for (const index of util_1.getAllKeysNumber(oldState.video.downstreamKeyers, newState.video.downstreamKeyers)) {
const oldDsk = atem_connection_1.AtemStateUtil.getDownstreamKeyer(oldState, index, true);
const newDsk = atem_connection_1.AtemStateUtil.getDownstreamKeyer(newState, index, true);
commands.push(...resolveDownstreamKeyerPropertiesState(index, oldDsk, newDsk));
commands.push(...resolveDownstreamKeyerMaskState(index, oldDsk, newDsk));
const oldSources = (_g = oldDsk.sources) !== null && _g !== void 0 ? _g : Defaults.Video.DownstreamerKeyerSources;
const newSources = (_h = newDsk.sources) !== null && _h !== void 0 ? _h : Defaults.Video.DownstreamerKeyerSources;
const oldSources = oldDsk.sources || __1.Defaults.Video.DownstreamerKeyerSources;
const newSources = newDsk.sources || __1.Defaults.Video.DownstreamerKeyerSources;
if (oldSources.fillSource !== newSources.fillSource) {

@@ -38,4 +37,4 @@ commands.push(new atem_connection_1.Commands.DownstreamKeyFillSourceCommand(index, newSources.fillSource));

return commands;
const oldProps = util_1.fillDefaults(Defaults.Video.DownstreamerKeyerProperties, oldDsk.properties);
const newProps = util_1.fillDefaults(Defaults.Video.DownstreamerKeyerProperties, newDsk.properties);
const oldProps = oldDsk.properties || __1.Defaults.Video.DownstreamerKeyerProperties;
const newProps = newDsk.properties || __1.Defaults.Video.DownstreamerKeyerProperties;
const props = util_1.diffObject(oldProps, newProps);

@@ -59,4 +58,4 @@ const command = new atem_connection_1.Commands.DownstreamKeyGeneralCommand(index);

return commands;
const oldProps = util_1.fillDefaults(Defaults.Video.DownstreamerKeyerProperties, oldDsk.properties);
const newProps = util_1.fillDefaults(Defaults.Video.DownstreamerKeyerProperties, newDsk.properties);
const oldProps = oldDsk.properties || __1.Defaults.Video.DownstreamerKeyerProperties;
const newProps = newDsk.properties || __1.Defaults.Video.DownstreamerKeyerProperties;
const props = util_1.diffObject(oldProps.mask, newProps.mask);

@@ -63,0 +62,0 @@ const command = new atem_connection_1.Commands.DownstreamKeyMaskCommand(index);

import { Commands as AtemCommands, Enums } from 'atem-connection';
import { State as StateObject } from '../state';
import { PartialDeep } from 'type-fest';
export declare function videoState(oldState: PartialDeep<StateObject>, newState: PartialDeep<StateObject>, version: Enums.ProtocolVersion): Array<AtemCommands.ISerializableCommand>;
import { State as StateObject } from '../';
export declare function videoState(oldState: StateObject, newState: StateObject, version: Enums.ProtocolVersion): Array<AtemCommands.ISerializableCommand>;
//# sourceMappingURL=index.d.ts.map

@@ -8,11 +8,7 @@ "use strict";

const supersource_1 = require("./supersource");
const classic_audio_1 = require("./classic-audio");
const audio_1 = require("./audio");
const macro_1 = require("./macro");
const util_1 = require("../util");
const media_1 = require("./media");
const color_1 = require("./color");
const multiviewer_1 = require("./settings/multiviewer");
const falirlight_audio_1 = require("./falirlight-audio");
function videoState(oldState, newState, version) {
var _a, _b, _c, _d, _e, _f, _g, _h;
const commands = [];

@@ -23,11 +19,8 @@ commands.push(...mixEffect_1.resolveMixEffectsState(oldState, newState));

commands.push(...supersource_1.resolveSuperSourceState(oldState, newState, version));
commands.push(...classic_audio_1.resolveClassicAudioState(oldState, newState));
commands.push(...falirlight_audio_1.resolveFairlightAudioState(oldState, newState, version));
commands.push(...audio_1.resolveAudioState(oldState, newState));
commands.push(...media_1.resolveMediaPlayerState(oldState, newState));
commands.push(...color_1.resolveColorState(oldState, newState));
commands.push(...multiviewer_1.resolveMultiviewerState(oldState, newState));
// resolve auxilliaries:
for (const index of util_1.getAllKeysNumber((_a = oldState.video) === null || _a === void 0 ? void 0 : _a.auxilliaries, (_b = newState.video) === null || _b === void 0 ? void 0 : _b.auxilliaries)) {
const oldSource = (_e = (_d = (_c = oldState.video) === null || _c === void 0 ? void 0 : _c.auxilliaries) === null || _d === void 0 ? void 0 : _d[index]) !== null && _e !== void 0 ? _e : 0;
const newSource = (_h = (_g = (_f = newState.video) === null || _f === void 0 ? void 0 : _f.auxilliaries) === null || _g === void 0 ? void 0 : _g[index]) !== null && _h !== void 0 ? _h : 0;
for (const index of util_1.getAllKeysNumber(oldState.video.auxilliaries, newState.video.auxilliaries)) {
const oldSource = oldState.video.auxilliaries[index] || 0;
const newSource = newState.video.auxilliaries[index] || 0;
if (oldSource !== newSource) {

@@ -34,0 +27,0 @@ commands.push(new atem_connection_1.Commands.AuxSourceCommand(index, newSource));

import { Commands as AtemCommands } from 'atem-connection';
import { PartialDeep } from 'type-fest';
import { State as StateObject } from '../state';
export declare function resolveMacroPlayerState(oldState: PartialDeep<StateObject>, newState: PartialDeep<StateObject>): Array<AtemCommands.ISerializableCommand>;
import { State as StateObject } from '../';
export declare function resolveMacroPlayerState(oldState: StateObject, newState: StateObject): Array<AtemCommands.ISerializableCommand>;
//# sourceMappingURL=macro.d.ts.map

@@ -6,10 +6,8 @@ "use strict";

function resolveMacroPlayerState(oldState, newState) {
var _a, _b;
const commands = [];
const newPlayer = (_a = newState.macro) === null || _a === void 0 ? void 0 : _a.macroPlayer;
const oldPlayer = (_b = oldState.macro) === null || _b === void 0 ? void 0 : _b.macroPlayer;
const newPlayer = newState.macro.macroPlayer;
const oldPlayer = oldState.macro.macroPlayer;
// TODO - fill out more
if (newPlayer &&
newPlayer.isRunning &&
newPlayer.macroIndex !== undefined &&
(!oldPlayer || !oldPlayer.isRunning || oldPlayer.macroIndex !== newPlayer.macroIndex)) {

@@ -16,0 +14,0 @@ commands.push(new atem_connection_1.Commands.MacroActionCommand(newPlayer.macroIndex, atem_connection_1.Enums.MacroAction.Run));

import { Commands as AtemCommands } from 'atem-connection';
import { PartialDeep } from 'type-fest';
import { State as StateObject } from '../state';
export declare function resolveMediaPlayerState(oldState: PartialDeep<StateObject>, newState: PartialDeep<StateObject>): Array<AtemCommands.ISerializableCommand>;
import { State as StateObject } from '../';
export declare function resolveMediaPlayerState(oldState: StateObject, newState: StateObject): Array<AtemCommands.ISerializableCommand>;
//# sourceMappingURL=media.d.ts.map

@@ -5,10 +5,8 @@ "use strict";

const atem_connection_1 = require("atem-connection");
const Defaults = require("../defaults");
const util_1 = require("../util");
function resolveMediaPlayerState(oldState, newState) {
var _a, _b, _c, _d, _e, _f;
const commands = [];
for (const index of util_1.getAllKeysNumber((_a = oldState.media) === null || _a === void 0 ? void 0 : _a.players, (_b = newState.media) === null || _b === void 0 ? void 0 : _b.players)) {
const newPlayer = util_1.fillDefaults(Defaults.Video.MediaPlayer, (_d = (_c = newState.media) === null || _c === void 0 ? void 0 : _c.players) === null || _d === void 0 ? void 0 : _d[index]);
const oldPlayer = util_1.fillDefaults(Defaults.Video.MediaPlayer, (_f = (_e = oldState.media) === null || _e === void 0 ? void 0 : _e.players) === null || _f === void 0 ? void 0 : _f[index]);
for (const index of util_1.getAllKeysNumber(oldState.media.players, newState.media.players)) {
const newPlayer = atem_connection_1.AtemStateUtil.getMediaPlayer(newState, index, true);
const oldPlayer = atem_connection_1.AtemStateUtil.getMediaPlayer(oldState, index, true);
const props = util_1.diffObject(oldPlayer, newPlayer);

@@ -15,0 +13,0 @@ const command = new atem_connection_1.Commands.MediaPlayerStatusCommand(index);

import { Commands as AtemCommands, VideoState } from 'atem-connection';
import { State as StateObject } from '../state';
import { State as StateObject } from '../';
import { ExtendedMixEffect } from '../state';
import { PartialDeep } from 'type-fest';
export declare function resolveMixEffectsState(oldState: PartialDeep<StateObject>, newState: PartialDeep<StateObject>): Array<AtemCommands.ISerializableCommand>;
export declare function resolveTransitionPropertiesState(mixEffectId: number, oldMixEffect: PartialDeep<VideoState.MixEffect> | PartialDeep<ExtendedMixEffect> | undefined, newMixEffect: PartialDeep<VideoState.MixEffect> | PartialDeep<ExtendedMixEffect> | undefined): Array<AtemCommands.ISerializableCommand>;
export declare function resolveTransitionSettingsState(mixEffectId: number, oldMixEffect: PartialDeep<VideoState.MixEffect> | PartialDeep<ExtendedMixEffect> | undefined, newMixEffect: PartialDeep<VideoState.MixEffect> | PartialDeep<ExtendedMixEffect> | undefined): Array<AtemCommands.ISerializableCommand>;
export declare function resolveMixEffectsState(oldState: StateObject, newState: StateObject): Array<AtemCommands.ISerializableCommand>;
export declare function resolveTransitionPropertiesState(mixEffectId: number, oldMixEffect: VideoState.MixEffect | ExtendedMixEffect, newMixEffect: VideoState.MixEffect | ExtendedMixEffect): Array<AtemCommands.ISerializableCommand>;
export declare function resolveTransitionSettingsState(mixEffectId: number, oldMixEffect: VideoState.MixEffect | ExtendedMixEffect, newMixEffect: VideoState.MixEffect | ExtendedMixEffect): Array<AtemCommands.ISerializableCommand>;
//# sourceMappingURL=mixEffect.d.ts.map

@@ -5,39 +5,22 @@ "use strict";

const atem_connection_1 = require("atem-connection");
const Defaults = require("../defaults");
const Enums = require("../enums");
const __1 = require("../");
const util_1 = require("../util");
const upstreamKeyers_1 = require("./upstreamKeyers");
function resolveMixEffectsState(oldState, newState) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
const commands = [];
for (const mixEffectId of util_1.getAllKeysNumber((_a = oldState.video) === null || _a === void 0 ? void 0 : _a.mixEffects, (_b = newState.video) === null || _b === void 0 ? void 0 : _b.mixEffects)) {
const oldMixEffect = (_d = (_c = oldState.video) === null || _c === void 0 ? void 0 : _c.mixEffects) === null || _d === void 0 ? void 0 : _d[mixEffectId];
const newMixEffect = (_f = (_e = newState.video) === null || _e === void 0 ? void 0 : _e.mixEffects) === null || _f === void 0 ? void 0 : _f[mixEffectId];
for (const mixEffectId of util_1.getAllKeysNumber(oldState.video.mixEffects, newState.video.mixEffects)) {
const oldMixEffect = atem_connection_1.AtemStateUtil.getMixEffect(oldState, mixEffectId, true);
const newMixEffect = atem_connection_1.AtemStateUtil.getMixEffect(newState, mixEffectId, true);
commands.push(...resolveTransitionPropertiesState(mixEffectId, oldMixEffect, newMixEffect));
commands.push(...resolveTransitionSettingsState(mixEffectId, oldMixEffect, newMixEffect));
commands.push(...upstreamKeyers_1.resolveUpstreamKeyerState(mixEffectId, oldMixEffect, newMixEffect));
let oldMEInput = 0;
let oldMeTransition = Defaults.Video.TransitionProperties.style;
if (oldMixEffect) {
if ('input' in oldMixEffect || 'transition' in oldMixEffect) {
oldMEInput = (_g = oldMixEffect.input) !== null && _g !== void 0 ? _g : oldMEInput;
oldMeTransition = (_h = oldMixEffect.transition) !== null && _h !== void 0 ? _h : oldMeTransition;
}
else {
oldMeTransition = (_k = (_j = oldMixEffect.transitionProperties) === null || _j === void 0 ? void 0 : _j.style) !== null && _k !== void 0 ? _k : oldMeTransition;
if ('programInput' in oldMixEffect) {
oldMEInput = (_l = oldMixEffect.programInput) !== null && _l !== void 0 ? _l : oldMEInput;
}
}
}
// const oldMEInput = 'input' in oldMixEffect2 ? oldMixEffect2.input : oldMixEffect2.programInput
// const oldMeTransition =
// 'transition' in oldMixEffect ? oldMixEffect.transition : oldMixEffect.transitionProperties.style
if (newMixEffect && 'input' in newMixEffect && 'transition' in newMixEffect) {
if (newMixEffect.input !== oldMEInput || newMixEffect.transition === Enums.TransitionStyle.DUMMY) {
commands.push(new atem_connection_1.Commands.PreviewInputCommand(mixEffectId, (_m = newMixEffect.input) !== null && _m !== void 0 ? _m : 0));
if (newMixEffect.transition === Enums.TransitionStyle.CUT) {
const oldMEInput = 'input' in oldMixEffect ? oldMixEffect.input : oldMixEffect.programInput;
const oldMeTransition = 'transition' in oldMixEffect ? oldMixEffect.transition : oldMixEffect.transitionProperties.style;
if ('input' in newMixEffect && 'transition' in newMixEffect) {
if (newMixEffect.input !== oldMEInput || newMixEffect.transition === __1.Enums.TransitionStyle.DUMMY) {
commands.push(new atem_connection_1.Commands.PreviewInputCommand(mixEffectId, newMixEffect.input));
if (newMixEffect.transition === __1.Enums.TransitionStyle.CUT) {
commands.push(new atem_connection_1.Commands.CutCommand(mixEffectId));
}
else if (newMixEffect.transition !== Enums.TransitionStyle.DUMMY) {
else if (newMixEffect.transition !== __1.Enums.TransitionStyle.DUMMY) {
if (newMixEffect.transition !== oldMeTransition) {

@@ -56,7 +39,7 @@ // set style before auto transition command

}
else if ((!oldMixEffect || 'previewInput' in oldMixEffect) && (!newMixEffect || 'previewInput' in newMixEffect)) {
if ((oldMixEffect === null || oldMixEffect === void 0 ? void 0 : oldMixEffect.previewInput) !== (newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.previewInput)) {
commands.push(new atem_connection_1.Commands.PreviewInputCommand(mixEffectId, (_o = newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.previewInput) !== null && _o !== void 0 ? _o : 0));
else if ('previewInput' in oldMixEffect && 'previewInput' in newMixEffect) {
if (oldMixEffect.previewInput !== newMixEffect.previewInput) {
commands.push(new atem_connection_1.Commands.PreviewInputCommand(mixEffectId, newMixEffect.previewInput));
}
if (oldMEInput !== (newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.programInput)) {
if (oldMEInput !== newMixEffect.programInput) {
// @todo: check if we need to use the cut command?

@@ -66,14 +49,14 @@ // use cut command if:

// Upstream Keyer is set for next transition
commands.push(new atem_connection_1.Commands.ProgramInputCommand(mixEffectId, (_p = newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.programInput) !== null && _p !== void 0 ? _p : 0));
commands.push(new atem_connection_1.Commands.ProgramInputCommand(mixEffectId, newMixEffect.programInput));
}
}
if (((_q = newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.transitionPosition) === null || _q === void 0 ? void 0 : _q.inTransition) &&
((_r = oldMixEffect === null || oldMixEffect === void 0 ? void 0 : oldMixEffect.transitionPosition) === null || _r === void 0 ? void 0 : _r.handlePosition) !== newMixEffect.transitionPosition.handlePosition) {
commands.push(new atem_connection_1.Commands.TransitionPositionCommand(mixEffectId, (_t = (_s = newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.transitionPosition) === null || _s === void 0 ? void 0 : _s.handlePosition) !== null && _t !== void 0 ? _t : 0));
if (newMixEffect.transitionPosition.inTransition &&
oldMixEffect.transitionPosition.handlePosition !== newMixEffect.transitionPosition.handlePosition) {
commands.push(new atem_connection_1.Commands.TransitionPositionCommand(mixEffectId, newMixEffect.transitionPosition.handlePosition));
}
if (((_u = oldMixEffect === null || oldMixEffect === void 0 ? void 0 : oldMixEffect.transitionPosition) === null || _u === void 0 ? void 0 : _u.inTransition) && !((_v = newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.transitionPosition) === null || _v === void 0 ? void 0 : _v.inTransition)) {
if (oldMixEffect.transitionPosition.inTransition && !newMixEffect.transitionPosition.inTransition) {
commands.push(new atem_connection_1.Commands.TransitionPositionCommand(mixEffectId, 10000)); // finish transition
}
if (((_w = oldMixEffect === null || oldMixEffect === void 0 ? void 0 : oldMixEffect.transitionPreview) !== null && _w !== void 0 ? _w : false) !== ((_x = newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.transitionPreview) !== null && _x !== void 0 ? _x : false)) {
commands.push(new atem_connection_1.Commands.PreviewTransitionCommand(mixEffectId, (_y = newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.transitionPreview) !== null && _y !== void 0 ? _y : false));
if (oldMixEffect.transitionPreview !== newMixEffect.transitionPreview) {
commands.push(new atem_connection_1.Commands.PreviewTransitionCommand(mixEffectId, newMixEffect.transitionPreview));
}

@@ -87,4 +70,4 @@ // @todo: fadeToBlack

const commands = [];
const oldTransitionProperties = util_1.fillDefaults(Defaults.Video.TransitionProperties, oldMixEffect === null || oldMixEffect === void 0 ? void 0 : oldMixEffect.transitionProperties);
const newTransitionProperties = util_1.fillDefaults(Defaults.Video.TransitionProperties, newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.transitionProperties);
const oldTransitionProperties = oldMixEffect.transitionProperties;
const newTransitionProperties = newMixEffect.transitionProperties;
const props = util_1.diffObject(oldTransitionProperties, newTransitionProperties);

@@ -100,6 +83,6 @@ const command = new atem_connection_1.Commands.TransitionPropertiesCommand(mixEffectId);

const commands = [];
const oldTransitionSettings = oldMixEffect === null || oldMixEffect === void 0 ? void 0 : oldMixEffect.transitionSettings;
const newTransitionSettings = newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.transitionSettings;
if ((newTransitionSettings === null || newTransitionSettings === void 0 ? void 0 : newTransitionSettings.dip) || (oldTransitionSettings === null || oldTransitionSettings === void 0 ? void 0 : oldTransitionSettings.dip)) {
const dipProperties = util_1.diffObject(util_1.fillDefaults(Defaults.Video.DipTransitionSettings, oldTransitionSettings === null || oldTransitionSettings === void 0 ? void 0 : oldTransitionSettings.dip), util_1.fillDefaults(Defaults.Video.DipTransitionSettings, newTransitionSettings === null || newTransitionSettings === void 0 ? void 0 : newTransitionSettings.dip));
const oldTransitionSettings = oldMixEffect.transitionSettings;
const newTransitionSettings = newMixEffect.transitionSettings;
if (newTransitionSettings.dip || oldTransitionSettings.dip) {
const dipProperties = util_1.diffObject(oldTransitionSettings.dip || __1.Defaults.Video.DipTransitionSettings, newTransitionSettings.dip || __1.Defaults.Video.DipTransitionSettings);
const command = new atem_connection_1.Commands.TransitionDipCommand(mixEffectId);

@@ -110,4 +93,4 @@ if (command.updateProps(dipProperties)) {

}
if ((newTransitionSettings === null || newTransitionSettings === void 0 ? void 0 : newTransitionSettings.DVE) || (oldTransitionSettings === null || oldTransitionSettings === void 0 ? void 0 : oldTransitionSettings.DVE)) {
const dveProperties = util_1.diffObject(util_1.fillDefaults(Defaults.Video.DVETransitionSettings, oldTransitionSettings === null || oldTransitionSettings === void 0 ? void 0 : oldTransitionSettings.DVE), util_1.fillDefaults(Defaults.Video.DVETransitionSettings, newTransitionSettings === null || newTransitionSettings === void 0 ? void 0 : newTransitionSettings.DVE));
if (newTransitionSettings.DVE || oldTransitionSettings.DVE) {
const dveProperties = util_1.diffObject(oldTransitionSettings.DVE || __1.Defaults.Video.DVETransitionSettings, newTransitionSettings.DVE || __1.Defaults.Video.DVETransitionSettings);
const command = new atem_connection_1.Commands.TransitionDVECommand(mixEffectId);

@@ -118,5 +101,5 @@ if (command.updateProps(dveProperties)) {

}
if ((newTransitionSettings === null || newTransitionSettings === void 0 ? void 0 : newTransitionSettings.mix) || (oldTransitionSettings === null || oldTransitionSettings === void 0 ? void 0 : oldTransitionSettings.mix)) {
const oldProps = util_1.fillDefaults(Defaults.Video.MixTransitionSettings, oldTransitionSettings === null || oldTransitionSettings === void 0 ? void 0 : oldTransitionSettings.mix);
const newProps = util_1.fillDefaults(Defaults.Video.MixTransitionSettings, newTransitionSettings === null || newTransitionSettings === void 0 ? void 0 : newTransitionSettings.mix);
if (newTransitionSettings.mix || oldTransitionSettings.mix) {
const oldProps = oldTransitionSettings.mix || __1.Defaults.Video.MixTransitionSettings;
const newProps = newTransitionSettings.mix || __1.Defaults.Video.MixTransitionSettings;
if (oldProps.rate !== newProps.rate) {

@@ -126,4 +109,4 @@ commands.push(new atem_connection_1.Commands.TransitionMixCommand(mixEffectId, newProps.rate));

}
if ((newTransitionSettings === null || newTransitionSettings === void 0 ? void 0 : newTransitionSettings.stinger) || (oldTransitionSettings === null || oldTransitionSettings === void 0 ? void 0 : oldTransitionSettings.stinger)) {
const stingerProperties = util_1.diffObject(util_1.fillDefaults(Defaults.Video.StingerTransitionSettings, oldTransitionSettings === null || oldTransitionSettings === void 0 ? void 0 : oldTransitionSettings.stinger), util_1.fillDefaults(Defaults.Video.StingerTransitionSettings, newTransitionSettings === null || newTransitionSettings === void 0 ? void 0 : newTransitionSettings.stinger));
if (newTransitionSettings.stinger || oldTransitionSettings.stinger) {
const stingerProperties = util_1.diffObject(oldTransitionSettings.stinger || __1.Defaults.Video.StingerTransitionSettings, newTransitionSettings.stinger || __1.Defaults.Video.StingerTransitionSettings);
const command = new atem_connection_1.Commands.TransitionStingerCommand(mixEffectId);

@@ -134,4 +117,4 @@ if (command.updateProps(stingerProperties)) {

}
if ((newTransitionSettings === null || newTransitionSettings === void 0 ? void 0 : newTransitionSettings.wipe) || (oldTransitionSettings === null || oldTransitionSettings === void 0 ? void 0 : oldTransitionSettings.wipe)) {
const wipeProperties = util_1.diffObject(util_1.fillDefaults(Defaults.Video.WipeTransitionSettings, oldTransitionSettings === null || oldTransitionSettings === void 0 ? void 0 : oldTransitionSettings.wipe), util_1.fillDefaults(Defaults.Video.WipeTransitionSettings, newTransitionSettings === null || newTransitionSettings === void 0 ? void 0 : newTransitionSettings.wipe));
if (newTransitionSettings.wipe || oldTransitionSettings.wipe) {
const wipeProperties = util_1.diffObject(oldTransitionSettings.wipe || __1.Defaults.Video.WipeTransitionSettings, newTransitionSettings.wipe || __1.Defaults.Video.WipeTransitionSettings);
const command = new atem_connection_1.Commands.TransitionWipeCommand(mixEffectId);

@@ -138,0 +121,0 @@ if (command.updateProps(wipeProperties)) {

import { Commands as AtemCommands, Enums } from 'atem-connection';
import { State as StateObject } from '../state';
import { PartialDeep } from 'type-fest';
export declare function resolveSuperSourceState(oldState: PartialDeep<StateObject>, newState: PartialDeep<StateObject>, version: Enums.ProtocolVersion): Array<AtemCommands.ISerializableCommand>;
export declare function resolveSuperSourceBoxState(oldState: PartialDeep<StateObject>, newState: PartialDeep<StateObject>, version: Enums.ProtocolVersion): Array<AtemCommands.ISerializableCommand>;
export declare function resolveSuperSourcePropertiesState(oldState: PartialDeep<StateObject>, newState: PartialDeep<StateObject>): Array<AtemCommands.ISerializableCommand>;
export declare function resolveSuperSourcePropertiesV8State(oldState: PartialDeep<StateObject>, newState: PartialDeep<StateObject>): Array<AtemCommands.ISerializableCommand>;
export declare function resolveSuperSourceBorderV8State(oldState: PartialDeep<StateObject>, newState: PartialDeep<StateObject>): Array<AtemCommands.ISerializableCommand>;
import { State as StateObject } from '..';
export declare function resolveSuperSourceState(oldState: StateObject, newState: StateObject, version: Enums.ProtocolVersion): Array<AtemCommands.ISerializableCommand>;
export declare function resolveSuperSourceBoxState(oldState: StateObject, newState: StateObject, version: Enums.ProtocolVersion): Array<AtemCommands.ISerializableCommand>;
export declare function resolveSuperSourcePropertiesState(oldState: StateObject, newState: StateObject): Array<AtemCommands.ISerializableCommand>;
export declare function resolveSuperSourcePropertiesV8State(oldState: StateObject, newState: StateObject): Array<AtemCommands.ISerializableCommand>;
export declare function resolveSuperSourceBorderV8State(oldState: StateObject, newState: StateObject): Array<AtemCommands.ISerializableCommand>;
//# sourceMappingURL=supersource.d.ts.map

@@ -22,5 +22,4 @@ "use strict";

function resolveSuperSourceBoxState(oldState, newState, version) {
var _a, _b, _c, _d, _e, _f, _g, _h;
const commands = [];
for (const ssrc of util_1.getAllKeysNumber((_a = oldState.video) === null || _a === void 0 ? void 0 : _a.superSources, (_b = newState.video) === null || _b === void 0 ? void 0 : _b.superSources).sort()) {
for (const ssrc of util_1.getAllKeysNumber(oldState.video.superSources, newState.video.superSources).sort()) {
if (version < atem_connection_1.Enums.ProtocolVersion.V8_0 && ssrc !== 0) {

@@ -30,8 +29,6 @@ // 8.0 added support for multiple ssrc. So only run for the first

}
const newSSrc = (_d = (_c = newState.video) === null || _c === void 0 ? void 0 : _c.superSources) === null || _d === void 0 ? void 0 : _d[ssrc];
const oldSSrc = (_f = (_e = oldState.video) === null || _e === void 0 ? void 0 : _e.superSources) === null || _f === void 0 ? void 0 : _f[ssrc];
for (const index of util_1.getAllKeysNumber(oldSSrc === null || oldSSrc === void 0 ? void 0 : oldSSrc.boxes, newSSrc === null || newSSrc === void 0 ? void 0 : newSSrc.boxes)) {
const oldBox = util_1.fillDefaults(Defaults.Video.SuperSourceBox, (_g = oldSSrc === null || oldSSrc === void 0 ? void 0 : oldSSrc.boxes) === null || _g === void 0 ? void 0 : _g[index]);
const newBox = util_1.fillDefaults(Defaults.Video.SuperSourceBox, (_h = newSSrc === null || newSSrc === void 0 ? void 0 : newSSrc.boxes) === null || _h === void 0 ? void 0 : _h[index]);
const props = util_1.diffObject(oldBox, newBox);
const newSSrc = atem_connection_1.AtemStateUtil.getSuperSource(newState, ssrc, true);
const oldSSrc = atem_connection_1.AtemStateUtil.getSuperSource(oldState, ssrc, true);
for (const index in newSSrc.boxes) {
const props = util_1.diffObject(oldSSrc.boxes[index] || Defaults.Video.SuperSourceBox, newSSrc.boxes[index] || Defaults.Video.SuperSourceBox);
const command = new atem_connection_1.Commands.SuperSourceBoxParametersCommand(ssrc, Number(index));

@@ -47,9 +44,7 @@ if (command.updateProps(props)) {

function resolveSuperSourcePropertiesState(oldState, newState) {
var _a, _b, _c, _d, _e, _f, _g, _h;
const commands = [];
if (!((_b = (_a = newState.video) === null || _a === void 0 ? void 0 : _a.superSources) === null || _b === void 0 ? void 0 : _b[0]) && !((_d = (_c = oldState.video) === null || _c === void 0 ? void 0 : _c.superSources) === null || _d === void 0 ? void 0 : _d[0]))
if (!newState.video.superSources[0] && !oldState.video.superSources[0])
return commands;
const ssrcDefaults = { properties: Defaults.Video.SuperSourceProperties, border: Defaults.Video.SuperSourceBorder };
const newSSrc = util_1.fillDefaults(ssrcDefaults, (_f = (_e = newState.video) === null || _e === void 0 ? void 0 : _e.superSources) === null || _f === void 0 ? void 0 : _f[0]);
const oldSSrc = util_1.fillDefaults(ssrcDefaults, (_h = (_g = oldState.video) === null || _g === void 0 ? void 0 : _g.superSources) === null || _h === void 0 ? void 0 : _h[0]);
const newSSrc = atem_connection_1.AtemStateUtil.getSuperSource(newState, 0, true);
const oldSSrc = atem_connection_1.AtemStateUtil.getSuperSource(oldState, 0, true);
const newSsProperties = {

@@ -72,8 +67,7 @@ ...newSSrc.properties,

function resolveSuperSourcePropertiesV8State(oldState, newState) {
var _a, _b, _c, _d, _e, _f, _g, _h;
const commands = [];
for (const ssrc of util_1.getAllKeysNumber((_a = oldState.video) === null || _a === void 0 ? void 0 : _a.superSources, (_b = newState.video) === null || _b === void 0 ? void 0 : _b.superSources).sort()) {
const newSSrcProps = util_1.fillDefaults(Defaults.Video.SuperSourceProperties, (_e = (_d = (_c = newState.video) === null || _c === void 0 ? void 0 : _c.superSources) === null || _d === void 0 ? void 0 : _d[ssrc]) === null || _e === void 0 ? void 0 : _e.properties);
const oldSSrcProps = util_1.fillDefaults(Defaults.Video.SuperSourceProperties, (_h = (_g = (_f = oldState.video) === null || _f === void 0 ? void 0 : _f.superSources) === null || _g === void 0 ? void 0 : _g[ssrc]) === null || _h === void 0 ? void 0 : _h.properties);
const props = util_1.diffObject(oldSSrcProps, newSSrcProps);
for (const ssrc of util_1.getAllKeysNumber(oldState.video.superSources, newState.video.superSources).sort()) {
const newSSrc = atem_connection_1.AtemStateUtil.getSuperSource(newState, ssrc, true);
const oldSSrc = atem_connection_1.AtemStateUtil.getSuperSource(oldState, ssrc, true);
const props = util_1.diffObject(oldSSrc.properties || Defaults.Video.SuperSourceProperties, newSSrc.properties || Defaults.Video.SuperSourceProperties);
const command = new atem_connection_1.Commands.SuperSourcePropertiesV8Command(ssrc);

@@ -88,8 +82,7 @@ if (command.updateProps(props)) {

function resolveSuperSourceBorderV8State(oldState, newState) {
var _a, _b, _c, _d, _e, _f, _g, _h;
const commands = [];
for (const ssrc of util_1.getAllKeysNumber((_a = oldState.video) === null || _a === void 0 ? void 0 : _a.superSources, (_b = newState.video) === null || _b === void 0 ? void 0 : _b.superSources).sort()) {
const newSSrcBorder = util_1.fillDefaults(Defaults.Video.SuperSourceBorder, (_e = (_d = (_c = newState.video) === null || _c === void 0 ? void 0 : _c.superSources) === null || _d === void 0 ? void 0 : _d[ssrc]) === null || _e === void 0 ? void 0 : _e.border);
const oldSSrcBorder = util_1.fillDefaults(Defaults.Video.SuperSourceBorder, (_h = (_g = (_f = oldState.video) === null || _f === void 0 ? void 0 : _f.superSources) === null || _g === void 0 ? void 0 : _g[ssrc]) === null || _h === void 0 ? void 0 : _h.border);
const props = util_1.diffObject(oldSSrcBorder, newSSrcBorder);
for (const ssrc of util_1.getAllKeysNumber(oldState.video.superSources, newState.video.superSources).sort()) {
const newSSrc = atem_connection_1.AtemStateUtil.getSuperSource(newState, ssrc, true);
const oldSSrc = atem_connection_1.AtemStateUtil.getSuperSource(oldState, ssrc, true);
const props = util_1.diffObject(oldSSrc.border || Defaults.Video.SuperSourceBorder, newSSrc.border || Defaults.Video.SuperSourceBorder);
const command = new atem_connection_1.Commands.SuperSourceBorderCommand(ssrc);

@@ -96,0 +89,0 @@ if (command.updateProps(props)) {

import { Commands as AtemCommands, VideoState } from 'atem-connection';
import { PartialDeep } from 'type-fest';
export declare function resolveChromaKeyerState(mixEffectId: number, upstreamKeyerId: number, oldKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>, newKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>): Array<AtemCommands.ISerializableCommand>;
export declare function resolveAdvancedChromaKeyerState(mixEffectId: number, upstreamKeyerId: number, oldKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>, newKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>): Array<AtemCommands.ISerializableCommand>;
export declare function resolveChromaKeyerState(mixEffectId: number, upstreamKeyerId: number, oldKeyer: VideoState.USK.UpstreamKeyer, newKeyer: VideoState.USK.UpstreamKeyer): Array<AtemCommands.ISerializableCommand>;
//# sourceMappingURL=chromaKeyer.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.resolveAdvancedChromaKeyerState = exports.resolveChromaKeyerState = void 0;
exports.resolveChromaKeyerState = void 0;
const atem_connection_1 = require("atem-connection");
const util_1 = require("../../util");
const Defaults = require("../../defaults");
const __1 = require("../..");
function resolveChromaKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer) {

@@ -11,4 +11,4 @@ const commands = [];

return commands;
const oldChromaKeyer = util_1.fillDefaults(Defaults.Video.UpstreamKeyerChromaSettings, oldKeyer.chromaSettings);
const newChromaKeyer = util_1.fillDefaults(Defaults.Video.UpstreamKeyerChromaSettings, newKeyer.chromaSettings);
const oldChromaKeyer = oldKeyer.chromaSettings || __1.Defaults.Video.UpstreamKeyerChromaSettings;
const newChromaKeyer = newKeyer.chromaSettings || __1.Defaults.Video.UpstreamKeyerChromaSettings;
const props = util_1.diffObject(oldChromaKeyer, newChromaKeyer);

@@ -22,28 +22,2 @@ const command = new atem_connection_1.Commands.MixEffectKeyChromaCommand(mixEffectId, upstreamKeyerId);

exports.resolveChromaKeyerState = resolveChromaKeyerState;
function resolveAdvancedChromaKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer) {
var _a, _b, _c, _d;
const commands = [];
if (!oldKeyer.advancedChromaSettings && !newKeyer.advancedChromaSettings)
return commands;
{
const oldProperties = util_1.fillDefaults(Defaults.Video.UpstreamKeyerAdvancedChromaProperties, (_a = oldKeyer.advancedChromaSettings) === null || _a === void 0 ? void 0 : _a.properties);
const newProperties = util_1.fillDefaults(Defaults.Video.UpstreamKeyerAdvancedChromaProperties, (_b = newKeyer.advancedChromaSettings) === null || _b === void 0 ? void 0 : _b.properties);
const props = util_1.diffObject(oldProperties, newProperties);
const command = new atem_connection_1.Commands.MixEffectKeyAdvancedChromaPropertiesCommand(mixEffectId, upstreamKeyerId);
if (command.updateProps(props)) {
commands.push(command);
}
}
{
const oldProperties = util_1.fillDefaults(Defaults.Video.UpstreamKeyerAdvancedChromaSample, (_c = oldKeyer.advancedChromaSettings) === null || _c === void 0 ? void 0 : _c.sample);
const newProperties = util_1.fillDefaults(Defaults.Video.UpstreamKeyerAdvancedChromaSample, (_d = newKeyer.advancedChromaSettings) === null || _d === void 0 ? void 0 : _d.sample);
const props = util_1.diffObject(oldProperties, newProperties);
const command = new atem_connection_1.Commands.MixEffectKeyAdvancedChromaSampleCommand(mixEffectId, upstreamKeyerId);
if (command.updateProps(props)) {
commands.push(command);
}
}
return commands;
}
exports.resolveAdvancedChromaKeyerState = resolveAdvancedChromaKeyerState;
//# sourceMappingURL=chromaKeyer.js.map
import { Commands as AtemCommands, VideoState } from 'atem-connection';
import { PartialDeep } from 'type-fest';
export declare function resolveDVEKeyerState(mixEffectId: number, upstreamKeyerId: number, oldKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>, newKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>): Array<AtemCommands.ISerializableCommand>;
export declare function resolveDVEKeyerState(mixEffectId: number, upstreamKeyerId: number, oldKeyer: VideoState.USK.UpstreamKeyer, newKeyer: VideoState.USK.UpstreamKeyer): Array<AtemCommands.ISerializableCommand>;
//# sourceMappingURL=dveKeyer.d.ts.map

@@ -6,3 +6,3 @@ "use strict";

const util_1 = require("../../util");
const Defaults = require("../../defaults");
const __1 = require("../..");
function resolveDVEKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer) {

@@ -12,4 +12,4 @@ const commands = [];

return commands;
const oldDVEKeyer = util_1.fillDefaults(Defaults.Video.UpstreamKeyerDVESettings, oldKeyer.dveSettings);
const newDVEKeyer = util_1.fillDefaults(Defaults.Video.UpstreamKeyerDVESettings, newKeyer.dveSettings);
const oldDVEKeyer = oldKeyer.dveSettings || __1.Defaults.Video.UpstreamKeyerDVESettings;
const newDVEKeyer = newKeyer.dveSettings || __1.Defaults.Video.UpstreamKeyerDVESettings;
const props = util_1.diffObject(oldDVEKeyer, newDVEKeyer);

@@ -16,0 +16,0 @@ const command = new atem_connection_1.Commands.MixEffectKeyDVECommand(mixEffectId, upstreamKeyerId);

import { Commands as AtemCommands, VideoState } from 'atem-connection';
import { ExtendedMixEffect } from '../../state';
import { PartialDeep } from 'type-fest';
export declare function resolveUpstreamKeyerState(mixEffectId: number, oldMixEffect: PartialDeep<VideoState.MixEffect> | PartialDeep<ExtendedMixEffect> | undefined, newMixEffect: PartialDeep<VideoState.MixEffect> | PartialDeep<ExtendedMixEffect> | undefined): Array<AtemCommands.ISerializableCommand>;
export declare function resolveUpstreamKeyerMaskState(mixEffectId: number, upstreamKeyerId: number, oldKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>, newKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>): Array<AtemCommands.ISerializableCommand>;
import { MixEffect } from '../../state';
export declare function resolveUpstreamKeyerState(mixEffectId: number, oldMixEffect: MixEffect, newMixEffect: MixEffect): Array<AtemCommands.ISerializableCommand>;
export declare function resolveUpstreamKeyerMaskState(mixEffectId: number, upstreamKeyerId: number, oldKeyer: VideoState.USK.UpstreamKeyer, newKeyer: VideoState.USK.UpstreamKeyer): Array<AtemCommands.ISerializableCommand>;
//# sourceMappingURL=index.d.ts.map

@@ -10,13 +10,10 @@ "use strict";

const util_1 = require("../../util");
const Defaults = require("../../defaults");
function resolveUpstreamKeyerState(mixEffectId, oldMixEffect, newMixEffect) {
var _a, _b;
const commands = [];
for (const upstreamKeyerId of util_1.getAllKeysNumber(oldMixEffect === null || oldMixEffect === void 0 ? void 0 : oldMixEffect.upstreamKeyers, newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.upstreamKeyers)) {
const oldKeyer = util_1.fillDefaults(Defaults.Video.UpstreamKeyer(upstreamKeyerId), (_a = oldMixEffect === null || oldMixEffect === void 0 ? void 0 : oldMixEffect.upstreamKeyers) === null || _a === void 0 ? void 0 : _a[upstreamKeyerId]);
const newKeyer = util_1.fillDefaults(Defaults.Video.UpstreamKeyer(upstreamKeyerId), (_b = newMixEffect === null || newMixEffect === void 0 ? void 0 : newMixEffect.upstreamKeyers) === null || _b === void 0 ? void 0 : _b[upstreamKeyerId]);
for (const upstreamKeyerId of util_1.getAllKeysNumber(oldMixEffect.upstreamKeyers, newMixEffect.upstreamKeyers)) {
const oldKeyer = atem_connection_1.AtemStateUtil.getUpstreamKeyer(oldMixEffect, upstreamKeyerId, true);
const newKeyer = atem_connection_1.AtemStateUtil.getUpstreamKeyer(newMixEffect, upstreamKeyerId, true);
commands.push(...resolveUpstreamKeyerMaskState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer));
commands.push(...dveKeyer_1.resolveDVEKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer));
commands.push(...chromaKeyer_1.resolveChromaKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer));
commands.push(...chromaKeyer_1.resolveAdvancedChromaKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer));
commands.push(...lumaKeyer_1.resolveLumaKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer));

@@ -44,5 +41,3 @@ commands.push(...patternKeyer_1.resolvePatternKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer));

const commands = [];
const oldMask = util_1.fillDefaults(Defaults.Video.UpstreamKeyerMask, oldKeyer.maskSettings);
const newMask = util_1.fillDefaults(Defaults.Video.UpstreamKeyerMask, newKeyer.maskSettings);
const props = util_1.diffObject(oldMask, newMask);
const props = util_1.diffObject(oldKeyer.maskSettings, newKeyer.maskSettings);
const command = new atem_connection_1.Commands.MixEffectKeyMaskSetCommand(mixEffectId, upstreamKeyerId);

@@ -49,0 +44,0 @@ if (command.updateProps(props)) {

import { Commands as AtemCommands, VideoState } from 'atem-connection';
import { PartialDeep } from 'type-fest';
export declare function resolveLumaKeyerState(mixEffectId: number, upstreamKeyerId: number, oldKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>, newKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>): Array<AtemCommands.ISerializableCommand>;
export declare function resolveLumaKeyerState(mixEffectId: number, upstreamKeyerId: number, oldKeyer: VideoState.USK.UpstreamKeyer, newKeyer: VideoState.USK.UpstreamKeyer): Array<AtemCommands.ISerializableCommand>;
//# sourceMappingURL=lumaKeyer.d.ts.map

@@ -6,3 +6,3 @@ "use strict";

const util_1 = require("../../util");
const Defaults = require("../../defaults");
const __1 = require("../..");
function resolveLumaKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer) {

@@ -12,4 +12,4 @@ const commands = [];

return commands;
const oldLumaKeyer = util_1.fillDefaults(Defaults.Video.UpstreamKeyerLumaSettings, oldKeyer.lumaSettings);
const newLumaKeyer = util_1.fillDefaults(Defaults.Video.UpstreamKeyerLumaSettings, newKeyer.lumaSettings);
const oldLumaKeyer = oldKeyer.lumaSettings || __1.Defaults.Video.UpstreamKeyerLumaSettings;
const newLumaKeyer = newKeyer.lumaSettings || __1.Defaults.Video.UpstreamKeyerLumaSettings;
const props = util_1.diffObject(oldLumaKeyer, newLumaKeyer);

@@ -16,0 +16,0 @@ const command = new atem_connection_1.Commands.MixEffectKeyLumaCommand(mixEffectId, upstreamKeyerId);

import { Commands as AtemCommands, VideoState } from 'atem-connection';
import { PartialDeep } from 'type-fest';
export declare function resolvePatternKeyerState(mixEffectId: number, upstreamKeyerId: number, oldKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>, newKeyer: PartialDeep<VideoState.USK.UpstreamKeyer>): Array<AtemCommands.ISerializableCommand>;
export declare function resolvePatternKeyerState(mixEffectId: number, upstreamKeyerId: number, oldKeyer: VideoState.USK.UpstreamKeyer, newKeyer: VideoState.USK.UpstreamKeyer): Array<AtemCommands.ISerializableCommand>;
//# sourceMappingURL=patternKeyer.d.ts.map

@@ -6,3 +6,3 @@ "use strict";

const util_1 = require("../../util");
const Defaults = require("../../defaults");
const __1 = require("../..");
function resolvePatternKeyerState(mixEffectId, upstreamKeyerId, oldKeyer, newKeyer) {

@@ -12,4 +12,4 @@ const commands = [];

return commands;
const oldPatternKeyer = util_1.fillDefaults(Defaults.Video.UpstreamKeyerPatternSettings, oldKeyer.patternSettings);
const newPatternKeyer = util_1.fillDefaults(Defaults.Video.UpstreamKeyerPatternSettings, newKeyer.patternSettings);
const oldPatternKeyer = oldKeyer.patternSettings || __1.Defaults.Video.UpstreamKeyerPatternSettings;
const newPatternKeyer = newKeyer.patternSettings || __1.Defaults.Video.UpstreamKeyerPatternSettings;
const props = util_1.diffObject(oldPatternKeyer, newPatternKeyer);

@@ -16,0 +16,0 @@ if (props && oldPatternKeyer.style !== newPatternKeyer.style) {

@@ -1,16 +0,13 @@

import { PartialDeep } from 'type-fest';
import { PartialObjectDeep } from 'type-fest/source/partial-deep';
export declare function diffObject<T>(oldObj: Partial<T>, newObj: Partial<T>): Partial<T>;
export declare function diffObject<T>(oldObj: T, newObj: T): Partial<T>;
export declare function getAllKeysString<V>(oldObj: {
[key: string]: V;
} | undefined, newObj: {
}, newObj: {
[key: string]: V;
} | undefined): string[];
}): string[];
export declare function getAllKeysNumber<V>(oldObj: {
[key: number]: V;
} | Array<V> | undefined, newObj: {
} | Array<V>, newObj: {
[key: number]: V;
} | Array<V> | undefined): number[];
} | Array<V>): number[];
export declare function jsonClone<T>(src: T): T;
export declare function fillDefaults<T extends object>(defaults: T, val: PartialDeep<T> | PartialObjectDeep<T> | undefined): T;
//# sourceMappingURL=util.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.fillDefaults = exports.jsonClone = exports.getAllKeysNumber = exports.getAllKeysString = exports.diffObject = void 0;
const deepMerge = require("deepmerge");
exports.jsonClone = exports.getAllKeysNumber = exports.getAllKeysString = exports.diffObject = void 0;
function diffObject(oldObj, newObj) {

@@ -22,3 +21,3 @@ const diff = {};

function getAllKeysString(oldObj, newObj) {
const rawKeys = Object.keys(oldObj !== null && oldObj !== void 0 ? oldObj : {}).concat(Object.keys(newObj !== null && newObj !== void 0 ? newObj : {}));
const rawKeys = Object.keys(oldObj).concat(Object.keys(newObj));
return rawKeys.filter((v, i) => keyIsValid(v, oldObj, newObj) && rawKeys.indexOf(v) === i);

@@ -28,3 +27,3 @@ }

function getAllKeysNumber(oldObj, newObj) {
const rawKeys = Object.keys(oldObj !== null && oldObj !== void 0 ? oldObj : []).concat(Object.keys(newObj !== null && newObj !== void 0 ? newObj : []));
const rawKeys = Object.keys(oldObj).concat(Object.keys(newObj));
return rawKeys.filter((v, i) => keyIsValid(v, oldObj, newObj) && rawKeys.indexOf(v) === i).map((v) => parseInt(v, 10));

@@ -37,7 +36,2 @@ }

exports.jsonClone = jsonClone;
// eslint-disable-next-line @typescript-eslint/ban-types
function fillDefaults(defaults, val) {
return deepMerge(defaults, (val !== null && val !== void 0 ? val : {}));
}
exports.fillDefaults = fillDefaults;
//# sourceMappingURL=util.js.map
{
"name": "atem-state",
"version": "0.11.0-nightly-feat-bitfocus-commands-20210422-213434-f4dc38e.0",
"version": "0.12.0-nightly-latest-20210507-154730-e40a6f9.0",
"description": "Typescript Node.js library for comparing ATEM states",

@@ -32,3 +32,2 @@ "main": "dist/index.js",

"scripts": {
"info": "npm-scripts-info",
"build": "rimraf dist && yarn build:main",

@@ -40,3 +39,2 @@ "build:main": "tsc -p tsconfig.build.json",

"test": "yarn lint && yarn unit",
"test:integration": "yarn lint && jest --config=jest-integration.config.js",
"watch": "jest --watch",

@@ -50,5 +48,3 @@ "cov": "jest --coverage; open-cli coverage/lcov-report/index.html",

"docs:json": "typedoc --json docs/typedoc.json src/index.ts",
"docs:publish": "yarn docs:html && gh-pages -d docs",
"changelog": "standard-version",
"release": "yarn reset && yarn test && yarn docs:publish && yarn changelog",
"release": "standard-version",
"reset": "git clean -dfx && git reset --hard && yarn",

@@ -60,3 +56,3 @@ "validate:dependencies": "yarn audit --groups dependencies && yarn license-validate",

"engines": {
"node": ">=10.10"
"node": ">=12.18"
},

@@ -70,13 +66,12 @@ "files": [

"devDependencies": {
"@sofie-automation/code-standard-preset": "^0.2.4",
"@types/jest": "^26.0.22",
"@types/node": "^12.11.2",
"codecov": "^3.8.1",
"gh-pages": "^3.1.0",
"@sofie-automation/code-standard-preset": "^0.2.5",
"@types/jest": "^26.0.23",
"@types/node": "^12.20.12",
"codecov": "^3.8.2",
"jest": "^26.6.3",
"open-cli": "^6",
"rimraf": "^3.0.2",
"standard-version": "^9.2.0",
"ts-jest": "^26.5.5",
"typedoc": "^0.20.35",
"standard-version": "^9.3.0",
"ts-jest": "^26.5.6",
"typedoc": "^0.20.36",
"typescript": "~4.0.5"

@@ -91,6 +86,4 @@ },

"dependencies": {
"atem-connection": "3.0.0-nightly-feat-bitfocus-commands-20210422-212239-b321988.0",
"deepmerge": "^4.2.2",
"tslib": "^2.2.0",
"type-fest": "^1.0.2"
"atem-connection": "2.2.2",
"tslib": "^2.2.0"
},

@@ -97,0 +90,0 @@ "standard-version": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc