Skip to content

Commit

Permalink
Fix: fadeToBlack - only send commands for channels that are open
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Oct 14, 2019
1 parent f635362 commit 48ed2ae
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/utils/AutomationConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ export class AutomationConnection {
window.storeRedux.dispatch({
type:'FADE_TO_BLACK'
});
window.mixerGenericConnection.updateOutLevels();
window.mixerGenericConnection.updateFadeToBlack();
} else if (this.checkOscCommand(message.address, this.automationProtocol.fromAutomation
.CLEAR_PST)) {
window.storeRedux.dispatch({
Expand Down
13 changes: 12 additions & 1 deletion src/utils/MixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,12 @@ export class MixerGenericConnection {
this.fadeActiveTimer = new Array(this.store.channels[0].channel.length);
}

updateFadeToBlack() {
this.store.faders[0].fader.map((channel: any, index: number) => {
this.updateOutLevel(index);
});
}

updateOutLevels() {
this.store.faders[0].fader.map((channel: any, index: number) => {
this.updateOutLevel(index);
Expand All @@ -74,7 +80,6 @@ export class MixerGenericConnection {
this.store.channels[0].channel.map((channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.fadeInOut(channelIndex, fadeTime);
//this.mixerConnection.updateOutLevel(index);
}
})
if (window.huiRemoteConnection) {
Expand Down Expand Up @@ -124,6 +129,12 @@ export class MixerGenericConnection {

fadeInOut (channelIndex: number, fadeTime: number){
let faderIndex = this.store.channels[0].channel[channelIndex].assignedFader
if (!this.store.faders[0].fader[faderIndex].pgmOn
&& !this.store.faders[0].fader[faderIndex].voOn
&& this.store.channels[0].channel[channelIndex].outputLevel === 0
) {
return
}
//Clear Old timer or set Fade to active:
if (this.store.channels[0].channel[channelIndex].fadeActive) {
clearInterval(this.fadeActiveTimer[channelIndex]);
Expand Down

0 comments on commit 48ed2ae

Please sign in to comment.