New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

atem-connection

Package Overview
Dependencies
Maintainers
1
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

atem-connection - npm Package Compare versions

Comparing version 0.10.0 to 1.0.0

dist/commands/MixEffects/FadeToBlack/FadeToBlackAutoCommand.d.ts

47

CHANGELOG.md

@@ -1,5 +0,50 @@

# Change Log
# Changelog
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
## [1.0.0](https://github.com/nrkno/tv-automation-atem-connection/compare/0.10.0...1.0.0) (2019-09-17)
### Bug Fixes
* broken autoDownstreamKey function and mangled multiviewer window state ([71c61f6](https://github.com/nrkno/tv-automation-atem-connection/commit/71c61f6))
* consistent API for super source methods ([4327660](https://github.com/nrkno/tv-automation-atem-connection/commit/4327660))
* data transfer uses old command names ([e6a6bd0](https://github.com/nrkno/tv-automation-atem-connection/commit/e6a6bd0))
* disable unsupported v8 tests ([8bcafb5](https://github.com/nrkno/tv-automation-atem-connection/commit/8bcafb5))
* dve value range ([33784bc](https://github.com/nrkno/tv-automation-atem-connection/commit/33784bc))
* exclude test helpers in build ([041c37f](https://github.com/nrkno/tv-automation-atem-connection/commit/041c37f))
* exit cleanly after running tests ([c23a9f9](https://github.com/nrkno/tv-automation-atem-connection/commit/c23a9f9))
* ignore failing tests ([8cfcfaf](https://github.com/nrkno/tv-automation-atem-connection/commit/8cfcfaf))
* improve commandParser typings ([1e26d6d](https://github.com/nrkno/tv-automation-atem-connection/commit/1e26d6d))
* Make buffer use in serialize consistent. Remove setting command name in serialize. ([40eec6e](https://github.com/nrkno/tv-automation-atem-connection/commit/40eec6e))
* More command test data mangling ([8bd9009](https://github.com/nrkno/tv-automation-atem-connection/commit/8bd9009))
* multiviewer state initialization ([2547af1](https://github.com/nrkno/tv-automation-atem-connection/commit/2547af1))
* regenerate commands test data ([fe619c4](https://github.com/nrkno/tv-automation-atem-connection/commit/fe619c4))
* restructure all command tests to use new structure ([957ed76](https://github.com/nrkno/tv-automation-atem-connection/commit/957ed76))
* some broken cases ([9ebde2e](https://github.com/nrkno/tv-automation-atem-connection/commit/9ebde2e))
* some more command serialization ([cf66953](https://github.com/nrkno/tv-automation-atem-connection/commit/cf66953))
* some tests ([3f14715](https://github.com/nrkno/tv-automation-atem-connection/commit/3f14715))
* **AudioMixerInputCommand:** sign in deserialization ([d9a3865](https://github.com/nrkno/tv-automation-atem-connection/commit/d9a3865))
* **MediaPlayerSourceCommand:** order of serialization ([a0a89f3](https://github.com/nrkno/tv-automation-atem-connection/commit/a0a89f3))
* **MixEffectFlyKeyFrameGetCommand:** correct validators ([a1648c1](https://github.com/nrkno/tv-automation-atem-connection/commit/a1648c1))
* tidy up some commented out code ([f1a1252](https://github.com/nrkno/tv-automation-atem-connection/commit/f1a1252))
* topology command ([e5812d9](https://github.com/nrkno/tv-automation-atem-connection/commit/e5812d9))
### Features
* 8.0.1 support ([eaa1e72](https://github.com/nrkno/tv-automation-atem-connection/commit/eaa1e72))
* Add test for api methods which change command based on version ([7208ee4](https://github.com/nrkno/tv-automation-atem-connection/commit/7208ee4))
* add test to verify that all commands have serialization test cases ([3cb9ae7](https://github.com/nrkno/tv-automation-atem-connection/commit/3cb9ae7))
* Enable and fix v8 command tests ([3a7d23d](https://github.com/nrkno/tv-automation-atem-connection/commit/3a7d23d))
* enable running tests in circleci ([662638d](https://github.com/nrkno/tv-automation-atem-connection/commit/662638d))
* expect commands to be split to be a serialize or deserialize (unless they use the same name for both) ([e9704f2](https://github.com/nrkno/tv-automation-atem-connection/commit/e9704f2))
* FadeToBlack control ([660e8dc](https://github.com/nrkno/tv-automation-atem-connection/commit/660e8dc))
* initial multi-version support ([fedc690](https://github.com/nrkno/tv-automation-atem-connection/commit/fedc690))
* prototype serialize command ([010fff2](https://github.com/nrkno/tv-automation-atem-connection/commit/010fff2))
* prototype what separate command converter structures would look like ([378be83](https://github.com/nrkno/tv-automation-atem-connection/commit/378be83))
* restructure some core buffer usage, and move command header (length + name) writing into common command serialization code ([3c8b062](https://github.com/nrkno/tv-automation-atem-connection/commit/3c8b062))
* split some commands ([beae1c4](https://github.com/nrkno/tv-automation-atem-connection/commit/beae1c4))
* stateChanged events report a path instead of the Command ([845909f](https://github.com/nrkno/tv-automation-atem-connection/commit/845909f))
# [0.10.0](https://github.com/nrkno/tv-automation-atem-connection/compare/0.9.0...0.10.0) (2019-04-02)

@@ -6,0 +51,0 @@

19

dist/atem.d.ts

@@ -7,3 +7,3 @@ /// <reference types="node" />

import { MultiViewerSourceState } from './state/settings';
import { DipTransitionSettings, DVETransitionSettings, MixTransitionSettings, StingerTransitionSettings, SuperSourceBox, TransitionProperties, WipeTransitionSettings, SuperSourceProperties } from './state/video';
import { DipTransitionSettings, DVETransitionSettings, MixTransitionSettings, StingerTransitionSettings, SuperSourceBox, TransitionProperties, WipeTransitionSettings, SuperSourceProperties, SuperSourceBorder } from './state/video';
import * as USK from './state/video/upstreamKeyers';

@@ -31,4 +31,5 @@ import { InputChannel } from './state/input';

private _sentQueue;
on: ((event: 'error', listener: (message: any) => void) => this) & ((event: 'connected', listener: () => void) => this) & ((event: 'disconnected', listener: () => void) => this) & ((event: 'stateChanged', listener: (state: AtemState, path: string) => void) => this);
constructor(options?: AtemOptions);
connect(address: string, port?: number): Promise<{}>;
connect(address: string, port?: number): Promise<unknown>;
disconnect(): Promise<void>;

@@ -40,3 +41,4 @@ sendCommand(command: AbstractCommand): Promise<any>;

autoTransition(me?: number): Promise<any>;
autoDownstreamKey(key?: number): Promise<any>;
fadeToBlack(me?: number): Promise<any>;
autoDownstreamKey(key?: number, isTowardsOnAir?: boolean): Promise<any>;
setDipTransitionSettings(newProps: Partial<DipTransitionSettings>, me?: number): Promise<any>;

@@ -74,4 +76,5 @@ setDVETransitionSettings(newProps: Partial<DVETransitionSettings>, me?: number): Promise<any>;

clearMediaPoolStill(stillId: number): Promise<any>;
setSuperSourceBoxSettings(newProps: Partial<SuperSourceBox>, box?: number): Promise<any>;
setSuperSourceProperties(newProps: Partial<SuperSourceProperties>): Promise<any>;
setSuperSourceBoxSettings(newProps: Partial<SuperSourceBox>, box?: number, ssrcId?: number): Promise<any>;
setSuperSourceProperties(newProps: Partial<SuperSourceProperties>, ssrcId?: number): Promise<any>;
setSuperSourceBorder(newProps: Partial<SuperSourceBorder>, ssrcId?: number): Promise<any>;
setInputSettings(newProps: Partial<InputChannel>, input?: number): Promise<any>;

@@ -87,5 +90,5 @@ setUpstreamKeyerChromaSettings(newProps: Partial<USK.UpstreamKeyerChromaSettings>, me?: number, keyer?: number): Promise<any>;

setUpstreamKeyerType(newProps: Partial<USK.UpstreamKeyerTypeSettings>, me?: number, keyer?: number): Promise<any>;
uploadStill(index: number, data: Buffer, name: string, description: string): Promise<{}>;
uploadClip(index: number, frames: Array<Buffer>, name: string): Promise<{}>;
uploadAudio(index: number, data: Buffer, name: string): Promise<{}>;
uploadStill(index: number, data: Buffer, name: string, description: string): Promise<unknown>;
uploadClip(index: number, frames: Array<Buffer>, name: string): Promise<unknown>;
uploadAudio(index: number, data: Buffer, name: string): Promise<unknown>;
setAudioMixerInputMixOption(index: number, mixOption: Enums.AudioMixOption): Promise<any>;

@@ -92,0 +95,0 @@ setAudioMixerInputGain(index: number, gain: number): Promise<any>;

@@ -11,2 +11,4 @@ "use strict";

const Enums = require("./enums");
const exitHook = require("exit-hook");
const util_1 = require("util");
class Atem extends events_1.EventEmitter {

@@ -34,2 +36,10 @@ constructor(options) {

this.dataTransferManager = new DT.DataTransferManager((command) => this.sendCommand(command));
// When the parent process begins exiting, remove the listeners on our child process.
// We do this to avoid throwing an error when the child process exits
// as a natural part of the parent process exiting.
exitHook(() => {
if (this.dataTransferManager) {
this.dataTransferManager.stop();
}
});
this.socket.on('receivedStateChange', (command) => this._mutateState(command));

@@ -81,5 +91,11 @@ this.socket.on(Enums.IPCMessageType.CommandAcknowledged, ({ trackingId }) => this._resolveCommand(trackingId));

}
autoDownstreamKey(key = 0) {
fadeToBlack(me = 0) {
const command = new Commands.FadeToBlackAutoCommand();
command.mixEffect = me;
return this.sendCommand(command);
}
autoDownstreamKey(key = 0, isTowardsOnAir) {
const command = new Commands.DownstreamKeyAutoCommand();
command.downstreamKeyerId = key;
command.updateProps({ isTowardsOnAir });
return this.sendCommand(command);

@@ -252,4 +268,5 @@ }

}
setSuperSourceBoxSettings(newProps, box = 0) {
setSuperSourceBoxSettings(newProps, box = 0, ssrcId = 0) {
const command = new Commands.SuperSourceBoxParametersCommand();
command.ssrcId = ssrcId;
command.boxId = box;

@@ -259,7 +276,28 @@ command.updateProps(newProps);

}
setSuperSourceProperties(newProps) {
const command = new Commands.SuperSourcePropertiesCommand();
command.updateProps(newProps);
return this.sendCommand(command);
setSuperSourceProperties(newProps, ssrcId = 0) {
if (this.state.info.apiVersion >= Enums.ProtocolVersion.V8_0) {
const command = new Commands.SuperSourcePropertiesV8Command();
command.ssrcId = ssrcId;
command.updateProps(newProps);
return this.sendCommand(command);
}
else {
const command = new Commands.SuperSourcePropertiesCommand();
command.updateProps(newProps);
return this.sendCommand(command);
}
}
setSuperSourceBorder(newProps, ssrcId = 0) {
if (this.state.info.apiVersion >= Enums.ProtocolVersion.V8_0) {
const command = new Commands.SuperSourceBorderCommand();
command.ssrcId = ssrcId;
command.updateProps(newProps);
return this.sendCommand(command);
}
else {
const command = new Commands.SuperSourcePropertiesCommand();
command.updateProps(newProps);
return this.sendCommand(command);
}
}
setInputSettings(newProps, input = 0) {

@@ -385,4 +423,7 @@ const command = new Commands.InputPropertiesCommand();

if (typeof command.applyToState === 'function') {
command.applyToState(this.state);
this.emit('stateChanged', this.state, command);
let changePaths = command.applyToState(this.state);
if (!util_1.isArray(changePaths)) {
changePaths = [changePaths];
}
changePaths.forEach(path => this.emit('stateChanged', this.state, path));
}

@@ -389,0 +430,0 @@ for (const commandName in DataTransferCommands) {

/// <reference types="node" />
import { AtemState } from '../state';
import { ProtocolVersion } from '../enums';
export default abstract class AbstractCommand {

@@ -10,10 +11,11 @@ static MaskFlags?: {

flag: number;
minimumVersion?: ProtocolVersion;
resolve: (cmd: AbstractCommand) => void;
reject: (cmd: AbstractCommand) => void;
abstract properties: any;
deserialize?(rawCommand: Buffer): void;
serialize?(): Buffer;
applyToState?(state: AtemState): void;
deserialize?(rawCommand: Buffer, version: ProtocolVersion): void;
serialize?(version: ProtocolVersion): Buffer;
applyToState?(state: AtemState): string | string[];
updateProps(newProps: object): void;
protected _updateProps(newProps: Object): void;
}

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

_updateProps(newProps) {
this.properties = Object.assign({}, this.properties, newProps);
this.properties = Object.assign(Object.assign({}, this.properties), newProps);
const maskFlags = this.constructor.MaskFlags;

@@ -14,0 +14,0 @@ if (maskFlags) {

@@ -15,5 +15,11 @@ /// <reference types="node" />

index: number;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class AudioMixerInputUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
properties: Partial<AudioChannel>;
index: number;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -8,14 +8,4 @@ "use strict";

super(...arguments);
this.rawName = 'AMIP';
this.rawName = 'CAMI';
}
deserialize(rawCommand) {
this.index = rawCommand.readUInt16BE(0);
this.properties = {
sourceType: rawCommand.readInt8(2),
portType: rawCommand.readInt8(7),
mixOption: rawCommand.readInt8(8),
gain: __1.Util.UInt16BEToDecibel(rawCommand.readUInt16BE(10)),
balance: __1.Util.IntToBalance(rawCommand.readInt16BE(12))
};
}
serialize() {

@@ -28,12 +18,6 @@ const buffer = Buffer.alloc(12);

buffer.writeInt16BE(__1.Util.BalanceToInt(this.properties.balance || 0), 8);
return Buffer.concat([
Buffer.from('CAMI', 'ascii'),
buffer
]);
return buffer;
}
applyToState(state) {
// const channel = state.audio.getChannel(this.index)
state.audio.channels[this.index] = Object.assign({}, state.audio.channels[this.index], this.properties);
}
}
exports.AudioMixerInputCommand = AudioMixerInputCommand;
AudioMixerInputCommand.MaskFlags = {

@@ -44,3 +28,24 @@ mixOption: 1 << 0,

};
exports.AudioMixerInputCommand = AudioMixerInputCommand;
class AudioMixerInputUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'AMIP';
}
deserialize(rawCommand) {
this.index = rawCommand.readUInt16BE(0);
this.properties = {
sourceType: rawCommand.readUInt8(2),
portType: rawCommand.readUInt8(7),
mixOption: rawCommand.readUInt8(8),
gain: __1.Util.UInt16BEToDecibel(rawCommand.readUInt16BE(10)),
balance: __1.Util.IntToBalance(rawCommand.readInt16BE(12))
};
}
applyToState(state) {
// const channel = state.audio.getChannel(this.index)
state.audio.channels[this.index] = Object.assign(Object.assign({}, state.audio.channels[this.index]), this.properties);
return `audio.channels.${this.index}`;
}
}
exports.AudioMixerInputUpdateCommand = AudioMixerInputUpdateCommand;
//# sourceMappingURL=AudioMixerInputCommand.js.map

@@ -13,5 +13,9 @@ /// <reference types="node" />

properties: Partial<AudioMasterChannel>;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class AudioMixerMasterUpdateCommand extends AbstractCommand {
rawName: string;
properties: Partial<AudioMasterChannel>;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

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

super(...arguments);
this.rawName = 'AMMO';
this.rawName = 'CAMM';
}
deserialize(rawCommand) {
this.properties = {
gain: __1.Util.UInt16BEToDecibel(rawCommand.readUInt16BE(0)),
balance: __1.Util.IntToBalance(rawCommand.readInt16BE(2)),
followFadeToBlack: rawCommand.readInt8(4) === 1
};
}
serialize() {

@@ -24,11 +17,6 @@ const buffer = Buffer.alloc(8);

buffer.writeUInt8(this.properties.followFadeToBlack ? 0x01 : 0x00, 6); // Note: I never got this one to work
return Buffer.concat([
Buffer.from('CAMM', 'ascii'),
buffer
]);
return buffer;
}
applyToState(state) {
state.audio.master = Object.assign({}, state.audio.master, this.properties);
}
}
exports.AudioMixerMasterCommand = AudioMixerMasterCommand;
AudioMixerMasterCommand.MaskFlags = {

@@ -39,3 +27,20 @@ gain: 1 << 0,

};
exports.AudioMixerMasterCommand = AudioMixerMasterCommand;
class AudioMixerMasterUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'AMMO';
}
deserialize(rawCommand) {
this.properties = {
gain: __1.Util.UInt16BEToDecibel(rawCommand.readUInt16BE(0)),
balance: __1.Util.IntToBalance(rawCommand.readInt16BE(2)),
followFadeToBlack: rawCommand.readInt8(4) === 1
};
}
applyToState(state) {
state.audio.master = Object.assign(Object.assign({}, state.audio.master), this.properties);
return `audio.master`;
}
}
exports.AudioMixerMasterUpdateCommand = AudioMixerMasterUpdateCommand;
//# sourceMappingURL=AudioMixerMasterCommand.js.map

@@ -10,5 +10,12 @@ /// <reference types="node" />

};
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class AuxSourceUpdateCommand extends AbstractCommand {
rawName: string;
auxBus: number;
properties: {
source: number;
};
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -7,2 +7,16 @@ "use strict";

super(...arguments);
this.rawName = 'CAuS';
}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt8(0x01, 0);
buffer.writeUInt8(this.auxBus, 1);
buffer.writeUInt16BE(this.properties.source, 2);
return buffer;
}
}
exports.AuxSourceCommand = AuxSourceCommand;
class AuxSourceUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'AuxS';

@@ -16,17 +30,8 @@ }

}
serialize() {
const rawCommand = 'CAuS';
return new Buffer([
...Buffer.from(rawCommand),
0x01,
this.auxBus,
this.properties.source >> 8,
this.properties.source & 0xFF
]);
}
applyToState(state) {
state.video.auxilliaries[this.auxBus] = this.properties.source;
return `video.auxilliaries.${this.auxBus}`;
}
}
exports.AuxSourceCommand = AuxSourceCommand;
exports.AuxSourceUpdateCommand = AuxSourceUpdateCommand;
//# sourceMappingURL=AuxSourceCommand.js.map

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

buffer.writeUInt16BE(this.properties.size, 2);
return Buffer.concat([Buffer.from('FTDa', 'ascii'), buffer, this.properties.body]);
return Buffer.concat([buffer, this.properties.body]);
}

@@ -17,0 +17,0 @@ deserialize(rawCommand) {

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

super(...arguments);
this.rawName = '';
this.rawName = 'FTSU';
}

@@ -17,3 +17,3 @@ serialize() {

buffer.writeUInt16BE(0x020f, 10);
return Buffer.concat([Buffer.from('FTSU', 'ascii'), buffer]);
return buffer;
}

@@ -20,0 +20,0 @@ }

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

super(...arguments);
this.rawName = '';
this.rawName = 'FTFD';
}

@@ -17,4 +17,4 @@ serialize() {

buffer.write(this.properties.description, 66, 128);
buffer.write(this.properties.fileHash, 194, 16);
return Buffer.concat([Buffer.from('FTFD', 'ascii'), buffer]);
Buffer.from(this.properties.fileHash, 'base64').copy(buffer, 194, 0, 16);
return buffer;
}

@@ -21,0 +21,0 @@ }

@@ -11,3 +11,2 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
}

@@ -16,13 +16,4 @@ "use strict";

}
serialize() {
const buffer = Buffer.alloc(16);
buffer.writeUInt16BE(this.properties.transferId, 0);
buffer[2] = 26; // https://github.com/LibAtem/LibAtem/blob/master/LibAtem/Commands/DataTransfer/DataTransferUploadContinueCommand.cs#L13
buffer.writeUInt16BE(this.properties.chunkSize, 6);
buffer.writeUInt16BE(this.properties.chunkCount, 8);
buffer[10] = 0x8b00;
return Buffer.concat([Buffer.from('FTCD', 'ascii'), buffer]);
}
}
exports.DataTransferUploadContinueCommand = DataTransferUploadContinueCommand;
//# sourceMappingURL=DataTransferUploadContinueCommand.js.map

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

super(...arguments);
this.rawName = '';
this.rawName = 'FTSD';
}

@@ -17,3 +17,3 @@ serialize() {

buffer.writeUInt16BE(this.properties.mode, 12); // @todo: should this be split into 2x enum8?
return Buffer.concat([Buffer.from('FTSD', 'ascii'), buffer]);
return buffer;
}

@@ -20,0 +20,0 @@ }

@@ -9,4 +9,11 @@ /// <reference types="node" />

};
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
}
export declare class LockStateUpdateCommand extends AbstractCommand {
rawName: string;
properties: {
index: number;
locked: boolean;
};
deserialize(rawCommand: Buffer): void;
}

@@ -7,2 +7,15 @@ "use strict";

super(...arguments);
this.rawName = 'LOCK';
}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt16BE(this.properties.index, 0);
buffer[2] = this.properties.locked ? 1 : 0;
return buffer;
}
}
exports.LockStateCommand = LockStateCommand;
class LockStateUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'LKST';

@@ -16,10 +29,4 @@ }

}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt16BE(this.properties.index, 0);
buffer[2] = this.properties.locked ? 1 : 0;
return Buffer.concat([Buffer.from('LOCK', 'ascii'), buffer]);
}
}
exports.LockStateCommand = LockStateCommand;
exports.LockStateUpdateCommand = LockStateUpdateCommand;
//# sourceMappingURL=LockStateCommand.js.map

@@ -11,4 +11,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -13,16 +13,6 @@ "use strict";

this.properties = {
deviceName: atemUtil_1.Util.bufToNullTerminatedString(rawCommand, 0, 32),
deviceName: atemUtil_1.Util.bufToNullTerminatedString(rawCommand, 0, 40),
model: atemUtil_1.Util.parseEnum(rawCommand[40], __1.Enums.Model)
};
}
serialize() {
const rawName = Buffer.from(this.properties.deviceName);
// https://github.com/LibAtem/LibAtem/blob/master/LibAtem/Commands/DeviceProfile/ProductIdentifierCommand.cs#L12
return Buffer.from([
...Buffer.from(rawName),
0x28, 0x36, 0x9B, 0x60,
0x4C, 0x08, 0x11, 0x60,
0x04, 0x3D, 0xA4, 0x60
]);
}
applyToState(state) {

@@ -42,2 +32,3 @@ state.info.productIdentifier = this.properties.deviceName;

}
return `info`;
}

@@ -44,0 +35,0 @@ }

@@ -10,3 +10,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -16,3 +16,4 @@ "use strict";

applyToState(state) {
state.info = Object.assign({}, state.info, this.properties);
state.info = Object.assign(Object.assign({}, state.info), this.properties);
return `info`;
}

@@ -19,0 +20,0 @@ }

@@ -9,3 +9,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -21,7 +21,10 @@ "use strict";

stingers: rawCommand[9],
hasSuperSources: rawCommand[10] === 1
hasSuperSources: rawCommand[10] !== 0,
superSources: rawCommand[10],
talkbackOverSDI: rawCommand[13]
};
}
applyToState(state) {
state.info.capabilities = Object.assign({}, state.info.capabilities, this.properties);
state.info.capabilities = Object.assign(Object.assign({}, state.info.capabilities), this.properties);
return `info.capabilities`;
}

@@ -28,0 +31,0 @@ }

/// <reference types="node" />
import AbstractCommand from '../AbstractCommand';
import { AtemState } from '../../state';
import { VersionProps } from '../../state/info';
import { ProtocolVersion } from '../../enums';
export declare class VersionCommand extends AbstractCommand {
rawName: string;
properties: VersionProps;
updateProps(newProps: Partial<VersionProps>): void;
properties: {
version: ProtocolVersion;
};
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -9,16 +9,10 @@ "use strict";

}
updateProps(newProps) {
this._updateProps(newProps);
}
deserialize(rawCommand) {
this.properties = {
major: rawCommand[1],
minor: rawCommand[3]
version: rawCommand.readUInt32BE(0)
};
}
serialize() {
return new Buffer(0);
}
applyToState(state) {
state.info.apiVersion = Object.assign({}, this.properties);
state.info.apiVersion = this.properties.version;
return `info.apiVersion`;
}

@@ -25,0 +19,0 @@ }

/// <reference types="node" />
import AbstractCommand from '../AbstractCommand';
import { ProtocolVersion } from '../../enums';
export declare class DownstreamKeyAutoCommand extends AbstractCommand {
rawName: string;
downstreamKeyerId: number;
properties: null;
deserialize(): void;
serialize(): Buffer;
applyToState(): void;
MaskFlags: {
isTowardsOnAir: number;
};
properties: {
isTowardsOnAir?: boolean;
};
updateProps(newProps: Partial<DownstreamKeyAutoCommand['properties']>): void;
serialize(version: ProtocolVersion): Buffer;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const AbstractCommand_1 = require("../AbstractCommand");
const enums_1 = require("../../enums");
class DownstreamKeyAutoCommand extends AbstractCommand_1.default {

@@ -8,19 +9,23 @@ constructor() {

this.rawName = 'DDsA';
this.MaskFlags = {
isTowardsOnAir: 1
};
}
deserialize() {
// nothing
updateProps(newProps) {
this._updateProps(newProps);
}
serialize() {
const rawCommand = 'DDsA';
return new Buffer([
...Buffer.from(rawCommand),
this.downstreamKeyerId,
0x00, 0x00, 0x00
]);
serialize(version) {
const buffer = Buffer.alloc(4);
if (version >= enums_1.ProtocolVersion.V8_0_1) {
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.downstreamKeyerId, 1);
buffer.writeUInt8(this.properties.isTowardsOnAir ? 1 : 0, 2);
}
else {
buffer.writeUInt8(this.downstreamKeyerId, 0);
}
return buffer;
}
applyToState() {
// nothing
}
}
exports.DownstreamKeyAutoCommand = DownstreamKeyAutoCommand;
//# sourceMappingURL=DownstreamKeyAutoCommand.js.map

@@ -11,5 +11,5 @@ "use strict";

const buffer = Buffer.alloc(4);
buffer[0] = this.downstreamKeyerId;
buffer.writeUInt8(this.downstreamKeyerId, 0);
buffer.writeUInt16BE(this.properties.input, 2);
return Buffer.concat([Buffer.from('CDsC', 'ascii'), buffer]);
return buffer;
}

@@ -16,0 +16,0 @@ updateProps(newProps) {

@@ -11,5 +11,5 @@ "use strict";

const buffer = Buffer.alloc(4);
buffer[0] = this.downstreamKeyerId;
buffer.writeUInt8(this.downstreamKeyerId, 0);
buffer.writeUInt16BE(this.properties.input, 2);
return Buffer.concat([Buffer.from('CDsF', 'ascii'), buffer]);
return buffer;
}

@@ -16,0 +16,0 @@ updateProps(newProps) {

@@ -11,9 +11,9 @@ "use strict";

const buffer = Buffer.alloc(12);
buffer[0] = this.flag;
buffer[1] = this.downstreamKeyerId;
buffer[2] = this.properties.preMultiply ? 1 : 0;
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.downstreamKeyerId, 1);
buffer.writeUInt8(this.properties.preMultiply ? 1 : 0, 2);
buffer.writeInt16BE(this.properties.clip, 4);
buffer.writeInt16BE(this.properties.gain, 6);
buffer[8] = this.properties.invert ? 1 : 0;
return Buffer.concat([Buffer.from('CDsG', 'ascii'), buffer]);
buffer.writeUInt8(this.properties.invert ? 1 : 0, 8);
return buffer;
}

@@ -24,2 +24,3 @@ updateProps(newProps) {

}
exports.DownstreamKeyGeneralCommand = DownstreamKeyGeneralCommand;
DownstreamKeyGeneralCommand.MaskFlags = {

@@ -31,3 +32,2 @@ preMultiply: 1 << 0,

};
exports.DownstreamKeyGeneralCommand = DownstreamKeyGeneralCommand;
//# sourceMappingURL=DownstreamKeyGeneralCommand.js.map

@@ -11,5 +11,5 @@ "use strict";

const buffer = Buffer.alloc(12);
buffer[0] = this.flag;
buffer[1] = this.downstreamKeyerId;
buffer[2] = this.properties.enabled ? 1 : 0;
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.downstreamKeyerId, 1);
buffer.writeUInt8(this.properties.enabled ? 1 : 0, 2);
buffer.writeInt16BE(this.properties.top, 4);

@@ -19,3 +19,3 @@ buffer.writeInt16BE(this.properties.bottom, 6);

buffer.writeInt16BE(this.properties.right, 10);
return Buffer.concat([Buffer.from('CDsM', 'ascii'), buffer]);
return buffer;
}

@@ -26,2 +26,3 @@ updateProps(newProps) {

}
exports.DownstreamKeyMaskCommand = DownstreamKeyMaskCommand;
DownstreamKeyMaskCommand.MaskFlags = {

@@ -34,3 +35,2 @@ enabled: 1 << 0,

};
exports.DownstreamKeyMaskCommand = DownstreamKeyMaskCommand;
//# sourceMappingURL=DownstreamKeyMaskCommand.js.map

@@ -9,5 +9,3 @@ /// <reference types="node" />

};
deserialize(): void;
serialize(): Buffer;
applyToState(): void;
}

@@ -9,19 +9,10 @@ "use strict";

}
deserialize() {
// nothing
}
serialize() {
const rawCommand = 'CDsL';
return new Buffer([
...Buffer.from(rawCommand),
this.downstreamKeyerId,
this.properties.onAir,
0x00, 0x00
]);
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.downstreamKeyerId, 0);
buffer.writeUInt8(this.properties.onAir ? 1 : 0, 1);
return buffer;
}
applyToState() {
// nothing
}
}
exports.DownstreamKeyOnAirCommand = DownstreamKeyOnAirCommand;
//# sourceMappingURL=DownstreamKeyOnAirCommand.js.map

@@ -10,3 +10,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -30,2 +30,3 @@ "use strict";

state.video.getDownstreamKeyer(this.downstreamKeyerId).properties = this.properties;
return `video.downstreamKeyers.${this.downstreamKeyerId}`;
}

@@ -32,0 +33,0 @@ }

@@ -11,5 +11,5 @@ "use strict";

const buffer = Buffer.alloc(4);
buffer[0] = this.downstreamKeyerId;
buffer[1] = this.properties.rate;
return Buffer.concat([Buffer.from('CDsR', 'ascii'), buffer]);
buffer.writeUInt8(this.downstreamKeyerId, 0);
buffer.writeUInt8(this.properties.rate, 1);
return buffer;
}

@@ -16,0 +16,0 @@ updateProps(newProps) {

@@ -12,3 +12,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

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

this.properties = {
fillSource: rawCommand.readInt16BE(2),
cutSource: rawCommand.readInt16BE(4)
fillSource: rawCommand.readUInt16BE(2),
cutSource: rawCommand.readUInt16BE(4)
};

@@ -20,2 +20,3 @@ }

state.video.getDownstreamKeyer(this.downstreamKeyerId).sources = this.properties;
return `video.downstreamKeyers.${this.downstreamKeyerId}`;
}

@@ -22,0 +23,0 @@ }

@@ -5,2 +5,3 @@ /// <reference types="node" />

import { DownstreamKeyerBase } from '../../state/video/downstreamKeyers';
import { ProtocolVersion } from '../../enums';
export declare class DownstreamKeyStateCommand extends AbstractCommand {

@@ -11,4 +12,11 @@ rawName: string;

deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}
export declare class DownstreamKeyStateV8Command extends AbstractCommand {
rawName: string;
downstreamKeyerId: number;
minimumVersion: ProtocolVersion;
properties: DownstreamKeyerBase;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -5,2 +5,3 @@ "use strict";

const __1 = require("../..");
const enums_1 = require("../../enums");
class DownstreamKeyStateCommand extends AbstractCommand_1.default {

@@ -20,13 +21,30 @@ constructor() {

}
serialize() {
// TODO(Lange - 2018-04-26): Commands such as this one don't have a corresponding serialize companion.
// Perhaps we should restructure the code to make commands like this less awkward, and avoid
// needing to define a stub serialize method.
return new Buffer(0);
applyToState(state) {
state.video.downstreamKeyers[this.downstreamKeyerId] = Object.assign(Object.assign({}, state.video.downstreamKeyers[this.downstreamKeyerId]), this.properties);
return `video.downstreamKeyers.${this.downstreamKeyerId}`;
}
}
exports.DownstreamKeyStateCommand = DownstreamKeyStateCommand;
class DownstreamKeyStateV8Command extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'DskS';
this.minimumVersion = enums_1.ProtocolVersion.V8_0_1;
}
deserialize(rawCommand) {
this.downstreamKeyerId = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);
this.properties = {
onAir: rawCommand[1] === 1,
inTransition: rawCommand[2] === 1,
isAuto: rawCommand[3] === 1,
isTowardsOnAir: rawCommand[4] === 1,
remainingFrames: rawCommand[5]
};
}
applyToState(state) {
state.video.downstreamKeyers[this.downstreamKeyerId] = Object.assign({}, state.video.downstreamKeyers[this.downstreamKeyerId], this.properties);
state.video.downstreamKeyers[this.downstreamKeyerId] = Object.assign(Object.assign({}, state.video.downstreamKeyers[this.downstreamKeyerId]), this.properties);
return `video.downstreamKeyers.${this.downstreamKeyerId}`;
}
}
exports.DownstreamKeyStateCommand = DownstreamKeyStateCommand;
exports.DownstreamKeyStateV8Command = DownstreamKeyStateV8Command;
//# sourceMappingURL=DownstreamKeyStateCommand.js.map

@@ -9,5 +9,3 @@ /// <reference types="node" />

};
deserialize(): void;
serialize(): Buffer;
applyToState(): void;
}

@@ -9,19 +9,10 @@ "use strict";

}
deserialize() {
// nothing
}
serialize() {
const rawCommand = 'CDsT';
return new Buffer([
...Buffer.from(rawCommand),
this.downstreamKeyerId,
this.properties.tie,
0x00, 0x00
]);
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.downstreamKeyerId, 0);
buffer.writeUInt8(this.properties.tie ? 1 : 0, 1);
return buffer;
}
applyToState() {
// nothing
}
}
exports.DownstreamKeyTieCommand = DownstreamKeyTieCommand;
//# sourceMappingURL=DownstreamKeyTieCommand.js.map

@@ -6,3 +6,3 @@ import AbstractCommand from './AbstractCommand';

deserialize(): void;
applyToState(): void;
applyToState(): string;
}

@@ -14,2 +14,3 @@ "use strict";

//
return `info`;
}

@@ -16,0 +17,0 @@ }

@@ -15,5 +15,10 @@ /// <reference types="node" />

updateProps(newProps: Partial<InputChannel>): void;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class InputPropertiesUpdateCommand extends AbstractCommand {
rawName: string;
inputId: number;
properties: InputChannel;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

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

super(...arguments);
this.rawName = 'InPr';
this.rawName = 'CInL';
}

@@ -15,2 +15,23 @@ updateProps(newProps) {

}
serialize() {
const buffer = Buffer.alloc(32);
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt16BE(this.inputId, 2);
buffer.write(this.properties.longName || '', 4);
buffer.write(this.properties.shortName || '', 24);
buffer.writeUInt16BE(this.properties.externalPortType, 28);
return buffer;
}
}
exports.InputPropertiesCommand = InputPropertiesCommand;
InputPropertiesCommand.MaskFlags = {
longName: 1 << 0,
shortName: 1 << 1,
isExternal: 1 << 2
};
class InputPropertiesUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'InPr';
}
deserialize(rawCommand) {

@@ -47,11 +68,2 @@ this.inputId = rawCommand.readUInt16BE(0);

}
serialize() {
const buffer = Buffer.alloc(32);
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt16BE(this.inputId, 2);
buffer.write(this.properties.longName || '', 4);
buffer.write(this.properties.shortName || '', 24);
buffer.writeUInt16BE(this.properties.externalPortType, 28);
return Buffer.concat([Buffer.from('CInL', 'ascii'), buffer]);
}
applyToState(state) {

@@ -62,10 +74,6 @@ // @TODO(Lange - 04/30/2018): We may need something to clean up inputs which

state.inputs[this.inputId] = Object.assign({}, this.properties);
return `inputs.${this.inputId}`;
}
}
InputPropertiesCommand.MaskFlags = {
longName: 1 << 0,
shortName: 1 << 1,
isExternal: 1 << 2
};
exports.InputPropertiesCommand = InputPropertiesCommand;
exports.InputPropertiesUpdateCommand = InputPropertiesUpdateCommand;
//# sourceMappingURL=InputPropertiesCommand.js.map

@@ -10,5 +10,3 @@ /// <reference types="node" />

};
deserialize(): void;
serialize(): Buffer;
applyToState(): void;
}

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

super(...arguments);
this.rawName = 'MAct'; // this seems unnecessary.
this.rawName = 'MAct';
}
deserialize() {
//
}
serialize() {
const rawCommand = 'MAct';
const buffer = new Buffer([...Buffer.from(rawCommand), 0x00, 0x00, this.properties.action, 0x00]);
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.properties.action, 2);
switch (this.properties.action) {
case enums_1.MacroAction.Run:
case enums_1.MacroAction.Delete:
buffer[4] = this.index >> 8;
buffer[5] = this.index & 0xff;
buffer.writeUInt16BE(this.index, 0);
break;

@@ -27,4 +23,3 @@ case enums_1.MacroAction.Stop:

case enums_1.MacroAction.Continue:
buffer[4] = 0xff;
buffer[5] = 0xff;
buffer.writeUInt16BE(0xffff, 0);
break;

@@ -36,7 +31,4 @@ default:

}
applyToState() {
//
}
}
exports.MacroActionCommand = MacroActionCommand;
//# sourceMappingURL=MacroActionCommand.js.map

@@ -10,3 +10,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -12,4 +12,4 @@ "use strict";

this.macroIndexID = rawCommand.readUInt16BE(0);
const descLen = rawCommand.readUInt16BE(4);
const nameLen = rawCommand.readUInt16BE(6);
const nameLen = rawCommand.readUInt16BE(4);
const descLen = rawCommand.readUInt16BE(6);
this.properties = {

@@ -29,3 +29,4 @@ description: '',

applyToState(state) {
state.macro.macroProperties[this.macroIndexID] = Object.assign({}, state.macro.macroProperties[this.macroIndexID], this.properties);
state.macro.macroProperties[this.macroIndexID] = Object.assign(Object.assign({}, state.macro.macroProperties[this.macroIndexID]), this.properties);
return `macro.macroProperties.${this.macroIndexID}`;
}

@@ -32,0 +33,0 @@ }

@@ -10,3 +10,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -17,3 +17,4 @@ "use strict";

applyToState(state) {
state.macro.macroRecorder = Object.assign({}, state.macro.macroRecorder, this.properties);
state.macro.macroRecorder = Object.assign(Object.assign({}, state.macro.macroRecorder), this.properties);
return `macro.macroRecorder`;
}

@@ -20,0 +21,0 @@ }

@@ -10,3 +10,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -19,3 +19,4 @@ "use strict";

applyToState(state) {
state.macro.macroPlayer = Object.assign({}, state.macro.macroPlayer, this.properties);
state.macro.macroPlayer = Object.assign(Object.assign({}, state.macro.macroPlayer), this.properties);
return `macro.macroPlayer`;
}

@@ -22,0 +23,0 @@ }

@@ -5,3 +5,2 @@ /// <reference types="node" />

import AbstractCommand from '../AbstractCommand';
import { Enums } from '../..';
export declare class MediaPlayerSourceCommand extends AbstractCommand {

@@ -16,10 +15,11 @@ static MaskFlags: {

properties: MediaPlayerSource;
updateProps(newProps: Partial<{
sourceType: Enums.MediaSourceType;
stillIndex: number;
clipIndex: number;
}>): void;
deserialize(rawCommand: Buffer): void;
updateProps(newProps: Partial<MediaPlayerSource>): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class MediaPlayerSourceUpdateCommand extends AbstractCommand {
rawName: string;
mediaPlayerId: number;
properties: MediaPlayerSource;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

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

super(...arguments);
this.rawName = 'MPCE';
this.rawName = 'MPSS';
}

@@ -13,2 +13,23 @@ updateProps(newProps) {

}
serialize() {
const buffer = Buffer.alloc(8);
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.mediaPlayerId, 1);
buffer.writeUInt8(this.properties.sourceType, 2);
buffer.writeUInt8(this.properties.clipIndex, 3);
buffer.writeUInt8(this.properties.stillIndex, 4);
return buffer;
}
}
exports.MediaPlayerSourceCommand = MediaPlayerSourceCommand;
MediaPlayerSourceCommand.MaskFlags = {
sourceType: 1 << 0,
stillIndex: 1 << 1,
clipIndex: 1 << 2
};
class MediaPlayerSourceUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'MPCE';
}
deserialize(rawCommand) {

@@ -18,30 +39,12 @@ this.mediaPlayerId = rawCommand[0];

sourceType: rawCommand[1],
stillIndex: rawCommand[2],
clipIndex: rawCommand[3]
clipIndex: rawCommand[2],
stillIndex: rawCommand[3]
};
}
serialize() {
const rawCommand = 'MPSS';
return new Buffer([
...Buffer.from(rawCommand),
this.flag,
this.mediaPlayerId,
this.properties.sourceType,
this.properties.stillIndex,
this.properties.clipIndex,
0x00,
0x00,
0x00
]);
}
applyToState(state) {
state.media.players[this.mediaPlayerId] = Object.assign({}, state.media.players[this.mediaPlayerId], this.properties);
state.media.players[this.mediaPlayerId] = Object.assign(Object.assign({}, state.media.players[this.mediaPlayerId]), this.properties);
return `media.players.${this.mediaPlayerId}`;
}
}
MediaPlayerSourceCommand.MaskFlags = {
sourceType: 1 << 0,
stillIndex: 1 << 1,
clipIndex: 1 << 2
};
exports.MediaPlayerSourceCommand = MediaPlayerSourceCommand;
exports.MediaPlayerSourceUpdateCommand = MediaPlayerSourceUpdateCommand;
//# sourceMappingURL=MediaPlayerSourceCommand.js.map

@@ -16,5 +16,10 @@ /// <reference types="node" />

updateProps(newProps: Partial<MediaPlayer>): void;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class MediaPlayerStatusUpdateCommand extends AbstractCommand {
rawName: string;
mediaPlayerId: number;
properties: MediaPlayer;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

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

super(...arguments);
this.rawName = 'RCPS';
this.rawName = 'SCPS';
}

@@ -14,2 +14,25 @@ updateProps(newProps) {

}
serialize() {
const buffer = Buffer.alloc(8);
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.mediaPlayerId, 1);
buffer.writeUInt8(this.properties.playing ? 1 : 0, 2);
buffer.writeUInt8(this.properties.loop ? 1 : 0, 3);
buffer.writeUInt8(this.properties.atBeginning ? 1 : 0, 4);
buffer.writeUInt16BE(this.properties.clipFrame, 6);
return buffer;
}
}
exports.MediaPlayerStatusCommand = MediaPlayerStatusCommand;
MediaPlayerStatusCommand.MaskFlags = {
playing: 1 << 0,
loop: 1 << 1,
atBeginning: 1 << 2,
frame: 1 << 3
};
class MediaPlayerStatusUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'RCPS';
}
deserialize(rawCommand) {

@@ -24,27 +47,8 @@ this.mediaPlayerId = atemUtil_1.Util.parseNumberBetween(rawCommand[0], 0, 3);

}
serialize() {
const rawCommand = 'SCPS';
return new Buffer([
...Buffer.from(rawCommand),
this.flag,
this.mediaPlayerId,
this.properties.playing,
this.properties.loop,
this.properties.atBeginning,
0x00,
this.properties.clipFrame >> 8,
this.properties.clipFrame & 0xFF
]);
}
applyToState(state) {
state.media.players[this.mediaPlayerId] = Object.assign({}, state.media.players[this.mediaPlayerId], this.properties);
state.media.players[this.mediaPlayerId] = Object.assign(Object.assign({}, state.media.players[this.mediaPlayerId]), this.properties);
return `media.players.${this.mediaPlayerId}`;
}
}
MediaPlayerStatusCommand.MaskFlags = {
playing: 1 << 0,
loop: 1 << 1,
atBeginning: 1 << 2,
frame: 1 << 3
};
exports.MediaPlayerStatusCommand = MediaPlayerStatusCommand;
exports.MediaPlayerStatusUpdateCommand = MediaPlayerStatusUpdateCommand;
//# sourceMappingURL=MediaPlayerStatusCommand.js.map

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

serialize() {
const rawCommand = 'CMPC';
return new Buffer([
...Buffer.from(rawCommand),
this.properties.index,
0x00,
0x00,
0x00
]);
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.properties.index, 0);
return buffer;
}

@@ -20,0 +15,0 @@ updateProps(props) {

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

serialize() {
const rawCommand = 'CSTL';
return new Buffer([
...Buffer.from(rawCommand),
this.properties.index,
0x00,
0x00,
0x00
]);
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.properties.index, 0);
return buffer;
}

@@ -20,0 +15,0 @@ updateProps(props) {

@@ -10,3 +10,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -25,2 +25,3 @@ "use strict";

state.media.clipPool[this.mediaPool] = newProps;
return `media.clipPool.${this.mediaPool}`;
}

@@ -27,0 +28,0 @@ }

@@ -11,3 +11,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

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

isUsed: rawCommand[4] === 1,
hash: atemUtil_1.Util.bufToNullTerminatedString(rawCommand, 5, 16),
hash: atemUtil_1.Util.bufToBase64String(rawCommand, 5, 16),
fileName: atemUtil_1.Util.bufToNullTerminatedString(rawCommand, 24, rawCommand[23])

@@ -23,6 +23,9 @@ };

state.media.stillPool[this.frameIndex] = this.properties;
return `media.stillPool.${this.frameIndex}`;
}
else if (this.mediaPool < 3) {
state.media.clipPool[this.mediaPool - 1].frames[this.frameIndex] = this.properties;
return `media.clipPool.${this.mediaPool - 1}.${this.frameIndex}`;
}
return `media`;
}

@@ -29,0 +32,0 @@ }

@@ -11,7 +11,2 @@ /// <reference types="node" />

serialize(): Buffer;
updateProps(props: {
index: number;
name: string;
frames: number;
}): void;
}

@@ -10,14 +10,11 @@ "use strict";

serialize() {
const buffer = new Buffer(68);
buffer[0] = 3;
buffer[1] = this.properties.index;
const buffer = Buffer.alloc(68);
buffer.writeUInt8(3, 0);
buffer.writeUInt8(this.properties.index, 1);
buffer.write(this.properties.name, 2, 44);
buffer.writeUInt16BE(this.properties.frames, 66);
return Buffer.concat([Buffer.from('SMPC', 'ascii'), buffer]);
return buffer;
}
updateProps(props) {
this._updateProps(props);
}
}
exports.MediaPoolSetClipCommand = MediaPoolSetClipCommand;
//# sourceMappingURL=MediaPoolSetClipCommand.js.map

@@ -7,5 +7,3 @@ /// <reference types="node" />

properties: null;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(): void;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const AbstractCommand_1 = require("../AbstractCommand");
const __1 = require("../..");
class AutoTransitionCommand extends AbstractCommand_1.default {

@@ -10,14 +9,9 @@ constructor() {

}
deserialize(rawCommand) {
this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);
}
serialize() {
const rawCommand = 'DAut';
return new Buffer([...Buffer.from(rawCommand), this.mixEffect, 0x00, 0x00, 0x00]);
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.mixEffect, 0);
return buffer;
}
applyToState() {
// nothing
}
}
exports.AutoTransitionCommand = AutoTransitionCommand;
//# sourceMappingURL=AutoTransitionCommand.js.map

@@ -7,5 +7,3 @@ /// <reference types="node" />

properties: null;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(): void;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const AbstractCommand_1 = require("../AbstractCommand");
const __1 = require("../..");
class CutCommand extends AbstractCommand_1.default {

@@ -10,14 +9,9 @@ constructor() {

}
deserialize(rawCommand) {
this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);
}
serialize() {
const rawCommand = 'DCut';
return new Buffer([...Buffer.from(rawCommand), this.mixEffect, 0xef, 0xbf, 0x5f]);
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.mixEffect, 0);
return buffer;
}
applyToState() {
// nothing
}
}
exports.CutCommand = CutCommand;
//# sourceMappingURL=CutCommand.js.map

@@ -0,1 +1,2 @@

export * from './FadeToBlack';
export * from './Key';

@@ -2,0 +3,0 @@ export * from './Transition';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
tslib_1.__exportStar(require("./FadeToBlack"), exports);
tslib_1.__exportStar(require("./Key"), exports);

@@ -5,0 +6,0 @@ tslib_1.__exportStar(require("./Transition"), exports);

@@ -17,5 +17,11 @@ /// <reference types="node" />

properties: UpstreamKeyerChromaSettings;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class MixEffectKeyChromaUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
upstreamKeyerId: number;
properties: UpstreamKeyerChromaSettings;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -8,2 +8,28 @@ "use strict";

super(...arguments);
this.rawName = 'CKCk';
}
serialize() {
const buffer = Buffer.alloc(16);
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.mixEffect, 1);
buffer.writeUInt8(this.upstreamKeyerId, 2);
buffer.writeUInt16BE(this.properties.hue, 4);
buffer.writeUInt16BE(this.properties.gain, 6);
buffer.writeUInt16BE(this.properties.ySuppress, 8);
buffer.writeUInt16BE(this.properties.lift, 10);
buffer.writeUInt8(this.properties.narrow ? 1 : 0, 12);
return buffer;
}
}
exports.MixEffectKeyChromaCommand = MixEffectKeyChromaCommand;
MixEffectKeyChromaCommand.MaskFlags = {
hue: 1 << 0,
gain: 1 << 1,
ySuppress: 1 << 2,
lift: 1 << 3,
narrow: 1 << 4
};
class MixEffectKeyChromaUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'KeCk';

@@ -22,14 +48,2 @@ }

}
serialize() {
const buffer = Buffer.alloc(16);
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.mixEffect, 1);
buffer.writeUInt8(this.upstreamKeyerId, 2);
buffer.writeUInt16BE(this.properties.hue, 4);
buffer.writeUInt16BE(this.properties.gain, 6);
buffer.writeUInt16BE(this.properties.ySuppress, 8);
buffer.writeUInt16BE(this.properties.lift, 10);
buffer[12] = this.properties.narrow ? 1 : 0;
return Buffer.concat([Buffer.from('CKCk', 'ascii'), buffer]);
}
applyToState(state) {

@@ -39,12 +53,6 @@ const mixEffect = state.video.getMe(this.mixEffect);

upstreamKeyer.chromaSettings = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.upstreamKeyers.${this.upstreamKeyerId}.chromaSettings`;
}
}
MixEffectKeyChromaCommand.MaskFlags = {
hue: 1 << 0,
gain: 1 << 1,
ySuppress: 1 << 2,
lift: 1 << 3,
narrow: 1 << 4
};
exports.MixEffectKeyChromaCommand = MixEffectKeyChromaCommand;
exports.MixEffectKeyChromaUpdateCommand = MixEffectKeyChromaUpdateCommand;
//# sourceMappingURL=MixEffectKeyChromaCommand.js.map

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

buffer.writeUInt16BE(this.properties.cutSource, 2);
return Buffer.concat([Buffer.from('CKeC', 'ascii'), buffer]);
return buffer;
}

@@ -17,0 +17,0 @@ }

@@ -38,5 +38,11 @@ /// <reference types="node" />

properties: UpstreamKeyerDVESettings;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class MixEffectKeyDVEUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
upstreamKeyerId: number;
properties: UpstreamKeyerDVESettings;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -8,36 +8,4 @@ "use strict";

super(...arguments);
this.rawName = 'KeDV';
this.rawName = 'CKDV';
}
deserialize(rawCommand) {
this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);
this.upstreamKeyerId = __1.Util.parseNumberBetween(rawCommand[1], 0, 3);
this.properties = {
sizeX: __1.Util.parseNumberBetween(rawCommand.readUInt32BE(4), 0, 99990),
sizeY: __1.Util.parseNumberBetween(rawCommand.readUInt32BE(8), 0, 99990),
positionX: __1.Util.parseNumberBetween(rawCommand.readInt32BE(12), -1000 * 1000, 1000 * 1000),
positionY: __1.Util.parseNumberBetween(rawCommand.readInt32BE(16), -1000 * 1000, 1000 * 1000),
rotation: __1.Util.parseNumberBetween(rawCommand.readInt32BE(20), -332230, 332230),
borderEnabled: rawCommand[24] === 1,
shadowEnabled: rawCommand[25] === 1,
borderBevel: __1.Util.parseEnum(rawCommand.readUInt8(26), __1.Enums.BorderBevel),
borderOuterWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(28), 0, 1600),
borderInnerWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(30), 0, 1600),
borderOuterSoftness: __1.Util.parseNumberBetween(rawCommand.readInt8(32), 0, 100),
borderInnerSoftness: __1.Util.parseNumberBetween(rawCommand.readInt8(33), 0, 100),
borderBevelSoftness: __1.Util.parseNumberBetween(rawCommand.readInt8(34), 0, 100),
borderBevelPosition: __1.Util.parseNumberBetween(rawCommand.readInt8(35), 0, 100),
borderOpacity: __1.Util.parseNumberBetween(rawCommand.readInt8(36), 0, 100),
borderHue: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(38), 0, 3600),
borderSaturation: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(40), 0, 1000),
borderLuma: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(42), 0, 1000),
lightSourceDirection: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(44), 0, 3599),
lightSourceAltitude: __1.Util.parseNumberBetween(rawCommand.readUInt8(46), 0, 100),
maskEnabled: rawCommand[47] === 1,
maskTop: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(48), 0, 38000),
maskBottom: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(50), 0, 38000),
maskLeft: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(52), 0, 52000),
maskRight: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(54), 0, 52000),
rate: __1.Util.parseNumberBetween(rawCommand.readInt8(56), 0, 250)
};
}
serialize() {

@@ -74,10 +42,6 @@ const buffer = Buffer.alloc(64);

buffer.writeUInt8(this.properties.rate, 60);
return Buffer.concat([Buffer.from('CKDV', 'ascii'), buffer]);
return buffer;
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
const upstreamKeyer = mixEffect.getUpstreamKeyer(this.upstreamKeyerId);
upstreamKeyer.dveSettings = Object.assign({}, this.properties);
}
}
exports.MixEffectKeyDVECommand = MixEffectKeyDVECommand;
MixEffectKeyDVECommand.MaskFlags = {

@@ -111,3 +75,48 @@ sizeX: 1 << 0,

};
exports.MixEffectKeyDVECommand = MixEffectKeyDVECommand;
class MixEffectKeyDVEUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'KeDV';
}
deserialize(rawCommand) {
this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);
this.upstreamKeyerId = __1.Util.parseNumberBetween(rawCommand[1], 0, 3);
this.properties = {
// Note: these are higher than the ui shows, but are within the range the atem can be set to
sizeX: __1.Util.parseNumberBetween(rawCommand.readUInt32BE(4), 0, Math.pow(2, 32) - 1),
sizeY: __1.Util.parseNumberBetween(rawCommand.readUInt32BE(8), 0, Math.pow(2, 32) - 1),
positionX: __1.Util.parseNumberBetween(rawCommand.readInt32BE(12), -1000 * 1000, 1000 * 1000),
positionY: __1.Util.parseNumberBetween(rawCommand.readInt32BE(16), -1000 * 1000, 1000 * 1000),
rotation: __1.Util.parseNumberBetween(rawCommand.readInt32BE(20), -332230, 332230),
borderEnabled: rawCommand[24] === 1,
shadowEnabled: rawCommand[25] === 1,
borderBevel: __1.Util.parseEnum(rawCommand.readUInt8(26), __1.Enums.BorderBevel),
borderOuterWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(28), 0, 1600),
borderInnerWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(30), 0, 1600),
borderOuterSoftness: __1.Util.parseNumberBetween(rawCommand.readInt8(32), 0, 100),
borderInnerSoftness: __1.Util.parseNumberBetween(rawCommand.readInt8(33), 0, 100),
borderBevelSoftness: __1.Util.parseNumberBetween(rawCommand.readInt8(34), 0, 100),
borderBevelPosition: __1.Util.parseNumberBetween(rawCommand.readInt8(35), 0, 100),
borderOpacity: __1.Util.parseNumberBetween(rawCommand.readInt8(36), 0, 100),
borderHue: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(38), 0, 3600),
borderSaturation: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(40), 0, 1000),
borderLuma: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(42), 0, 1000),
lightSourceDirection: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(44), 0, 3599),
lightSourceAltitude: __1.Util.parseNumberBetween(rawCommand.readUInt8(46), 0, 100),
maskEnabled: rawCommand[47] === 1,
maskTop: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(48), 0, 38000),
maskBottom: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(50), 0, 38000),
maskLeft: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(52), 0, 52000),
maskRight: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(54), 0, 52000),
rate: __1.Util.parseNumberBetween(rawCommand.readUInt8(56), 0, 250)
};
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
const upstreamKeyer = mixEffect.getUpstreamKeyer(this.upstreamKeyerId);
upstreamKeyer.dveSettings = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.upstreamKeyers.${this.upstreamKeyerId}.dveSettings`;
}
}
exports.MixEffectKeyDVEUpdateCommand = MixEffectKeyDVEUpdateCommand;
//# sourceMappingURL=MixEffectKeyDVECommand.js.map

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

buffer.writeUInt16BE(this.properties.fillSource, 2);
return Buffer.concat([Buffer.from('CKeF', 'ascii'), buffer]);
return buffer;
}

@@ -17,0 +17,0 @@ }

@@ -11,3 +11,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -15,24 +15,25 @@ "use strict";

keyFrameId: __1.Util.parseNumberBetween(rawCommand[2], 1, 2),
sizeX: __1.Util.parseNumberBetween(rawCommand.readUInt32BE(4), 0, 99990),
sizeY: __1.Util.parseNumberBetween(rawCommand.readUInt32BE(8), 0, 99990),
positionX: __1.Util.parseNumberBetween(rawCommand.readInt32BE(12), -1000 * 1000, 1000 * 1000),
positionY: __1.Util.parseNumberBetween(rawCommand.readInt32BE(16), -1000 * 1000, 1000 * 1000),
// Note: these are higher than the ui shows, but are within the range the atem can be set to
sizeX: __1.Util.parseNumberBetween(rawCommand.readUInt32BE(4), 0, Math.pow(2, 32) - 1),
sizeY: __1.Util.parseNumberBetween(rawCommand.readUInt32BE(8), 0, Math.pow(2, 32) - 1),
positionX: __1.Util.parseNumberBetween(rawCommand.readInt32BE(12), -32768 * 1000, 32768 * 1000),
positionY: __1.Util.parseNumberBetween(rawCommand.readInt32BE(16), -32768 * 1000, 32768 * 1000),
rotation: __1.Util.parseNumberBetween(rawCommand.readInt32BE(20), -332230, 332230),
borderOuterWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(24), 0, 1600),
borderInnerWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(26), 0, 1600),
borderOuterSoftness: __1.Util.parseNumberBetween(rawCommand.readInt8(28), 0, 100),
borderInnerSoftness: __1.Util.parseNumberBetween(rawCommand.readInt8(29), 0, 100),
borderBevelSoftness: __1.Util.parseNumberBetween(rawCommand.readInt8(30), 0, 100),
borderBevelPosition: __1.Util.parseNumberBetween(rawCommand.readInt8(31), 0, 100),
borderOpacity: __1.Util.parseNumberBetween(rawCommand.readInt8(32), 0, 100),
borderHue: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(34), 0, 3599),
borderSaturation: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(36), 0, 1000),
borderLuma: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(38), 0, 1000),
lightSourceDirection: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(40), 0, 3599),
lightSourceAltitude: __1.Util.parseNumberBetween(rawCommand.readUInt8(42), 0, 100),
borderOuterWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(24), 0, 65535),
borderInnerWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(26), 0, 65535),
borderOuterSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(28), 0, 254),
borderInnerSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(29), 0, 254),
borderBevelSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(30), 0, 254),
borderBevelPosition: __1.Util.parseNumberBetween(rawCommand.readUInt8(31), 0, 254),
borderOpacity: __1.Util.parseNumberBetween(rawCommand.readUInt8(32), 0, 254),
borderHue: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(34), 0, 65535),
borderSaturation: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(36), 0, 65535),
borderLuma: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(38), 0, 65535),
lightSourceDirection: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(40), 0, 65535),
lightSourceAltitude: __1.Util.parseNumberBetween(rawCommand.readUInt8(42), 0, 254),
maskEnabled: rawCommand[43] === 1,
maskTop: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(44), 0, 38000),
maskBottom: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(46), 0, 38000),
maskLeft: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(48), 0, 52000),
maskRight: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(50), 0, 52000)
maskTop: __1.Util.parseNumberBetween(rawCommand.readInt16BE(44), -9000, 9000),
maskBottom: __1.Util.parseNumberBetween(rawCommand.readInt16BE(46), -9000, 9000),
maskLeft: __1.Util.parseNumberBetween(rawCommand.readInt16BE(48), -16000, 16000),
maskRight: __1.Util.parseNumberBetween(rawCommand.readInt16BE(50), -16000, 16000)
};

@@ -44,2 +45,3 @@ }

upstreamKeyer.flyKeyframes[this.properties.keyFrameId] = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.upstreamKeyers.${this.upstreamKeyerId}.flyKeyframes.${this.properties.keyFrameId}`;
}

@@ -46,0 +48,0 @@ }

@@ -11,3 +11,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -24,2 +24,3 @@ "use strict";

upstreamKeyer.flyProperties = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.upstreamKeyers.${this.upstreamKeyerId}.flyProperties`;
}

@@ -26,0 +27,0 @@ }

@@ -16,5 +16,11 @@ /// <reference types="node" />

properties: UpstreamKeyerLumaSettings;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class MixEffectKeyLumaUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
upstreamKeyerId: number;
properties: UpstreamKeyerLumaSettings;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -8,2 +8,26 @@ "use strict";

super(...arguments);
this.rawName = 'CKLm';
}
serialize() {
const buffer = Buffer.alloc(12);
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.mixEffect, 1);
buffer.writeUInt8(this.upstreamKeyerId, 2);
buffer.writeUInt8(this.properties.preMultiplied ? 1 : 0, 3);
buffer.writeUInt16BE(this.properties.clip, 4);
buffer.writeUInt16BE(this.properties.gain, 6);
buffer.writeUInt8(this.properties.invert ? 1 : 0, 8);
return buffer;
}
}
exports.MixEffectKeyLumaCommand = MixEffectKeyLumaCommand;
MixEffectKeyLumaCommand.MaskFlags = {
preMultiplied: 1 << 0,
clip: 1 << 1,
gain: 1 << 2,
invert: 1 << 3
};
class MixEffectKeyLumaUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'KeLm';

@@ -21,13 +45,2 @@ }

}
serialize() {
const buffer = Buffer.alloc(12);
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.mixEffect, 1);
buffer.writeUInt8(this.upstreamKeyerId, 2);
buffer[3] = this.properties.preMultiplied ? 1 : 0;
buffer.writeUInt16BE(this.properties.clip, 4);
buffer.writeUInt16BE(this.properties.gain, 6);
buffer[8] = this.properties.invert ? 1 : 0;
return Buffer.concat([Buffer.from('CKLm', 'ascii'), buffer]);
}
applyToState(state) {

@@ -37,11 +50,6 @@ const mixEffect = state.video.getMe(this.mixEffect);

upstreamKeyer.lumaSettings = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.upstreamKeyers.${this.upstreamKeyerId}.lumaSettings`;
}
}
MixEffectKeyLumaCommand.MaskFlags = {
preMultiplied: 1 << 0,
clip: 1 << 1,
gain: 1 << 2,
invert: 1 << 3
};
exports.MixEffectKeyLumaCommand = MixEffectKeyLumaCommand;
exports.MixEffectKeyLumaUpdateCommand = MixEffectKeyLumaUpdateCommand;
//# sourceMappingURL=MixEffectKeyLumaCommand.js.map

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

buffer.writeUInt8(this.upstreamKeyerId, 2);
buffer[3] = this.properties.maskEnabled ? 1 : 0;
buffer.writeUInt8(this.properties.maskEnabled ? 1 : 0, 3);
buffer.writeInt16BE(this.properties.maskTop, 4);

@@ -20,5 +20,6 @@ buffer.writeInt16BE(this.properties.maskBottom, 6);

buffer.writeInt16BE(this.properties.maskRight, 10);
return Buffer.concat([Buffer.from('CKMs', 'ascii'), buffer]);
return buffer;
}
}
exports.MixEffectKeyMaskSetCommand = MixEffectKeyMaskSetCommand;
MixEffectKeyMaskSetCommand.MaskFlags = {

@@ -31,3 +32,2 @@ maskEnabled: 1 << 0,

};
exports.MixEffectKeyMaskSetCommand = MixEffectKeyMaskSetCommand;
//# sourceMappingURL=MixEffectKeyMaskSetCommand.js.map

@@ -11,5 +11,13 @@ /// <reference types="node" />

};
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class MixEffectKeyOnAirUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
upstreamKeyerId: number;
properties: {
onAir: boolean;
};
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -8,2 +8,16 @@ "use strict";

super(...arguments);
this.rawName = 'CKOn';
}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.mixEffect, 0);
buffer.writeUInt8(this.upstreamKeyerId, 1);
buffer.writeUInt8(this.properties.onAir ? 1 : 0, 2);
return buffer;
}
}
exports.MixEffectKeyOnAirCommand = MixEffectKeyOnAirCommand;
class MixEffectKeyOnAirUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'KeOn';

@@ -18,9 +32,2 @@ }

}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.mixEffect, 0);
buffer.writeUInt8(this.upstreamKeyerId, 1);
buffer[2] = this.properties.onAir ? 1 : 0;
return Buffer.concat([Buffer.from('CKOn', 'ascii'), buffer]);
}
applyToState(state) {

@@ -30,5 +37,6 @@ const mixEffect = state.video.getMe(this.mixEffect);

upstreamKeyer.onAir = this.properties.onAir;
return `video.ME.${this.mixEffect}.upstreamKeyers.${this.upstreamKeyerId}.onAir`;
}
}
exports.MixEffectKeyOnAirCommand = MixEffectKeyOnAirCommand;
exports.MixEffectKeyOnAirUpdateCommand = MixEffectKeyOnAirUpdateCommand;
//# sourceMappingURL=MixEffectKeyOnAirCommand.js.map

@@ -19,5 +19,11 @@ /// <reference types="node" />

properties: UpstreamKeyerPatternSettings;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class MixEffectKeyUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
upstreamKeyerId: number;
properties: UpstreamKeyerPatternSettings;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -8,17 +8,4 @@ "use strict";

super(...arguments);
this.rawName = 'KePt';
this.rawName = 'CKPt';
}
deserialize(rawCommand) {
this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);
this.upstreamKeyerId = __1.Util.parseNumberBetween(rawCommand[1], 0, 3);
this.properties = {
style: __1.Util.parseEnum(rawCommand[2], __1.Enums.Pattern),
size: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(4), 0, 10000),
symmetry: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(6), 0, 10000),
softness: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(8), 0, 10000),
positionX: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(10), 0, 10000),
positionY: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(12), 0, 10000),
invert: rawCommand[14] === 1
};
}
serialize() {

@@ -35,11 +22,7 @@ const buffer = Buffer.alloc(16);

buffer.writeUInt16BE(this.properties.positionY, 12);
buffer[14] = this.properties.invert ? 1 : 0;
return Buffer.concat([Buffer.from('CKPt', 'ascii'), buffer]);
buffer.writeUInt8(this.properties.invert ? 1 : 0, 14);
return buffer;
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
const upstreamKeyer = mixEffect.getUpstreamKeyer(this.upstreamKeyerId);
upstreamKeyer.patternSettings = Object.assign({}, this.properties);
}
}
exports.MixEffectKeyPatternCommand = MixEffectKeyPatternCommand;
MixEffectKeyPatternCommand.MaskFlags = {

@@ -54,3 +37,28 @@ style: 1 << 0,

};
exports.MixEffectKeyPatternCommand = MixEffectKeyPatternCommand;
class MixEffectKeyUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'KePt';
}
deserialize(rawCommand) {
this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);
this.upstreamKeyerId = __1.Util.parseNumberBetween(rawCommand[1], 0, 3);
this.properties = {
style: __1.Util.parseEnum(rawCommand[2], __1.Enums.Pattern),
size: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(4), 0, 10000),
symmetry: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(6), 0, 10000),
softness: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(8), 0, 10000),
positionX: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(10), 0, 10000),
positionY: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(12), 0, 10000),
invert: rawCommand[14] === 1
};
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
const upstreamKeyer = mixEffect.getUpstreamKeyer(this.upstreamKeyerId);
upstreamKeyer.patternSettings = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.upstreamKeyers.${this.upstreamKeyerId}.patternSettings`;
}
}
exports.MixEffectKeyUpdateCommand = MixEffectKeyUpdateCommand;
//# sourceMappingURL=MixEffectKeyPatternCommand.js.map

@@ -10,3 +10,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -28,2 +28,3 @@ "use strict";

Object.assign(mixEffect.upstreamKeyers[this.properties.upstreamKeyerId], this.properties);
return `video.ME.${this.mixEffect}.upstreamKeyers.${this.properties.upstreamKeyerId}`;
}

@@ -30,0 +31,0 @@ }

@@ -15,6 +15,7 @@ "use strict";

buffer.writeUInt8(this.properties.keyType, 3);
buffer[4] = this.properties.flyEnabled ? 1 : 0;
return Buffer.concat([Buffer.from('CKTp', 'ascii'), buffer]);
buffer.writeUInt8(this.properties.flyEnabled ? 1 : 0, 4);
return buffer;
}
}
exports.MixEffectKeyTypeSetCommand = MixEffectKeyTypeSetCommand;
MixEffectKeyTypeSetCommand.MaskFlags = {

@@ -24,3 +25,2 @@ keyType: 1 << 0,

};
exports.MixEffectKeyTypeSetCommand = MixEffectKeyTypeSetCommand;
//# sourceMappingURL=MixEffectKeyTypeSetCommand.js.map

@@ -10,5 +10,12 @@ /// <reference types="node" />

};
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class PreviewInputUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
properties: {
source: number;
};
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -8,2 +8,15 @@ "use strict";

super(...arguments);
this.rawName = 'CPvI';
}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.mixEffect, 0);
buffer.writeUInt16BE(this.properties.source, 2);
return buffer;
}
}
exports.PreviewInputCommand = PreviewInputCommand;
class PreviewInputUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'PrvI';

@@ -17,18 +30,9 @@ }

}
serialize() {
const rawCommand = 'CPvI';
return new Buffer([
...Buffer.from(rawCommand),
this.mixEffect,
0x00,
this.properties.source >> 8,
this.properties.source & 0xFF
]);
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
mixEffect.previewInput = this.properties.source;
return `video.ME.${this.mixEffect}.previewInput`;
}
}
exports.PreviewInputCommand = PreviewInputCommand;
exports.PreviewInputUpdateCommand = PreviewInputUpdateCommand;
//# sourceMappingURL=PreviewInputCommand.js.map

@@ -10,5 +10,12 @@ /// <reference types="node" />

};
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class ProgramInputUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
properties: {
source: number;
};
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -8,2 +8,15 @@ "use strict";

super(...arguments);
this.rawName = 'CPgI';
}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.mixEffect, 0);
buffer.writeUInt16BE(this.properties.source, 2);
return buffer;
}
}
exports.ProgramInputCommand = ProgramInputCommand;
class ProgramInputUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'PrgI';

@@ -17,18 +30,9 @@ }

}
serialize() {
const rawCommand = 'CPgI';
return new Buffer([
...Buffer.from(rawCommand),
this.mixEffect,
0x00,
this.properties.source >> 8,
this.properties.source & 0xFF
]);
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
mixEffect.programInput = this.properties.source;
return `video.ME.${this.mixEffect}.programInput`;
}
}
exports.ProgramInputCommand = ProgramInputCommand;
exports.ProgramInputUpdateCommand = ProgramInputUpdateCommand;
//# sourceMappingURL=ProgramInputCommand.js.map

@@ -14,5 +14,10 @@ /// <reference types="node" />

updateProps(newProps: Partial<DipTransitionSettings>): void;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class TransitionDipUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
properties: DipTransitionSettings;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

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

super(...arguments);
this.rawName = 'TDpP';
this.rawName = 'CTDp';
}

@@ -14,2 +14,21 @@ updateProps(newProps) {

}
serialize() {
const buffer = Buffer.alloc(8);
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.mixEffect, 1);
buffer.writeUInt8(this.properties.rate, 2);
buffer.writeUInt16BE(this.properties.input, 4);
return buffer;
}
}
exports.TransitionDipCommand = TransitionDipCommand;
TransitionDipCommand.MaskFlags = {
rate: 1 << 0,
input: 1 << 1
};
class TransitionDipUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'TDpP';
}
deserialize(rawCommand) {

@@ -22,26 +41,9 @@ this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);

}
serialize() {
const rawCommand = 'CTDp';
return new Buffer([
...Buffer.from(rawCommand),
this.flag,
this.mixEffect,
this.properties.rate,
0x00,
this.properties.input >> 8,
this.properties.input & 0xFF,
0x00,
0x00
]);
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
mixEffect.transitionSettings.dip = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.transitionSettings.dip`;
}
}
TransitionDipCommand.MaskFlags = {
rate: 1 << 0,
input: 1 << 1
};
exports.TransitionDipCommand = TransitionDipCommand;
exports.TransitionDipUpdateCommand = TransitionDipUpdateCommand;
//# sourceMappingURL=TransitionDipCommand.js.map

@@ -24,5 +24,10 @@ /// <reference types="node" />

updateProps(newProps: Partial<DVETransitionSettings>): void;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class TransitionDVEUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
properties: DVETransitionSettings;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

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

super(...arguments);
this.rawName = 'TDvP';
this.rawName = 'CTDv';
}

@@ -14,2 +14,41 @@ updateProps(newProps) {

}
serialize() {
const buffer = Buffer.alloc(20, 0);
buffer.writeUInt16BE(this.flag, 0);
buffer.writeUInt8(this.mixEffect, 2);
buffer.writeUInt8(this.properties.rate, 3);
buffer.writeUInt8(this.properties.logoRate, 4);
buffer.writeUInt8(this.properties.style, 5);
buffer.writeUInt16BE(this.properties.fillSource, 6);
buffer.writeUInt16BE(this.properties.keySource, 8);
buffer.writeUInt8(this.properties.enableKey ? 1 : 0, 10);
buffer.writeUInt8(this.properties.preMultiplied ? 1 : 0, 11);
buffer.writeUInt16BE(this.properties.clip, 12);
buffer.writeUInt16BE(this.properties.gain, 14);
buffer.writeUInt8(this.properties.invertKey ? 1 : 0, 16);
buffer.writeUInt8(this.properties.reverse ? 1 : 0, 17);
buffer.writeUInt8(this.properties.flipFlop ? 1 : 0, 18);
return buffer;
}
}
exports.TransitionDVECommand = TransitionDVECommand;
TransitionDVECommand.MaskFlags = {
rate: 1 << 0,
logoRate: 1 << 1,
style: 1 << 2,
fillSource: 1 << 3,
keySource: 1 << 4,
enableKey: 1 << 5,
preMultiplied: 1 << 6,
clip: 1 << 7,
gain: 1 << 8,
invertKey: 1 << 9,
reverse: 1 << 10,
flipFlop: 1 << 11
};
class TransitionDVEUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'TDvP';
}
deserialize(rawCommand) {

@@ -32,43 +71,9 @@ this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);

}
serialize() {
const rawCommand = 'CTDv';
const buffer = new Buffer(24);
buffer.fill(0);
Buffer.from(rawCommand).copy(buffer, 0);
buffer.writeUInt16BE(this.flag, 4);
buffer.writeUInt8(this.mixEffect, 6);
buffer.writeUInt8(this.properties.rate, 7);
buffer.writeUInt8(this.properties.logoRate, 8);
buffer.writeUInt8(this.properties.style, 9);
buffer.writeUInt16BE(this.properties.fillSource, 10);
buffer.writeUInt16BE(this.properties.keySource, 12);
buffer[14] = this.properties.enableKey ? 1 : 0;
buffer[15] = this.properties.preMultiplied ? 1 : 0;
buffer.writeUInt16BE(this.properties.clip, 16);
buffer.writeUInt16BE(this.properties.gain, 18);
buffer[20] = this.properties.invertKey ? 1 : 0;
buffer[21] = this.properties.reverse ? 1 : 0;
buffer[22] = this.properties.flipFlop ? 1 : 0;
return buffer;
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
mixEffect.transitionSettings.DVE = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.transitionSettings.DVE`;
}
}
TransitionDVECommand.MaskFlags = {
rate: 1 << 0,
logoRate: 1 << 1,
style: 1 << 2,
fillSource: 1 << 3,
keySource: 1 << 4,
enableKey: 1 << 5,
preMultiplied: 1 << 6,
clip: 1 << 7,
gain: 1 << 8,
invertKey: 1 << 9,
reverse: 1 << 10,
flipFlop: 1 << 11
};
exports.TransitionDVECommand = TransitionDVECommand;
exports.TransitionDVEUpdateCommand = TransitionDVEUpdateCommand;
//# sourceMappingURL=TransitionDVECommand.js.map

@@ -10,5 +10,10 @@ /// <reference types="node" />

updateProps(newProps: Partial<MixTransitionSettings>): void;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class TransitionMixUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
properties: MixTransitionSettings;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

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

super(...arguments);
this.rawName = 'TMxP';
this.rawName = 'CTMx';
}

@@ -14,2 +14,15 @@ updateProps(newProps) {

}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.mixEffect, 0);
buffer.writeUInt8(this.properties.rate, 1);
return buffer;
}
}
exports.TransitionMixCommand = TransitionMixCommand;
class TransitionMixUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'TMxP';
}
deserialize(rawCommand) {

@@ -21,17 +34,9 @@ this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);

}
serialize() {
const rawCommand = 'CTMx';
return new Buffer([
...Buffer.from(rawCommand),
this.mixEffect,
this.properties.rate,
0x00, 0x00
]);
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
mixEffect.transitionSettings.mix = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.transitionSettings.mix`;
}
}
exports.TransitionMixCommand = TransitionMixCommand;
exports.TransitionMixUpdateCommand = TransitionMixUpdateCommand;
//# sourceMappingURL=TransitionMixCommand.js.map

@@ -12,5 +12,14 @@ /// <reference types="node" />

};
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class TransitionPositionUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
properties: {
readonly inTransition: boolean;
readonly remainingFrames: number;
handlePosition: number;
};
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -8,4 +8,17 @@ "use strict";

super(...arguments);
this.rawName = 'TrPs'; // this seems unnecessary.
this.rawName = 'CTPs';
}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.mixEffect, 0);
buffer.writeUInt16BE(this.properties.handlePosition, 2);
return buffer;
}
}
exports.TransitionPositionCommand = TransitionPositionCommand;
class TransitionPositionUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'TrPs';
}
deserialize(rawCommand) {

@@ -19,12 +32,2 @@ this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);

}
serialize() {
const rawCommand = 'CTPs';
return new Buffer([
...Buffer.from(rawCommand),
this.mixEffect,
0x00,
this.properties.handlePosition >> 8,
this.properties.handlePosition & 0xff
]);
}
applyToState(state) {

@@ -35,5 +38,6 @@ const mixEffect = state.video.getMe(this.mixEffect);

mixEffect.inTransition = this.properties.inTransition;
return `video.ME.${this.mixEffect}.transition`;
}
}
exports.TransitionPositionCommand = TransitionPositionCommand;
exports.TransitionPositionUpdateCommand = TransitionPositionUpdateCommand;
//# sourceMappingURL=TransitionPositionCommand.js.map

@@ -10,5 +10,12 @@ /// <reference types="node" />

};
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class PreviewTransitionUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
properties: {
preview: boolean;
};
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -8,4 +8,17 @@ "use strict";

super(...arguments);
this.rawName = 'TrPr'; // this seems unnecessary.
this.rawName = 'CTPr';
}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.mixEffect, 0);
buffer.writeUInt8(this.properties.preview ? 1 : 0, 1);
return buffer;
}
}
exports.PreviewTransitionCommand = PreviewTransitionCommand;
class PreviewTransitionUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'TrPr';
}
deserialize(rawCommand) {

@@ -17,17 +30,9 @@ this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);

}
serialize() {
const rawCommand = 'CTPr';
return new Buffer([
...Buffer.from(rawCommand),
this.mixEffect,
this.properties.preview,
0x00, 0x00
]);
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
mixEffect.transitionPreview = this.properties.preview;
return `video.ME.${this.mixEffect}.transitionPreview`;
}
}
exports.PreviewTransitionCommand = PreviewTransitionCommand;
exports.PreviewTransitionUpdateCommand = PreviewTransitionUpdateCommand;
//# sourceMappingURL=TransitionPreviewCommand.js.map

@@ -14,5 +14,10 @@ /// <reference types="node" />

updateProps(newProps: Partial<TransitionProperties>): void;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class TransitionPropertiesUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
properties: TransitionProperties;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

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

super(...arguments);
this.rawName = 'TrSS';
this.rawName = 'CTTp';
}

@@ -14,2 +14,21 @@ updateProps(newProps) {

}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.mixEffect, 1);
buffer.writeUInt8(this.properties.style, 2);
buffer.writeUInt8(this.properties.selection, 3);
return buffer;
}
}
exports.TransitionPropertiesCommand = TransitionPropertiesCommand;
TransitionPropertiesCommand.MaskFlags = {
style: 1 << 0,
selection: 1 << 1
};
class TransitionPropertiesUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'TrSS';
}
deserialize(rawCommand) {

@@ -24,23 +43,9 @@ this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);

}
serialize() {
const rawCommand = 'CTTp';
const buffer = new Buffer(8);
buffer.fill(0);
Buffer.from(rawCommand).copy(buffer, 0);
buffer.writeUInt8(this.flag, 4);
buffer.writeUInt8(this.mixEffect, 5);
buffer.writeUInt8(this.properties.style, 6);
buffer.writeUInt8(this.properties.selection, 7);
return buffer;
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
mixEffect.transitionProperties = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.transitionProperties`;
}
}
TransitionPropertiesCommand.MaskFlags = {
style: 1 << 0,
selection: 1 << 1
};
exports.TransitionPropertiesCommand = TransitionPropertiesCommand;
exports.TransitionPropertiesUpdateCommand = TransitionPropertiesUpdateCommand;
//# sourceMappingURL=TransitionPropertiesCommand.js.map

@@ -21,5 +21,10 @@ /// <reference types="node" />

updateProps(newProps: Partial<StingerTransitionSettings>): void;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class TransitionStingerUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
properties: StingerTransitionSettings;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

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

super(...arguments);
this.rawName = 'TStP';
this.rawName = 'CTSt';
}

@@ -14,2 +14,35 @@ updateProps(newProps) {

}
serialize() {
const buffer = Buffer.alloc(20);
buffer.writeUInt16BE(this.flag, 0);
buffer.writeUInt8(this.mixEffect, 2);
buffer.writeUInt8(this.properties.source, 3);
buffer.writeUInt8(this.properties.preMultipliedKey ? 1 : 0, 4);
buffer.writeUInt16BE(this.properties.clip, 6);
buffer.writeUInt16BE(this.properties.gain, 8);
buffer.writeUInt8(this.properties.invert ? 1 : 0, 10);
buffer.writeUInt16BE(this.properties.preroll, 12);
buffer.writeUInt16BE(this.properties.clipDuration, 14);
buffer.writeUInt16BE(this.properties.triggerPoint, 16);
buffer.writeUInt16BE(this.properties.mixRate, 18);
return buffer;
}
}
exports.TransitionStingerCommand = TransitionStingerCommand;
TransitionStingerCommand.MaskFlags = {
source: 1 << 0,
preMultipliedKey: 1 << 1,
clip: 1 << 2,
gain: 1 << 3,
invert: 1 << 4,
preroll: 1 << 5,
clipDuration: 1 << 6,
triggerPoint: 1 << 7,
mixRate: 1 << 8
};
class TransitionStingerUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'TStP';
}
deserialize(rawCommand) {

@@ -29,37 +62,9 @@ this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);

}
serialize() {
const rawCommand = 'CTSt';
const buffer = new Buffer(24);
buffer.fill(0);
Buffer.from(rawCommand).copy(buffer, 0);
buffer.writeUInt16BE(this.flag, 4);
buffer.writeUInt8(this.mixEffect, 6);
buffer.writeUInt8(this.properties.source, 7);
buffer.writeUInt8(this.properties.preMultipliedKey ? 1 : 0, 8);
buffer.writeUInt16BE(this.properties.clip, 10);
buffer.writeUInt16BE(this.properties.gain, 12);
buffer.writeUInt8(this.properties.invert ? 1 : 0, 14);
buffer.writeUInt16BE(this.properties.preroll, 16);
buffer.writeUInt16BE(this.properties.clipDuration, 18);
buffer.writeUInt16BE(this.properties.triggerPoint, 20);
buffer.writeUInt16BE(this.properties.mixRate, 22);
return buffer;
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
mixEffect.transitionSettings.stinger = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.transitionSettings.stinger`;
}
}
TransitionStingerCommand.MaskFlags = {
source: 1 << 0,
preMultipliedKey: 1 << 1,
clip: 1 << 2,
gain: 1 << 3,
invert: 1 << 4,
preroll: 1 << 5,
clipDuration: 1 << 6,
triggerPoint: 1 << 7,
mixRate: 1 << 8
};
exports.TransitionStingerCommand = TransitionStingerCommand;
exports.TransitionStingerUpdateCommand = TransitionStingerUpdateCommand;
//# sourceMappingURL=TransitionStingerCommand.js.map

@@ -22,5 +22,10 @@ /// <reference types="node" />

updateProps(newProps: Partial<WipeTransitionSettings>): void;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class TransitionWipeUpdateCommand extends AbstractCommand {
rawName: string;
mixEffect: number;
properties: WipeTransitionSettings;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

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

super(...arguments);
this.rawName = 'TWpP';
this.rawName = 'CTWp';
}

@@ -14,2 +14,37 @@ updateProps(newProps) {

}
serialize() {
const buffer = Buffer.alloc(20);
buffer.writeUInt16BE(this.flag, 0);
buffer.writeUInt8(this.mixEffect, 2);
buffer.writeUInt8(this.properties.rate, 3);
buffer.writeUInt8(this.properties.pattern, 4);
buffer.writeUInt16BE(this.properties.borderWidth, 6);
buffer.writeUInt16BE(this.properties.borderInput, 8);
buffer.writeUInt16BE(this.properties.symmetry, 10);
buffer.writeUInt16BE(this.properties.borderSoftness, 12);
buffer.writeUInt16BE(this.properties.xPosition, 14);
buffer.writeUInt16BE(this.properties.yPosition, 16);
buffer.writeUInt8(this.properties.reverseDirection ? 1 : 0, 18);
buffer.writeUInt8(this.properties.flipFlop ? 1 : 0, 19);
return buffer;
}
}
exports.TransitionWipeCommand = TransitionWipeCommand;
TransitionWipeCommand.MaskFlags = {
rate: 1 << 0,
pattern: 1 << 1,
borderWidth: 1 << 2,
borderInput: 1 << 3,
symmetry: 1 << 4,
borderSoftness: 1 << 5,
xPosition: 1 << 6,
yPosition: 1 << 7,
reverseDirection: 1 << 8,
flipFlop: 1 << 9
};
class TransitionWipeUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'TWpP';
}
deserialize(rawCommand) {

@@ -30,39 +65,9 @@ this.mixEffect = __1.Util.parseNumberBetween(rawCommand[0], 0, 3);

}
serialize() {
const rawCommand = 'CTWp';
const buffer = new Buffer(24);
buffer.fill(0);
Buffer.from(rawCommand).copy(buffer, 0);
buffer.writeUInt16BE(this.flag, 4);
buffer.writeUInt8(this.mixEffect, 6);
buffer.writeUInt8(this.properties.rate, 7);
buffer.writeUInt8(this.properties.pattern, 8);
buffer.writeUInt16BE(this.properties.borderWidth, 10);
buffer.writeUInt16BE(this.properties.borderInput, 12);
buffer.writeUInt16BE(this.properties.symmetry, 14);
buffer.writeUInt16BE(this.properties.borderSoftness, 16);
buffer.writeUInt16BE(this.properties.xPosition, 18);
buffer.writeUInt16BE(this.properties.yPosition, 20);
buffer.writeUInt8(this.properties.reverseDirection ? 1 : 0, 22);
buffer.writeUInt8(this.properties.flipFlop ? 1 : 0, 23);
return buffer;
}
applyToState(state) {
const mixEffect = state.video.getMe(this.mixEffect);
mixEffect.transitionSettings.wipe = Object.assign({}, this.properties);
return `video.ME.${this.mixEffect}.transitionSettings.wipe`;
}
}
TransitionWipeCommand.MaskFlags = {
rate: 1 << 0,
pattern: 1 << 1,
borderWidth: 1 << 2,
borderInput: 1 << 3,
symmetry: 1 << 4,
borderSoftness: 1 << 5,
xPosition: 1 << 6,
yPosition: 1 << 7,
reverseDirection: 1 << 8,
flipFlop: 1 << 9
};
exports.TransitionWipeCommand = TransitionWipeCommand;
exports.TransitionWipeUpdateCommand = TransitionWipeUpdateCommand;
//# sourceMappingURL=TransitionWipeCommand.js.map

@@ -13,3 +13,3 @@ /// <reference types="node" />

deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): void;
applyToState(state: AtemState): string;
}

@@ -23,2 +23,3 @@ "use strict";

state.info.power = this.properties.slice(0, count);
return `info.power`;
}

@@ -25,0 +26,0 @@ }

@@ -11,5 +11,11 @@ /// <reference types="node" />

updateProps(newProps: Partial<MultiViewerSourceState>): void;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class MultiViewerSourceUpdateCommand extends AbstractCommand {
rawName: string;
multiViewerId: number;
index: number;
properties: MultiViewerSourceState;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

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

super(...arguments);
this.rawName = 'MvIn';
this.rawName = 'CMvI';
}

@@ -13,2 +13,16 @@ updateProps(newProps) {

}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.multiViewerId, 0);
buffer.writeUInt8(this.properties.windowIndex, 1);
buffer.writeUInt16BE(this.properties.source, 2);
return buffer;
}
}
exports.MultiViewerSourceCommand = MultiViewerSourceCommand;
class MultiViewerSourceUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'MvIn';
}
deserialize(rawCommand) {

@@ -22,19 +36,9 @@ this.index = rawCommand.readUInt8(1);

}
serialize() {
const rawCommand = 'CMvI';
return new Buffer([
...Buffer.from(rawCommand),
this.multiViewerId,
this.properties.windowIndex,
this.properties.source >> 8,
this.properties.source & 0xFF
]);
}
applyToState(state) {
const obj = {};
obj[this.index] = this.properties;
state.settings.multiViewers[this.multiViewerId] = Object.assign({}, state.settings.multiViewers[this.multiViewerId], obj);
const multiviewer = state.settings.getMultiViewer(this.multiViewerId);
multiviewer.windows[this.index] = Object.assign(Object.assign({}, multiviewer.windows[this.index]), this.properties);
return `settings.multiViewers.${this.multiViewerId}.windows.${this.index}`;
}
}
exports.MultiViewerSourceCommand = MultiViewerSourceCommand;
exports.MultiViewerSourceUpdateCommand = MultiViewerSourceUpdateCommand;
//# sourceMappingURL=MultiViewerSourceCommand.js.map

@@ -11,5 +11,12 @@ /// <reference types="node" />

};
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class VideoModeUpdateCommand extends AbstractCommand {
rawName: string;
auxBus: number;
properties: {
mode: Enums.VideoMode;
};
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -7,2 +7,14 @@ "use strict";

super(...arguments);
this.rawName = 'CVdM';
}
serialize() {
const buffer = Buffer.alloc(4);
buffer.writeUInt8(this.properties.mode, 0);
return buffer;
}
}
exports.VideoModeCommand = VideoModeCommand;
class VideoModeUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'VidM';

@@ -15,12 +27,8 @@ }

}
serialize() {
const buffer = Buffer.alloc(4);
buffer[0] = this.properties.mode;
return Buffer.concat([Buffer.from('CVdM', 'ascii'), buffer]);
}
applyToState(state) {
state.settings.videoMode = this.properties.mode;
return `settings.videoMode`;
}
}
exports.VideoModeCommand = VideoModeCommand;
exports.VideoModeUpdateCommand = VideoModeUpdateCommand;
//# sourceMappingURL=VideoMode.js.map

@@ -5,2 +5,3 @@ /// <reference types="node" />

import { SuperSourceBox } from '../../state/video';
import { ProtocolVersion } from '../../enums';
export declare class SuperSourceBoxParametersCommand extends AbstractCommand {

@@ -20,8 +21,15 @@ static MaskFlags: {

rawName: string;
ssrcId: number;
boxId: number;
properties: SuperSourceBox;
updateProps(newProps: Partial<SuperSourceBox>): void;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
serialize(version: ProtocolVersion): Buffer;
}
export declare class SuperSourceBoxParametersUpdateCommand extends AbstractCommand {
rawName: string;
ssrcId: number;
boxId: number;
properties: SuperSourceBox;
deserialize(rawCommand: Buffer, version: ProtocolVersion): void;
applyToState(state: AtemState): string;
}

@@ -5,6 +5,7 @@ "use strict";

const __1 = require("../..");
const enums_1 = require("../../enums");
class SuperSourceBoxParametersCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'SSBP';
this.rawName = 'CSBP';
}

@@ -14,37 +15,27 @@ updateProps(newProps) {

}
deserialize(rawCommand) {
this.boxId = rawCommand[0];
this.properties = {
enabled: rawCommand[1] === 1,
source: rawCommand.readUInt16BE(2),
x: __1.Util.parseNumberBetween(rawCommand.readInt16BE(4), -4800, 4800),
y: __1.Util.parseNumberBetween(rawCommand.readInt16BE(6), -3400, 3400),
size: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(8), 70, 1000),
cropped: rawCommand[10] === 1,
cropTop: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(12), 0, 18000),
cropBottom: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(14), 0, 18000),
cropLeft: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(16), 0, 32000),
cropRight: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(18), 0, 32000)
};
}
serialize() {
serialize(version) {
const buffer = Buffer.alloc(24);
let i = 0;
if (version >= enums_1.ProtocolVersion.V8_0) {
i = 1;
buffer.writeUInt8(this.ssrcId, i + 1);
}
buffer.writeUInt16BE(this.flag, 0);
buffer.writeUInt8(this.boxId, 2);
buffer.writeUInt8(this.properties.enabled ? 1 : 0, 3);
buffer.writeUInt16BE(this.properties.source, 4);
buffer.writeInt16BE(this.properties.x, 6);
buffer.writeInt16BE(this.properties.y, 8);
buffer.writeUInt16BE(this.properties.size, 10);
buffer.writeUInt8(this.properties.cropped ? 1 : 0, 12);
buffer.writeUInt16BE(this.properties.cropTop, 14);
buffer.writeUInt16BE(this.properties.cropBottom, 16);
buffer.writeUInt16BE(this.properties.cropLeft, 18);
buffer.writeUInt16BE(this.properties.cropRight, 20);
return Buffer.concat([Buffer.from('CSBP', 'ascii'), buffer]);
buffer.writeUInt8(this.boxId, i + 2);
buffer.writeUInt8(this.properties.enabled ? 1 : 0, i + 3);
if (i === 1)
i++; // Needs to be 2 byte aligned now
buffer.writeUInt16BE(this.properties.source, i + 4);
buffer.writeInt16BE(this.properties.x, i + 6);
buffer.writeInt16BE(this.properties.y, i + 8);
buffer.writeUInt16BE(this.properties.size, i + 10);
buffer.writeUInt8(this.properties.cropped ? 1 : 0, i + 12);
buffer.writeUInt16BE(this.properties.cropTop, i + 14);
buffer.writeUInt16BE(this.properties.cropBottom, i + 16);
buffer.writeUInt16BE(this.properties.cropLeft, i + 18);
buffer.writeUInt16BE(this.properties.cropRight, i + 20);
return buffer;
}
applyToState(state) {
state.video.superSourceBoxes[this.boxId] = Object.assign({}, this.properties);
}
}
exports.SuperSourceBoxParametersCommand = SuperSourceBoxParametersCommand;
SuperSourceBoxParametersCommand.MaskFlags = {

@@ -62,3 +53,37 @@ enabled: 1 << 0,

};
exports.SuperSourceBoxParametersCommand = SuperSourceBoxParametersCommand;
class SuperSourceBoxParametersUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'SSBP';
}
deserialize(rawCommand, version) {
let i = 0;
if (version >= enums_1.ProtocolVersion.V8_0) {
i = 2;
this.ssrcId = rawCommand.readUInt8(0);
}
else {
this.ssrcId = 0;
}
this.boxId = rawCommand.readUInt8(i > 0 ? 1 : 0);
this.properties = {
enabled: rawCommand[i > 0 ? 2 : 1] === 1,
source: rawCommand.readUInt16BE(i + 2),
x: __1.Util.parseNumberBetween(rawCommand.readInt16BE(i + 4), -4800, 4800),
y: __1.Util.parseNumberBetween(rawCommand.readInt16BE(i + 6), -3400, 3400),
size: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(i + 8), 70, 1000),
cropped: rawCommand[i + 10] === 1,
cropTop: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(i + 12), 0, 18000),
cropBottom: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(i + 14), 0, 18000),
cropLeft: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(i + 16), 0, 32000),
cropRight: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(i + 18), 0, 32000)
};
}
applyToState(state) {
const supersource = state.video.getSuperSource(this.ssrcId);
supersource.boxes[this.boxId] = Object.assign({}, this.properties);
return `video.superSources.${this.ssrcId}.boxes.${this.boxId}`;
}
}
exports.SuperSourceBoxParametersUpdateCommand = SuperSourceBoxParametersUpdateCommand;
//# sourceMappingURL=SuperSourceBoxParametersCommand.js.map
/// <reference types="node" />
import AbstractCommand from '../AbstractCommand';
import { AtemState } from '../../state';
import { SuperSourceProperties } from '../../state/video';
import { SuperSourceProperties, SuperSourceBorder, SuperSource } from '../../state/video';
import { Enums } from '../..';
export declare class SuperSourcePropertiesCommand extends AbstractCommand {

@@ -29,8 +30,67 @@ static MaskFlags: {

rawName: string;
boxId: number;
properties: SuperSourceProperties & SuperSourceBorder;
updateProps(newProps: Partial<SuperSourceProperties & SuperSourceBorder>): void;
serialize(): Buffer;
}
export declare class SuperSourcePropertiesV8Command extends AbstractCommand {
static MaskFlags: {
artFillSource: number;
artCutSource: number;
artOption: number;
artPreMultiplied: number;
artClip: number;
artGain: number;
artInvertKey: number;
};
rawName: string;
minimumVersion: Enums.ProtocolVersion;
ssrcId: number;
properties: SuperSourceProperties;
updateProps(newProps: Partial<SuperSourceProperties>): void;
deserialize(rawCommand: Buffer): void;
serialize(): Buffer;
applyToState(state: AtemState): void;
}
export declare class SuperSourceBorderCommand extends AbstractCommand {
static MaskFlags: {
borderEnabled: number;
borderBevel: number;
borderOuterWidth: number;
borderInnerWidth: number;
borderOuterSoftness: number;
borderInnerSoftness: number;
borderBevelSoftness: number;
borderBevelPosition: number;
borderHue: number;
borderSaturation: number;
borderLuma: number;
borderLightSourceDirection: number;
borderLightSourceAltitude: number;
};
rawName: string;
minimumVersion: Enums.ProtocolVersion;
ssrcId: number;
properties: SuperSourceBorder;
updateProps(newProps: Partial<SuperSourceBorder>): void;
serialize(): Buffer;
}
export declare class SuperSourcePropertiesUpdateCommand extends AbstractCommand {
rawName: string;
properties: Pick<SuperSource, 'properties' | 'border'>;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string[];
}
export declare class SuperSourcePropertiesUpdateV8Command extends AbstractCommand {
rawName: string;
minimumVersion: Enums.ProtocolVersion;
ssrcId: number;
properties: SuperSourceProperties;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}
export declare class SuperSourceBorderUpdateCommand extends AbstractCommand {
rawName: string;
minimumVersion: Enums.ProtocolVersion;
ssrcId: number;
properties: SuperSourceBorder;
deserialize(rawCommand: Buffer): void;
applyToState(state: AtemState): string;
}

@@ -5,6 +5,7 @@ "use strict";

const __1 = require("../..");
const enums_1 = require("../../enums");
class SuperSourcePropertiesCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'SSrc';
this.rawName = 'CSSc';
}

@@ -14,27 +15,2 @@ updateProps(newProps) {

}
deserialize(rawCommand) {
this.boxId = rawCommand[0];
this.properties = {
artFillSource: rawCommand.readUInt16BE(0),
artCutSource: rawCommand.readUInt16BE(2),
artOption: __1.Util.parseEnum(rawCommand.readUInt8(4), __1.Enums.SuperSourceArtOption),
artPreMultiplied: rawCommand[5] === 1,
artClip: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(6), 0, 1000),
artGain: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(8), 0, 1000),
artInvertKey: rawCommand[10] === 1,
borderEnabled: rawCommand[11] === 1,
borderBevel: __1.Util.parseEnum(rawCommand.readUInt8(12), __1.Enums.BorderBevel),
borderOuterWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(14), 0, 1600),
borderInnerWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(16), 0, 1600),
borderOuterSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(18), 0, 100),
borderInnerSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(19), 0, 100),
borderBevelSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(20), 0, 100),
borderBevelPosition: __1.Util.parseNumberBetween(rawCommand.readUInt8(21), 0, 100),
borderHue: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(22), 0, 3599),
borderSaturation: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(24), 0, 1000),
borderLuma: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(26), 0, 1000),
borderLightSourceDirection: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(28), 0, 3599),
borderLightSourceAltitude: __1.Util.parseNumberBetween(rawCommand.readUInt8(30), 0, 100)
};
}
serialize() {

@@ -63,8 +39,6 @@ const buffer = Buffer.alloc(36);

buffer.writeUInt8(this.properties.borderLightSourceAltitude, 34);
return Buffer.concat([Buffer.from('CSSc', 'ascii'), buffer]);
return buffer;
}
applyToState(state) {
state.video.superSourceProperties = Object.assign({}, this.properties);
}
}
exports.SuperSourcePropertiesCommand = SuperSourcePropertiesCommand;
SuperSourcePropertiesCommand.MaskFlags = {

@@ -92,3 +66,180 @@ artFillSource: 1 << 0,

};
exports.SuperSourcePropertiesCommand = SuperSourcePropertiesCommand;
class SuperSourcePropertiesV8Command extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'CSSc';
this.minimumVersion = enums_1.ProtocolVersion.V8_0;
}
updateProps(newProps) {
this._updateProps(newProps);
}
serialize() {
const buffer = Buffer.alloc(16);
buffer.writeUInt8(this.flag, 0);
buffer.writeUInt8(this.ssrcId, 1);
buffer.writeUInt16BE(this.properties.artFillSource, 2);
buffer.writeUInt16BE(this.properties.artCutSource, 4);
buffer.writeUInt8(this.properties.artOption, 6);
buffer.writeUInt8(this.properties.artPreMultiplied ? 1 : 0, 7);
buffer.writeUInt16BE(this.properties.artClip, 8);
buffer.writeUInt16BE(this.properties.artGain, 10);
buffer.writeUInt8(this.properties.artInvertKey ? 1 : 0, 12);
return buffer;
}
}
exports.SuperSourcePropertiesV8Command = SuperSourcePropertiesV8Command;
SuperSourcePropertiesV8Command.MaskFlags = {
artFillSource: 1 << 0,
artCutSource: 1 << 1,
artOption: 1 << 2,
artPreMultiplied: 1 << 3,
artClip: 1 << 4,
artGain: 1 << 5,
artInvertKey: 1 << 6
};
class SuperSourceBorderCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'CSBd';
this.minimumVersion = enums_1.ProtocolVersion.V8_0;
}
updateProps(newProps) {
this._updateProps(newProps);
}
serialize() {
const buffer = Buffer.alloc(24);
buffer.writeUInt16BE(this.flag, 0);
buffer.writeUInt8(this.ssrcId, 2);
buffer.writeUInt8(this.properties.borderEnabled ? 1 : 0, 3);
buffer.writeUInt8(this.properties.borderBevel, 4);
buffer.writeUInt16BE(this.properties.borderOuterWidth, 6);
buffer.writeUInt16BE(this.properties.borderInnerWidth, 8);
buffer.writeUInt8(this.properties.borderOuterSoftness, 10);
buffer.writeUInt8(this.properties.borderInnerSoftness, 11);
buffer.writeUInt8(this.properties.borderBevelSoftness, 12);
buffer.writeUInt8(this.properties.borderBevelPosition, 13);
buffer.writeUInt16BE(this.properties.borderHue, 14);
buffer.writeUInt16BE(this.properties.borderSaturation, 16);
buffer.writeUInt16BE(this.properties.borderLuma, 18);
buffer.writeUInt16BE(this.properties.borderLightSourceDirection, 20);
buffer.writeUInt8(this.properties.borderLightSourceAltitude, 22);
return buffer;
}
}
exports.SuperSourceBorderCommand = SuperSourceBorderCommand;
SuperSourceBorderCommand.MaskFlags = {
borderEnabled: 1 << 0,
borderBevel: 1 << 1,
borderOuterWidth: 1 << 2,
borderInnerWidth: 1 << 3,
borderOuterSoftness: 1 << 4,
borderInnerSoftness: 1 << 5,
borderBevelSoftness: 1 << 6,
borderBevelPosition: 1 << 7,
borderHue: 1 << 8,
borderSaturation: 1 << 9,
borderLuma: 1 << 10,
borderLightSourceDirection: 1 << 11,
borderLightSourceAltitude: 1 << 12
};
class SuperSourcePropertiesUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'SSrc';
}
deserialize(rawCommand) {
this.properties = {
properties: {
artFillSource: rawCommand.readUInt16BE(0),
artCutSource: rawCommand.readUInt16BE(2),
artOption: __1.Util.parseEnum(rawCommand.readUInt8(4), __1.Enums.SuperSourceArtOption),
artPreMultiplied: rawCommand[5] === 1,
artClip: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(6), 0, 1000),
artGain: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(8), 0, 1000),
artInvertKey: rawCommand[10] === 1
},
border: {
borderEnabled: rawCommand[11] === 1,
borderBevel: __1.Util.parseEnum(rawCommand.readUInt8(12), __1.Enums.BorderBevel),
borderOuterWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(14), 0, 1600),
borderInnerWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(16), 0, 1600),
borderOuterSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(18), 0, 100),
borderInnerSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(19), 0, 100),
borderBevelSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(20), 0, 100),
borderBevelPosition: __1.Util.parseNumberBetween(rawCommand.readUInt8(21), 0, 100),
borderHue: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(22), 0, 3599),
borderSaturation: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(24), 0, 1000),
borderLuma: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(26), 0, 1000),
borderLightSourceDirection: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(28), 0, 3599),
borderLightSourceAltitude: __1.Util.parseNumberBetween(rawCommand.readUInt8(30), 0, 100)
}
};
}
applyToState(state) {
const supersource = state.video.getSuperSource(0);
supersource.properties = Object.assign({}, this.properties.properties);
supersource.border = Object.assign({}, this.properties.border);
return [
`video.superSources.0.properties`,
`video.superSources.0.border`
];
}
}
exports.SuperSourcePropertiesUpdateCommand = SuperSourcePropertiesUpdateCommand;
class SuperSourcePropertiesUpdateV8Command extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'SSrc';
this.minimumVersion = enums_1.ProtocolVersion.V8_0;
}
deserialize(rawCommand) {
this.ssrcId = rawCommand.readUInt8(0);
this.properties = {
artFillSource: rawCommand.readUInt16BE(2),
artCutSource: rawCommand.readUInt16BE(4),
artOption: __1.Util.parseEnum(rawCommand.readUInt8(6), __1.Enums.SuperSourceArtOption),
artPreMultiplied: rawCommand[7] === 1,
artClip: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(8), 0, 1000),
artGain: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(10), 0, 1000),
artInvertKey: rawCommand[12] === 1
};
}
applyToState(state) {
const supersource = state.video.getSuperSource(this.ssrcId);
supersource.properties = Object.assign({}, this.properties);
return `video.superSources.${this.ssrcId}.properties`;
}
}
exports.SuperSourcePropertiesUpdateV8Command = SuperSourcePropertiesUpdateV8Command;
class SuperSourceBorderUpdateCommand extends AbstractCommand_1.default {
constructor() {
super(...arguments);
this.rawName = 'SSBd';
this.minimumVersion = enums_1.ProtocolVersion.V8_0;
}
deserialize(rawCommand) {
this.ssrcId = rawCommand.readUInt8(0);
this.properties = {
borderEnabled: rawCommand[1] === 1,
borderBevel: __1.Util.parseEnum(rawCommand.readUInt8(2), __1.Enums.BorderBevel),
borderOuterWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(4), 0, 1600),
borderInnerWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(6), 0, 1600),
borderOuterSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(8), 0, 100),
borderInnerSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(9), 0, 100),
borderBevelSoftness: __1.Util.parseNumberBetween(rawCommand.readUInt8(10), 0, 100),
borderBevelPosition: __1.Util.parseNumberBetween(rawCommand.readUInt8(11), 0, 100),
borderHue: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(12), 0, 3599),
borderSaturation: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(14), 0, 1000),
borderLuma: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(16), 0, 1000),
borderLightSourceDirection: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(18), 0, 3599),
borderLightSourceAltitude: __1.Util.parseNumberBetween(rawCommand.readUInt8(20), 0, 100)
};
}
applyToState(state) {
const supersource = state.video.getSuperSource(this.ssrcId);
supersource.border = Object.assign({}, this.properties);
return `video.superSources.${this.ssrcId}.border`;
}
}
exports.SuperSourceBorderUpdateCommand = SuperSourceBorderUpdateCommand;
//# sourceMappingURL=SuperSourcePropertiesCommand.js.map

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

const command = new __1.Commands.DataTransferFileDescriptionCommand();
command.updateProps(Object.assign({}, this.description, { fileHash: this.hash, transferId: this.transferId }));
command.updateProps(Object.assign(Object.assign({}, this.description), { fileHash: this.hash, transferId: this.transferId }));
this.commandQueue.push(command);

@@ -22,0 +22,0 @@ }

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

const command = new __1.Commands.DataTransferFileDescriptionCommand();
command.updateProps(Object.assign({}, this.description, { fileHash: this.hash, transferId: this.transferId }));
command.updateProps(Object.assign(Object.assign({}, this.description), { fileHash: this.hash, transferId: this.transferId }));
this.commandQueue.push(command);

@@ -11,0 +11,0 @@ }

@@ -9,8 +9,10 @@ /// <reference types="node" />

readonly clip2Lock: DataLock;
readonly interval: NodeJS.Timer;
transferIndex: number;
constructor(sendCommand: (command: Commands.AbstractCommand) => Promise<Commands.AbstractCommand>);
stop(): void;
handleCommand(command: Commands.AbstractCommand): void;
uploadStill(index: number, data: Buffer, name: string, description: string): Promise<{}>;
uploadClip(index: number, data: Array<Buffer>, name: string): Promise<{}>;
uploadAudio(index: number, data: Buffer, name: string): Promise<{}>;
uploadStill(index: number, data: Buffer, name: string, description: string): Promise<unknown>;
uploadClip(index: number, data: Array<Buffer>, name: string): Promise<unknown>;
uploadAudio(index: number, data: Buffer, name: string): Promise<unknown>;
}

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

this.transferIndex = 0;
setInterval(() => {
this.interval = setInterval(() => {
if (this.commandQueue.length <= 0) {

@@ -29,2 +29,5 @@ return;

}
stop() {
clearInterval(this.interval);
}
handleCommand(command) {

@@ -34,3 +37,3 @@ const allLocks = [this.stillsLock, this.clip1Lock, this.clip2Lock];

let lock;
if (command.constructor.name === __1.Commands.LockObtainedCommand.name || command.constructor.name === __1.Commands.LockStateCommand.name) {
if (command.constructor.name === __1.Commands.LockObtainedCommand.name || command.constructor.name === __1.Commands.LockStateUpdateCommand.name) {
switch (command.properties.index) {

@@ -69,3 +72,3 @@ case 0:

}
if (command.constructor.name === __1.Commands.LockStateCommand.name) {
if (command.constructor.name === __1.Commands.LockStateUpdateCommand.name) {
if (!command.properties.locked)

@@ -72,0 +75,0 @@ lock.lostLock();

export declare enum Model {
Unknown = 0,
TVS = 1,

@@ -9,4 +10,10 @@ OneME = 2,

TwoMEBS4K = 7,
TVSHD = 8
TVSHD = 8,
Constellation8K = 11
}
export declare enum ProtocolVersion {
V7_2 = 131094,
V8_0 = 131100,
V8_0_1 = 131101
}
export declare enum TransitionStyle {

@@ -13,0 +20,0 @@ MIX = 0,

@@ -5,2 +5,3 @@ "use strict";

(function (Model) {
Model[Model["Unknown"] = 0] = "Unknown";
Model[Model["TVS"] = 1] = "TVS";

@@ -14,3 +15,10 @@ Model[Model["OneME"] = 2] = "OneME";

Model[Model["TVSHD"] = 8] = "TVSHD";
Model[Model["Constellation8K"] = 11] = "Constellation8K";
})(Model = exports.Model || (exports.Model = {}));
var ProtocolVersion;
(function (ProtocolVersion) {
ProtocolVersion[ProtocolVersion["V7_2"] = 131094] = "V7_2";
ProtocolVersion[ProtocolVersion["V8_0"] = 131100] = "V8_0";
ProtocolVersion[ProtocolVersion["V8_0_1"] = 131101] = "V8_0_1"; // 2.29
})(ProtocolVersion = exports.ProtocolVersion || (exports.ProtocolVersion = {}));
var TransitionStyle;

@@ -17,0 +25,0 @@ (function (TransitionStyle) {

import AbstractCommand from '../commands/AbstractCommand';
import { ProtocolVersion } from '../enums';
declare type CommandConstructor = new () => AbstractCommand;
export declare class CommandParser {
commands: {
[key: string]: AbstractCommand;
[key: string]: Array<CommandConstructor>;
};
version: ProtocolVersion;
constructor();
commandFromRawName(name: string): AbstractCommand | undefined;
}
export {};
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const Commands = require("../commands");
const enums_1 = require("../enums");
class CommandParser {
constructor() {
this.commands = {};
this.version = enums_1.ProtocolVersion.V7_2; // Default to the minimum supported
for (const cmd in Commands) {
try {
const rawName = new Commands[cmd]().rawName;
this.commands[rawName] = Commands[cmd];
const cmdConstructor = Commands[cmd];
const rawName = new cmdConstructor().rawName;
if (rawName) {
if (!this.commands[rawName])
this.commands[rawName] = [];
this.commands[rawName].push(cmdConstructor);
}
}

@@ -18,6 +25,23 @@ catch (e) {

commandFromRawName(name) {
if (this.commands[name]) {
// we instantiate a class based on the raw command name
return new this.commands[name]();
// return Object.create((this.commands as any)[name]['prototype'])
const commandsArray = this.commands[name];
if (commandsArray) {
// instantiate all commands in the array for access to the version prop:
const commands = commandsArray.map(cmd => new cmd());
if (!this.version) { // edge case for the version command itself:
return commands[0];
}
else { // now we should have a version defined
const baseline = commands.find(cmd => !cmd.minimumVersion);
const overrides = commands.filter(cmd => cmd.minimumVersion && cmd.minimumVersion <= this.version);
if (overrides.length === 0)
return baseline;
let highestProtoCommand = overrides[0];
for (const cmd of overrides) { // find highest version in overrides
if (highestProtoCommand.minimumVersion && cmd.minimumVersion &&
(cmd.minimumVersion > highestProtoCommand.minimumVersion)) {
highestProtoCommand = cmd;
}
}
return highestProtoCommand;
}
}

@@ -24,0 +48,0 @@ return undefined;

@@ -18,7 +18,7 @@ /// <reference types="node" />

});
connect(address?: string, port?: number): Promise<{}>;
disconnect(): Promise<{}>;
connect(address?: string, port?: number): Promise<unknown>;
disconnect(): Promise<unknown>;
log(..._args: any[]): void;
readonly nextPacketId: number;
_sendCommand(command: AbstractCommand, trackingId: number): Promise<{}>;
_sendCommand(command: AbstractCommand, trackingId: number): Promise<unknown>;
private _createSocketProcess;

@@ -25,0 +25,0 @@ private _sendSubprocessMessage;

@@ -69,9 +69,13 @@ "use strict";

}
const payload = command.serialize();
const payload = command.serialize(this._commandParser.version);
const fullPayload = Buffer.alloc(payload.length + 8, 0);
fullPayload.writeUInt16BE(fullPayload.length, 0);
fullPayload.write(command.rawName, 4, 4);
payload.copy(fullPayload, 8, 0);
if (this._debug)
this.log('PAYLOAD', payload);
this.log('PAYLOAD', fullPayload);
return this._sendSubprocessMessage({
cmd: enums_1.IPCMessageType.OutboundCommand,
payload: {
data: payload,
data: fullPayload,
trackingId

@@ -156,4 +160,8 @@ }

try {
cmd.deserialize(buffer.slice(0, length).slice(8));
cmd.deserialize(buffer.slice(0, length).slice(8), this._commandParser.version);
cmd.packetId = packetId || -1;
if (name === '_ver') { // init started
const verCmd = cmd;
this._commandParser.version = verCmd.properties.version;
}
this.emit('receivedStateChange', cmd);

@@ -160,0 +168,0 @@ }

@@ -90,13 +90,7 @@ "use strict";

this.log('PAYLOAD', payload);
const buffer = new Buffer(16 + payload.length);
buffer.fill(0);
buffer[0] = (16 + payload.length) / 256 | 0x08;
buffer[1] = (16 + payload.length) % 256;
buffer[2] = this._sessionId >> 8;
buffer[3] = this._sessionId & 0xff;
buffer[10] = this._localPacketId / 256;
buffer[11] = this._localPacketId % 256;
buffer[12] = (4 + payload.length) / 256;
buffer[13] = (4 + payload.length) % 256;
payload.copy(buffer, 16);
const buffer = Buffer.alloc(12 + payload.length, 0);
buffer.writeUInt16BE(0x0800 | payload.length + 12, 0); // Opcode & Length
buffer.writeUInt16BE(this._sessionId, 2);
buffer.writeUInt16BE(this._localPacketId, 10);
payload.copy(buffer, 12);
this._sendPacket(buffer);

@@ -192,11 +186,7 @@ this._inFlight.push({

_sendAck(packetId) {
const buffer = new Buffer(12);
buffer.fill(0);
buffer[0] = 0x80;
buffer[1] = 0x0C;
buffer[2] = this._sessionId >> 8;
buffer[3] = this._sessionId & 0xFF;
buffer[4] = packetId >> 8;
buffer[5] = packetId & 0xFF;
buffer[9] = 0x41;
const buffer = Buffer.alloc(12, 0);
buffer.writeUInt16BE(0x800C, 0); // Opcode & Length
buffer.writeUInt16BE(this._sessionId, 2);
buffer.writeUInt16BE(packetId, 4);
buffer.writeUInt8(0x41, 9);
this._sendPacket(buffer);

@@ -203,0 +193,0 @@ }

@@ -6,2 +6,3 @@ /// <reference types="node" />

function stringToBytes(str: string): Array<number>;
function bufToBase64String(buffer: Buffer, start: number, length: number): string;
function bufToNullTerminatedString(buffer: Buffer, start: number, length: number): string;

@@ -14,3 +15,3 @@ function parseNumberBetween(num: number, min: number, max: number): number;

_messageId?: number;
}, log: Function): Promise<{}>;
}, log: Function): Promise<unknown>;
const COMMAND_CONNECT_HELLO: Buffer;

@@ -17,0 +18,0 @@ const COMMAND_CONNECT_HELLO_ANSWER: Buffer;

@@ -16,2 +16,6 @@ "use strict";

Util.stringToBytes = stringToBytes;
function bufToBase64String(buffer, start, length) {
return buffer.toString('base64', start, start + length);
}
Util.bufToBase64String = bufToBase64String;
function bufToNullTerminatedString(buffer, start, length) {

@@ -33,3 +37,3 @@ const slice = buffer.slice(start, start + length);

if (!type[value])
throw Error('Value is not a valid option in enum');
throw Error(`Value ${value} is not a valid option in enum`);
return value;

@@ -76,3 +80,3 @@ }

if (log) {
log(`Failed to send IPC message: ${error.message} (attempt ${error.attemptNumber}/${error.attemptNumber + error.attemptsLeft}).`);
log(`Failed to send IPC message: ${error.message} (attempt ${error.attemptNumber}/${error.attemptNumber + error.retriesLeft}).`);
}

@@ -116,3 +120,3 @@ },

const KGoKRi = KG / KRi * HalfCbCrRange;
const buffer = new Buffer(width * height * 4);
const buffer = Buffer.alloc(width * height * 4);
let i = 0;

@@ -174,3 +178,3 @@ while (i < width * height * 4) {

const buffer = Buffer.from(wav.data.samples);
const buffer2 = new Buffer(buffer.length);
const buffer2 = Buffer.alloc(buffer.length);
for (let i = 0; i < buffer.length; i += 3) {

@@ -177,0 +181,0 @@ // 24bit samples, change endian

@@ -1,2 +0,2 @@

import { Model } from '../enums';
import { Model, ProtocolVersion } from '../enums';
export interface VersionProps {

@@ -18,5 +18,7 @@ readonly major: number;

readonly hasSuperSources: boolean;
readonly superSources: number;
readonly talkbackOverSDI: number;
}
export declare class DeviceInfo {
apiVersion: VersionProps;
apiVersion: ProtocolVersion;
capabilities: AtemCapabilites;

@@ -23,0 +25,0 @@ model: Model;

@@ -5,10 +5,22 @@ export interface MultiViewerSourceState {

}
export declare class MultViewerWindowState {
[windowIndex: string]: MultiViewerSourceState;
export interface MultiViewerWindowState extends MultiViewerSourceState {
safeTitle: boolean;
audioMeter: boolean;
}
export declare class MultiViewer {
index: number;
layout: number;
overlayOpacity: number;
windows: {
[index: string]: MultiViewerWindowState;
};
constructor(index: number);
getWindow(index: number): MultiViewerWindowState;
}
export declare class SettingsState {
multiViewers: {
[viewerIndex: string]: MultiViewerSourceState;
[index: string]: MultiViewer;
};
videoMode: number;
getMultiViewer(index: number): MultiViewer;
}
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
class MultViewerWindowState {
class MultiViewer {
constructor(index) {
this.windows = {};
this.index = index;
}
getWindow(index) {
if (!this.windows[index]) {
this.windows[index] = {};
}
return this.windows[index];
}
}
exports.MultViewerWindowState = MultViewerWindowState;
exports.MultiViewer = MultiViewer;
class SettingsState {

@@ -10,4 +20,10 @@ constructor() {

}
getMultiViewer(index) {
if (!this.multiViewers[index]) {
this.multiViewers[index] = new MultiViewer(index);
}
return this.multiViewers[index];
}
}
exports.SettingsState = SettingsState;
//# sourceMappingURL=settings.js.map

@@ -6,2 +6,3 @@ export interface DownstreamKeyerBase {

remainingFrames: number;
isTowardsOnAir?: boolean;
}

@@ -8,0 +9,0 @@ export interface DownstreamKeyer extends DownstreamKeyerBase {

@@ -68,3 +68,3 @@ import * as Enum from '../../enums';

transitionFramesLeft: number;
fadeToBlack: boolean;
fadeToBlack: FadeToBlackProperties;
numberOfKeyers: number;

@@ -85,3 +85,3 @@ transitionProperties: TransitionProperties;

transitionFramesLeft: number;
fadeToBlack: boolean;
fadeToBlack: FadeToBlackProperties;
numberOfKeyers: number;

@@ -116,2 +116,4 @@ transitionProperties: TransitionProperties;

artInvertKey: boolean;
}
export interface SuperSourceBorder {
borderEnabled: boolean;

@@ -131,2 +133,17 @@ borderBevel: Enum.BorderBevel;

}
export declare class SuperSource {
index: number;
boxes: {
[index: string]: SuperSourceBox;
};
properties: SuperSourceProperties;
border: SuperSourceBorder;
constructor(index: number);
}
export interface FadeToBlackProperties {
isFullyBlack: boolean;
rate: number;
inTransition: boolean;
remainingFrames: number;
}
export declare class AtemVideoState {

@@ -142,8 +159,8 @@ ME: {

};
superSourceBoxes: {
[index: string]: SuperSourceBox;
superSources: {
[index: string]: SuperSource;
};
superSourceProperties: SuperSourceProperties;
getMe(index: number): MixEffect;
getSuperSource(index: number): SuperSource;
getDownstreamKeyer(index: number): DownstreamKeyer;
}

@@ -25,2 +25,9 @@ "use strict";

exports.MixEffect = MixEffect;
class SuperSource {
constructor(index) {
this.boxes = {};
this.index = index;
}
}
exports.SuperSource = SuperSource;
class AtemVideoState {

@@ -31,3 +38,3 @@ constructor() {

this.auxilliaries = {};
this.superSourceBoxes = {};
this.superSources = {};
}

@@ -40,2 +47,8 @@ getMe(index) {

}
getSuperSource(index) {
if (!this.superSources[index]) {
this.superSources[index] = new SuperSource(index);
}
return this.superSources[index];
}
getDownstreamKeyer(index) {

@@ -42,0 +55,0 @@ if (!this.downstreamKeyers[index]) {

{
"name": "atem-connection",
"version": "0.10.0",
"version": "1.0.0",
"description": "Typescript Node.js library for connecting with an ATEM switcher.",

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

"lint": "tslint --project tsconfig.jest.json --config tslint.json",
"unit": "jest --forceExit",
"unit": "jest",
"test": "yarn lint && yarn unit",
"watch": "jest --watch",
"cov": "jest --coverage; opn coverage/lcov-report/index.html",
"cov-open": "opn coverage/lcov-report/index.html",
"cov": "jest --coverage; open-cli coverage/lcov-report/index.html",
"cov-open": "open-cli coverage/lcov-report/index.html",
"send-coverage": "jest && codecov",
"docs": "yarn docs:html && opn docs/index.html",
"docs": "yarn docs:html && open-cli docs/index.html",
"docs:test": "yarn docs:html",

@@ -78,9 +78,7 @@ "docs:html": "typedoc src/index.ts --excludePrivate --mode file --theme minimal --out docs",

"devDependencies": {
"@types/exit-hook": "^1.1.0",
"@types/jest": "24.0.11",
"@types/jest": "^24.0.11",
"@types/node": "^8.0.4",
"@types/p-retry": "^2.0.0",
"codecov": "3.2.0",
"gh-pages": "^1.0.0",
"jest": "24.5.0",
"codecov": "^3.2.0",
"gh-pages": "^2.0.1",
"jest": "^24.8.0",
"jest-haste-map": "^24.0.0",

@@ -91,11 +89,11 @@ "jest-resolve": "^24.1.0",

"npm-scripts-info": "0.3.9",
"nyc": "13.3.0",
"opn-cli": "4.0.0",
"open-cli": "^5.0.0",
"sleep-ms": "^2.0.1",
"standard-version": "5.0.2",
"trash-cli": "^1.4.0",
"ts-jest": "24.0.0",
"tslint": "5.14.0",
"standard-version": "^7.0.0",
"trash-cli": "^3.0.0",
"ts-jest": "^24.0.2",
"tslint": "^5.17.0",
"tslint-config-security": "^1.16.0",
"tslint-config-standard": "8.0.1",
"typedoc": "0.14.2",
"typedoc": "^0.15.0",
"typescript": "^3.3.4000"

@@ -113,4 +111,3 @@ },

"nanotimer": "^0.3.15",
"p-queue": "^2.4.2",
"p-retry": "^2.0.0",
"p-retry": "^4.1.0",
"tslib": "^1.9.0",

@@ -117,0 +114,0 @@ "wavefile": "^8.4.4"

@@ -69,4 +69,5 @@ # Sofie: The Modern TV News Studio Automation System (ATEM connection library)

- `stateChanged(state)`
- `stateChanged(state, path)`
Whenever a packet from the ATEM is received that changes the state, this event will be fired.
The path parameter is a path into the state that represents the change, to allow for filtering of events. eg video.ME.0.programInput

@@ -89,5 +90,6 @@ ## Debug

This module will run tests by jest (in the future).
This module run tests with jest.
```sh
$ yarn unit
```
There is a suite of generated serialization tests, using [atem-connection-test-generator](https://github.com/LibAtem/atem-connection-test-generator) as the [LibAtem](https://github.com/LibAtem) project has tests to verify its serialization against the Blackmagic Atem SDK

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

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

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