diff --git a/README.md b/README.md index 15439420..cbbff4b9 100644 --- a/README.md +++ b/README.md @@ -148,6 +148,9 @@ To set the state send these OSC commands from you Automation to ProducersAudioMi /ch/1/mix/faderlevel - float {between 0 and 1} #### Set channel label: /ch/1/label - string {name of channel} +#### Inject Command: +Pass a command directly from Automation to Audiomixer +/inject #### Crossfade between PGM and PST: /take #### Set snap 1-xx to PST: diff --git a/server/constants/AutomationPresets.ts b/server/constants/AutomationPresets.ts index ea70ac1a..4ae0de82 100644 --- a/server/constants/AutomationPresets.ts +++ b/server/constants/AutomationPresets.ts @@ -18,6 +18,7 @@ export interface IAutomationProtocol { CHANNEL_PGM_ON_OFF: string, CHANNEL_PST_ON_OFF: string, CHANNEL_FADER_LEVEL: string, + INJECT_COMMAND: string, CHANNEL_VISIBLE: string, CHANNEL_MUTE: string, X_MIX: string, @@ -76,6 +77,7 @@ export const AutomationPresets: { [key: string]: IAutomationProtocol } = { CHANNEL_VISIBLE: '/ch/{value1}/visible', CHANNEL_MUTE: '/ch/{value1}/mute', X_MIX: '/take', + INJECT_COMMAND: '/inject', SET_LABEL: '/ch/{value1}/label', FADE_TO_BLACK: '/fadetoblack', CLEAR_PST: '/clearpst', diff --git a/server/utils/AutomationConnection.ts b/server/utils/AutomationConnection.ts index aa3760fa..d2518ced 100644 --- a/server/utils/AutomationConnection.ts +++ b/server/utils/AutomationConnection.ts @@ -146,6 +146,17 @@ export class AutomationConnection { mixerGenericConnection.updateOutLevel(ch-1) global.mainThreadHandler.updatePartialStore(ch - 1) } + } else if (this.checkOscCommand(message.address, this.automationProtocol.fromAutomation + .INJECT_COMMAND)) { + let ch = message.address.split("/")[2]; + store.dispatch({ + type: SET_CHANNEL_LABEL, + channel: ch -1, + label: message.args[0] + }); + mixerGenericConnection.injectCommand(message.args) + global.mainThreadHandler.updatePartialStore(ch - 1) + } else if (this.checkOscCommand(message.address, this.automationProtocol.fromAutomation .SNAP_RECALL)) { let snapNumber = message.address.split("/")[2]; diff --git a/server/utils/MixerConnection.ts b/server/utils/MixerConnection.ts index 7e3542c1..f0f2be39 100644 --- a/server/utils/MixerConnection.ts +++ b/server/utils/MixerConnection.ts @@ -185,6 +185,10 @@ export class MixerGenericConnection { this.mixerConnection.updateChannelName(channelIndex); } + injectCommand(command: string[]) { + this.mixerConnection.injectCommand(command) + } + updateChannelSettings(channelIndex: number, setting: string, value: string) { if (this.mixerProtocol.protocol === 'CasparCG') { this.mixerConnection.updateChannelSetting(channelIndex, setting, value) diff --git a/server/utils/mixerConnections/CasparCGConnection.ts b/server/utils/mixerConnections/CasparCGConnection.ts index ffb2c856..97d93db8 100644 --- a/server/utils/mixerConnections/CasparCGConnection.ts +++ b/server/utils/mixerConnections/CasparCGConnection.ts @@ -337,5 +337,9 @@ export class CasparCGConnection { updateChannelName(channelIndex: number) { //CasparCG does not need Labels. } + + injectCommand(command: string[]) { + return true + } } diff --git a/server/utils/mixerConnections/EmberMixerConnection.ts b/server/utils/mixerConnections/EmberMixerConnection.ts index 25b64dc5..324ed3d6 100644 --- a/server/utils/mixerConnections/EmberMixerConnection.ts +++ b/server/utils/mixerConnections/EmberMixerConnection.ts @@ -258,5 +258,10 @@ export class EmberMixerConnection { "string" ); } + + injectCommand(command: string[]) { + return true + } + } diff --git a/server/utils/mixerConnections/MidiMixerConnection.ts b/server/utils/mixerConnections/MidiMixerConnection.ts index 9823feef..e57dbe00 100644 --- a/server/utils/mixerConnections/MidiMixerConnection.ts +++ b/server/utils/mixerConnections/MidiMixerConnection.ts @@ -236,5 +236,9 @@ return true; ); } + injectCommand(command: string[]) { + return true + } + } diff --git a/server/utils/mixerConnections/OscMixerConnection.ts b/server/utils/mixerConnections/OscMixerConnection.ts index 1405a362..1b6dc1de 100644 --- a/server/utils/mixerConnections/OscMixerConnection.ts +++ b/server/utils/mixerConnections/OscMixerConnection.ts @@ -534,5 +534,10 @@ export class OscMixerConnection { "s" ); } + + injectCommand(command: string[]) { + return true + } + } diff --git a/server/utils/mixerConnections/QlClMixerConnection.ts b/server/utils/mixerConnections/QlClMixerConnection.ts index 45d13a91..665e26d6 100644 --- a/server/utils/mixerConnections/QlClMixerConnection.ts +++ b/server/utils/mixerConnections/QlClMixerConnection.ts @@ -275,5 +275,10 @@ export class QlClMixerConnection { "s" ); } + + injectCommand(command: string[]) { + return true + } + } diff --git a/server/utils/mixerConnections/SSLMixerConnection.ts b/server/utils/mixerConnections/SSLMixerConnection.ts index 6bcbe332..7fca7b46 100644 --- a/server/utils/mixerConnections/SSLMixerConnection.ts +++ b/server/utils/mixerConnections/SSLMixerConnection.ts @@ -411,5 +411,10 @@ export class SSLMixerConnection { ); */ } + + injectCommand(command: string[]) { + return true + } + }