5 files changed +53
-1
lines changed Original file line number Diff line number Diff line change @@ -439,6 +439,11 @@ export class Atem extends BasicAtem {
439
439
return this . sendCommand ( command )
440
440
}
441
441
442
+ public async setTimeMode ( mode : Enums . TimeMode ) : Promise < void > {
443
+ const command = new Commands . TimeConfigCommand ( mode )
444
+ return this . sendCommand ( command )
445
+ }
446
+
442
447
public async requestTime ( ) : Promise < void > {
443
448
const command = new Commands . TimeRequestCommand ( )
444
449
return this . sendCommand ( command )
Original file line number Diff line number Diff line change
1
+ import * as Enums from '../enums'
2
+ import { BasicWritableCommand } from '.'
3
+ import { DeserializedCommand } from './CommandBase'
4
+ import { AtemState } from '../state'
5
+
6
+ export class TimeConfigCommand extends BasicWritableCommand < { mode : Enums . TimeMode } > {
7
+ public static readonly rawName = 'CTCC'
8
+ public static readonly minimumVersion = Enums . ProtocolVersion . V8_1_1
9
+
10
+ constructor ( mode : Enums . TimeMode ) {
11
+ super ( { mode } )
12
+ }
13
+
14
+ public serialize ( ) : Buffer {
15
+ const buffer = Buffer . alloc ( 4 )
16
+ buffer . writeUInt8 ( this . properties . mode , 0 )
17
+
18
+ return buffer
19
+ }
20
+ }
21
+
22
+ export class TimeConfigUpdateCommand extends DeserializedCommand < { mode : Enums . TimeMode } > {
23
+ public static readonly rawName = 'TCCc'
24
+ public static readonly minimumVersion = Enums . ProtocolVersion . V8_1_1
25
+
26
+ constructor ( mode : Enums . TimeMode ) {
27
+ super ( { mode } )
28
+ }
29
+
30
+ public static deserialize ( rawCommand : Buffer ) : TimeConfigUpdateCommand {
31
+ const mode = rawCommand . readUInt8 ( 0 )
32
+
33
+ return new TimeConfigUpdateCommand ( mode )
34
+ }
35
+
36
+ public applyToState ( state : AtemState ) : string {
37
+ state . settings . timeMode = this . properties . mode
38
+ return 'settings.timeMode'
39
+ }
40
+ }
Original file line number Diff line number Diff line change @@ -22,3 +22,4 @@ export * from './PowerStatusCommand'
22
22
export * from './StartupStateCommand'
23
23
export * from './TallyBySourceCommand'
24
24
export * from './TimeCommand'
25
+ export * from './TimeConfigCommand'
Original file line number Diff line number Diff line change @@ -412,3 +412,8 @@ export enum AudioInternalPortType {
412
412
AuxOut = 10 ,
413
413
AudioAuxOut = 11 , // TODO - verify
414
414
}
415
+
416
+ export enum TimeMode {
417
+ FreeRun = 0 ,
418
+ TimeOfDay = 1 ,
419
+ }
Original file line number Diff line number Diff line change 1
- import { VideoMode , MultiViewerLayout } from '../enums'
1
+ import { VideoMode , MultiViewerLayout , TimeMode } from '../enums'
2
2
3
3
export interface MultiViewerSourceState {
4
4
source : number
@@ -33,4 +33,5 @@ export interface SettingsState {
33
33
readonly multiViewers : Array < MultiViewer | undefined >
34
34
videoMode : VideoMode
35
35
mediaPool ?: MediaPool
36
+ timeMode ?: TimeMode
36
37
}
0 commit comments