-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
53 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
import * as Enums from '../enums' | ||
import { BasicWritableCommand } from '.' | ||
import { DeserializedCommand } from './CommandBase' | ||
import { AtemState } from '../state' | ||
|
||
export class TimeConfigCommand extends BasicWritableCommand<{ mode: Enums.TimeMode }> { | ||
public static readonly rawName = 'CTCC' | ||
public static readonly minimumVersion = Enums.ProtocolVersion.V8_1_1 | ||
|
||
constructor(mode: Enums.TimeMode) { | ||
super({ mode }) | ||
} | ||
|
||
public serialize(): Buffer { | ||
const buffer = Buffer.alloc(4) | ||
buffer.writeUInt8(this.properties.mode, 0) | ||
|
||
return buffer | ||
} | ||
} | ||
|
||
export class TimeConfigUpdateCommand extends DeserializedCommand<{ mode: Enums.TimeMode }> { | ||
public static readonly rawName = 'TCCc' | ||
public static readonly minimumVersion = Enums.ProtocolVersion.V8_1_1 | ||
|
||
constructor(mode: Enums.TimeMode) { | ||
super({ mode }) | ||
} | ||
|
||
public static deserialize(rawCommand: Buffer): TimeConfigUpdateCommand { | ||
const mode = rawCommand.readUInt8(0) | ||
|
||
return new TimeConfigUpdateCommand(mode) | ||
} | ||
|
||
public applyToState(state: AtemState): string { | ||
state.settings.timeMode = this.properties.mode | ||
return 'settings.timeMode' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters