Skip to content

Commit

Permalink
feat: Atem Fairlight Ch-Fader relation
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Jul 8, 2023
1 parent db25280 commit 5bc654e
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions server/src/utils/mixerConnections/AtemConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ export class AtemMixerConnection {
.data(error)
.error(
'Failed to connect to atem ' +
state.settings[0].mixers[this.mixerIndex].deviceIp
state.settings[0].mixers[this.mixerIndex].deviceIp
)
})
}
Expand Down Expand Up @@ -104,7 +104,7 @@ export class AtemMixerConnection {
if (
channelIndex === undefined ||
!state.fairlight.inputs[input].sources[
this._sourceTracks[channelIndex]
this._sourceTracks[channelIndex]
]
) {
continue
Expand All @@ -114,7 +114,7 @@ export class AtemMixerConnection {
const fader = this.getFaderFromChannelIndex(channelIndex)
const source =
state.fairlight.inputs[input].sources[
this._sourceTracks[channelIndex]
this._sourceTracks[channelIndex]
]

this.setPropsFromChannel(channelIndex, channel, fader, source)
Expand Down Expand Up @@ -197,7 +197,7 @@ export class AtemMixerConnection {
const { pgmOn, pflOn } = this.getFaderFromChannelIndex(channelIndex)
const tracks =
this.mixerProtocol.channelTypes[0].toMixer.CHANNEL_INPUT_SELECTOR?.[
inputSelected - 1
inputSelected - 1
]
if (!tracks) return

Expand Down Expand Up @@ -312,13 +312,11 @@ export class AtemMixerConnection {
}

private getFaderFromChannelIndex(channelIndex: number): IFader {
const faderIndex =
state.channels[0].chMixerConnection[this.mixerIndex].channel[
channelIndex
].assignedFader

return state.faders[0].fader[faderIndex]
return state.faders[0].fader.find(
(fader: IFader) => fader.assignedChannels.includes({ mixerIndex: this.mixerIndex, channelIndex })
)
}

private getChannel(channelIndex: number): IChannel {
return state.channels[0].chMixerConnection[this.mixerIndex].channel[
channelIndex
Expand Down

0 comments on commit 5bc654e

Please sign in to comment.