Skip to content

Commit

Permalink
Fix: Use sendVuLevel for reduction in Behringer XR and plain OSC prot…
Browse files Browse the repository at this point in the history
…ocol
  • Loading branch information
olzzon authored and olzzon committed Nov 10, 2020
1 parent de5c255 commit 6300181
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 46 deletions.
44 changes: 10 additions & 34 deletions server/utils/mixerConnections/OscMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,7 @@ import {
storeSetMute,
} from '../../reducers/faderActions'
import { storeSetMixerOnline } from '../../reducers/settingsActions'
import {
SOCKET_SET_VU_REDUCTION,
SOCKET_SET_MIXER_ONLINE,
} from '../../constants/SOCKET_IO_DISPATCHERS'
import { SOCKET_SET_MIXER_ONLINE } from '../../constants/SOCKET_IO_DISPATCHERS'
import { logger } from '../logger'
import { sendVuLevel, VuType } from '../vuServer'

Expand Down Expand Up @@ -128,36 +125,15 @@ export class OscMixerConnection {
.CHANNEL_VU_REDUCTION[0].mixerMessage
)
) {
if (
state.settings[0].mixers[
this.mixerIndex
].mixerProtocol.includes('behringer')
) {
behringerReductionMeter(this.mixerIndex, message.args)
} else if (
state.settings[0].mixers[
this.mixerIndex
].mixerProtocol.includes('midas')
) {
midasMeter(this.mixerIndex, message.args)
} else {
let ch = message.address.split('/')[
this.cmdChannelIndex
]
store.dispatch(
storeVuReductionLevel(
state.channels[0].chConnection[this.mixerIndex]
.channel[ch - 1].assignedFader,
message.args[0]
)
)
socketServer.emit(SOCKET_SET_VU_REDUCTION, {
faderIndex:
state.channels[0].chConnection[this.mixerIndex]
.channel[ch - 1].assignedFader,
level: message.args[0],
})
}
let ch = message.address.split('/')[this.cmdChannelIndex]
sendVuLevel(
state.channels[0].chConnection[this.mixerIndex].channel[
ch - 1
].assignedFader,
VuType.Reduction,
0,
message.args[0]
)
} else if (
this.checkOscCommand(
message.address,
Expand Down
14 changes: 2 additions & 12 deletions server/utils/mixerConnections/productSpecific/behringerXr.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import { store, state } from '../../../reducers/store'
import { socketServer } from '../../../expressHandler'

import { storeVuReductionLevel } from '../../../reducers/faderActions'
import { SOCKET_SET_VU_REDUCTION } from '../../../constants/SOCKET_IO_DISPATCHERS'
import { state } from '../../../reducers/store'
import { sendVuLevel, VuType } from '../../vuServer'

const DATA_OFFSET = 4
Expand Down Expand Up @@ -39,12 +35,6 @@ export const behringerReductionMeter = (mixerIndex: number, message: any) => {
let level =
1 -
(dataview.getInt16(DATA_OFFSET + 2 * (i + 16), true) + 8000) / 8000
store.dispatch(storeVuReductionLevel(i, level))
socketServer.emit(SOCKET_SET_VU_REDUCTION, {
faderIndex:
state.channels[0].chConnection[mixerIndex].channel[i]
.assignedFader,
level: level,
})
sendVuLevel(i, VuType.Reduction, 0, level)
}
}

0 comments on commit 6300181

Please sign in to comment.