comments not needed here
This commit is contained in:
parent
a894f36ffa
commit
0de770ce99
1 changed files with 4 additions and 12 deletions
16
cimp.bas
16
cimp.bas
|
|
@ -168,32 +168,24 @@ while keyin <> 27
|
|||
if _sndgetpos(musichandle) = _sndlen(musichandle) then playnext = 1
|
||||
if playnext <> 0 then
|
||||
oldhandle = musichandle
|
||||
|
||||
' Check repeat settings before advancing the playlist index
|
||||
if repeat = 1 and playnext = 1 then
|
||||
' Repeat current song: do not change index i
|
||||
playnext = 0
|
||||
else
|
||||
' Advance or go back in playlist
|
||||
i = i + playnext
|
||||
|
||||
' Check boundary conditions based on repeat settings
|
||||
if i > ubound(file) then
|
||||
if repeat = -1 then
|
||||
i = 0 ' Loop back to start if repeat playlist is enabled
|
||||
i = 0
|
||||
else
|
||||
goto quit ' Exit program if we reached the end of the files
|
||||
goto quit
|
||||
end if
|
||||
elseif i < lbound(file) then
|
||||
if repeat = -1 then
|
||||
i = ubound(file) ' Loop to the end if navigating backwards
|
||||
i = ubound(file)
|
||||
else
|
||||
i = lbound(file) ' Clamp to start if repeat is off
|
||||
i = lbound(file)
|
||||
end if
|
||||
end if
|
||||
end if
|
||||
|
||||
' Only change song if playnext wasn't canceled by a track-level repeat
|
||||
musichandle = _sndopen(file(i))
|
||||
if musichandle <> 0 then
|
||||
_sndvol musichandle, volume
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue