Skip to content

Commit

Permalink
feat: code cleanup, remove unused emptyMixerProtocol() function in OS…
Browse files Browse the repository at this point in the history
…C mixer protocols
  • Loading branch information
olzzon committed Mar 16, 2021
1 parent 62d2ea2 commit 66e3d9c
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 94 deletions.
20 changes: 1 addition & 19 deletions server/constants/mixerProtocols/DmxIs.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { IMixerProtocol, emptyMixerMessage } from '../MixerProtocolInterface'
import { IMixerProtocol } from '../MixerProtocolInterface'

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()],
pingResponseCommand: [emptyMixerMessage()],
pingTime: 0, //Bypass ping when pingTime is zero
initializeCommands: [emptyMixerMessage()],
channelTypes: [
{
channelTypeName: 'CH',
Expand All @@ -26,14 +22,6 @@ export const DMXIS: IMixerProtocol = {
zero: 0.75,
},
],
CHANNEL_VU: [emptyMixerMessage()],
CHANNEL_VU_REDUCTION: [emptyMixerMessage()],
CHANNEL_NAME: [emptyMixerMessage()],
PFL: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_OUT_GAIN: [
Expand All @@ -56,12 +44,6 @@ export const DMXIS: IMixerProtocol = {
zero: 0.75,
},
],
PFL_ON: [emptyMixerMessage()],
PFL_OFF: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
},
],
Expand Down
15 changes: 1 addition & 14 deletions server/constants/mixerProtocols/ardourMaster.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import { IMixerProtocol, emptyMixerMessage } from '../MixerProtocolInterface'
import { IMixerProtocol } from '../MixerProtocolInterface'

export const ArdourMaster: IMixerProtocol = {
protocol: 'OSC',
label: 'Ardour DAW - Master Mode',
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
leadingZeros: false,
pingCommand: [
Expand Down Expand Up @@ -63,7 +62,6 @@ export const ArdourMaster: IMixerProtocol = {
zero: 0.75,
},
],
CHANNEL_VU_REDUCTION: [emptyMixerMessage()],
CHANNEL_NAME: [
{
mixerMessage: '/strip/name/{channel}',
Expand All @@ -74,11 +72,6 @@ export const ArdourMaster: IMixerProtocol = {
zero: 0.75,
},
],
PFL: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_OUT_GAIN: [
Expand All @@ -101,12 +94,6 @@ export const ArdourMaster: IMixerProtocol = {
zero: 0.75,
},
],
PFL_ON: [emptyMixerMessage()],
PFL_OFF: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
},
],
Expand Down
16 changes: 1 addition & 15 deletions server/constants/mixerProtocols/behringerXrMaster.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
import {
IMixerProtocol,
emptyMixerMessage,
fxParamsList,
} from '../MixerProtocolInterface'
import { IMixerProtocol } from '../MixerProtocolInterface'

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 Expand Up @@ -65,8 +60,6 @@ export const BehringerXrMaster: IMixerProtocol = {
channelTypeName: 'CH',
channelTypeColor: '#2f2f2f',
fromMixer: {
CHANNEL_INPUT_GAIN: [emptyMixerMessage()],
CHANNEL_INPUT_SELECTOR: [emptyMixerMessage()],
CHANNEL_OUT_GAIN: [
{
mixerMessage: '/ch/{channel}/mix/fader',
Expand All @@ -87,8 +80,6 @@ export const BehringerXrMaster: IMixerProtocol = {
mixerMessage: '/ch/{channel}/config/name',
},
],
PFL: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [
{
mixerMessage: '/ch/{channel}/mix/{argument}/level',
Expand All @@ -99,8 +90,6 @@ export const BehringerXrMaster: IMixerProtocol = {
mixerMessage: '/ch/{channel}/mix/on',
},
],
// Only MUTE_ON is used as receiver
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_OUT_GAIN: [
Expand All @@ -113,9 +102,6 @@ export const BehringerXrMaster: IMixerProtocol = {
mixerMessage: '/ch/{channel}/config/name',
},
],
PFL_ON: [emptyMixerMessage()],
PFL_OFF: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [
{
mixerMessage: '/ch/{channel}/mix/{argument}/level',
Expand Down
2 changes: 0 additions & 2 deletions server/constants/mixerProtocols/casparCGMaster.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import {
ICasparCGMixerGeometry,
ICasparCGMixerGeometryFile,
emptyMixerMessage,
} from '../MixerProtocolInterface'

// TODO: This is just template data to avoid error if not loading
Expand Down Expand Up @@ -105,7 +104,6 @@ let CasparCGMasterObject: ICasparCGMixerGeometry = {
protocol: 'CasparCG',
label: `CasparCG Audio Mixer`,
presetFileExtension: '',
loadPresetCommand: [emptyMixerMessage()],
FADE_DISPATCH_RESOLUTION: 5,
studio: 'studio0',
leadingZeros: false,
Expand Down
16 changes: 1 addition & 15 deletions server/constants/mixerProtocols/midasMaster.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
IMixerProtocol,
emptyMixerMessage,
fxParamsList,
} from '../MixerProtocolInterface'
import { IMixerProtocol, fxParamsList } from '../MixerProtocolInterface'

export const MidasMaster: IMixerProtocol = {
protocol: 'OSC',
Expand Down Expand Up @@ -129,10 +125,6 @@ export const MidasMaster: IMixerProtocol = {
mixerMessage: '/meters/1',
},
],
CHANNEL_VU_REDUCTION: [emptyMixerMessage()], // Gain reduction is return toghter with CHANNEL_VU response
CHANNEL_NAME: [emptyMixerMessage()], //[{ mixerMessage: '/ch/{channel}/config/name', value: 0, type: 'f', min: 0, max: 1, zero: 0.75}],
PFL: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
[fxParamsList.GainTrim]: [
{
mixerMessage: '/ch/{channel}/preamp/trim',
Expand Down Expand Up @@ -332,19 +324,13 @@ export const MidasMaster: IMixerProtocol = {
mixerMessage: '/ch/{channel}/mix/on',
},
],
// Only MUTE_ON is used as receiver
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_OUT_GAIN: [
{
mixerMessage: '/ch/{channel}/mix/fader',
},
],
CHANNEL_NAME: [emptyMixerMessage()], //[{ mixerMessage: '/ch/{channel}/config/name', value: 0, type: 'f', min: 0, max: 1, zero: 0.75}],
PFL_ON: [emptyMixerMessage()],
PFL_OFF: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
[fxParamsList.GainTrim]: [
{
mixerMessage: '/ch/{channel}/preamp/trim',
Expand Down
30 changes: 1 addition & 29 deletions server/constants/mixerProtocols/reaperMaster.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,12 @@
import { IMixerProtocol, emptyMixerMessage } from '../MixerProtocolInterface'
import { IMixerProtocol } from '../MixerProtocolInterface'

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()],
pingResponseCommand: [emptyMixerMessage()],
pingTime: 0, //Set to value to get MixerOnline status
initializeCommands: [emptyMixerMessage()],
channelTypes: [
{
channelTypeName: 'CH',
Expand All @@ -36,7 +32,6 @@ export const ReaperMaster: IMixerProtocol = {
zero: 0.75,
},
],
CHANNEL_VU_REDUCTION: [emptyMixerMessage()],
CHANNEL_NAME: [
{
mixerMessage: '/track/{channel}/name',
Expand All @@ -47,11 +42,6 @@ export const ReaperMaster: IMixerProtocol = {
zero: 0.75,
},
],
PFL: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_OUT_GAIN: [
Expand Down Expand Up @@ -94,10 +84,6 @@ export const ReaperMaster: IMixerProtocol = {
zero: 0.75,
},
],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
},
{
Expand Down Expand Up @@ -132,13 +118,6 @@ export const ReaperMaster: IMixerProtocol = {
zero: 0.75,
},
],
CHANNEL_VU_REDUCTION: [emptyMixerMessage()],
CHANNEL_NAME: [emptyMixerMessage()],
PFL: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
toMixer: {
CHANNEL_OUT_GAIN: [
Expand All @@ -151,13 +130,6 @@ export const ReaperMaster: IMixerProtocol = {
zero: 0.75,
},
],
CHANNEL_NAME: [emptyMixerMessage()],
PFL_ON: [emptyMixerMessage()],
PFL_OFF: [emptyMixerMessage()],
NEXT_SEND: [emptyMixerMessage()],
AUX_LEVEL: [emptyMixerMessage()],
CHANNEL_MUTE_ON: [emptyMixerMessage()],
CHANNEL_MUTE_OFF: [emptyMixerMessage()],
},
},
],
Expand Down

0 comments on commit 66e3d9c

Please sign in to comment.