Skip to content

Commit

Permalink
fix: more optionals when no channels are assigned to a fader
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Jul 13, 2023
1 parent 92b6091 commit 991128a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion server/src/MainThreadHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class MainThreadHandlers {
faderIndex: faderIndex,
state: state.faders[0].fader[faderIndex],
})
state.faders[0].fader[faderIndex].assignedChannels.forEach(
state.faders[0].fader[faderIndex].assignedChannels?.forEach(
(channel: IChannelReference) => {
socketServer.emit(IO.SOCKET_SET_STORE_CHANNEL, {
channelIndex: channel.channelIndex,
Expand Down
14 changes: 7 additions & 7 deletions server/src/utils/MixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ export class MixerGenericConnection {
}


state.faders[0].fader[faderIndex].assignedChannels.forEach(
state.faders[0].fader[faderIndex].assignedChannels?.forEach(
(assignedChannel: IChannelReference) => {
if (assignedChannel.mixerIndex !== mixerIndexToSkip) {
this.fadeInOut(
Expand All @@ -225,7 +225,7 @@ export class MixerGenericConnection {

updateInputGain = (faderIndex: number) => {
let level = state.faders[0].fader[faderIndex].inputGain
state.faders[0].fader[faderIndex].assignedChannels.forEach(
state.faders[0].fader[faderIndex].assignedChannels?.forEach(
(assignedChannel: IChannelReference) => {
this.mixerConnection[assignedChannel.mixerIndex].updateInputGain(
assignedChannel.channelIndex,
Expand All @@ -238,7 +238,7 @@ export class MixerGenericConnection {
updateInputSelector = (faderIndex: number) => {
let inputSelected = state.faders[0].fader[faderIndex].inputSelector
logger.trace(`${faderIndex} ${inputSelected}`)
state.faders[0].fader[faderIndex].assignedChannels.forEach(
state.faders[0].fader[faderIndex].assignedChannels?.forEach(
(assignedChannel: IChannelReference) => {
this.mixerConnection[assignedChannel.mixerIndex].updateInputSelector(
assignedChannel.channelIndex,
Expand All @@ -253,7 +253,7 @@ export class MixerGenericConnection {
}

updateMuteState = (faderIndex: number, mixerIndexToSkip: number = -1) => {
state.faders[0].fader[faderIndex].assignedChannels.forEach(
state.faders[0].fader[faderIndex].assignedChannels?.forEach(
(assignedChannel: IChannelReference) => {
if (assignedChannel.mixerIndex !== mixerIndexToSkip) {
this.mixerConnection[assignedChannel.mixerIndex].updateMuteState(
Expand All @@ -266,7 +266,7 @@ export class MixerGenericConnection {
}

updateAMixState = (faderIndex: number) => {
state.faders[0].fader[faderIndex].assignedChannels.forEach(
state.faders[0].fader[faderIndex].assignedChannels?.forEach(
(assignedChannel: IChannelReference) => {
this.mixerConnection[assignedChannel.mixerIndex].updateAMixState(
assignedChannel.channelIndex,
Expand All @@ -286,7 +286,7 @@ export class MixerGenericConnection {
(100 - state.settings[0].voLevel)) /
100
}
state.faders[0].fader[faderIndex].assignedChannels.forEach(
state.faders[0].fader[faderIndex].assignedChannels?.forEach(
(assignedChannel: IChannelReference) => {
this.mixerConnection[assignedChannel.mixerIndex].updateNextAux(
assignedChannel.channelIndex,
Expand All @@ -298,7 +298,7 @@ export class MixerGenericConnection {

updateFx = (fxParam: fxParamsList, faderIndex: number) => {
let level: number = state.faders[0].fader[faderIndex][fxParam][0]
state.faders[0].fader[faderIndex].assignedChannels.forEach(
state.faders[0].fader[faderIndex].assignedChannels?.forEach(
(assignedChannel: IChannelReference) => {
this.mixerConnection[assignedChannel.mixerIndex].updateFx(
fxParam,
Expand Down

0 comments on commit 991128a

Please sign in to comment.