Table of Contents

Interface IMusicTrack

Namespace
Vintagestory.API.Client
Assembly
VintagestoryAPI.dll
public interface IMusicTrack

Properties

IsActive

Is the track active?

bool IsActive { get; }

Property Value

bool

Name

The name of the track

string Name { get; }

Property Value

string

PositionString

string PositionString { get; }

Property Value

string

Priority

The priority of the track. A higher priority will cancel active tracks.

float Priority { get; }

Property Value

float

StartPriority

The start priority of the track. A higher priority will leave active tracks playing.

float StartPriority { get; }

Property Value

float

Methods

BeginPlay(TrackedPlayerProperties)

Begin playing the current track.

void BeginPlay(TrackedPlayerProperties props)

Parameters

props TrackedPlayerProperties

Player Properties

BeginSort()

Called before sorting by start priority happens

void BeginSort()

ContinuePlay(float, TrackedPlayerProperties)

Is it cool for the current track to continue playing?

bool ContinuePlay(float dt, TrackedPlayerProperties props)

Parameters

dt float

Delta Time/Change in time.

props TrackedPlayerProperties

Track properties.

Returns

bool

Cool or not cool?

FadeOut(float, Action)

Called when the track to interupted or when Update() returned false. So called every time the tracked ended or has to end

void FadeOut(float seconds, Action onFadedOut = null)

Parameters

seconds float
onFadedOut Action

FastForward(float)

void FastForward(float seconds)

Parameters

seconds float

Initialize(IAssetManager, ICoreClientAPI, IMusicEngine)

Initialization of the Music Track.

void Initialize(IAssetManager assetManager, ICoreClientAPI capi, IMusicEngine musicEngine)

Parameters

assetManager IAssetManager

the global Asset Manager

capi ICoreClientAPI

The Core Client API

musicEngine IMusicEngine

ShouldPlay(TrackedPlayerProperties, ClimateCondition, BlockPos)

Should this current track play?

bool ShouldPlay(TrackedPlayerProperties props, ClimateCondition conds, BlockPos pos)

Parameters

props TrackedPlayerProperties

Player Properties

conds ClimateCondition
pos BlockPos

Returns

bool

Should we play the current track?

UpdateVolume()

Updates the volume on the current track.

void UpdateVolume()