diff --git a/packages/timeline-state-resolver-types/src/generated/vmix.ts b/packages/timeline-state-resolver-types/src/generated/vmix.ts index e83619d05..e32bc5635 100644 --- a/packages/timeline-state-resolver-types/src/generated/vmix.ts +++ b/packages/timeline-state-resolver-types/src/generated/vmix.ts @@ -125,12 +125,16 @@ export interface SavePresetPayload { export enum VmixActions { LastPreset = 'lastPreset', OpenPreset = 'openPreset', - SavePreset = 'savePreset' + SavePreset = 'savePreset', + StartExternal = 'startExternal', + StopExternal = 'stopExternal' } export interface VmixActionExecutionResults { lastPreset: () => void, openPreset: (payload: OpenPresetPayload) => void, - savePreset: (payload: SavePresetPayload) => void + savePreset: (payload: SavePresetPayload) => void, + startExternal: () => void, + stopExternal: () => void } export type VmixActionExecutionPayload = Parameters< VmixActionExecutionResults[A] diff --git a/packages/timeline-state-resolver/src/integrations/vmix/$schemas/actions.json b/packages/timeline-state-resolver/src/integrations/vmix/$schemas/actions.json index 42a42220d..3beda32de 100644 --- a/packages/timeline-state-resolver/src/integrations/vmix/$schemas/actions.json +++ b/packages/timeline-state-resolver/src/integrations/vmix/$schemas/actions.json @@ -41,6 +41,18 @@ "required": ["filename"], "additionalProperties": false } + }, + { + "id": "startExternal", + "name": "Start External Output", + "destructive": false, + "timeout": 5000 + }, + { + "id": "stopExternal", + "name": "Stop External Output", + "destructive": false, + "timeout": 5000 } ] } diff --git a/packages/timeline-state-resolver/src/integrations/vmix/index.ts b/packages/timeline-state-resolver/src/integrations/vmix/index.ts index 2b49fd98e..21cbcc5ce 100644 --- a/packages/timeline-state-resolver/src/integrations/vmix/index.ts +++ b/packages/timeline-state-resolver/src/integrations/vmix/index.ts @@ -300,18 +300,18 @@ export class VMixDevice extends DeviceWithState> case VmixActions.SavePreset: return this._savePreset(payload as SavePresetPayload) as Promise> + case VmixActions.StartExternal: + return this._startExternalOutput() as Promise> + case VmixActions.StopExternal: + return this._stopExternalOutput() as Promise> default: return actionNotFoundMessage(actionId) } } _checkPresetAction(payload?: any, payloadRequired?: boolean): ActionExecutionResult | undefined { - if (!this._vMixConnection.connected) { - return { - result: ActionExecutionResultCode.Error, - response: t('Cannot perform VMix action without a connection'), - } - } + const connectionError = this._checkConnectionForAction() + if (connectionError) return connectionError if (payloadRequired) { if (!payload || typeof payload !== 'object') { @@ -358,6 +358,36 @@ export class VMixDevice extends DeviceWithState