This class is used to interface with CasparCG installations. It creates device states from timeline states and then diffs these states to generate commands. It depends on the DoOnTime class to execute the commands timely or, optionally, uses the CasparCG command scheduling features.

Hierarchy

  • DeviceWithState<State, DeviceOptionsCasparCGInternal>
    • CasparCGDevice

Constructors

Properties

_ccg: BasicCasparCGAPI

Setup in init

_commandReceiver: CommandReceiver = ...
_connected: boolean = false
_currentState: InternalState = ...
_deviceOptions: DeviceOptionsCasparCGInternal
_doOnTime: DoOnTime
_isActive: boolean = true
_queueOverflow: boolean = false
_reportAllCommands: boolean = false
_retryTime: null | number = null
_retryTimeout: undefined | Timeout
_transitionHandler: InternalTransitionHandler = ...
initOptions?: CasparCGOptions
useDirectTime: boolean = false

Accessors

Methods

  • Use either AMCP Command Scheduling or the doOnTime to execute commands at {@code time}.

    Parameters

    • commandsToAchieveState: AMCPCommandWithContext[]

      Commands to be added to queue

    • time: number

      Point in time to send commands at

    Returns void

  • Sends a command over a casparcg-connection instance

    Parameters

    • time: number

      deprecated

    • cmd: AMCPCommand

      Command to execute

    • context: string
    • timelineObjId: string

    Returns Promise<any>

  • Type Parameters

    • T extends keyof DeviceEvents

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]) => void)
        • (...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]): void
        • Parameters

          • Rest ...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]

          Returns void

    • Optional context: any

    Returns CasparCGDevice

  • Sets a windows outside of which all states will be removed.

    Parameters

    • removeBeforeTime: number
    • removeAfterTime: number

    Returns void

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends keyof DeviceEvents

    Parameters

    • event: T
    • Rest ...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns (keyof DeviceEvents)[]

  • Get the last known state at a point in time. Useful for creating device diffs.

    Todo

    is this literally the same as "getStateBefore(time + 1)"?

    Parameters

    • Optional time: number

    Returns null | {
        state: State;
        time: number;
    }

  • Get the last known state before a point time. Useful for creating device diffs.

    Parameters

    • time: number

    Returns null | {
        state: State;
        time: number;
    }

  • Return the number of listeners listening to a given event.

    Parameters

    • event: keyof DeviceEvents

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    • T extends keyof DeviceEvents

    Parameters

    • event: T

    Returns ((...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]) => void)[]

  • Prepares the physical device for playout. If amcp scheduling is used this tries to sync the timecode. If {@code okToDestroyStuff === true} this clears all channels and resets our states.

    Parameters

    • Optional okToDestroyStuff: boolean

      Whether it is OK to restart the device

    Returns Promise<void>

  • Type Parameters

    • T extends keyof DeviceEvents

    Parameters

    • event: T
    • Optional fn: ((...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]) => void)
        • (...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]): void
        • Parameters

          • Rest ...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns CasparCGDevice

  • Add a listener for a given event.

    Type Parameters

    • T extends keyof DeviceEvents

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]) => void)
        • (...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]): void
        • Parameters

          • Rest ...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]

          Returns void

    • Optional context: any

    Returns CasparCGDevice

  • Add a one-time listener for a given event.

    Type Parameters

    • T extends keyof DeviceEvents

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]) => void)
        • (...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]): void
        • Parameters

          • Rest ...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]

          Returns void

    • Optional context: any

    Returns CasparCGDevice

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optional event: keyof DeviceEvents

    Returns CasparCGDevice

  • Remove the listeners of a given event.

    Type Parameters

    • T extends keyof DeviceEvents

    Parameters

    • event: T
    • Optional fn: ((...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]) => void)
        • (...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]): void
        • Parameters

          • Rest ...args: ArgumentMap<DeviceEvents>[Extract<T, keyof DeviceEvents>]

          Returns void

    • Optional context: any
    • Optional once: boolean

    Returns CasparCGDevice

  • Saves a state on a certain time point. Overwrites any previous state saved at the same time. Removes any state after this time point.

    Parameters

    • state: State
    • time: number

    Returns void

  • The standDown event could be triggered at a time after broadcast The exact implementation differ between different devices

    Parameters

    • Optional _okToDestroyStuff: boolean

    Returns Promise<void>

Generated using TypeDoc