Hacky hack
See comment in code.
This commit is contained in:
parent
9945ba8bda
commit
777002030d
1 changed files with 13 additions and 4 deletions
17
cimp.bas
17
cimp.bas
|
|
@ -250,13 +250,22 @@ while keyin<>27
|
|||
elseif left$(client_cmd, 10) = "SOUNDBANK:" then
|
||||
loadsoundbank mid$(client_cmd,11)
|
||||
if _SNDPLAYING(musichandle) then
|
||||
oldhandle=musichandle
|
||||
|
||||
' a hack to make qb64pe load the midi file that is already loaded.
|
||||
' qb64 can't open the same file again with a new sound bank for some reason
|
||||
' so it has to be closed, freed and given a short delay before reloading
|
||||
' which gives a short break in the playing of music, very annoying.
|
||||
' this should be reverted if qb64pe ever gets the ability to reload the same
|
||||
' file more than once.
|
||||
|
||||
tmppos=_sndgetpos(musichandle)
|
||||
_sndstop musichandle
|
||||
_sndclose musichandle
|
||||
_delay .1
|
||||
musichandle=_sndopen(file(i))
|
||||
_sndvol musichandle,volume
|
||||
_sndsetpos musichandle,tmppos
|
||||
_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
|
||||
|
|
|
|||
Loading…
Reference in a new issue