onexit *exit sdim cl:cl=cmdline strmid comm,cl,1,4 if comm="play" :strmid opt,cl,5,60:gosub *cd_play if comm="stop" :gosub *cd_stop if comm="seek" :strmid trs,cl,5,10:gosub *tr_sel if comm!"" :end title "簡易CDプレーヤー" screen 0,200,50:cls 1 objsize 32,24 pos 0,0:button "|<<",*but pos 32,0:button "<<",*but pos 64,0:button ">",*but pos 96,0:button "ロ",*but pos 128,0:button ">>",*but pos 160,0:button ">>|",*but gsel 0,1 stop *but mode=stat if mode=0 :trs="s":gosub *tr_sel if mode=1 :trs="-":gosub *tr_sel if mode=2 :gosub *cd_play if mode=3 :gosub *cd_stop if mode=4 :trs="+":gosub *tr_sel if mode=5 :trs="e":gosub *tr_sel title "curtr="+tr+" max="+tr_max stop *exit mci "close CDAudio" end *tr_sel mci "status CDAudio current track" tr=stat mci "status CDAudio number of tracks" tr_max=stat if trs="-" :tr-- if trs="+" :tr++ if trs="s" :tr=1 if trs="e" :tr=tr_max if tr>tr_max :tr=1 tmp=trs int tmp if tmp>0 :tr=trs mci "open CDAudio" mci "set CDAudio time format tmsf" mci "play CDAudio from "+tr mci "close CDAudio" return *cd_play str tr_st str tr_en getstr tr_st,opt,0,'-' getstr tr_en,opt,strsize,'-' pp="" if tr_st!"" :pp=" from "+tr_st :if tr_en!"" :pp+=" to "+tr_en mci "open CDAudio" mci "set CDAudio time format tmsf" mci "play CDAudio"+pp mci "close CDAudio" return *cd_stop mci "stop CDAudio" return