Package mindustry.audio
Class SoundControl
java.lang.Object
mindustry.audio.SoundControl
Controls playback of multiple audio tracks.
-
Nested Class Summary
-
Field Summary
Modifier and TypeFieldDescriptionnormal, ambient music, plays at any timemusic used explicitly after boss spawnsprotected Music
darker music, used in times of conflictprotected float
protected AudioFilter
float
float
protected Music
float
float
float
protected boolean
protected ObjectMap<Sound,
SoundControl.SoundData> protected Interval
protected AudioBus
protected boolean
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
isDark()
Whether to play dark music.void
void
protected void
Plays and fades in a music track.protected void
Plays a music track once and only once.void
Plays a random track.protected void
reload()
protected void
protected boolean
protected void
silence()
Fades out the current track, unless it has already been silenced.void
stop()
void
update()
Update and play the right music track.protected void
-
Field Details
-
finTime
public float finTime -
foutTime
public float foutTime -
musicInterval
public float musicInterval -
musicChance
public float musicChance -
musicWaveChance
public float musicWaveChance -
ambientMusic
normal, ambient music, plays at any time -
darkMusic
darker music, used in times of conflict -
bossMusic
music used explicitly after boss spawns -
lastRandomPlayed
-
timer
-
current
-
fade
protected float fade -
silenced
protected boolean silenced -
uiBus
-
wasPlaying
protected boolean wasPlaying -
filter
-
sounds
-
-
Constructor Details
-
SoundControl
public SoundControl()
-
-
Method Details
-
setupFilters
protected void setupFilters() -
reload
protected void reload() -
loop
-
loop
-
stop
public void stop() -
update
public void update()Update and play the right music track. -
updateLoops
protected void updateLoops() -
playRandom
public void playRandom()Plays a random track. -
isDark
protected boolean isDark()Whether to play dark music. -
play
Plays and fades in a music track. This must be called every frame. If something is already playing, fades out that track and fades in this new music. -
playOnce
Plays a music track once and only once. If something is already playing, does nothing. -
shouldPlay
protected boolean shouldPlay() -
silence
protected void silence()Fades out the current track, unless it has already been silenced.
-