Skip to content

Commit

Permalink
fix: checkFxCommands didn´t filter out non numbered
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon authored and olzzon committed Oct 30, 2020
1 parent 5e4ae42 commit d98f592
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 28 deletions.
2 changes: 2 additions & 0 deletions client/components/ChanStripFull.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,8 @@ class ChanStripFull extends React.PureComponent<
}

handleFx(fxParam: fxParamsList, level: any) {
if (level < 0) { level = 0}
if (level > 1) { level = 1}
window.socketIoClient.emit(SOCKET_SET_FX, {
fxParam: fxParam,
channel: this.props.faderIndex,
Expand Down
57 changes: 29 additions & 28 deletions server/utils/mixerConnections/OscMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -443,38 +443,39 @@ export class OscMixerConnection {
}

checkFxCommands(message: any) {
Object.keys(fxParamsList)
.filter((fxKey: number | string) => {
return typeof fxKey === 'string'
})
.forEach((keyName: string) => {
let fxKey = keyName as keyof typeof fxParamsList
if (
this.checkOscCommand(
message.address,
this.mixerProtocol.channelTypes[0].fromMixer[
fxParamsList[fxKey]
][0].mixerMessage
)
) {
let ch = message.address.split('/')[this.cmdChannelIndex]
store.dispatch(
storeFaderFx(
fxParamsList[fxKey],
state.channels[0].chConnection[this.mixerIndex]
.channel[ch - 1].assignedFader,
message.args[0]
)
)
global.mainThreadHandler.updatePartialStore(
Object.keys(fxParamsList).forEach((keyName: string) => {
if (!isNaN(parseFloat(keyName))) {
return
}

let fxKey = keyName as keyof typeof fxParamsList
if (
this.checkOscCommand(
message.address,
this.mixerProtocol.channelTypes[0].fromMixer[
fxParamsList[fxKey]
][0].mixerMessage
)
) {
let ch = message.address.split('/')[this.cmdChannelIndex]
store.dispatch(
storeFaderFx(
fxParamsList[fxKey],
state.channels[0].chConnection[this.mixerIndex].channel[
ch - 1
].assignedFader
].assignedFader,
message.args[0]
)
}
)
global.mainThreadHandler.updatePartialStore(
state.channels[0].chConnection[this.mixerIndex].channel[
ch - 1
].assignedFader
)
}

console.log(fxKey)
})
console.log(fxKey)
})
}

checkOscCommand(message: string, command: string): boolean {
Expand Down

0 comments on commit d98f592

Please sign in to comment.