atem-connection
Advanced tools
Comparing version 0.8.2 to 0.9.0
@@ -5,2 +5,17 @@ # Change Log | ||
# [0.9.0](https://github.com/nrkno/tv-automation-atem-connection/compare/0.8.2...0.9.0) (2019-02-21) | ||
### Bug Fixes | ||
* AudioMixerInputCommand ([69608c7](https://github.com/nrkno/tv-automation-atem-connection/commit/69608c7)) | ||
### Features | ||
* audio channels ([1b3bd32](https://github.com/nrkno/tv-automation-atem-connection/commit/1b3bd32)) | ||
* top level methods for audio channels ([6c390d3](https://github.com/nrkno/tv-automation-atem-connection/commit/6c390d3)) | ||
<a name="0.8.2"></a> | ||
@@ -7,0 +22,0 @@ ## [0.8.2](https://github.com/nrkno/tv-automation-atem-connection/compare/0.8.1...0.8.2) (2019-01-19) |
@@ -12,2 +12,3 @@ /// <reference types="node" /> | ||
import * as Enums from './enums'; | ||
import { AudioChannel } from './state/audio'; | ||
export interface AtemOptions { | ||
@@ -86,2 +87,5 @@ address?: string; | ||
uploadAudio(index: number, data: Buffer, name: string): Promise<{}>; | ||
setAudioChannelMixOption(index: number, mixOption: Enums.AudioMixOption): Promise<any>; | ||
setAudioChannelGain(index: number, gain: number): Promise<any>; | ||
setAudioChannelProps(index: number, props: Partial<AudioChannel>): Promise<any>; | ||
private _mutateState; | ||
@@ -88,0 +92,0 @@ private _resolveCommand; |
@@ -6,3 +6,2 @@ "use strict"; | ||
const atemSocket_1 = require("./lib/atemSocket"); | ||
const enums_1 = require("./enums"); | ||
const Commands = require("./commands"); | ||
@@ -12,2 +11,3 @@ const DataTransferCommands = require("./commands/DataTransfer"); | ||
const atemUtil_1 = require("./lib/atemUtil"); | ||
const Enums = require("./enums"); | ||
class Atem extends events_1.EventEmitter { | ||
@@ -36,4 +36,4 @@ constructor(options) { | ||
this.socket.on('receivedStateChange', (command) => this._mutateState(command)); | ||
this.socket.on(enums_1.IPCMessageType.CommandAcknowledged, ({ trackingId }) => this._resolveCommand(trackingId)); | ||
this.socket.on(enums_1.IPCMessageType.CommandTimeout, ({ trackingId }) => this._rejectCommand(trackingId)); | ||
this.socket.on(Enums.IPCMessageType.CommandAcknowledged, ({ trackingId }) => this._resolveCommand(trackingId)); | ||
this.socket.on(Enums.IPCMessageType.CommandTimeout, ({ trackingId }) => this._rejectCommand(trackingId)); | ||
this.socket.on('error', (e) => this.emit('error', e)); | ||
@@ -186,3 +186,3 @@ this.socket.on('connect', () => this.emit('connected')); | ||
command.index = 0; | ||
command.updateProps({ action: enums_1.MacroAction.Continue }); | ||
command.updateProps({ action: Enums.MacroAction.Continue }); | ||
return this.sendCommand(command); | ||
@@ -193,3 +193,3 @@ } | ||
command.index = index; | ||
command.updateProps({ action: enums_1.MacroAction.Delete }); | ||
command.updateProps({ action: Enums.MacroAction.Delete }); | ||
return this.sendCommand(command); | ||
@@ -200,3 +200,3 @@ } | ||
command.index = 0; | ||
command.updateProps({ action: enums_1.MacroAction.InsertUserWait }); | ||
command.updateProps({ action: Enums.MacroAction.InsertUserWait }); | ||
return this.sendCommand(command); | ||
@@ -207,3 +207,3 @@ } | ||
command.index = index; | ||
command.updateProps({ action: enums_1.MacroAction.Run }); | ||
command.updateProps({ action: Enums.MacroAction.Run }); | ||
return this.sendCommand(command); | ||
@@ -214,3 +214,3 @@ } | ||
command.index = 0; | ||
command.updateProps({ action: enums_1.MacroAction.Stop }); | ||
command.updateProps({ action: Enums.MacroAction.Stop }); | ||
return this.sendCommand(command); | ||
@@ -221,3 +221,3 @@ } | ||
command.index = 0; | ||
command.updateProps({ action: enums_1.MacroAction.StopRecord }); | ||
command.updateProps({ action: Enums.MacroAction.StopRecord }); | ||
return this.sendCommand(command); | ||
@@ -353,2 +353,20 @@ } | ||
} | ||
setAudioChannelMixOption(index, mixOption) { | ||
const command = new Commands.AudioMixerInputCommand(); | ||
command.index = index; | ||
command.updateProps({ mixOption }); | ||
return this.sendCommand(command); | ||
} | ||
setAudioChannelGain(index, gain) { | ||
const command = new Commands.AudioMixerInputCommand(); | ||
command.index = index; | ||
command.updateProps({ gain }); | ||
return this.sendCommand(command); | ||
} | ||
setAudioChannelProps(index, props) { | ||
const command = new Commands.AudioMixerInputCommand(); | ||
command.index = index; | ||
command.updateProps(props); | ||
return this.sendCommand(command); | ||
} | ||
_mutateState(command) { | ||
@@ -355,0 +373,0 @@ if (typeof command.applyToState === 'function') { |
import AbstractCommand from './AbstractCommand'; | ||
export * from './Audio'; | ||
export * from './DataTransfer'; | ||
@@ -3,0 +4,0 @@ export * from './DeviceProfile'; |
@@ -6,2 +6,3 @@ "use strict"; | ||
exports.AbstractCommand = AbstractCommand_1.default; | ||
tslib_1.__exportStar(require("./Audio"), exports); | ||
tslib_1.__exportStar(require("./DataTransfer"), exports); | ||
@@ -8,0 +9,0 @@ tslib_1.__exportStar(require("./DeviceProfile"), exports); |
@@ -5,3 +5,2 @@ "use strict"; | ||
const __1 = require("../.."); | ||
const __2 = require("../.."); | ||
class SuperSourcePropertiesCommand extends AbstractCommand_1.default { | ||
@@ -20,3 +19,3 @@ constructor() { | ||
artCutSource: rawCommand.readUInt16BE(2), | ||
artOption: __1.Util.parseEnum(rawCommand.readUInt8(4), __2.Enums.SuperSourceArtOption), | ||
artOption: __1.Util.parseEnum(rawCommand.readUInt8(4), __1.Enums.SuperSourceArtOption), | ||
artPreMultiplied: rawCommand[5] === 1, | ||
@@ -27,3 +26,3 @@ artClip: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(6), 0, 1000), | ||
borderEnabled: rawCommand[11] === 1, | ||
borderBevel: __1.Util.parseEnum(rawCommand.readUInt8(12), __2.Enums.BorderBevel), | ||
borderBevel: __1.Util.parseEnum(rawCommand.readUInt8(12), __1.Enums.BorderBevel), | ||
borderOuterWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(14), 0, 1600), | ||
@@ -30,0 +29,0 @@ borderInnerWidth: __1.Util.parseNumberBetween(rawCommand.readUInt16BE(16), 0, 1600), |
@@ -96,3 +96,7 @@ export declare enum Model { | ||
Component = 4, | ||
SVideo = 5 | ||
SVideo = 5, | ||
XLR = 32, | ||
AESEBU = 64, | ||
RCA = 128, | ||
TSJack = 129 | ||
} | ||
@@ -228,1 +232,11 @@ export declare enum InternalPortType { | ||
} | ||
export declare enum AudioMixOption { | ||
Off = 0, | ||
On = 1, | ||
AudioFollowVideo = 2 | ||
} | ||
export declare enum AudioSourceType { | ||
ExternalVideo = 0, | ||
MediaPlayer = 1, | ||
ExternalAudio = 2 | ||
} |
@@ -108,2 +108,6 @@ "use strict"; | ||
ExternalPortType[ExternalPortType["SVideo"] = 5] = "SVideo"; | ||
ExternalPortType[ExternalPortType["XLR"] = 32] = "XLR"; | ||
ExternalPortType[ExternalPortType["AESEBU"] = 64] = "AESEBU"; | ||
ExternalPortType[ExternalPortType["RCA"] = 128] = "RCA"; | ||
ExternalPortType[ExternalPortType["TSJack"] = 129] = "TSJack"; // @todo: check value | ||
})(ExternalPortType = exports.ExternalPortType || (exports.ExternalPortType = {})); | ||
@@ -254,2 +258,14 @@ var InternalPortType; | ||
})(MultiViewerLayout = exports.MultiViewerLayout || (exports.MultiViewerLayout = {})); | ||
var AudioMixOption; | ||
(function (AudioMixOption) { | ||
AudioMixOption[AudioMixOption["Off"] = 0] = "Off"; | ||
AudioMixOption[AudioMixOption["On"] = 1] = "On"; | ||
AudioMixOption[AudioMixOption["AudioFollowVideo"] = 2] = "AudioFollowVideo"; | ||
})(AudioMixOption = exports.AudioMixOption || (exports.AudioMixOption = {})); | ||
var AudioSourceType; | ||
(function (AudioSourceType) { | ||
AudioSourceType[AudioSourceType["ExternalVideo"] = 0] = "ExternalVideo"; | ||
AudioSourceType[AudioSourceType["MediaPlayer"] = 1] = "MediaPlayer"; | ||
AudioSourceType[AudioSourceType["ExternalAudio"] = 2] = "ExternalAudio"; | ||
})(AudioSourceType = exports.AudioSourceType || (exports.AudioSourceType = {})); | ||
//# sourceMappingURL=index.js.map |
@@ -23,2 +23,4 @@ /// <reference types="node" /> | ||
function convertWAVToRaw(inputBuffer: Buffer): Buffer; | ||
function UIntToDecibel(input: number): number; | ||
function DecibelToUint(input: number): number; | ||
} |
@@ -180,3 +180,11 @@ "use strict"; | ||
Util.convertWAVToRaw = convertWAVToRaw; | ||
function UIntToDecibel(input) { | ||
return Math.log10(input / 128) * 20; | ||
} | ||
Util.UIntToDecibel = UIntToDecibel; | ||
function DecibelToUint(input) { | ||
return parseInt(Math.pow(10, input / 20) * 128 + '', 10); | ||
} | ||
Util.DecibelToUint = DecibelToUint; | ||
})(Util = exports.Util || (exports.Util = {})); | ||
//# sourceMappingURL=atemUtil.js.map |
@@ -0,9 +1,8 @@ | ||
import { AudioSourceType, ExternalPortType, AudioMixOption } from '../enums'; | ||
export declare class AudioChannel { | ||
on: boolean; | ||
afv: boolean; | ||
sourceType: AudioSourceType; | ||
portType: ExternalPortType; | ||
mixOption: AudioMixOption; | ||
gain: number; | ||
rawGain: number; | ||
rawPan: number; | ||
leftLevel: number; | ||
rightLevel: number; | ||
balance: number; | ||
} | ||
@@ -15,3 +14,3 @@ export declare class AtemAudioState { | ||
master: AudioChannel; | ||
getMe(index: number): AudioChannel; | ||
getChannel(index: number): AudioChannel; | ||
} |
@@ -11,3 +11,3 @@ "use strict"; | ||
} | ||
getMe(index) { | ||
getChannel(index) { | ||
if (!this.channels[index]) { | ||
@@ -14,0 +14,0 @@ this.channels[index] = new AudioChannel(); |
import * as Enum from '../../enums'; | ||
import { MixEffectKeyType } from '../../enums'; | ||
export interface UpstreamKeyerBase { | ||
@@ -79,3 +78,3 @@ readonly upstreamKeyerId: number; | ||
export interface UpstreamKeyerTypeSettings { | ||
keyType: MixEffectKeyType; | ||
keyType: Enum.MixEffectKeyType; | ||
flyEnabled: boolean; | ||
@@ -82,0 +81,0 @@ } |
{ | ||
"name": "atem-connection", | ||
"version": "0.8.2", | ||
"version": "0.9.0", | ||
"description": "Typescript Node.js library for connecting with an ATEM switcher.", | ||
@@ -44,3 +44,3 @@ "main": "dist/index.js", | ||
"changelog": "standard-version", | ||
"release": "yarn reset && yarn test && yarn docs:publish && yarn changelog", | ||
"release": "yarn reset && yarn docs:publish && yarn changelog", | ||
"reset": "git clean -dfx && git reset --hard && yarn", | ||
@@ -79,22 +79,21 @@ "ci": "yarn test && yarn docs:test", | ||
"@types/exit-hook": "^1.1.0", | ||
"@types/jest": "^22.1.3", | ||
"@types/jest": "24.0.6", | ||
"@types/node": "^8.0.4", | ||
"@types/p-retry": "^2.0.0", | ||
"codecov": "3.1.0", | ||
"cpx": "^1.5.0", | ||
"gh-pages": "^1.0.0", | ||
"jest": "^22.4.2", | ||
"jest": "24.1.0", | ||
"mkdirp": "^0.5.1", | ||
"node-license-validator": "^1.3.0", | ||
"npm-scripts-info": "^0.3.6", | ||
"nyc": "^11.0.3", | ||
"opn-cli": "^3.1.0", | ||
"npm-scripts-info": "0.3.9", | ||
"nyc": "13.3.0", | ||
"opn-cli": "4.0.0", | ||
"sleep-ms": "^2.0.1", | ||
"standard-version": "^4.0.0", | ||
"standard-version": "5.0.0", | ||
"trash-cli": "^1.4.0", | ||
"ts-jest": "^22.0.4", | ||
"tslint": "^5.4.3", | ||
"tslint-config-standard": "^6.0.1", | ||
"typedoc": "^0.8.0", | ||
"typescript": "^2.4.1" | ||
"ts-jest": "23.10.5", | ||
"tslint": "5.12.1", | ||
"tslint-config-standard": "8.0.1", | ||
"typedoc": "0.14.2", | ||
"typescript": "3.3.3" | ||
}, | ||
@@ -101,0 +100,0 @@ "keywords": [ |
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
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
425422
20
328
6332