Skip to content

Commit

Permalink
fix(mc2): support mc2 firmware 5.6.0
Browse files Browse the repository at this point in the history
Should ideally work with all firmwares
  • Loading branch information
Balte de Wit committed Sep 16, 2020
1 parent a02d194 commit fa80bde
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 13 deletions.
3 changes: 1 addition & 2 deletions server/constants/mixerProtocols/LawoMC2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ export const LawoMC2: IMixerProtocol = {
],
CHANNEL_NAME: [
{
mixerMessage:
'Channels.Inputs.${channel}.General.Inherited Label',
mixerMessage: 'Channels.Inputs.${channel}',
value: 0,
type: 'real',
min: -200,
Expand Down
36 changes: 25 additions & 11 deletions server/utils/mixerConnections/EmberMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -299,16 +299,30 @@ export class EmberMixerConnection {
channelTypeIndex,
mixerMessage,
(node) => {
logger.verbose(
`Receiving Label from Ch "${ch}", val: ${
(node.contents as Model.Parameter).value
}`
)
store.dispatch({
type: SET_CHANNEL_LABEL,
channel: ch - 1,
label: (node.contents as Model.Parameter).value,
})
if (this.mixerProtocol.label === LawoMC2.label) {
// this also depends on version of the firmware -_-
logger.verbose(
`Receiving Label from Ch "${ch}", val: ${
(node.contents as Model.Parameter).description
}`
)
store.dispatch({
type: SET_CHANNEL_LABEL,
channel: ch - 1,
label: (node.contents as Model.Parameter).description,
})
} else {
logger.verbose(
`Receiving Label from Ch "${ch}", val: ${
(node.contents as Model.Parameter).value
}`
)
store.dispatch({
type: SET_CHANNEL_LABEL,
channel: ch - 1,
label: (node.contents as Model.Parameter).value,
})
}
global.mainThreadHandler.updatePartialStore(ch - 1)
}
)
Expand Down Expand Up @@ -825,7 +839,7 @@ export class EmberMixerConnection {
(' ' + inp).substr(-l)

if (this.mixerProtocol.label === LawoMC2.label) {
const channelName = 'INP ' + pad(channel, 3)
const channelName = '_' + Number(channel).toString(16) // 'INP ' + pad(channel, 3)
return command.replace('${channel}', channelName)
} else if (this.mixerProtocol.leadingZeros) {
return command.replace('${channel}', pad(channel, 2))
Expand Down

0 comments on commit fa80bde

Please sign in to comment.