From 01d612cd057fa7cad70c4712ceac114589d353c2 Mon Sep 17 00:00:00 2001 From: na Date: Mon, 7 Sep 2026 10:38:00 +0200 Subject: [PATCH] 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. --- cimp.bas | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cimp.bas b/cimp.bas index 5733d89..07fb0e8 100644 --- a/cimp.bas +++ b/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