Skip to content

Commit

Permalink
fix: ignore dve commands if not supported
Browse files Browse the repository at this point in the history
  • Loading branch information
Julusian committed Dec 7, 2019
1 parent 698c19e commit aa9cea6
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/commands/MixEffects/Key/MixEffectKeyDVECommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ export class MixEffectKeyDVEUpdateCommand extends DeserializedCommand<UpstreamKe
public applyToState (state: AtemState) {
if (!state.info.capabilities || this.mixEffect >= state.info.capabilities.mixEffects || this.upstreamKeyerId >= state.info.capabilities.upstreamKeyers) {
throw new Error(`UpstreamKeyer ${this.mixEffect}-${this.upstreamKeyerId} is not valid`)
} else if (!state.info.capabilities.DVEs) {
throw new Error(`DVE is not supported`)
}

const mixEffect = state.video.getMe(this.mixEffect)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ export class MixEffectKeyFlyKeyframeGetCommand extends DeserializedCommand<Upstr
public applyToState (state: AtemState) {
if (!state.info.capabilities || this.mixEffect >= state.info.capabilities.mixEffects || this.upstreamKeyerId >= state.info.capabilities.upstreamKeyers) {
throw new Error(`UpstreamKeyer ${this.mixEffect}-${this.upstreamKeyerId} is not valid`)
} else if (this.keyFrameId <= 0 || this.keyFrameId > 2) {
throw new Error(`KeyFrame ${this.keyFrameId} is not valid`)
}

const mixEffect = state.video.getMe(this.mixEffect)
Expand Down
2 changes: 2 additions & 0 deletions src/commands/MixEffects/Transition/TransitionDVECommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ export class TransitionDVEUpdateCommand extends DeserializedCommand<DVETransitio
public applyToState (state: AtemState) {
if (!state.info.capabilities || this.mixEffect >= state.info.capabilities.mixEffects) {
throw new Error(`MixEffect ${this.mixEffect} is not valid`)
} else if (!state.info.capabilities.DVEs) {
throw new Error(`DVE is not supported`)
}

const mixEffect = state.video.getMe(this.mixEffect)
Expand Down

0 comments on commit aa9cea6

Please sign in to comment.