Class BeatCue

The BeatCue defines some action which should be performed after x number of beats has passed.

Hierarchy

  • CueBase

    Hierarchy

    • BeatCue

Constructors

  • Parameters

    • metronome: IMetronome

      The metronome to use for counting beats.

    • beatCount: number

      The number of beats to wait before performing some action.

    • action: (() => void)

      The action to perform once the cue has finished waiting.

        • (): void
        • Returns void

    Returns BeatCue

Accessors

  • get action(): (() => void)
  • The action to perform once the cue has finished waiting.

    Returns (() => void)

      • (): void
      • The action to perform once the cue has finished waiting.

        Returns void

  • get beatCount(): number
  • The number of beats to wait before performing some action.

    Returns number

  • get finished(): ClockChildFinishedEvent
  • This event fires when the Cue finishes. This is included because it's part of the IClockChild definition. In practice, there's no reason to use it though, since the whole point of a Cue object is that it's already lining up some action to be performed once it finishes.

    Returns ClockChildFinishedEvent

  • get isFinished(): boolean
  • Signifies whether the Cue has stopped.

    Returns boolean

  • get metronome(): IMetronome
  • The metronome to use for counting beats.

    Returns IMetronome

  • get ref(): string
  • Provides a way of identifying cues so they can be easily retrieved later.

    Returns string

  • set ref(value: string): void
  • Parameters

    • value: string

    Returns void

  • get typeName(): string
  • Returns the name of this type. This can be used rather than instanceof which is sometimes unreliable.

    Returns string

Methods

  • Calling this tells the Cue to stop whatever it's doing and that it will no longer be used.

    Returns void

  • This method is intended to be called by a clock to provide regular updates. It should not be called by consumers of the library.

    Parameters

    • deltaMs: number

      How many milliseconds have passed since the last update cycle.

    Returns void

  • Provides a way for setting the ref through a chained function call. For example:

    clock.addChild(Cue.afterMs(100, console.log('Hello!')).withRef('cue'));
    

    Returns

    The calling object.

    Parameters

    • ref: string

      The ref to set on the object.

    Returns IClockChild

Generated using TypeDoc