#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 mcigetstat
mci "status _" + cntno + " mode"
return
#global
objsize 40, 40
font "webdings", 20 : objmode 2
pos 10, 10 : button "6", *open
pos 60, 10 : button "4", *play
*@
wait 50
mcigetstat
if refstr ! state : gosub *button_change
goto *@b
*open
dialog "", 16
if stat : mciload refstr
goto *@b
*play
mcigetstat
if refstr = "playing" : mcistop : else : mciplay "", "", 1
goto *@b
*button_change
state = refstr
if state = "playing" : objprm 1, ";" : else : objprm 1, "4"
return
|