Skip to content

Commit

Permalink
fix: broken autoDownstreamKey function and mangled multiviewer window…
Browse files Browse the repository at this point in the history
… state
  • Loading branch information
Julusian committed Sep 17, 2019
1 parent b3af54b commit 71c61f6
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/atem.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,10 @@ export class Atem extends EventEmitter {
return this.sendCommand(command)
}

autoDownstreamKey (key = 0) {
autoDownstreamKey (key = 0, isTowardsOnAir?: boolean) {
const command = new Commands.DownstreamKeyAutoCommand()
command.downstreamKeyerId = key
command.updateProps({ isTowardsOnAir })
return this.sendCommand(command)
}

Expand Down
6 changes: 5 additions & 1 deletion src/commands/DownstreamKey/DownstreamKeyAutoCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ export class DownstreamKeyAutoCommand extends AbstractCommand {
}

properties: {
isTowardsOnAir: boolean
isTowardsOnAir?: boolean
}

updateProps (newProps: Partial<DownstreamKeyAutoCommand['properties']>) {
this._updateProps(newProps)
}

serialize (version: ProtocolVersion) {
Expand Down
10 changes: 4 additions & 6 deletions src/commands/Settings/MultiViewerSourceCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,10 @@ export class MultiViewerSourceUpdateCommand extends AbstractCommand {
}

applyToState (state: AtemState) {
const obj: { [key: string]: MultiViewerSourceState } = {}
obj[this.index] = this.properties

state.settings.getMultiViewer(this.multiViewerId).windows[this.index] = {
...state.settings.getMultiViewer(this.multiViewerId).windows[this.index],
...obj
const multiviewer = state.settings.getMultiViewer(this.multiViewerId)
multiviewer.windows[this.index] = {
...multiviewer.windows[this.index],
...this.properties
}

return `settings.multiViewers.${this.multiViewerId}.windows.${this.index}`
Expand Down

0 comments on commit 71c61f6

Please sign in to comment.