Implements a Replayer track

Implements

Constructors

  • Creates a new track

    Parameters

    • name: string

      {string} - The name for the track.

    • album: string

      {string} - The album name, if any.

    • artist: string

      {string} - The artist name, if any.

    • preRoll: null | number

      {number | null} - The track's custom pre-roll duration, in [seconds]

    • initialPlayheadPosition: null | number

      {number | null} - The track's initial playhead position, in [seconds]. The value will be applied once after a media resource with a player has been mounted.

    • playbackRate: number

      {number} - The track's playback rate. If not finite, a default value is used.

    • pitchShift: number

      {number} - The track's pitch shift in [cents]. If not finite, a default value is used.

    • meter: null | IMeter
    • useMeasureNumbers: null | boolean
    • url: string

      {string} - The online URL (starting with http(s)) or the local file name (possibly including a path) for the media file. If it is relative, it may get made absolute using the compilation's media path.

    • id: string
    • cues: ICue[]
    • tags: Set<string>
    • duration: null | number

      {number | null} - Duration of the media associated with the track. This is not persisted, but set to a specific value once after a matching track has been loaded.

    • volume: number

      {volume} - Track volume.

    Returns Track

Properties

Album: string = ''

The album name where this track was taken from.

Remarks

This is a more descriptive information and not intended to uniquely identify an album.

Artist: string = ''

The artist

Cues: ICue[] = ...

The cues

Duration: null | number = null

The extracted duration of the loaded media file for this track.

Remarks

This is only defined if there is a loaded media file for this track.

Devdoc

This must get calculated/reset if the track is loaded/unloaded. It must never get persisted.

Id: string = ''

A unique identifier for this track.

Remarks

To work correctly, this identifier must be unique among all currenlty loaded compilations. Best, to make it universally unique by using a UUID.

Devdoc

This identifier allows to recognise this item over multiple edits

Meter: null | IMeter = null

The musical meter for this track

Remark

This is only relevant for music tracks.

Name: string = ''

The name of the track

PitchShift: number = DefaultPitchShift

The amount of pitch shift in [cents] (aka detune) at which the track's media is being played back. A value of 0, the default, indicates no shift.

Remarks

Not all types of track support a pitch shift.

PlaybackRate: number = DefaultPlaybackRate

The rate at which the track's media is being played back. A value of 1.0, the default, indicates normal speed.

Remarks

Not all types of track support a custom playback tempo.

PlayheadPosition: null | number = null

The track's (coarse, perodically persisted) playhead position, in [seconds].

Remarks

This is not necessarily exactly the current position in the playing media. This value is intended to be periodically updated only to remember the playback position a track (re-)load. When loading a track, the value will be applied once after a media resource with a player has been mounted. If not set, zero may be used

PreRoll: null | number = null

The track's custom pre-roll duration, in [seconds]

Remarks

If not set, the default pre-roll duration, if any, should be used at playback

Tags: Set<string> = ...

The tags

Remarks

The set of tags can be arbitrarily long. Tags classify a track.

Url: string = ''

The URL or the local file name (possibly including a path) for the media file.

Devdoc

If it is relative, it may get made absolute using the compilation's media path.

UseMeasureNumbers: null | boolean = null

Whether to use the measure number to set and display the cue positions

Volume: number = DefaultTrackVolume

The playback volume for this track in the range of [0..1].

Remarks

This can be set by the user, and is persisted.

Methods