Skip to content

Commit

Permalink
feat: load mixer preset - Load scene from X32
Browse files Browse the repository at this point in the history
  • Loading branch information
olzzon authored and olzzon committed Jun 5, 2020
1 parent 74524c4 commit 7f1eb77
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 7 deletions.
11 changes: 10 additions & 1 deletion server/constants/mixerProtocols/midasMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,16 @@ export const MidasMaster: IMixerProtocol = {
protocol: 'OSC',
label: 'Midas M32 / Behringer X32 Master Mode',
presetFileExtension: 'X32',
loadPresetCommand: [emptyMixerMessage()],
loadPresetCommand: [
{
mixerMessage: '/load',
value: 0,
type: 'f',
min: 0,
max: 1,
zero: 0.75,
},
],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: true,
pingCommand: [
Expand Down
21 changes: 15 additions & 6 deletions server/utils/mixerConnections/OscMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -813,12 +813,21 @@ export class OscMixerConnection {

loadMixerPreset(presetName: string) {
logger.info('Loading preset :', presetName)
this.sendOutMessage(
this.mixerProtocol.loadPresetCommand[0].mixerMessage,
0,
0,
'i'
)
if (this.mixerProtocol.presetFileExtension === 'X32') {
this.oscConnection.send({
address: this.mixerProtocol.loadPresetCommand[0].mixerMessage,
args: [
{
type: 's',
value: 'scene',
},
{
type: 'i',
value: 1,
},
],
})
}
}

injectCommand(command: string[]) {
Expand Down

0 comments on commit 7f1eb77

Please sign in to comment.