Skip to content

Commit

Permalink
Merge pull request #338 from bbc/fix/change-ui-level-while-fadeactive
Browse files Browse the repository at this point in the history
bug fix - change UI level while fadeactive
  • Loading branch information
LindvedKrvang authored Oct 11, 2024
2 parents 341eb25 + 6d17731 commit bc6faaa
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 bc6faaa

Please sign in to comment.