Options
All
  • Public
  • Public/Protected
  • All
Menu

Class AutomatonWithGUI

IT'S AUTOMATON!

Hierarchy

Implements

Index

Constructors

constructor

Properties

Protected Optional __eventListeners

__eventListeners: Map<keyof AutomatonWithGUIEvents, EventListener<any>[]>

Protected __fxDefinitions

__fxDefinitions: {}

A map of fx definitions.

Type declaration

  • [name: string]: FxDefinition

Private Optional __guiRemocon

__guiRemocon: GUIRemocon | null

This enables the Automaton instance to be able to communicate with GUI.

Private __guiSettings

__guiSettings: GUISettings

GUI settings for this automaton.

Private __isDisabledChannelNotUsedWarning

__isDisabledChannelNotUsedWarning: boolean = false

Whether it disables not used warning for channels or not. Can be specified via AutomatonWithGUIOptions.

Protected __isPlaying

__isPlaying: boolean

It's currently playing or not.

Protected __labels

__labels: {}

Labels.

Type declaration

  • [name: string]: number

Private __lengthPrev

__lengthPrev: number = 1

A cache of previous length. You should not touch this from any place but __tryUpdateLength.

Private __loopRegion

__loopRegion: { begin: number; end: number } | null = null

Timeline will loop between these timepoints.

Private Optional __parentNode

__parentNode: HTMLElement | null

Mounted point of its GUI.

Protected __resolution

__resolution: number

Resolution of the timeline.

Private __shouldSave

__shouldSave: boolean = false

Whether it has any changes that is not saved yet or not.

Protected __time

__time: number

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

Protected __version

__version: string = process.env.VERSION!

Version of the automaton.

Readonly auto

auto: Automaton["__auto"]

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: ChannelWithGUI[]

Channels of the timeline.

Readonly curves

curves: CurveWithGUI[]

Curves of the automaton.

Readonly mapNameToChannel

mapNameToChannel: BiMap<string, ChannelWithGUI>

Map of channels, name vs. channel itself.

Optional overrideSave

overrideSave: undefined | (() => void)

Overrided save procedure. Originally intended to be used by automaton-electron. Can also be specified via AutomatonWithGUIOptions.

Optional saveContextMenuCommands

saveContextMenuCommands: Array<ContextMenuCommand>

Define what to do with the context menu when you click the save icon on the header. Originally intended to be used by automaton-electron. Can also be specified via AutomatonWithGUIOptions.

Accessors

channelNames

  • get channelNames(): string[]

fxDefinitions

  • get fxDefinitions(): {}

guiSettings

isPlaying

  • get isPlaying(): boolean

labels

  • get labels(): {}

length

  • get length(): number

loopRegion

  • get loopRegion(): { begin: number; end: number } | null

resolution

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

    Returns number

shouldSave

  • get shouldSave(): boolean
  • set shouldSave(shouldSave: boolean): void

time

  • get time(): number
  • Current time of the automaton, that is set via update.

    Returns number

version

  • get version(): string
  • Version of the automaton.

    Returns string

Methods

Protected __auto

  • __auto(name: string, listener?: undefined | ((event: ChannelUpdateEvent) => void)): number
  • Assigned to Automaton.auto at constructor.

    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

Protected __emit

  • __emit<TType>(...__namedParameters: [undefined | TEvents[TType]]): void

Private __serializeChannels

  • __serializeChannels(): [name: string, channel: SerializedChannel][]

Private __serializeCurves

  • __serializeCurves(): SerializedCurve[]

Private __tryUpdateLength

  • __tryUpdateLength(): void

addFxDefinitions

  • addFxDefinitions(fxDefinitions: {}): void

countChannels

  • countChannels(): number

createChannel

  • createChannel(name: string, data?: SerializedChannel, index?: undefined | number): ChannelWithGUI

createCurve

createOrOverwriteChannel

  • createOrOverwriteChannel(name: string, data?: SerializedChannel, index?: undefined | number): ChannelWithGUI

cueReset

  • cueReset(): void

deleteLabel

  • deleteLabel(name: string): void

deserialize

generateDefaultFxParams

  • generateDefaultFxParams(id: string): {}

getChannel

getChannelIndex

  • getChannelIndex(name: string): number

getCurve

getCurveById

getCurveIndex

getCurveIndexById

  • getCurveIndexById(id: string): number
  • Search for a curve that has given id then return index of it. If it couldn't find the curve, it will throw an error instead.

    Parameters

    • id: string

      Id of the curve you want to grab

    Returns number

    The index of the curve

getFxDefinition

  • getFxDefinition(id: string): FxDefinition | null
  • 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

getFxDefinitionDescription

  • getFxDefinitionDescription(id: string): string | null
  • Return description of a fx definition. If it can't find the fx definition, it returns null instead.

    Parameters

    • id: string

      Id of the fx definition you want to grab

    Returns string | null

    Description of the fx definition

getFxDefinitionIds

  • getFxDefinitionIds(): string[]

getFxDefinitionName

  • getFxDefinitionName(id: string): string | null
  • Return display name of a fx definition. If it can't find the fx definition, it returns null instead.

    Parameters

    • id: string

      Id of the fx definition you want to grab

    Returns string | null

    Name of the fx definition

getFxDefinitionParams

  • getFxDefinitionParams(id: string): {} | null

getOrCreateChannel

mountGUI

  • mountGUI(target: HTMLElement): void

off

  • off<TType>(type: TType, listener: EventListener<AutomatonWithGUIEvents[TType]>): void

on

openAbout

  • openAbout(): void

pause

  • pause(): void

play

  • play(): void

precalcAll

  • precalcAll(): void
  • Precalculate all curves.

    Returns void

redo

  • redo(): void

removeChannel

  • removeChannel(name: string): void

removeCurve

  • removeCurve(curveId: string): void

reorderChannels

  • reorderChannels(name: string, isRelative?: boolean): (index: number) => ChannelWithGUI[]

reset

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

    Returns void

seek

  • seek(time: number): void

serialize

setGUISettings

  • setGUISettings<T>(key: T, value: GUISettings[T]): void

setLabel

  • setLabel(name: string, time: number): void

setLoopRegion

  • setLoopRegion(loopRegion: { begin: number; end: number } | null): void

setResolution

  • setResolution(resolution: number): void

toasty

togglePlay

  • togglePlay(): void

undo

  • undo(): void

unmountGUI

  • unmountGUI(): void

update

  • update(time: number): void

Static compat

Static minimizeData

Generated using TypeDoc