logoBMates

TimeIndicator

TimeIndicator is a class that visually represents the current time in the audio editing timeline. It indicates the playback position and helps users understand where they are in the audio track.

Related: Node

Properties

name: string

The name of the TimeIndicator. The default value is 'TimeIndicator'.

_time: number

The current time represented by the TimeIndicator.

style: EditorStyleType

Contains the style settings for the TimeIndicator.

Constructor

constructor(style: EditorStyleType)

style: EditorStyleType

The style settings for the TimeIndicator.

Methods

update (dT)

Updates the state of the TimeIndicator.

NameTypeDescription
dTnumberDelta time

draw (ctx)

Draws the TimeIndicator on the canvas.

NameTypeDescription
ctxCanvasRenderingContext2DThe rendering context for the drawing surface

setTime (time)

Sets the current time for the TimeIndicator.

NameTypeDescription
timenumberThe new time to set for the indicator.

getTime ()

Returns the current time of the TimeIndicator.

  • Return: number

Usage Example

const timeIndicatorStyle: EditorStyleType = {
  /* ... */
};

const timeIndicator = new TimeIndicator(timeIndicatorStyle);
this.add(timeIndicator);
PREVTimelineNEXTNode
logoBMates