Skip to content

Commit

Permalink
fix: multiple mixers, mixerconnection reference to correct mixer inst…
Browse files Browse the repository at this point in the history
…ead of first one
  • Loading branch information
olzzon authored and olzzon committed Oct 5, 2020
1 parent f59036a commit 59dee5d
Showing 1 changed file with 29 additions and 29 deletions.
58 changes: 29 additions & 29 deletions server/utils/MixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,17 +108,18 @@ export class MixerGenericConnection {
(chConnection: IchConnection, index: number) => {
this.mixerTimers.push({
chTimer: new Array(
state.channels[0].chConnection[0].channel.length
state.channels[0].chConnection[index].channel.length
),
fadeActiveTimer: new Array(
state.channels[0].chConnection[0].channel.length
state.channels[0].chConnection[index].channel.length
),
})
}
)
}

getPresetFileExtention(): string {
//TODO: atm mixer presets only supports first mixer connected to Sisyfos
return this.mixerProtocol[0].presetFileExtension || ''
}

Expand Down Expand Up @@ -185,11 +186,11 @@ export class MixerGenericConnection {
updateInputGain(faderIndex: number) {
let level = state.faders[0].fader[faderIndex].inputGain
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateInputGain(
this.mixerConnection[mixerIndex].updateInputGain(
channelIndex,
level
)
Expand All @@ -204,14 +205,13 @@ export class MixerGenericConnection {
let inputSelected = state.faders[0].fader[faderIndex].inputSelector
console.log(faderIndex, inputSelected)
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateInputSelector(
channelIndex,
inputSelected
)
this.mixerConnection[
mixerIndex
].updateInputSelector(channelIndex, inputSelected)
}
}
)
Expand All @@ -225,11 +225,11 @@ export class MixerGenericConnection {

updateMuteState(faderIndex: number) {
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateMuteState(
this.mixerConnection[mixerIndex].updateMuteState(
channelIndex,
state.faders[0].fader[faderIndex].muteOn
)
Expand All @@ -242,11 +242,11 @@ export class MixerGenericConnection {

updateAMixState(faderIndex: number) {
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateAMixState(
this.mixerConnection[mixerIndex].updateAMixState(
channelIndex,
state.faders[0].fader[faderIndex].amixOn
)
Expand All @@ -268,11 +268,11 @@ export class MixerGenericConnection {
100
}
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateNextAux(
this.mixerConnection[mixerIndex].updateNextAux(
channelIndex,
level
)
Expand All @@ -286,11 +286,11 @@ export class MixerGenericConnection {
updateThreshold(faderIndex: number) {
let level = state.faders[0].fader[faderIndex].threshold
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateThreshold(
this.mixerConnection[mixerIndex].updateThreshold(
channelIndex,
level
)
Expand All @@ -303,11 +303,11 @@ export class MixerGenericConnection {
updateRatio(faderIndex: number) {
let level = state.faders[0].fader[faderIndex].ratio
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateRatio(
this.mixerConnection[mixerIndex].updateRatio(
channelIndex,
level
)
Expand All @@ -320,11 +320,11 @@ export class MixerGenericConnection {
updateDelayTime(faderIndex: number) {
let delayTime = state.faders[0].fader[faderIndex].delayTime
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateDelayTime(
this.mixerConnection[mixerIndex].updateDelayTime(
channelIndex,
delayTime
)
Expand All @@ -337,11 +337,11 @@ export class MixerGenericConnection {
updateLow(faderIndex: number) {
let level = state.faders[0].fader[faderIndex].low
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateLow(
this.mixerConnection[mixerIndex].updateLow(
channelIndex,
level
)
Expand All @@ -354,11 +354,11 @@ export class MixerGenericConnection {
updateLoMid(faderIndex: number) {
let level = state.faders[0].fader[faderIndex].loMid
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateLoMid(
this.mixerConnection[mixerIndex].updateLoMid(
channelIndex,
level
)
Expand All @@ -371,11 +371,11 @@ export class MixerGenericConnection {
updateMid(faderIndex: number) {
let level = state.faders[0].fader[faderIndex].mid
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateMid(
this.mixerConnection[mixerIndex].updateMid(
channelIndex,
level
)
Expand All @@ -388,11 +388,11 @@ export class MixerGenericConnection {
updateHigh(faderIndex: number) {
let level = state.faders[0].fader[faderIndex].high
state.channels[0].chConnection.forEach(
(chConnection: IchConnection) => {
(chConnection: IchConnection, mixerIndex: number) => {
chConnection.channel.forEach(
(channel: IChannel, channelIndex: number) => {
if (faderIndex === channel.assignedFader) {
this.mixerConnection[0].updateHigh(
this.mixerConnection[mixerIndex].updateHigh(
channelIndex,
level
)
Expand Down

0 comments on commit 59dee5d

Please sign in to comment.