Skip to content

Commit

Permalink
fix: MaskFlags are a static property
Browse files Browse the repository at this point in the history
  • Loading branch information
Balte de Wit committed Jun 7, 2018
1 parent 3db61b0 commit ddafc4f
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 62 deletions.
9 changes: 5 additions & 4 deletions src/commands/DownstreamKey/DownstreamKeyGeneralCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@ import AbstractCommand from '../AbstractCommand'
import { DownstreamKeyerGeneral } from '../../state/video/downstreamKeyers'

export class DownstreamKeyGeneralCommand extends AbstractCommand {
rawName = 'CDsG'
downstreamKeyerId: number
properties: DownstreamKeyerGeneral
MaskFlags = {
static MaskFlags = {
preMultiply: 1 << 0,
clip: 1 << 1,
gain: 1 << 2,
invert: 1 << 3
}

rawName = 'CDsG'
downstreamKeyerId: number
properties: DownstreamKeyerGeneral

serialize () {
const buffer = Buffer.alloc(12)
buffer[0] = this.flag
Expand Down
9 changes: 5 additions & 4 deletions src/commands/DownstreamKey/DownstreamKeyMaskCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,18 @@ import AbstractCommand from '../AbstractCommand'
import { DownstreamKeyerMask } from '../../state/video/downstreamKeyers'

export class DownstreamKeyMaskCommand extends AbstractCommand {
rawName = 'CDsM'
downstreamKeyerId: number
properties: DownstreamKeyerMask
MaskFlags = {
static MaskFlags = {
enabled: 1 << 0,
top: 1 << 1,
bottom: 1 << 2,
left: 1 << 3,
right: 1 << 4
}

rawName = 'CDsM'
downstreamKeyerId: number
properties: DownstreamKeyerMask

serialize () {
const buffer = Buffer.alloc(12)
buffer[0] = this.flag
Expand Down
7 changes: 4 additions & 3 deletions src/commands/Inputs/InputPropertiesCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ import { ExternalPorts, ExternalPortType } from '../../enums'
import { Util } from '../../lib/atemUtil'

export class InputPropertiesCommand extends AbstractCommand {
rawName = 'InPr'
inputId: number
MaskFlags = {
static MaskFlags = {
longName: 1 << 0,
shortName: 1 << 1,
isExternal: 1 << 2
}

rawName = 'InPr'
inputId: number

properties: InputChannel

updateProps (newProps: Partial<InputChannel>) {
Expand Down
7 changes: 4 additions & 3 deletions src/commands/Media/MediaPlayerStatusCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@ import { MediaPlayer } from '../../state/media'
import AbstractCommand from '../AbstractCommand'

export class MediaPlayerStatusCommand extends AbstractCommand {
rawName = 'RCPS'
mediaPlayerId: number
MaskFlags = {
static MaskFlags = {
playing: 1 << 0,
loop: 1 << 1,
atBeginning: 1 << 2,
frame: 1 << 3
}

rawName = 'RCPS'
mediaPlayerId: number

properties: MediaPlayer

updateProps (newProps: Partial<MediaPlayer>) {
Expand Down
11 changes: 6 additions & 5 deletions src/commands/MixEffects/Key/MixEffectKeyChromaCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,19 @@ import { AtemState } from '../../../state'
import { UpstreamKeyerChromaSettings } from '../../../state/video/upstreamKeyers'

export class MixEffectKeyChromaCommand extends AbstractCommand {
rawName = 'KeCk'
mixEffect: number
upstreamKeyerId: number
properties: UpstreamKeyerChromaSettings
MaskFlags = {
static MaskFlags = {
hue: 1 << 0,
gain: 1 << 1,
ySuppress: 1 << 2,
lift: 1 << 3,
narrow: 1 << 4
}

rawName = 'KeCk'
mixEffect: number
upstreamKeyerId: number
properties: UpstreamKeyerChromaSettings

deserialize (rawCommand: Buffer) {
this.mixEffect = rawCommand[0]
this.upstreamKeyerId = rawCommand[1]
Expand Down
11 changes: 6 additions & 5 deletions src/commands/MixEffects/Key/MixEffectKeyDVECommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import { AtemState } from '../../../state'
import { UpstreamKeyerDVESettings } from '../../../state/video/upstreamKeyers'

export class MixEffectKeyDVECommand extends AbstractCommand {
rawName = 'KeDV'
mixEffect: number
upstreamKeyerId: number
properties: UpstreamKeyerDVESettings
MaskFlags = {
static MaskFlags = {
sizeX: 1 << 0,
sizeY: 1 << 1,
positionX: 1 << 2,
Expand Down Expand Up @@ -36,6 +32,11 @@ export class MixEffectKeyDVECommand extends AbstractCommand {
rate: 1 << 25
}

rawName = 'KeDV'
mixEffect: number
upstreamKeyerId: number
properties: UpstreamKeyerDVESettings

deserialize (rawCommand: Buffer) {
this.mixEffect = rawCommand[0]
this.upstreamKeyerId = rawCommand[1]
Expand Down
11 changes: 6 additions & 5 deletions src/commands/MixEffects/Key/MixEffectKeyLumaCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@ import { AtemState } from '../../../state'
import { UpstreamKeyerLumaSettings } from '../../../state/video/upstreamKeyers'

export class MixEffectKeyLumaCommand extends AbstractCommand {
rawName = 'KeLm'
mixEffect: number
upstreamKeyerId: number
properties: UpstreamKeyerLumaSettings
MaskFlags = {
static MaskFlags = {
preMultiplied: 1 << 0,
clip: 1 << 1,
gain: 1 << 2,
invert: 1 << 3
}

rawName = 'KeLm'
mixEffect: number
upstreamKeyerId: number
properties: UpstreamKeyerLumaSettings

deserialize (rawCommand: Buffer) {
this.mixEffect = rawCommand[0]
this.upstreamKeyerId = rawCommand[1]
Expand Down
11 changes: 6 additions & 5 deletions src/commands/MixEffects/Key/MixEffectKeyMaskSetCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,19 @@ import AbstractCommand from '../../AbstractCommand'
import { UpstreamKeyerMaskSettings } from '../../../state/video/upstreamKeyers'

export class MixEffectKeyMaskSetCommand extends AbstractCommand {
rawName = 'CKMs'
mixEffect: number
upstreamKeyerId: number
properties: UpstreamKeyerMaskSettings
MaskFlags = {
static MaskFlags = {
maskEnabled: 1 << 0,
maskTop: 1 << 1,
maskBottom: 1 << 2,
maskLeft: 1 << 3,
maskRight: 1 << 4
}

rawName = 'CKMs'
mixEffect: number
upstreamKeyerId: number
properties: UpstreamKeyerMaskSettings

serialize () {
const buffer = Buffer.alloc(12)
buffer.writeUInt8(this.flag, 0)
Expand Down
11 changes: 6 additions & 5 deletions src/commands/MixEffects/Key/MixEffectKeyPatternCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,7 @@ import { AtemState } from '../../../state'
import { UpstreamKeyerPatternSettings } from '../../../state/video/upstreamKeyers'

export class MixEffectKeyPatternCommand extends AbstractCommand {
rawName = 'KePt'
mixEffect: number
upstreamKeyerId: number
properties: UpstreamKeyerPatternSettings
MaskFlags = {
static MaskFlags = {
style: 1 << 0,
size: 1 << 1,
symmetry: 1 << 2,
Expand All @@ -17,6 +13,11 @@ export class MixEffectKeyPatternCommand extends AbstractCommand {
invert: 1 << 6
}

rawName = 'KePt'
mixEffect: number
upstreamKeyerId: number
properties: UpstreamKeyerPatternSettings

deserialize (rawCommand: Buffer) {
this.mixEffect = rawCommand[0]
this.upstreamKeyerId = rawCommand[1]
Expand Down
9 changes: 5 additions & 4 deletions src/commands/MixEffects/Key/MixEffectKeyTypeSetCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import AbstractCommand from '../../AbstractCommand'
import { UpstreamKeyerTypeSettings } from '../../../state/video/upstreamKeyers'

export class MixEffectKeyTypeSetCommand extends AbstractCommand {
static MaskFlags = {
keyType: 1 << 0,
flyEnabled: 1 << 1
}

rawName = 'CKTp'
mixEffect: number
upstreamKeyerId: number
properties: UpstreamKeyerTypeSettings
MaskFlags = {
keyType: 1 << 0,
flyEnabled: 1 << 1
}

serialize () {
const buffer = Buffer.alloc(8)
Expand Down
7 changes: 4 additions & 3 deletions src/commands/MixEffects/Transition/TransitionDVECommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { AtemState } from '../../../state'
import { DVETransitionSettings } from '../../../state/video'

export class TransitionDVECommand extends AbstractCommand {
rawName = 'TDvP'
mixEffect: number
MaskFlags = {
static MaskFlags = {
rate: 1 << 0,
logoRate: 1 << 1,
style: 1 << 2,
Expand All @@ -20,6 +18,9 @@ export class TransitionDVECommand extends AbstractCommand {
flipFlop: 1 << 11
}

rawName = 'TDvP'
mixEffect: number

properties: DVETransitionSettings

updateProps (newProps: Partial<DVETransitionSettings>) {
Expand Down
7 changes: 4 additions & 3 deletions src/commands/MixEffects/Transition/TransitionDipCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { AtemState } from '../../../state'
import { DipTransitionSettings } from '../../../state/video'

export class TransitionDipCommand extends AbstractCommand {
rawName = 'TDpP'
mixEffect: number
MaskFlags = {
static MaskFlags = {
rate: 1 << 0,
input: 1 << 1
}

rawName = 'TDpP'
mixEffect: number

properties: DipTransitionSettings

updateProps (newProps: Partial<DipTransitionSettings>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ import { AtemState } from '../../../state'
import { TransitionProperties } from '../../../state/video'

export class TransitionPropertiesCommand extends AbstractCommand {
rawName = 'TrSS'
mixEffect: number
MaskFlags = {
static MaskFlags = {
style: 1 << 0,
selection: 1 << 1
}

rawName = 'TrSS'
mixEffect: number

properties: TransitionProperties

updateProps (newProps: Partial<TransitionProperties>) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { AtemState } from '../../../state'
import { StingerTransitionSettings } from '../../../state/video'

export class TransitionStingerCommand extends AbstractCommand {
rawName = 'TStP'
mixEffect: number
MaskFlags = {
static MaskFlags = {
source: 1 << 0,
preMultipliedKey: 1 << 1,
clip: 1 << 2,
Expand All @@ -17,6 +15,9 @@ export class TransitionStingerCommand extends AbstractCommand {
mixRate: 1 << 8
}

rawName = 'TStP'
mixEffect: number

properties: StingerTransitionSettings

updateProps (newProps: Partial<StingerTransitionSettings>) {
Expand Down
7 changes: 4 additions & 3 deletions src/commands/MixEffects/Transition/TransitionWipeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ import { AtemState } from '../../../state'
import { WipeTransitionSettings } from '../../../state/video'

export class TransitionWipeCommand extends AbstractCommand {
rawName = 'TWpP'
mixEffect: number
MaskFlags = {
static MaskFlags = {
rate: 1 << 0,
pattern: 1 << 1,
borderWidth: 1 << 2,
Expand All @@ -18,6 +16,9 @@ export class TransitionWipeCommand extends AbstractCommand {
flipFlop: 1 << 9
}

rawName = 'TWpP'
mixEffect: number

properties: WipeTransitionSettings

updateProps (newProps: Partial<WipeTransitionSettings>) {
Expand Down
9 changes: 5 additions & 4 deletions src/commands/SuperSource/SuperSourceBoxParametersCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,7 @@ import { AtemState } from '../../state'
import { SuperSourceBox } from '../../state/video'

export class SuperSourceBoxParametersCommand extends AbstractCommand {
rawName = 'SSBP'
boxId: number
properties: SuperSourceBox
MaskFlags = {
static MaskFlags = {
enabled: 1 << 0,
source: 1 << 1,
x: 1 << 2,
Expand All @@ -19,6 +16,10 @@ export class SuperSourceBoxParametersCommand extends AbstractCommand {
cropRight: 1 << 9
}

rawName = 'SSBP'
boxId: number
properties: SuperSourceBox

updateProps (newProps: Partial<SuperSourceBox>) {
this._updateProps(newProps)
}
Expand Down

0 comments on commit ddafc4f

Please sign in to comment.