transition anim for gapless play

This commit is contained in:
minjaesong
2023-12-28 21:37:17 +09:00
parent a4cb3f4d29
commit fe762e9396
3 changed files with 18 additions and 11 deletions

View File

@@ -277,12 +277,14 @@ class TerrarumMusicGovernor : MusicGovernor() {
}
// MixerTrackProcessor will call this function externally to make gapless playback work
fun pullNextMusicTrack(): MusicContainer {
fun pullNextMusicTrack(callNextMusicHook: Boolean = false): MusicContainer {
// prevent same song to play twice in row (for the most time)
if (musicBin.isEmpty()) {
restockMUsicBin()
}
return songs[musicBin.removeAt(0)]
return songs[musicBin.removeAt(0)].also { mus ->
if (musicStartHooks.isNotEmpty()) musicStartHooks.forEach { it(mus) }
}
}
// MixerTrackProcessor will call this function externally to make gapless playback work