Skip to content

Commit

Permalink
feat: Midas/X32 MUTE button support
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon committed Jan 31, 2020
1 parent de6a733 commit e922d5f
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
7 changes: 4 additions & 3 deletions server/constants/mixerProtocols/midasMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ export const MidasMaster: IMixerProtocol = {
MID: [{ mixerMessage: '/ch/{channel}/eq/3/g', value: 0, type: 'f', min: 0, max: 1, zero: 0}],
HIGH: [{ mixerMessage: '/ch/{channel}/eq/4/g', value: 0, type: 'f', min: 0, max: 1, zero: 0}],
AUX_LEVEL: [{mixerMessage: '/ch/{channel}/mix/{argument}/level', value: 0, type: 'f', min: 0, max: 1, zero: 0}],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [{ mixerMessage: '/ch/{channel}/mix/on', value: 0, type: 'i', min: 0, max: 1, zero: 0}],
// Only MUTE_ON is used as receiver
CHANNEL_MUTE_OFF: [emptyMixerMessage()]
},
toMixer: {
Expand All @@ -150,8 +151,8 @@ export const MidasMaster: IMixerProtocol = {
MID: [{ mixerMessage: '/ch/{channel}/eq/3/g', value: 0, type: 'f', min: 0, max: 1, zero: 0}],
HIGH: [{ mixerMessage: '/ch/{channel}/eq/4/g', value: 0, type: 'f', min: 0, max: 1, zero: 0}],
AUX_LEVEL: [{mixerMessage: '/ch/{channel}/mix/{argument}/level', value: 0, type: 'f', min: 0, max: 1, zero: 0}],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()]
CHANNEL_MUTE_ON: [{ mixerMessage: '/ch/{channel}/mix/on', value: 0, type: 'f', min: 0, max: 1, zero: 0}],
CHANNEL_MUTE_OFF: [{ mixerMessage: '/ch/{channel}/mix/on', value: 1, type: 'f', min: 0, max: 1, zero: 0}]
},
}],
fader: {
Expand Down
34 changes: 31 additions & 3 deletions server/utils/mixerConnections/OscMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ import {
SET_FADER_MID,
SET_FADER_HIGH,
SET_FADER_LOW,
SET_FADER_DELAY_TIME
SET_FADER_DELAY_TIME,
SET_MUTE
} from '../../reducers/faderActions'
import { SET_MIXER_ONLINE } from '../../reducers/settingsActions';
import { SOCKET_SET_VU } from '../../constants/SOCKET_IO_DISPATCHERS';
Expand Down Expand Up @@ -184,6 +185,16 @@ export class OscMixerConnection {
label: message.args[0]
});
global.mainThreadHandler.updatePartialStore(state.channels[0].channel[ch - 1].assignedFader)
} else if (this.checkOscCommand(message.address, this.mixerProtocol.channelTypes[0].fromMixer
.CHANNEL_MUTE_ON[0].mixerMessage)) {
let ch = message.address.split("/")[this.cmdChannelIndex]
let mute = (message.args[0] === 0) ? 1 : 0
store.dispatch({
type: SET_MUTE,
channel: state.channels[0].channel[ch - 1].assignedFader,
muteOn: mute
});
global.mainThreadHandler.updatePartialStore(state.channels[0].channel[ch - 1].assignedFader)
} else if (this.checkOscCommand(message.address, this.mixerProtocol.channelTypes[0].fromMixer
.THRESHOLD[0].mixerMessage)) {
let ch = message.address.split("/")[this.cmdChannelIndex];
Expand Down Expand Up @@ -427,8 +438,25 @@ export class OscMixerConnection {
}

updateMuteState(channelIndex: number, muteOn: boolean) {
return true
}
let channelType = state.channels[0].channel[channelIndex].channelType;
let channelTypeIndex = state.channels[0].channel[channelIndex].channelTypeIndex
if (muteOn === true) {
let mute = this.mixerProtocol.channelTypes[channelType].toMixer.CHANNEL_MUTE_ON[0]
this.sendOutMessage(
mute.mixerMessage,
channelTypeIndex + 1,
mute.value,
mute.type
)
} else {
let mute = this.mixerProtocol.channelTypes[channelType].toMixer.CHANNEL_MUTE_OFF[0]
this.sendOutMessage(
mute.mixerMessage,
channelTypeIndex + 1,
mute.value,
mute.type
)
} }

updateNextAux(channelIndex: number, level: number) {
return true
Expand Down

0 comments on commit e922d5f

Please sign in to comment.