Add reload file on soundbank change.

Code runs fine, but it seems qb64pe doesn't reload a midi file if it is
already loaded, even it the soundbank is changed, but now it's here if
they ever adds that capability.
This commit is contained in:
na 2026-09-07 10:38:00 +02:00
commit 01d612cd05

View file

@ -249,6 +249,15 @@ while keyin<>27
nyan = not nyan nyan = not nyan
elseif left$(client_cmd, 10) = "SOUNDBANK:" then elseif left$(client_cmd, 10) = "SOUNDBANK:" then
loadsoundbank mid$(client_cmd,11) loadsoundbank mid$(client_cmd,11)
if _SNDPLAYING(musichandle) then
oldhandle=musichandle
musichandle=_sndopen(file(i))
_sndvol musichandle,volume
_sndplay musichandle
_sndsetpos musichandle, _sndgetpos(oldhandle)
_sndstop oldhandle
_sndclose oldhandle
end if
elseif left$(client_cmd, 4) = "VOL:" then elseif left$(client_cmd, 4) = "VOL:" then
volume = val(mid$(client_cmd, 5)) / 100 volume = val(mid$(client_cmd, 5)) / 100
if volume > 1 then volume = 1 if volume > 1 then volume = 1