Skip to content

Commit

Permalink
Fix: Fadi In/out when "master" mode didn´t turn down when PGM was on.
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Apr 14, 2019
1 parent 069b4b0 commit 2313f0d
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions src/utils/MixerConnection.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,25 +42,37 @@ export class MixerConnection {
targetVal = parseFloat(this.store.channels[0].channel[channelIndex].faderLevel);
}

let fadeDirection = 1;
if (targetVal<outputLevel) {
fadeDirection = -1;
let timer = setInterval(() => {
outputLevel = outputLevel - 3*this.mixerProtocol.fader.step;
if ( outputLevel <= targetVal){
outputLevel = targetVal;
clearInterval(timer);
return true;
}
window.storeRedux.dispatch({
type:'SET_OUTPUT_LEVEL',
channel: channelIndex,
level: outputLevel
});
this.mixerConnection.updateOutLevel(channelIndex);
}, 1);
} else {
let timer = setInterval(() => {
outputLevel = outputLevel + 3*this.mixerProtocol.fader.step;
if ( outputLevel >= targetVal){
outputLevel = targetVal;
clearInterval(timer);
return true;
}
window.storeRedux.dispatch({
type:'SET_OUTPUT_LEVEL',
channel: channelIndex,
level: outputLevel
});
this.mixerConnection.updateOutLevel(channelIndex);
}, 1);
}

let timer = setInterval(() => {
outputLevel = outputLevel + fadeDirection*3*this.mixerProtocol.fader.step;
if ( outputLevel >= targetVal){
outputLevel = targetVal;
clearInterval(timer);
return true;
}
window.storeRedux.dispatch({
type:'SET_OUTPUT_LEVEL',
channel: channelIndex,
level: outputLevel
});
this.mixerConnection.updateOutLevel(channelIndex);
}, 1);
} else {
let outputLevel = this.store.channels[0].channel[channelIndex].outputLevel;
let timer = setInterval(() => {
Expand Down

0 comments on commit 2313f0d

Please sign in to comment.