#module
#deffunc mcisel int
mref no, 0
cntno = no
return
#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
#global
sdim list, 256
num = 10
notesel list
repeat num
noteadd "未登録" + cnt, -1
loop
objsize 200, 25
listbox item, 100, list
button "読込", *load
button "再生", *play
button "停止", *suspend
stop
*load
dialog "wav;*.mid;*.mp3;*.asf;*.wma", 16
if stat {
getpath tmp, refstr, 8
noteadd tmp, item, 1
mciload refstr, item
item.1 = item // リスト更新時に非選択となるので退避しておく
objprm 0, list
objprm 0, item.1 // 再度選択
}
stop
*play
mcisel item
mciplay "", ""
stop
*suspend
mcisel item
mcistop
stop
|