chooseTrack

fun chooseTrack(prefix: String = "", suffix: String = "Ambient", flags: EnumSet<MusicTrackChooserFlags> = EnumSet.noneOf(MusicTrackChooserFlags::class.java)): Boolean

Chooses and plays a music track using an adaptable approach - for details see the wiki. Called without parameters it will choose a new ambient music track and start playing it with fade-in/out. Will do nothing when no music files exist or the master volume is zero.

Return

true = success, false = no match, no playback change

Parameters

prefix

file name prefix, meant to represent Context - in most cases a Civ name

suffix

file name suffix, meant to represent Mood - e.g. Peace, War, Theme, Defeat, Ambient (Ambient is the default when a track ends and exists so War Peace and the others are not chosen in that case)

flags

a set of optional flags to tune the choice and playback.

fun chooseTrack(prefix: String = "", suffixes: List<String>, flags: EnumSet<MusicTrackChooserFlags> = EnumSet.noneOf(MusicTrackChooserFlags::class.java)): Boolean

Variant of chooseTrack that tries several moods (suffixes) until a match is chosen