import { Api } from './api'; import { OmpAudioRouterState, OmpAudioRoutingConnection, OmpAudioRoutingPath } from '../video'; import { Observable } from 'rxjs'; import { OmpAudioRouterChangeEvent, OmpAudioRouterInputSoloMuteEvent } from '../types'; import { OmpAudioEffect, OmpAudioEffectFilter, OmpAudioEffectParam, OmpAudioEffectsGraph, OmpAudioEffectsGraphDef } from '../audio'; import { OmpAudioRouterInputSoloMuteState, OmpAudioRoutingInputType } from '../video/model'; /** * Audio router */ export interface AudioRouterApi extends Api { /** * Fires when {@link OmpAudioRouterState} changes */ onChange$: Observable; /** * Fires when {@link OmpAudioRouterInputSoloMuteState} changes */ onInputSoloMute$: Observable; /** * Updates routing connections * @param connections */ updateConnections(connections: OmpAudioRoutingConnection[]): void; /** * Creates {@link OmpAudioEffectsGraph}'s from provided {@link effectsGraphDef}'s to routing paths provided with {@link routingPath}.
* * If {@link routingPath} is not provided {@link OmpAudioEffectsGraph}s will be set on all available routing paths.
* If {@link routingPath.output} is not provided {@link OmpAudioEffectsGraph}s will be set on all available routing paths where {@link OmpAudioRoutingPath.input} = {@link routingPath.input}.
* If {@link routingPath.input} is not provided {@link OmpAudioEffectsGraph}s will be set on all available routing paths where {@link OmpAudioRoutingPath.output} = {@link routingPath.output}.
* * @param effectsGraphDef * @param routingPath */ setAudioEffectsGraphs(effectsGraphDef: OmpAudioEffectsGraphDef, routingPath?: Partial): Observable; /** * Removes {@link OmpAudioEffectsGraph}'s from routing paths provided with {@link routingPath}.
* * If {@link routingPath} is not provided {@link OmpAudioEffectsGraph}s will be removed on all available routing paths.
* If {@link routingPath.output} is not provided {@link OmpAudioEffectsGraph}s will be removed on all available routing paths where {@link OmpAudioRoutingPath.input} = {@link routingPath.input}.
* If {@link routingPath.input} is not provided {@link OmpAudioEffectsGraph}s will be removed on all available routing paths where {@link OmpAudioRoutingPath.output} = {@link routingPath.output}.
* * @param routingPath */ removeAudioEffectsGraphs(routingPath?: Partial): void; /** * @returns {@link OmpAudioEffectsGraph}'s from routing paths provided with {@link routingPath}.
* * @param routingPath */ findAudioEffectsGraphs(routingPath?: Partial): OmpAudioEffectsGraph[]; /** * Returns all audio effects that match {@link filter} * * @param filter */ findAudioEffects(filter?: { routingPath?: Partial; } & OmpAudioEffectFilter): OmpAudioEffect[]; /** * Sets {@link OmpAudioEffectParam} for audio effects that match {@link filter} * * @param param * @param filter */ setAudioEffectsParams(param: OmpAudioEffectParam, filter?: { routingPath?: Partial; } & OmpAudioEffectFilter): void; /** * Source {@link AudioNode} */ get sourceAudioNode(): AudioNode | undefined; /** * @returns audio router state */ getAudioRouterState(): OmpAudioRouterState; /** * @returns last changed (solo/mute/unsolo/unmute) audio router input state */ getAudioRouterInputSoloMuteState(): OmpAudioRouterInputSoloMuteState; /** * @returs audio router initial/default connections */ getInitialRoutingConnections(): OmpAudioRoutingConnection[]; /** * Overrides audio router initial/default connections * @param connections */ setInitialRoutingConnections(connections: OmpAudioRoutingConnection[]): void; /** * Solo or unsolo (depending on current input state) given audio router input * @param routingPath */ toggleSolo(routingPath: OmpAudioRoutingInputType): void; /** * Mute or unmute (depending on current input state) given audio router input * @param routingPath */ toggleMute(routingPath: OmpAudioRoutingInputType): void; /** * Reset all audio router inputs states */ resetInputsSoloMuteState(): void; }