@ginden/blinkstick-v2
    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>

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

      Will wait for the animation to finish before returning

      Parameters

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

      Returns Promise<void>

    • Will replace the current animation and run the new one Optional callback will be called when the animation is finished

      Parameters

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

      Returns void

    • Runs the animation, replacing the current one

      If the animation is already running, it will be stopped

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

      Parameters

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

      Returns Promise<void>