Skip to content

Commit

Permalink
feat: load mixer preset - prepared protocols with loadPresetCommand.m…
Browse files Browse the repository at this point in the history
…ixerMessage
  • Loading branch information
olzzon authored and olzzon committed Jun 5, 2020
1 parent 53581c3 commit 4ffbf3c
Show file tree
Hide file tree
Showing 24 changed files with 373 additions and 199 deletions.
1 change: 1 addition & 0 deletions server/constants/MixerProtocolInterface.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ export interface IMixerProtocolGeneric {
protocol: string
label: string
presetFileExtension: string
loadPresetCommand: Array<IMixerMessageProtocol>
FADE_DISPATCH_RESOLUTION: number
fader: {
min: number
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/DmxIs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const DMXIS: IMixerProtocol = {
protocol: 'OSC',
label: 'DMXIS Light Controller Protocol',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: false, //some OSC protocols needs channels to be 01, 02 etc.
pingCommand: [emptyMixerMessage()],
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/LawoMC2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const LawoMC2: IMixerProtocol = {
protocol: 'EMBER',
label: 'Lawo MC2 - NOT IMPLEMENTED',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: false, //some OSC protocols needs channels to be 01, 02 etc.
pingCommand: [emptyMixerMessage()],
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/LawoRelayVrx4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const LawoRelayVrx4: IMixerProtocol = {
protocol: 'EMBER',
label: 'Lawo Relay VRX4 - client',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 15,
leadingZeros: false, //some OSC protocols needs channels to be 01, 02 etc.
pingCommand: [emptyMixerMessage()],
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/LawoRuby.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const LawoRuby: IMixerProtocol = {
protocol: 'EMBER',
label: 'Lawo Ruby',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 15,
leadingZeros: false, //some OSC protocols needs channels to be 01, 02 etc.
pingCommand: [emptyMixerMessage()],
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/SSLsystemT.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const SSLSystemT: IMixerProtocol = {
protocol: 'SSL',
label: 'SSL System T',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: false,
pingCommand: [emptyMixerMessage()],
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/StuderOnAirEmber.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const StuderOnAirMaster: IMixerProtocol = {
protocol: 'STUDER',
label: 'Studer OnAir 3000',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: false, //some OSC protocols needs channels to be 01, 02 etc.
pingCommand: [emptyMixerMessage()],
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/ardourMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const ArdourMaster: IMixerProtocol = {
protocol: 'OSC',
label: 'Ardour DAW - Master Mode',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: false,
pingCommand: [
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/behringerXrMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const BehringerXrMaster: IMixerProtocol = {
protocol: 'OSC',
label: 'Behringer XR-series / Midas MR-series',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: true,
pingCommand: [
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/casparCGMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ let CasparCGMasterObject: ICasparCGMixerGeometry = {
protocol: 'CasparCG',
label: `CasparCG Audio Mixer`,
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
studio: 'studio0',
leadingZeros: false,
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/genericMidi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const GenericMidi: IMixerProtocol = {
protocol: 'MIDI',
label: 'Generic Midi',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: false,
pingCommand: [emptyMixerMessage()],
Expand Down
3 changes: 2 additions & 1 deletion server/constants/mixerProtocols/midasMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { IMixerProtocol, emptyMixerMessage } from '../MixerProtocolInterface'
export const MidasMaster: IMixerProtocol = {
protocol: 'OSC',
label: 'Midas M32 / Behringer X32 Master Mode',
presetFileExtension: '',
presetFileExtension: 'X32',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: true,
pingCommand: [
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/reaperMaster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const ReaperMaster: IMixerProtocol = {
protocol: 'OSC',
label: 'Reaper DAW Master mode(reaper.fm)',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: false, //some OSC protocols needs channels to be 01, 02 etc.
pingCommand: [emptyMixerMessage()],
Expand Down
1 change: 1 addition & 0 deletions server/constants/mixerProtocols/yamahaQLCL.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export const YamahaQLCL: IMixerProtocol = {
protocol: 'QLCL',
label: 'Yamaha QL/CL',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: false,
pingCommand: [emptyMixerMessage()],
Expand Down
5 changes: 2 additions & 3 deletions server/utils/MixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,11 @@ export class MixerGenericConnection {
}

getPresetFileExtention(): string {
console.log('TODO: File extension should be handled pr. mixer type')
return 'x32'
return this.mixerProtocol.presetFileExtension
}

loadMixerPreset(presetName: string) {
logger.info('Loading Preset :' + presetName)
this.mixerConnection.loadMixerPreset(presetName)
}

checkForAutoResetThreshold(channel: number) {
Expand Down
5 changes: 4 additions & 1 deletion server/utils/SettingsStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,10 @@ export const getSnapShotList = () => {
return files
}

export const getMixerPresetList = (fileExtension: string) => {
export const getMixerPresetList = (fileExtension: string): string[] => {
if (fileExtension === '') {
return []
}
const files = fs
.readdirSync(path.resolve('storage'))
.filter((file: string) => {
Expand Down
Loading

0 comments on commit 4ffbf3c

Please sign in to comment.