mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-02 20:08:10 +03:00
Fix MAKO::check_music()
This fixes infinite loop in the opening demo of Only You, waiting for the end of the music.
This commit is contained in:
@@ -195,6 +195,10 @@ private class CddaPlayer(private val playlistPath: File) {
|
||||
private val player = MediaPlayer()
|
||||
private var playerPaused = false
|
||||
|
||||
init {
|
||||
player.setOnCompletionListener { currentTrack = 0 }
|
||||
}
|
||||
|
||||
fun start(track: Int, loop: Boolean) {
|
||||
val f = playlist.elementAtOrNull(track - 1)
|
||||
if (f.isNullOrEmpty()) {
|
||||
@@ -251,6 +255,10 @@ private class MidiPlayer {
|
||||
private var playing = false
|
||||
private var playerPaused = false
|
||||
|
||||
init {
|
||||
player.setOnCompletionListener { playing = false }
|
||||
}
|
||||
|
||||
fun start(path: String, loop: Boolean) {
|
||||
try {
|
||||
player.apply {
|
||||
|
||||
Reference in New Issue
Block a user