From de94606eb90d26b74da8160b5a9a3bb2fc5a3a1d Mon Sep 17 00:00:00 2001 From: Olzzon Date: Fri, 31 Jan 2020 13:04:01 +0100 Subject: [PATCH] feat: Midas receive delayTime state --- server/constants/mixerProtocols/midasMaster.ts | 8 ++++++++ .../utils/mixerConnections/OscMixerConnection.ts | 14 +++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/server/constants/mixerProtocols/midasMaster.ts b/server/constants/mixerProtocols/midasMaster.ts index 0d4c1190..a6f026f9 100644 --- a/server/constants/mixerProtocols/midasMaster.ts +++ b/server/constants/mixerProtocols/midasMaster.ts @@ -73,6 +73,14 @@ export const MidasMaster: IMixerProtocol = { max: 1, zero: 0.75 }, + { + mixerMessage: '/ch/{channel}/delay/time', + value: "", + type: "s", + min: 0, + max: 1, + zero: 0.75 + }, { mixerMessage: '/ch/{channel}/eq/1/g', value: "", diff --git a/server/utils/mixerConnections/OscMixerConnection.ts b/server/utils/mixerConnections/OscMixerConnection.ts index 5ddfe07d..24e0ef59 100644 --- a/server/utils/mixerConnections/OscMixerConnection.ts +++ b/server/utils/mixerConnections/OscMixerConnection.ts @@ -20,7 +20,8 @@ import { SET_FADER_LO_MID, SET_FADER_MID, SET_FADER_HIGH, - SET_FADER_LOW + SET_FADER_LOW, + SET_FADER_DELAY_TIME } from '../../reducers/faderActions' import { SET_MIXER_ONLINE } from '../../reducers/settingsActions'; import { SOCKET_SET_VU } from '../../constants/SOCKET_IO_DISPATCHERS'; @@ -203,6 +204,17 @@ export class OscMixerConnection { level: level }) global.mainThreadHandler.updatePartialStore(state.channels[0].channel[ch - 1].assignedFader) + } else if (this.checkOscCommand(message.address, this.mixerProtocol.channelTypes[0].fromMixer + .DELAY_TIME[0].mixerMessage)) { + let ch = message.address.split("/")[this.cmdChannelIndex] + let delay = this.mixerProtocol.channelTypes[0].fromMixer.DELAY_TIME[0] + let delayTime = message.args[0] / ((delay.max-delay.min) + delay.min) + store.dispatch({ + type: SET_FADER_DELAY_TIME, + channel: state.channels[0].channel[ch - 1].assignedFader, + delayTime: delayTime + }) + global.mainThreadHandler.updatePartialStore(state.channels[0].channel[ch - 1].assignedFader) } else if (this.checkOscCommand(message.address, this.mixerProtocol.channelTypes[0].fromMixer .LOW[0].mixerMessage)) { let ch = message.address.split("/")[this.cmdChannelIndex];