Skip to content

Commit

Permalink
feat: Preparing CCG - /inject command so it´s possible pass a command…
Browse files Browse the repository at this point in the history
… directly from Sofie to Audiomixer.
  • Loading branch information
olzzon committed Jan 24, 2020
1 parent f2dc03f commit cb53eb5
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions server/constants/AutomationPresets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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',
Expand Down
11 changes: 11 additions & 0 deletions server/utils/AutomationConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
4 changes: 4 additions & 0 deletions server/utils/MixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 4 additions & 0 deletions server/utils/mixerConnections/CasparCGConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -337,5 +337,9 @@ export class CasparCGConnection {
updateChannelName(channelIndex: number) {
//CasparCG does not need Labels.
}

injectCommand(command: string[]) {
return true
}
}

5 changes: 5 additions & 0 deletions server/utils/mixerConnections/EmberMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -258,5 +258,10 @@ export class EmberMixerConnection {
"string"
);
}

injectCommand(command: string[]) {
return true
}

}

4 changes: 4 additions & 0 deletions server/utils/mixerConnections/MidiMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -236,5 +236,9 @@ return true;
);
}

injectCommand(command: string[]) {
return true
}

}

5 changes: 5 additions & 0 deletions server/utils/mixerConnections/OscMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -534,5 +534,10 @@ export class OscMixerConnection {
"s"
);
}

injectCommand(command: string[]) {
return true
}

}

5 changes: 5 additions & 0 deletions server/utils/mixerConnections/QlClMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -275,5 +275,10 @@ export class QlClMixerConnection {
"s"
);
}

injectCommand(command: string[]) {
return true
}

}

5 changes: 5 additions & 0 deletions server/utils/mixerConnections/SSLMixerConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,5 +411,10 @@ export class SSLMixerConnection {
);
*/
}

injectCommand(command: string[]) {
return true
}

}

0 comments on commit cb53eb5

Please sign in to comment.