Class Device<TOptions>Abstract

Base class for all Devices to inherit from. Defines the API that the conductor class will use.

Type Parameters

Hierarchy

  • EventEmitter<DeviceEvents>
    • Device

Implements

  • IDevice<TOptions>

Constructors

  • Type Parameters

    Parameters

    • deviceId: string
    • deviceOptions: TOptions
    • getCurrentTime: (() => Promise<number>)
        • (): Promise<number>
        • Returns Promise<number>

    Returns Device<TOptions>

Properties

_currentTimeDiff: number = 0
_currentTimeUpdated: number = 0
_deviceId: string
_deviceOptions: TOptions
_getCurrentTime: undefined | (() => number | Promise<number>)
_instanceId: number
_isActive: boolean = true
_reportAllCommands: boolean = false
_startTime: number
debugLogging: boolean
debugState: boolean
useDirectTime: boolean = false

Accessors

Methods

  • 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 Device<TOptions>

  • 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)[]

  • Connect to the device, resolve the promise when ready.

    Parameters

    • initOptions: TOptions["options"]

      Device-specific options

    • Optional activeRundownPlaylistId: string

      ID of active rundown playlist

    Returns Promise<boolean>

  • 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)[]

  • The makeReady method could be triggered at a time before broadcast Whenever we know that the user want's to make sure things are ready for broadcast The exact implementation differ between different devices

    Parameters

    • Optional _okToDestroyStuff: boolean
    • Optional _activeRundownId: string

    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 Device<TOptions>

  • 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 Device<TOptions>

  • 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 Device<TOptions>

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

    Parameters

    • Optional event: keyof DeviceEvents

    Returns Device<TOptions>

  • 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 Device<TOptions>

  • 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