comments not needed here

This commit is contained in:
visionmercer 2026-06-09 11:03:47 +02:00
commit 0de770ce99

View file

@ -168,32 +168,24 @@ while keyin <> 27
if _sndgetpos(musichandle) = _sndlen(musichandle) then playnext = 1 if _sndgetpos(musichandle) = _sndlen(musichandle) then playnext = 1
if playnext <> 0 then if playnext <> 0 then
oldhandle = musichandle oldhandle = musichandle
' Check repeat settings before advancing the playlist index
if repeat = 1 and playnext = 1 then if repeat = 1 and playnext = 1 then
' Repeat current song: do not change index i
playnext = 0 playnext = 0
else else
' Advance or go back in playlist
i = i + playnext i = i + playnext
' Check boundary conditions based on repeat settings
if i > ubound(file) then if i > ubound(file) then
if repeat = -1 then if repeat = -1 then
i = 0 ' Loop back to start if repeat playlist is enabled i = 0
else else
goto quit ' Exit program if we reached the end of the files goto quit
end if end if
elseif i < lbound(file) then elseif i < lbound(file) then
if repeat = -1 then if repeat = -1 then
i = ubound(file) ' Loop to the end if navigating backwards i = ubound(file)
else else
i = lbound(file) ' Clamp to start if repeat is off i = lbound(file)
end if end if
end if end if
end if end if
' Only change song if playnext wasn't canceled by a track-level repeat
musichandle = _sndopen(file(i)) musichandle = _sndopen(file(i))
if musichandle <> 0 then if musichandle <> 0 then
_sndvol musichandle, volume _sndvol musichandle, volume