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:
parent
74edf59ecb
commit
01d612cd05
1 changed files with 9 additions and 0 deletions
9
cimp.bas
9
cimp.bas
|
|
@ -249,6 +249,15 @@ while keyin<>27
|
|||
nyan = not nyan
|
||||
elseif left$(client_cmd, 10) = "SOUNDBANK:" then
|
||||
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
|
||||
volume = val(mid$(client_cmd, 5)) / 100
|
||||
if volume > 1 then volume = 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue