Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Automaton

IT'S AUTOMATON!

param

Serialized data of the automaton

param

Options for this Automaton instance

Hierarchy

  • Automaton

Index

Constructors

constructor

Properties

Protected __fxDefinitions

__fxDefinitions: {}

A map of fx definitions.

Type declaration

Protected __resolution

__resolution: number = 1000

Resolution of the timeline.

Protected __time

__time: number = 0

Current time of the automaton. Can be set by update, be retrieved by [[get time]], be used by auto

Protected __version

__version: string = process.env.VERSION!

Version of the automaton.

Readonly auto

auto: Automaton["__auto"] = this.__auto.bind( this )

It returns the current value of the Channel called name. If the name is an array, it returns a set of name : channel as an object instead. You can also give a listener which will be executed when the channel changes its value (optional).

param

The name of the channel

param

A function that will be executed when the channel changes its value

returns

Current value of the channel

Readonly channels

channels: Channel[] = []

Channels of the timeline.

Readonly curves

curves: Curve[] = []

Curves of the automaton.

Readonly mapNameToChannel

mapNameToChannel: Map<string, Channel> = new Map<string, Channel>()

Map of channels, name vs. channel itself.

Accessors

resolution

  • get resolution(): number
  • Resolution = Sampling point per second.

    Returns number

time

  • get time(): number

version

  • get version(): string

Methods

Protected __auto

  • __auto(name: string, listener?: undefined | ((event: ChannelUpdateEvent) => void)): number
  • Assigned to {@link Automaton#auto} on its initialize phase.

    Parameters

    • name: string

      The name of the channel

    • Optional listener: undefined | ((event: ChannelUpdateEvent) => void)

      A function that will be executed when the channel changes its value

    Returns number

    Current value of the channel

addFxDefinitions

  • addFxDefinitions(fxDefinitions: {}): void
  • Add fx definitions.

    Parameters

    • fxDefinitions: {}

      A map of id - fx definition

    Returns void

deserialize

getCurve

  • getCurve(index: number): Curve | null
  • Get a curve.

    Parameters

    • index: number

      An index of the curve

    Returns Curve | null

getFxDefinition

  • Get a fx definition. If it can't find the definition, it returns null instead.

    Parameters

    • id: string

      Unique id for the Fx definition

    Returns FxDefinition | null

precalcAll

  • precalcAll(): void

reset

  • reset(): void
  • Reset the internal states of channels. Call this method when you seek the time.

    Returns void

update

  • update(time: number): void
  • Update the entire automaton. You may want to call this in your update loop.

    Parameters

    • time: number

      Current time

    Returns void

Generated using TypeDoc