@ginden/blinkstick-v2 - v3.4.1
    Preparing search index...

    Class AnimationRunner

    This class is responsible for running animations on a Blinkstick device. It handles the animation loop, applying frames to the device, and managing the animation state.

    It's bound to a single Blinkstick device and can only run one animation at a time.

    Index

    Constructors

    Properties

    abortController: AbortController = ...
    blinkstick: BlinkstickAny
    buffer: Buffer<ArrayBuffer>
    isRunning: boolean = false
    ledCount: number
    ledGroup: LedGroup
    leds: Led[]

    Methods

    • Protected

      Applies a frame to the device and waits for the duration of the frame.

      Parameters

      • frame: Frame
      • signal: AbortSignal

      Returns Promise<void>

    • Parameters

      • animations: FrameIterable[]
      • __namedParameters: { signal?: AbortSignal } = {}

      Returns Promise<void>

      If the animation is already running, it will throw an error

      Will wait for the animation to finish before returning

    • Parameters

      • animations: FrameIterable[]
      • Optionalcb: (err: Error | null) => unknown
      • __namedParameters: { signal?: AbortSignal } = {}

      Returns void

      Optional callback will be called when the animation is finished (may be never)

    • Parameters

      • animations: FrameIterable[]
      • __namedParameters: { signal?: AbortSignal } = {}

      Returns Promise<void>

      If the animation is already running, it will be stopped

      You can pass an optional AbortSignal to cancel the animation at any time