芳醇な味わい
中2のときに作ったHSPのウンコード
onexit *clo
timei=0
buffer 1
picload "b.bmp"
screen 0,360,200
await 1
color 100,100,100 :boxf
*sta
title "MUSIC PLAYER ver.2.0 [FILE "+buf1+"]"
y=160
objsize 40,40
pos 40,y
objimage 1,0,0,0,40,0,80
button "",*mm
pos 80,y
objimage 1,40,0,40,40,40,80
button "",*ps
pos 120,y
objimage 1,80,0,80,40,80,80
button "",*pl
pos 160,y
objimage 1,120,0,120,40,120,80
button "",*st
pos 200,y
objimage 1,160,0,160,40,160,80
button "",*ho
pos 240,y
objimage 1,200,0,200,40,200,80
button "",*fop
pos 0,y
objimage 1,240,0,240,40,240,80
button "",*mt
pos 280,y
objsize 40,40
objimage 1,280,0,280,40,280,80
button "",*tt
pos 320,y
objsize 40,40
objimage 1,320,0,320,40,320,80
button "",*spl
stop
*mm
tmm=tmn-5000
if tmn<=5000 :mci "seek med to 0"
if tmn>5000 :mci "seek med to "+tmm
mci "play med"
goto *ctlm
*ps
mci "pause med"
goto *ctlm
*pl
mci "play med"
goto *ctlm
*st
mci "seek med to 0"
mci "stop med"
goto *ctlm
*ho
tmh=tmn+5000
if tmh>=tml :goto *ctlm
if tmn<tml :mci "seek med to "+tmh
mci "play med"
goto *ctlm
*ctlm
color 0,0,0 :boxf
color 240,240,20
mci "status med position"
tmn=stat
mi=strf("%02d",tmn/1000/60)
se=strf("%02d",tmn/1000\60)
tm=""+mi+":"+se+"/"+mi2+":"+se2+""
pos 0,0
font "msgosic",10
mes ""+buf1+""
pos 0,12
font "msgosic",36,1
mes tm
wait 50
goto *ctlm
*clo
mci "close med"
end
*fop
dialog "mp3;* .mid;* .wav",16,"オーディオファイル"
if stat=0 : goto *sta
buf1=refstr
wait 2
*fyo
mci "set med time format ms"
mci "open \""+buf1+"\" alias med"
mci "status med length"
tml=stat
mi2=strf("%02d",tml/1000/60)
se2=strf("%02d",tml/1000\60)
goto *sta
*mt
stop
*tt
stop
*spl
stop
使い方ヒント: 「これは臭う」という行を見付けたら、各行の
をクリックしてマーキングしておきましょう(要Twitter OAuth認証)
コメント投稿には、twitter認証が必要です。
Twitter認証
そもそもHSPはスパゲッティコードを作りやすいから仕方がない