#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
#deffunc mcimove int
mref position, 1
mci "seek _" + cntno + " to " + position
return
#deffunc mcicurrent
mci "status _" + cntno + " position"
return
#global
button "OPEN", *open
button "PLAY", *play
button "STOP", *suspend
button "MARK", *mark
button "MOVE", *seek
pos 100, 0
stop
*open
dialog "", 16, "再生するファイル"
if stat {
mciload refstr
mes "読み込みました"
}
stop
*play
mciplay "", ""
stop
*suspend
mcistop
stop
*mark
mcicurrent
position = stat
mes "マークしました[" + position + "ms]"
stop
*seek
mcimove position
mciplay "", ""
mes "移動しました"
stop
|