casparcg-state
Version:
Node.js Javascript/Typescript library for keeping and resolving a given state of CasparCG into commands for casparcg-connection.
38 lines • 2.92 kB
TypeScript
import { Channel, MediaLayer, NextUpMedia, NextUp, LayerBase, State } from './api';
import { AMCPCommandWithContext, DiffCommands } from './casparCGState';
import { AMCPCommand } from 'casparcg-connection';
import { InternalLayer, InternalState } from './stateObjectStorage';
export declare function frames2Time(frames: number, fps: number | undefined): number;
export declare function time2Frames(time: number, fps: number | undefined): number;
export declare function frames2TimeChannel(frames: number, newChannel: Channel, oldChannel?: Channel): number;
export declare function time2FramesChannel(time: number, newChannel: Channel, oldChannel?: Channel): number;
/**
* Calculate seek time needed to make the clip to play in sync
* Returns seek, in frames
*/
export declare function calculateSeek(newChannel: Channel, oldChannel: Channel, layer: MediaLayer | NextUpMedia, timeSincePlay: number | null): number;
export declare function calculatePlayAttributes(timeSincePlay: number | null, nl: MediaLayer | NextUp, newChannel: Channel, oldChannel: Channel): {
inPointFrames: number | undefined;
lengthFrames: number | undefined;
seekFrames: number;
looping: boolean;
channelLayout: string | undefined;
};
export declare function getTimeSincePlay(layer: MediaLayer, currentTime: number, minTimeSincePlay: number): number | null;
export declare function fixPlayCommandInput<T extends object>(o: T): T;
export declare function compareAttrs<T extends {
[key: string]: any;
}>(obj0: T | undefined, obj1: T | undefined, attrs: Array<keyof T>, minTimeSincePlay?: number, // [ms]
strict?: boolean): null | string;
export declare function addContext<T extends AMCPCommand>(cmd: T, context: string, layer: LayerBase | null): AMCPCommandWithContext;
export declare function addContext<T extends AMCPCommand>(cmd: T, context: string, layer: LayerBase | null): AMCPCommandWithContext;
export declare function isIAMCPCommand(cmd: any): cmd is AMCPCommand;
export declare function setTransition(options: any | null, channel: Channel, oldLayer: LayerBase, content: unknown, isRemove: boolean, isBg?: boolean): void;
export declare function setMixerTransition(options: any | null, channel: Channel, oldLayer: LayerBase, content: unknown, isRemove: boolean): void;
export declare function setDefaultValue(obj: any | Array<any>, key: string | Array<string>, value: unknown): void;
export declare function compareMixerValues(layer: LayerBase, oldLayer: InternalLayer, attr: string, attrs?: Array<string>): string | null;
export declare function getChannel(state: State | InternalState, channelNo: string): Channel;
export declare function getLayer(state: State | InternalState, channelNo: string, layerNo: string): LayerBase;
export declare function addCommands(diff: DiffCommands, ...commands: Array<AMCPCommandWithContext>): void;
export declare function literal<T>(o: T): T;
//# sourceMappingURL=util.d.ts.map