Track

Track

Class representing a track. Contains methods for parsing events and keeping track of pointer.

Constructor

new Track()

Source:

Methods

disable() → {Track}

Sets this track to be disabled during playback.
Source:
Returns:
Type:
Track

enable() → {Track}

Sets this track to be enabled during playback.
Source:
Returns:
Type:
Track

endOfTrack()

Returns true if pointer has reached the end of the track.
Source:
Parameters:
Type Description
boolean

getCurrentByte() → {number}

Gets byte located at pointer position.
Source:
Returns:
Type:
number

getDelta() → {number}

Get delta value at current pointer position.
Source:
Returns:
Type:
number

getDeltaByteCount() → {number}

Gets count of delta bytes and current pointer position.
Source:
Returns:
Type:
number

getStringData(eventStartIndex) → {string}

Get string data from event.
Source:
Parameters:
Name Type Description
eventStartIndex number
Returns:
Type:
string

handleEvent(currentTick, dryRun)

Handles event within a given track starting at specified index
Source:
Parameters:
Name Type Description
currentTick number
dryRun boolean If true events will be parsed and returned regardless of time.

parseEvent() → {object}

Parses event into JSON and advances pointer for the track
Source:
Returns:
Type:
object

reset() → {Track}

Resets all stateful track informaion used during playback.
Source:
Returns:
Type:
Track

setEventIndexByTick(tick) → {Track}

Sets the track event index to the nearest event to the given tick.
Source:
Parameters:
Name Type Description
tick number
Returns:
Type:
Track