feat: send osc

This commit is contained in:
Carlos Valente
2025-01-11 15:24:14 +01:00
committed by Carlos Valente
parent ab4dd300ca
commit 6c4d80158c
7 changed files with 401 additions and 19 deletions
@@ -9,9 +9,11 @@ import {
} from 'ontime-types';
import { getState, type RuntimeState } from '../../stores/runtimeState.js';
import { emitOSC } from './clients/osc.client.js';
import { emitHTTP } from './clients/http.client.js';
import { getAutomations, getBlueprints } from './automation.dao.js';
import { isOntimeCloud } from '../../externals.js';
/**
* Exposes a method for triggering actions based on a TimerLifeCycle event
@@ -94,9 +96,10 @@ function send(output: AutomationOutput[], state?: RuntimeState) {
const stateSnapshot = state ?? getState();
output.forEach((payload) => {
if (isOSCOutput(payload)) {
emitOSC();
}
if (isHTTPOutput(payload)) {
if (!isOntimeCloud) {
emitOSC(payload, stateSnapshot);
}
} else if (isHTTPOutput(payload)) {
emitHTTP(payload, stateSnapshot);
}
});