Options
All
  • Public
  • Public/Protected
  • All
Menu

Class CurveWithGUI

It represents a channel of Automaton. It has even more pretty APIs than raw Curve yay

param

Parent automaton

param

Data of the channel

Hierarchy

Index

Constructors

constructor

Properties

$id

$id: string

Protected __automaton

__automaton: AutomatonWithGUI

The parent automaton.

Protected Optional __eventListeners

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

Protected __fxs

__fxs: Array<FxSection & WithBypass & WithID>

List of fx sections.

Protected __nodes

__nodes: Array<BezierNode & WithID>

List of bezier nodes.

Protected __shouldNotInterpolate

__shouldNotInterpolate: Uint8Array

An array of bool where you do not want to interpolate the value. Its length is same as curve.__automaton.resolution * curve.__automaton.length + 1.

Private __throttlePreviewTime

__throttlePreviewTime: Throttle

Limiting the emit of previewTime because it's too much

Private __userCount

__userCount: number = 0

I'm crying

Protected __values

__values: Float32Array

An array of precalculated value. Its length is same as curve.__automaton.resolution * curve.__automaton.length + 1.

Protected __valuesWithoutFxs

__valuesWithoutFxs: Float32Array

__values but without fxs.

deserialize

  • deserialize(data: SerializedCurve): void

serialize

  • serialize(): SerializedCurve

Accessors

fxs

isUsed

  • get isUsed(): boolean

length

  • get length(): number
  • The length of this curve.

    Returns number

nodes

  • get nodes(): Array<BezierNode & WithID>

status

Methods

Protected __applyFxs

  • __applyFxs(): void
  • The second step of precalc: apply fxs to the generated curves.

    Returns void

Protected __clearStatus

  • __clearStatus(): void

Protected __deleteStatus

Protected __emit

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

Protected __generateCurve

  • __generateCurve(): void

Private __getFreeRow

  • __getFreeRow(_time: number, _length: number, _row?: number): number

Private __getFxIndexById

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

    Parameters

    • id: string

      Id of section you want to grab

    Returns number

    The index of the section

Private __getNodeIndexById

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

    Parameters

    • id: string

      Id of node you want to grab

    Returns number

    The index of the node

Private __serializeFxs

  • __serializeFxs(): SerializedFxSection[] | undefined

Private __serializeNodes

  • __serializeNodes(): SerializedBezierNode[]

Protected __setStatus

Private __sortFxs

  • __sortFxs(): void

Private __sortNodes

  • __sortNodes(): void

Private __watchStatus

  • __watchStatus(procedure: () => void): void
  • Watch for status changes. Execute given procedure immediately. If the procedure changes its status, emit an event.

    Parameters

    • procedure: () => void

      A procedure that might change its status

        • (): void
        • Returns void

    Returns void

bypassFx

  • bypassFx(id: string, bypass: boolean): void

changeFxParam

  • changeFxParam(id: string, name: string, value: any): void

changeFxRow

  • changeFxRow(id: string, row: number): void

createFx

  • createFx(time: number, length: number, def: string): (FxSection & WithBypass & WithID) | null

createFxFromData

createNode

  • createNode(time: number, value: number): BezierNode & WithID

createNodeFromData

  • createNodeFromData(node: BezierNode & WithID): BezierNode & WithID

decrementUserCount

  • decrementUserCount(): void

emitPreviewTime

  • emitPreviewTime(event: CurveWithGUIEvents["previewTime"]): void

forceMoveFx

  • forceMoveFx(id: string, time: number, row: number): void

getFx

getFxByIndex

getNextNode

  • getNextNode(id: string): (BezierNode & WithID) | null
  • Dump data of a next node from a specified node. It might return null when the specified node is the last node.

    Parameters

    • id: string

      Id of the node you want to refer

    Returns (BezierNode & WithID) | null

    Data of the next node

getNode

  • getNode(id: string): BezierNode & WithID

getNodeByIndex

  • getNodeByIndex(index: number): BezierNode & WithID

getNumNode

  • getNumNode(): number

getPreviousNode

  • getPreviousNode(id: string): (BezierNode & WithID) | null
  • Dump data of a previous node from a specified node. It might return null when the specified node is the first node.

    Parameters

    • id: string

      Id of the node you want to refer

    Returns (BezierNode & WithID) | null

    Data of the previous node

getSpecificStatus

  • getSpecificStatus<T>(code: T): Status<T> | null

getValue

  • getValue(time: number): number
  • Return the value of specified time point.

    Parameters

    • time: number

      Time at the point you want to grab the value.

    Returns number

    Result value

getValueWithoutFxs

  • getValueWithoutFxs(time: number): number

incrementUserCount

  • incrementUserCount(): void

isFirstNode

  • isFirstNode(id: string): boolean

isLastNode

  • isLastNode(id: string): boolean

moveFx

  • moveFx(id: string, time: number): void

moveHandleTime

  • moveHandleTime(id: string, dir: "in" | "out", time: number): void

moveHandleValue

  • moveHandleValue(id: string, dir: "in" | "out", value: number): void

moveNodeTime

  • moveNodeTime(id: string, time: number): void

moveNodeValue

  • moveNodeValue(id: string, value: number): void

off

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

on

precalc

  • precalc(): void

removeFx

  • removeFx(id: string): void

removeNode

  • removeNode(id: string): void

resetHandle

  • resetHandle(id: string, dir: "in" | "out"): void

resizeFx

  • resizeFx(id: string, length: number): void

resizeFxByLeft

  • resizeFxByLeft(id: string, length: number): void

serializeWithID

  • serializeWithID(): SerializedCurve & WithID

Object literals

Static Readonly DEFAULT_DATA

DEFAULT_DATA: object

Default data of a curve.

fxs

fxs: never[] = []

nodes

nodes: [number, number, number, number, number, number][] = [[ 0.0, 0.0, 0.0, 0.0, CURVE_DEFAULT_HANDLE_LENGTH, 0.0 ],[ 1.0, 0.0, -CURVE_DEFAULT_HANDLE_LENGTH, 0.0, 0.0, 0.0 ],]

Generated using TypeDoc