Skip to content

Commit

Permalink
fix: if fadeTime is zero, jump to new level instead of fade
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Oct 3, 2024
1 parent 4b24ca2 commit 6d17731
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions server/src/utils/MixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,11 @@ export class MixerGenericConnection {
channel: channelIndex,
active: true,
})
// If fadeTime is 0 - jump to level and don't use timer
if (fadeTime === 0) {
this.jumpToLevel(mixerIndex, channelIndex, faderIndex)
return
}
if (
state.faders[0].fader[faderIndex].pgmOn ||
state.faders[0].fader[faderIndex].voOn
Expand All @@ -442,6 +447,22 @@ export class MixerGenericConnection {
}
}

jumpToLevel = (mixerIndex: number, channelIndex: number, faderIndex: number) => {
let targetVal = state.faders[0].fader[faderIndex].faderLevel
if (state.faders[0].fader[faderIndex].voOn) {
targetVal = (targetVal * (100 - state.settings[0].voLevel)) / 100
}
this.mixerConnection[mixerIndex].updateFadeIOLevel(channelIndex, targetVal)
store.dispatch({
type: ChannelActionTypes.SET_OUTPUT_LEVEL,
mixerIndex: mixerIndex,
channel: channelIndex,
level: targetVal,
})
sendChLevelsToOuputServer(mixerIndex, channelIndex, targetVal)
this.delayedFadeActiveDisable(mixerIndex, channelIndex)
}

fadeUp = (
mixerIndex: number,
channelIndex: number,
Expand Down

0 comments on commit 6d17731

Please sign in to comment.