Tape Deck by JJF July 1994 (c) JJF 1994 ".Lib" ft%=&BBB monitor%= blk% &100,dat% &100,menu% &400,menu2% &200,menu3% &200,menuind% &100 ind% &2800,info% &200,index% &2800,fileinfo% &400,tuneinfo% &400 control% &800,save% &400 "Wimp_Initialise",200,&4B534154,"Tape Deck" assemble #*IconSprites .Sprites "Wimp_OpenTemplate",,".Templates" "Wimp_LoadTemplate",,info%,ind%,ind%+&FF,-1,"Info" "Wimp_CreateWindow",,info% infoh% "Wimp_LoadTemplate",,index%,ind%+&100,ind%+&1FFF,-1,"Index" "Wimp_CreateWindow",,index% indexh% "Wimp_LoadTemplate",,fileinfo%,ind%+&2000,ind%+&20FF,-1,"FileInfo" "Wimp_CreateWindow",,fileinfo% fileinfoh% "Wimp_LoadTemplate",,tuneinfo%,ind%+&2100,ind%+&21FF,-1,"TuneInfo" "Wimp_CreateWindow",,tuneinfo% tuneinfoh% "Wimp_LoadTemplate",,control%,ind%+&2200,ind%+&23FF,-1,"Control" "Wimp_CreateWindow",,control% controlh% "Wimp_LoadTemplate",,save%,ind%+&2400,ind%+&24FF,-1,"Save" "Wimp_CreateWindow",,save% saveh% "Wimp_CloseTemplate" drag_init settext(infoh%,1,"Tape Deck (unregistered)") pos%=4 loop=1 settext(indexh%,pos%, (loop)) pos%+=5 ,Lblk%!0=-1:blk%!4=0:blk%!8=0:blk%!12=68:blk%!16=68:blk%!20=(3<<12)+%11010 $(blk%+24)="!TapeDeck" "Wimp_CreateIcon",,blk% iconbarh% settext(controlh%,7,"stopp") dummy%= type$(5) 5?type$()="","Symphony","Coco","Tracker","Krisalis","Tracker" nolists%=8 name$(nolists%,50),author$(nolists%,50),type%(nolists%,50),path$(nolists%,50),list$(nolists%),entries%(nolists%) loop=1 nolists%:list$(loop)="List no "+ (loop):entries%(loop)=0: curlist%=1 curmenu%=0 seltune%=0 file$="IndexFile" loadedtune%=0 loadedlist%=0 status%=0:status2%=0 tunelen$="0000":tunepos%=0 tunefin%= :maxsofar%=0 vol%=64: changevolume(0) arcfs%= checkload error a GOTO points to here - don't change the line numbers! "Wimp_Poll",0,blk% reason% reason% "Wimp_OpenWindow",,blk% "Wimp_CloseWindow",,blk% click draggedbox select 17,18: message status%=3 update status%=3 status2%>0 tunefin%= cycle message blk%!16 cleartune: "Wimp_CloseDown": savedata 3,5: recieve: "Hourglass_Off" 1282: click mx%=!blk%:my%=blk%!4 blk%!8=2 blk%!12=-2 iconbarmenu: blk%!8=4 blk%!12=-2 openindex: opencontrol: blk%!8=1 blk%!12=-2 status%=3 monitor: blk%!8=2 blk%!12=indexh% indexmenu: blk%!8=4 blk%!12=indexh% endcycle: seltune(curlist%,((blk%!16)+1) error%= loadtune: playtune: blk%!8=1 blk%!12=indexh% endcycle: seltune(curlist%,((blk%!16)+1) error%= loadtune: monitor: (blk%!8=4 blk%!8=1) blk%!12=controlh% clickcontrol blk%!12=saveh% blk%!16 savedata2 select curmenu% blk%!0 openindex opencontrol monitor blk%!4<>-1 arcfs%= arcfs%= blk%!4<>-1 arcfs%= cleartune: "Wimp_CloseDown": blk%!0 blk%!4 blk%!8>-1 name$(curlist%,seltune%)= ctrlstring(menuind%+15): settext(indexh%,((seltune%-1)*5)+5,name$(curlist%,seltune%)): loadedlist%=curlist% loadedtune%=seltune% settext(controlh%,0,name$(curlist%,seltune%)) blk%!8>-1 author$(curlist%,seltune%)= ctrlstring(menuind%+50): settext(indexh%,((seltune%-1)*5)+6,author$(curlist%,seltune%)) blk%!8>-1 delete opendir blk%!4>-1 oldlist%=curlist%:curlist%=(blk%!4)+1: entries%(curlist%)>entries%(oldlist%) entries%(curlist%)=entries%(oldlist%) indexdata(curlist%,entries%(curlist%)) indexdata(curlist%,entries%(oldlist%)) blk%!4=0 list$(curlist%)= ctrlstring(menuind%) blk%!4 namesort authorsort fnamesort blk%!0 saveh%: blk%!24=13 savedata2 "Wimp_ProcessKey",blk%!24 iconbarmenu setmenublock(menu%,"Tape Deck",170) addmenuitem(menu%+28,0,infoh%,((7<<24)+%10001),"Info") addmenuitem(menu%+52,0,-1,((7<<24)+%10001),"Tune List") addmenuitem(menu%+76,0,-1,((7<<24)+%10001),"Control") checkmenuitem2(menu%+100,0,-1,((7<<24)+%10001),&7000021-( <<22),"Monitor",status%=3) addmenuitem(menu%+124,0,menu%+172,((7<<24)+%10001),"Config") addmenuitem(menu%+148,128,-1,((7<<24)+%10001),"Quit") setmenublock(menu%+172,"Config",116) checkmenuitem1(menu%+200,128,129,-1,((7<<24)+%10001),"ArcFS",arcfs%= "Wimp_CreateMenu",,menu%,mx%-64,336 curmenu%=1 openindex blk%!0=indexh% "Wimp_GetWindowState",,blk% blk%!28=-1 "Wimp_OpenWindow",,blk% recieve filetype%,filename$ "Hourglass_On" filetype%=blk%!40 type%=0 filetype%=&10B type%=1 filetype%=&365 type%=2 filetype%=&000 filetype%=&001 filetype%=&002 filetype%=&CB6 type%=3 filetype%=&CC5 type%=0: Strangely, Krisalis music modules won't work... blk%!16=5 type%=0 filetype%<>ft% type%=type%(loadedlist%,loadedtune%) status%>0 stoptune: cleartune filetype%=blk%!40 "filename$= ctrlstring(blk%+44) blk%!12=blk%!8 blk%!16=4 "Wimp_SendMessage",17,blk%,blk%!4 filetype%=ft% loaddata(filename$): entries%(curlist%)=50 whinge("No room in this list!"): type%=0 whinge("I don't know what this is, but I can't do anything with it!"): (type%=3 type%=4) status%=3 (type%(loadedlist%,loadedtune%)=3 type%(loadedlist%,loadedtune%)=4) whinge("Sorry - I can't index this whilst the current tune is playing!"): entries%(curlist%)+=1 type% 1:name$(curlist%,entries%(curlist%))= tracktext(filename$,&80):author$(curlist%,entries%(curlist%))="unknown" 2:name$(curlist%,entries%(curlist%))= gettext(filename$,1,10):author$(curlist%,entries%(curlist%))="unknown" 3,4: "XQTM_Load",filename$,0 ;flags%: (flags% 1)=1 type%=5 "Tracker_Load",filename$ "Tracker_TuneInfo" ,,,name%,author% 0 checkmenuitem2(menu%+76,0,menu%+320,((7<<24)+%10001),&7000021-( <<22),"Tune",seltune%<(entries%(curlist%)+1) seltune%>0) addmenuitem(menu%+100,0,menu2%,((7<<24)+%10001),"View Lists") addmenuitem(menu%+124,0,menu%+180,((7<<24)+%10001),"Rename List") checkmenuitem2(menu%+148,128,menu%+600,((7<<24)+%10001),&7000021-( <<22),"Sort Tunes",entries%(curlist%)>1 status2%=0) Sub Menues setmenublock(menu%+180,"Name:",170) addindirectmenuitem(menu%+208,132,-1,&7000119,list$(curlist%),menuind%,10) setmenublock(menu%+240,"Misc",100) addmenuitem(menu%+268,0,infoh%,((7<<24)+%10001),"Info") addmenuitem(menu%+292,128,fileinfoh%,((7<<24)+%10001),"File") setmenublock(menu%+320,"Tune",190) addmenuitem(menu%+348,0,tuneinfoh%,((7<<24)+%10001),"Info") addmenuitem(menu%+372,0,menu%+496,((7<<24)+%10001),"Edit Name") addmenuitem(menu%+396,2,menu%+548,((7<<24)+%10001),"Edit Author") addmenuitem(menu%+420,0,menu3%,((7<<24)+%10001),"Move Tune") addmenuitem(menu%+444,0,-1,((7<<24)+%10001),"Remove Tune") addmenuitem(menu%+468,128,-1,((7<<24)+%10001),"Open Dir") setmenublock(menu%+496,"Name:",200) addindirectmenuitem(menu%+524,132,-1,&7000119,name$(curlist%,seltune%),menuind%+15,24) setmenublock(menu%+548,"Author:",200) addindirectmenuitem(menu%+576,132,-1,&7000119,author$(curlist%,seltune%),menuind%+50,24) setmenublock(menu%+600,"Sort by",145) addmenuitem(menu%+628,0,-1,((7<<24)+%10001),"Name") addmenuitem(menu%+652,0,-1,((7<<24)+%10001),"Author") addmenuitem(menu%+676,128,-1,((7<<24)+%10001),"Filename") setmenublock(menu2%,"View List",200) loop=1 nolists% addmenuitem(menu2%+28+((loop-1)*24),0,-1,((7<<24)+%10001),list$(loop)) loop=curlist% !(menu2%+28+((loop-1)*24))+=1 loop=nolists% !(menu2%+28+((loop-1)*24))+=128 setmenublock(menu3%,"Move to:",200) loop=1 nolists% addmenuitem(menu3%+28+((loop-1)*24),0,-1,((7<<24)+%10001),list$(loop)) loop=curlist% !(menu3%+28+((loop-1)*24))+=1 loop=nolists% !(menu3%+28+((loop-1)*24))+=128 Put the data in the windows settext(fileinfoh%,1, file$,28)) settext(fileinfoh%,2, (nolists%)) settext(fileinfoh%,6, (tot%)) settext(tuneinfoh%,1,name$(curlist%,seltune%)) settext(tuneinfoh%,2,author$(curlist%,seltune%)) settext(tuneinfoh%,3,type$(type%(curlist%,seltune%))) settext(tuneinfoh%,4, path$(curlist%,seltune%),29)) "Wimp_CreateMenu",,menu%,mx%-64,my% opencontrol blk%!0=controlh% "Wimp_GetWindowState",,blk% blk%!28=-1 "Wimp_OpenWindow",,blk% clickcontrol blk%!16 status%>0 status%<>3 playtune status%>0 status%=3 pausetune status%>1 stoptune changevolume(-1) changevolume(1) cyclelist cycleall random seltune(list%,tune%) error%= tune%<1 tune%>entries%(list%) error%= status%>0 cleartune loadedlist%=list% loadedtune%=tune% maxsofar%=0 settext(controlh%,0,name$(loadedlist%,loadedtune%)) cleartune status% settext(controlh%,6,"Pause") settext(controlh%,4,"Play") status%=0 tunelen$="0000" tunepos%=0 settext(controlh%,7,"Stopp") type%(loadedlist%,loadedtune%) "DSym_Pause": "DSym_ResetParams": "DSym_Load",-1 "Coco_ReleaseRMA" 3,4: "QTM_Clear" "Tracker_Stop" settext(controlh%,0,"No Tune Selected") settext(controlh%,1,"0000 : 0000") settext(controlh%,2,"00 min 00 sec") loadedlist%=0:loadedtune%=0 loadtune "Hourglass_On" status%=1 type%(loadedlist%,loadedtune%) 1:$menu%=path$(loadedlist%,loadedtune%): "DSym_Load",menu%,,0,,0: "DSym_TuneInfo" tunelen%: "DSym_Vol",vol%: settext(controlh%,2,"00 min 00 sec") 2:fh%= (path$(loadedlist%,loadedtune%)): #fh%=22:tunelen%= "Coco_LoadTrack",path$(loadedlist%,loadedtune%),0: settext(controlh%,2,"00 min 00 sec") vol%<>0 "Coco_SetVolume",256-(vol%*4) "Coco_SetVolume",255 3,4: "QTM_Load",path$(loadedlist%,loadedtune%),0: "QTM_Volume",vol%: "QTM_ReadSongLength" tunelen%: "QTM_ReadPlayingTime" ,,time%: settext(controlh%,2, "00"+ (time% 60),2)+" min "+ "00"+ (time% 60),2)+" sec") "Tracker_Load",path$(loadedlist%,loadedtune%): "Tracker_ReadPos" ,,tunelen%: settext(controlh%,2,"00 min 00 sec") k#tunelen$= "0000"+ (tunelen%),4) settext(controlh%,1,"0000 : "+tunelen$) changevolume(0) "Hourglass_Off" arcfs%= "CloseArchive" playtune status%=0 status% settext(controlh%,7,"Stop"): settext(controlh%,4,"Playp") type%(loadedlist%,loadedtune%) "DSym_RestartSong" "Coco_PlayStart",0 3,4: "QTM_Start" "Tracker_Play" settext(controlh%,6,"Pause"): settext(controlh%,4,"Playp") type%(loadedlist%,loadedtune%) "DSym_TuneControl",1 "Coco_PlayStart",0 3,4: "QTM_Start" "Tracker_Play" status%=3 stoptune status%=0 status% settext(controlh%,6,"Pause") settext(controlh%,4,"Play") settext(controlh%,7,"Stopp") status%=1 type%(loadedlist%,loadedtune%) "DSym_Pause" "Coco_PlayStop" 3,4: "XQTM_Stop" "Tracker_SetPos",0,0: "Tracker_Pause" tunepos%=0 maxsofar%=0 settext(controlh%,1,"0000 : "+tunelen$) pausetune status%=0 settext(controlh%,4,"Play") settext(controlh%,6,"Pausep") status%=2 type%(loadedlist%,loadedtune%) "DSym_Pause" "Coco_PlayStop" 3,4: "XQTM_Pause" "Tracker_Pause" type%(loadedlist%,loadedtune%)=2 tunepos%=0 settext(controlh%,3,"rewindp") tunepos%-=1 type%(loadedlist%,loadedtune%) "DSym_FlushOutput": "DSym_SongPos",tunepos%,-1 3,4: "QTM_Pos",tunepos%,-1 "Tracker_SetPos",tunepos%,0 settext(controlh%,1, "0000"+ (tunepos%),4)+" : "+tunelen$) settext(controlh%,3,"rewind") maxsofar%<>0 maxsofar%=tunepos% type%(loadedlist%,loadedtune%)=2 tunepos%= (tunelen$)-1 settext(controlh%,5,"ffp") tunepos%+=1 type%(loadedlist%,loadedtune%) "DSym_FlushOutput": "DSym_SongPos",tunepos%,-1 3,4: "QTM_Pos",tunepos%,-1 "Tracker_SetPos",tunepos%,0 settext(controlh%,1, "0000"+ (tunepos%),4)+" : "+tunelen$) settext(controlh%,5,"ff") changevolume(change%) vol%>0 change%<0 vol%+=change% vol%<64 change%>0 vol%+=change% settext(controlh%,11, (vol%)) status%<1 type%(loadedlist%,loadedtune%) "DSym_Vol",vol% vol%<>0 "Coco_SetVolume",256-(vol%*4) "Coco_SetVolume",255 3,4: "QTM_Volume",vol% update seqpos%,patpos%,oldpos% oldpos%=tunepos% type%(loadedlist%,loadedtune%) "DSym_SongPos",-1,-1 seqpos%,patpos% "Coco_GetInfos" ,seqpos% 3,4: "QTM_Pos",-1,-1 seqpos%,patpos% "Tracker_ReadPos" seqpos%,patpos% seqpos%<>tunepos% tunepos%=seqpos%: settext(controlh%,1, "0000"+ (tunepos%),4)+" : "+tunelen$) tunepos%>maxsofar% maxsofar%=tunepos% tunepos% (tunelen$) tunefin%= :maxsofar%=0 cycle list%,tune% stoptune 'list%=loadedlist%:tune%=loadedtune% tunefin%= tune%=entries%(list%) status2%=1 cyclelist:exit%= tune%=entries%(list%) status2%=2 tune%=0: :list%+=1: entries%(list%)>0 list%>nolists% list%>nolists% cycleall:exit%= 5tot%=0: loop=1 nolists%:tot%+=entries%(loop): status2%<3 tune%+=1 tot%<2 endcycle:exit%= :tune%= (tot%):list%=1: tune%>entries%(list%):tune%-=entries%(list%):list%+=1: type%(list%,tune%)<>2 seltune(list%,tune%) loadtune playtune endcycle status2% cyclelist cycleall random namesort "Hourglass_On" loop1=1 entries%(curlist%) loop2=loop1 entries%(curlist%) loop1=loop2 sortpos%=0 dis%= )string1$= caps(name$(curlist%,loop1)) )string2$= caps(name$(curlist%,loop2)) sortpos%+=1 string1$,sortpos%,1))<> string2$,sortpos%,1)) dis%= string1$,sortpos%,1))> string2$,sortpos%,1)) swaptune dis%= sortpos%= (string1$) sortpos%= (string2$) dis%= (string2$)> (string1$) swaptune indexdata(curlist%,entries%(curlist%)) "Hourglass_Off" authorsort "Hourglass_On" loop1=1 entries%(curlist%) loop2=loop1 entries%(curlist%) loop1=loop2 sortpos%=0 dis%= +string1$= caps(author$(curlist%,loop1)) +string2$= caps(author$(curlist%,loop2)) sortpos%+=1 string1$,sortpos%,1))<> string2$,sortpos%,1)) dis%= string1$,sortpos%,1))> string2$,sortpos%,1)) swaptune dis%= sortpos%= (string1$) sortpos%= (string2$) dis%= (string2$)> (string1$) swaptune indexdata(curlist%,entries%(curlist%)) "Hourglass_Off" fnamesort "Hourglass_On" loop1=1 entries%(curlist%) loop2=loop1 entries%(curlist%) loop1=loop2 sortpos%=0 dis%= /)string1$= caps(path$(curlist%,loop1)) 0)string2$= caps(path$(curlist%,loop2)) sortpos%+=1 string1$,sortpos%,1))<> string2$,sortpos%,1)) dis%= string1$,sortpos%,1))> string2$,sortpos%,1)) swaptune dis%= sortpos%= (string1$) sortpos%= (string2$) dis%= (string2$)> (string1$) swaptune indexdata(curlist%,entries%(curlist%)) "Hourglass_Off" swaptune name$(curlist%,loop1),name$(curlist%,loop2) author$(curlist%,loop1),author$(curlist%,loop2) type%(curlist%,loop1),type%(curlist%,loop2) path$(curlist%,loop1),path$(curlist%,loop2) loadedlist%=curlist% loadedtune%=loop1 loadedtune%=loop2 loadedtune%=loop2 loadedtune%=loop1 cyclelist tot% status2% settext(controlh%,17,"button") settext(controlh%,18,"button") settext(controlh%,19,"button") status2%=1 status2%=0: stoptune: entries%(curlist%)<2 status2%=0: settext(controlh%,17,"buttonp") status2%=1 seltune(curlist%,1) loadtune playtune cycleall tot% status2% settext(controlh%,17,"button") settext(controlh%,18,"button") settext(controlh%,19,"button") status2%=2 status2%=0: stoptune: `5tot%=0: loop=1 nolists%:tot%+=entries%(loop): tot%<2 status2%=0: settext(controlh%,18,"buttonp") status2%=2 d*list%=0: :list%+=1: entries%(list%)>0 seltune(list%,1) loadtune playtune random tot% status2% settext(controlh%,17,"button") settext(controlh%,18,"button") settext(controlh%,19,"button") status2%=3 status2%=0: stoptune: r5tot%=0: loop=1 nolists%:tot%+=entries%(loop): tot%<2 status2%=0: settext(controlh%,19,"buttonp") status2%=3 :list%= (nolists%): entries%(list%)>0 entries%(list%)>1 seltune(list%, (entries%(list%))) seltune(list%,1) loadtune playtune wipeindex loop1,loop2 loop1=1 nolists% entries%(loop1)=0 loop2=1 name$(loop1,loop2)=" " author$(loop1,loop2)=" " type%(loop1,loop2)=0 path$(loop1,loop2)=" " opendir "path$=path$(curlist%,seltune%) path$= path$, (path$)-1) path$,1)="." path$= path$, (path$)-1) "Filer_OpenDir "+path$ moveto%=(blk%!8)+1 status2%=0 status%>0 loadedlist%=curlist% loadedtune%=seltune% stoptune: cleartune loadedlist%=curlist% loadedtune%=seltune% whinge("You can't move the tune that's playing!"): entries%(moveto%)=50 whinge("Sorry - no room on that list!"): entries%(moveto%)+=1 =name$(moveto%,entries%(moveto%))=name$(curlist%,seltune%) Aauthor$(moveto%,entries%(moveto%))=author$(curlist%,seltune%) =path$(moveto%,entries%(moveto%))=path$(curlist%,seltune%) =type%(moveto%,entries%(moveto%))=type%(curlist%,seltune%) delete delete loop status2%=0 status%>0 loadedlist%=curlist% loadedtune%=seltune% stoptune: cleartune loadedlist%=curlist% loadedtune%=seltune% whinge("You can't delete the tune that's playing!"): loadedlist%=curlist% loadedtune%>seltune% loadedtune%-=1 seltune%<50 loop=seltune% /name$(curlist%,loop)=name$(curlist%,loop+1) 3author$(curlist%,loop)=author$(curlist%,loop+1) /type%(curlist%,loop)=type%(curlist%,loop+1) /path$(curlist%,loop)=path$(curlist%,loop+1) name$(curlist%,50)="" author$(curlist%,50)="" type%(curlist%,50)=0 path$(curlist%,50)="" entries%(curlist%)-=1 indexdata(curlist%,entries%(curlist%)+1) monitor mode%,scr%,xe%,xl%,ye%,yl% "OS_ReadModeVariable",-1,11 ,,xl% "OS_ReadModeVariable",-1,4 ,,xe%:xl%=xl%*2^xe% "OS_ReadModeVariable",-1,12 ,,yl% "OS_ReadModeVariable",-1,5 ,,ye%:yl%=yl%*2^ye% mode%= whinge("Monitor needs 160k of Screen Memory!"): monitor%= 6,112,2 scr%=1 palette status%<>3 playtune monitorinit exit%= "XOS_Byte",19 6,112,scr% scr%=3-scr% 6,113,scr% getscraddr update status2%>0 tunefin%= monitorend: cycle: monitorinit cls80 type%(loadedlist%,loadedtune%) dsymmonitor 3,4: qtmmonitor 2,5: nomonitor X,Y,Z Z<>0 exit%= monitorend "Wimp_SetMode",mode% monitor%= updateall monitorinit Initialise the monitor... type%(loadedlist%,loadedtune%) "DSym_VuGravity",1: "DSym_Configure",1 3,4: "QTM_VUBarControl",1,1 monitorend type%(loadedlist%,loadedtune%) 3,4: "QTM_VUBarControl",0,-1 6,112,1: 6,113,1 palette 0,0,0,0 1,255,255,255 rs=50:gs=60:bs=16 !rd=-50/13:gd=195/13:bd=-16/13 loop=0 loop+2,rs+(rd*loop),gs+(gd*loop),bs+(bd*loop): updateall Updates ALL icons on control panel! settext(controlh%,0,name$(loadedlist%,loadedtune%)) settext(controlh%,1, "0000"+ (tunepos%),4)+" : "+tunelen$) settext(controlh%,4,"Play") settext(controlh%,6,"Pause") settext(controlh%,7,"Stop") type%(loadedlist%,loadedtune%) 1,2,5: settext(controlh%,2,"00 min 00 sec") 3,4: "QTM_ReadPlayingTime" ,,time%: settext(controlh%,2, "00"+ (time% 60),2)+" min "+ "00"+ (time% 60),2)+" sec") status% settext(controlh%,7,"Stopp") settext(controlh%,6,"Pausep") settext(controlh%,4,"Playp") settext(controlh%,17,"Button") settext(controlh%,18,"Button") settext(controlh%,19,"Button") status2% settext(controlh%,17,"Buttonp") settext(controlh%,18,"Buttonp") settext(controlh%,19,"Buttonp") dsymmonitor 0,0);"Track : ";name$(loadedlist%,loadedtune%) 0,1);"Author : ";author$(loadedlist%,loadedtune%) 67,0);"Length : ";tunelen$ 65,1);"Position : "; "0000"+ (tunepos%),4) loop=0 "DSym_VuBar",loop ,height% !linex=((loop 4)*32)+96 .starty%=255-(((7-loop) 4)*((65*4)+20)/4) loop2=0 height% !?linecol= (((13/64)*loop2)+2) !liney=starty%-loop2 horline qtmmonitor 0,0);"Track : ";name$(loadedlist%,loadedtune%) 0,1);"Author : ";author$(loadedlist%,loadedtune%) 67,0);"Length : ";tunelen$ 65,1);"Position : "; "0000"+ (tunepos%),4) loop=0 "QTM_ReadVULevels",loop+1 height% !linex=((loop 4)*32)+96 ,.starty%=255-(((7-loop) 4)*((65*4)+20)/4) loop2=0 height% .!?linecol= (((13/64)*loop2)+2) !liney=starty%-loop2 horline nomonitor 0,0);"Track : ";name$(loadedlist%,loadedtune%) 0,1);"Author : ";author$(loadedlist%,loadedtune%) 67,0);"Length : ";tunelen$ 65,1);"Position : "; "0000"+ (tunepos%),4) cen("I'm very sorry, but there is no monitor",15) cen("display for this type of tune.",16) time$= time$,8),31) assemble count,screen,sp,link,pc code% &1000 count=0 E,scraddr=11:screen=12:sp=13:link=14:pc=15 pass%=0 P%=code% [OPT pass% EQUD 0 .block EQUD 148 EQUD -1 .getscraddr ADR R0,block ADR R1,scr SWI "XOS_ReadVduVariables" MOV pc,link .cls80 XhMOV R1,#0:MOV R2,#0:MOV R3,#0:MOV R4,#0:MOV R5,#0:MOV R6,#0:MOV R7,#0:MOV R8,#0:MOV R9,#0:MOV R10,#0 MOV count,#2048 LDR screen,scr .clsloop STMIA (screen)!,{R1-R10} SUBS count,count,#1 BNE clsloop MOV pc,link .linex EQUD 0 .liney EQUD 0 .linecol EQUD 0 .horline LDRB R1,linecol MOV count,R1,ASL #4 ADD count,count,R1 STRB count,linecol STRB count,linecol+1 STRB count,linecol+2 STRB count,linecol+3 LDR count,linecol LDR R1,liney LDR R2,linex LDR screen,scr MOV R3,#320 MLA scraddr,R1,R3,R2 ADD scraddr,scraddr,screen MOV R1,#7 .lineloop STMIA (scraddr)!,{count} SUBS R1,R1,#1 BNE lineloop MOV pc,link whinge(err$) blk%!0=0 $(blk%+4)=err$ "Wimp_ReportError",blk%,2,"Tape Deck" FNreadtext, FNctrlstring, PROCdrag, PROCdraggedbox, FNleafname by A J Cawte. readtext(wi%,ic%) !dat%=wi% dat%!4=ic% "Wimp_GetIconState",,dat% ctrlstring(dat%!28) ctrlstring(ad%) s$="" ?ad%>31 (?ad%) ad%+=1 settext(wd%,ic%,t$) monitor%= sets the icon, handle 'ic%' in window 'wd%' to string t$ 4!dat%=wd%:dat%!4=ic%: "Wimp_GetIconState",,dat% $$(dat%!28)=t$:dat%!8=0:dat%!12=0 "Wimp_SetIconState",,dat% settext2(wd%,ic%,t$) monitor%= 4!dat%=wd%:dat%!4=ic%: "Wimp_GetIconState",,dat% ctrlstring(dat%!28)=t$ $$(dat%!28)=t$:dat%!8=0:dat%!12=0 "Wimp_SetIconState",,dat% leafname(file$) file$,".")<>0 'file$= file$,( file$)- file$,".")) =file$ setmenublock(block%,text$,width%) $block%=text$ block%!16=width% setmenublock2(block%) setmenublock2(block%) 3block%?12=7:block%?13=2:block%?14=7:block%?15=0 block%!20=40 block%!24=0 addmenuitem(addr,flags,pointer,iconflags,entry$) A!addr=flags:addr!4=pointer:addr!8=iconflags:$(addr+12)=entry$ fname(f$) loop,loop2 loop= (f$)+1:loop2=-1 loop-=1:loop2+=1 f$,loop,1)="." loop2= loop2= (f$) f$,30) f$,loop2) error monitor%= "WimpMode "+ (mode%) "Hourglass_Smash" !blk%=0 !$(blk%+4)= $+" at line "+ "Wimp_ReportError",blk%,2,"Tape Deck" cleartune "Wimp_CloseDown": checkmenuitem1(addr,flags1,flags2,pointer,iconflags,entry$,test%) test%= addmenuitem(addr,flags1,pointer,iconflags,entry$) test%= addmenuitem(addr,flags2,pointer,iconflags,entry$) checkmenuitem2(addr,flags,pointer,iconflags1,iconflags2,entry$,test%) test%= addmenuitem(addr,flags,pointer,iconflags1,entry$) test%= addmenuitem(addr,flags,pointer,iconflags2,entry$) addindirectmenuitem(addr,flags,pointer,iconflags,entry$,addr2,len) addmenuitem(addr,flags,pointer,iconflags,"") addr!12=addr2 addr!16=-1 addr!20=len+1 $addr2=entry$ caps(txt$) pos% (txt$)<1 txt$=" " txt2$="" pos%=1 (txt$) txt$,pos%,1))>96 txt$,pos%,1))<123 txt2$+= txt$,pos%,1))-32) txt2$+= txt$,pos%,1) =txt2$ gettext(fname$,startaddr%,terminate%) filehandle%,byte%,name$ name$="" filehandle%= (fname$) #filehandle%=&7E byte%= #filehandle% byte%>31 byte%<>terminate% name$+= (byte%) byte%=terminate% (name$)>28 #filehandle% (name$)>29 name$= fname(fname$) =name$ tracktext(fname$,track%) filehandle%,len%,name$ name$="" filehandle%= (fname$) #filehandle%=track% #filehandle% #filehandle%=track% #filehandle% #filehandle%=track% #filehandle% #filehandle%<>track% #filehandle% #filehandle% fname(fname$) #filehandle%=( #filehandle%)-1 len%= #filehandle% loop=1 len% name$+= #filehandle%) #filehandle% name$,29) gettext2(startaddr%,terminate%,len%) byte%,name$ name$="" #byte%=?startaddr%:startaddr%+=1 byte%>31 byte%<>terminate% name$+= (byte%) byte%=terminate% (name$)>len% =name$ getstring(fh%,addr%,len%) str$ #fh%=addr% str$="" loop=1 len% str$+= =str$ cen(t$,y%) x%=((80- (t$))/2)-1 x%,y%);t$; swi(swi$) "XOS_SWINumberFromString",,swi$ swi,flag (flag 1) swi=-1 checkload "OS_GetEnv" load$ pos%=0 pos%+=1 load$,pos%,6)="-load " pos%= (load$) pos%+=5 pos%> (load$)-1 load$= load$, (load$)-pos%) loaddata(load$) blk%!12=blk%!8 blk%!16=&503 text$="" blk%!32 -2:text$="This is the Tape Deck icon. Click SELECT to display the tune list and control windows. Click ADJUST to display the monitor. Drag a tune here to add it to the current list." infoh%:text$="This window displays information about Tape Deck." fileinfoh%:text$="This window displays information about the current index file." tuneinfoh%:text$="This window displays information about the tune you clicked on." saveh%:text$="Drag the icon to a directory viewer to save the index." controlh%: blk%!36 0:text$="This tune is currently playing." 1:text$="This is the current position in the tune." 2:text$="This is the length of the tune." 3:text$="Click on this button to rewind the tune." 4:text$="Click on this button to play the tune." 5:text$="Click on this button to fast-forward the tune." 6:text$="Click on this button to pause the tune." 7:text$="Click on this button to stop the tune." 10,11,12,13:text$="This is the volume control." 14,17:text$="Click on the button to cycle through the tunes in this list." 15,18:text$="Click on the button to play all of the tunes that Tape Deck knows about." 16,19:text$="Click on the button to play the tunes in a random order." indexh%:text$="This window is displaying the tune list called """+list$(curlist%)+"""" $(blk%+20)=text$ M$blk%!0=(((20+ (text$)+1) 4)*4)+4 $(blk%+21+ (text$))= "Wimp_SendMessage",17,blk%