Skip to content

Commit

Permalink
feat: Video Mode command
Browse files Browse the repository at this point in the history
  • Loading branch information
Balte de Wit authored and Alex Van Camp committed Oct 4, 2018
1 parent 3b7f2e8 commit b9980e3
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 0 deletions.
29 changes: 29 additions & 0 deletions src/commands/Settings/VideoMode.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import AbstractCommand from '../AbstractCommand'
import { AtemState } from '../../state'
import { Enums } from '../..';

export class VideoModeCommand extends AbstractCommand {
rawName = 'VidM'
auxBus: number

properties: {
mode: Enums.VideoMode
}

deserialize (rawCommand: Buffer) {
this.properties = {
mode: rawCommand[0]
}
}

serialize () {
const buffer = Buffer.alloc(4)
buffer[0] = this.properties.mode

return Buffer.concat([Buffer.from('CVdM', 'ascii'), buffer])
}

applyToState (state: AtemState) {
state.settings.videoMode = this.properties.mode
}
}
1 change: 1 addition & 0 deletions src/commands/Settings/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './VideoMode'
1 change: 1 addition & 0 deletions src/commands/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export * from './Inputs'
export * from './Macro'
export * from './Media'
export * from './MixEffects'
export * from './Settings'
export * from './SuperSource'

export { AbstractCommand }
Expand Down
26 changes: 26 additions & 0 deletions src/enums/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,3 +207,29 @@ export enum StoragePool {
Clips,
Sounds
}

export enum VideoMode {
N525i5994NTSC,
P625i50PAL,
N525i5994169,
P625i50169,

P720p50,
N720p5994,
P1080i50,
N1080i5994,
N1080p2398,
N1080p24,
P1080p25,
N1080p2997,
P1080p50,
N1080p5994,

N4KHDp2398,
N4KHDp24,
P4KHDp25,
N4KHDp2997,

P4KHDp5000,
N4KHDp5994
}

0 comments on commit b9980e3

Please sign in to comment.