ll_libload winmm, "winmm.dll"
ll_getproc mciGetErrorStringA, "mciGetErrorStringA", winmm
#module
#deffunc mciload str, int
mref file, 32 : mref no, 1
cntno = no
mci "close _" + cntno
strmid i, file, , 2 : int i
if i {
file = "cdaudio!?"
poke file, 8, i + 64
}
mci "open \"" + file + "\" alias _" + cntno
return
#deffunc mciplay str, str, int
mref start, 32 : mref finish, 33
mref re, 2
if start ! "" : s = " from " + start : else : s = ""
if finish ! "" : s += " to " + finish
if re : s += " repeat"
mci "play _" + cntno + s
return
#deffunc mcistop
mci "stop _" + cntno
return
#deffunc mciend onexit
mci "stop all"
mci "close all"
return
#deffunc mciresult int
mref code, 0
mref rstr, 65
ll_getptr rstr : ll_ret i
prm = code, i, 128
ll_callfunc prm, 3, mciGetErrorStringA@ // エラー内容を取得する
return
#global
dialog "", 16
if stat = 0 : end
mciload refstr
mciresult stat
mes refstr
mciplay "", ""
mciresult stat
mes refstr
wait 300
mcistop
mciresult stat
mes refstr
stop
|