home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 3 / PDCD_3.iso / utilities / utilsp / qtmplay / !QTMPlay / !RunImage (.txt) < prev    next >
RISC OS BBC BASIC V Source  |  1995-08-27  |  34KB  |  1,464 lines

  1.  > <QTMPlay$Dir>.!RunImage
  2.  Copyright 1994,95 Chris Rutter, DIGITAL DREAM
  3.  > Hello people, I
  4. m 14. I
  5. m also very very sad.
  6. error
  7. setup_prevariables
  8. do_preprocessing
  9.  "Wimp_Initialise",310,&4b534154,"QTM Player",block% 
  10.  os_version%,task%
  11. create_windows
  12. find_icons
  13. do_postprocessing
  14. create_menus
  15. read_from_file%=
  16. #0:!error%=0:$(error%+4)=
  17. msg("ChoicesCorrupt"):
  18.  "Wimp_ReportError",error%,1,
  19. msg("LongTask"):read_from_file%=
  20. :error_occured%=
  21. setup_variables
  22. error
  23. put_choices
  24. tune_loaded%=
  25.  tune_loaded%=
  26.  tune_loaded% 
  27. intercept_loaded
  28. error
  29. wimp_error
  30. read_mode_variables
  31. set_postvariables
  32.  "Wimp_Poll",0,block% 
  33.  wimp_action%
  34. deal_with(wimp_action%)
  35. do_tickeractions
  36.  quit%
  37. tidy_exit
  38. deal_with(action%)
  39.  action% 
  40.  1 : 
  41. poll_redraw
  42. .#    
  43.  thumbtack% 
  44.  block%!28=-1
  45. /$    
  46.  "Wimp_OpenWindow",,block%
  47. 11    
  48.  !block%<>qtmplay_handle% 
  49.  menu_open%=
  50. 2%    
  51.  "Wimp_CloseWindow",,block%
  52. 3;    
  53.  block%!0=control_handle% 
  54.  control_window_open%=
  55.  6 : 
  56. poll_mouse
  57.  7 : 
  58. poll_stopdrag
  59.  8 : 
  60. poll_key
  61.  9 : 
  62. poll_menu
  63.  17,18
  64.  block%!16 
  65.       
  66.  0       : quit%=
  67. ;%      
  68.  2       : 
  69. poll_finalsave
  70. <$      
  71.  3       : 
  72. poll_loadfile
  73. =%      
  74.  5       : 
  75. intercept_load
  76. >$      
  77.  6       : 
  78. poll_ramfetch
  79. ?'      
  80.  &502    : 
  81. acknowledge_help
  82. @*      
  83.  &400C1  : 
  84. read_mode_variables
  85. A        
  86. poll_mouse
  87. mx%=block%!0
  88. my%=block%!4
  89. mb%=block%!8
  90. whan%=block%!12
  91. ihan%=block%!16
  92. menu_open%=
  93.  whan% 
  94.  qtmplay_handle%
  95.  lastdrag%=2 
  96.  lastdrag%<>2 
  97. PF     block%!24=qtmplay_handle%:
  98.  "Wimp_GetWindowState",,block%+24
  99. QD     
  100.  block%!8=4 
  101.  block%!52=-1:
  102.  "Wimp_OpenWindow",,block%+24
  103. R.     block%!20=qtmplay_handle%:block%!24=1
  104. S%     
  105.  "Wimp_DragBox",,block%+20
  106. Tk     !block%=qtmplay_handle%:
  107.  "Wimp_GetWindowState",,block%:wyd%=block%!16-block%!8:myd%=my%-block%!8
  108.      lastdrag%=2
  109. V        
  110. W        
  111.       
  112.  mb% 
  113.         
  114.           
  115.  ihan% 
  116.             
  117.               
  118.  mb% 
  119. ]7                
  120.  4 : 
  121.  tune_loaded% 
  122.  "QTM_Start"
  123.                 
  124. _&                  carousel_play%=1
  125. `P                  
  126.  carousel$(1)="" 
  127.  carousel_play%=
  128. next_carousel_track(1)
  129. aG                  
  130.  carousel_play%>0 
  131. play_carousel(carousel_play%)
  132.               
  133.             
  134. dO              block%!24=qtmplay_handle%:
  135.  "Wimp_GetWindowState",,block%+24
  136. eH              
  137.  mb%=4 
  138.  block%!52=-1:
  139.  "Wimp_OpenWindow",,block%+24
  140. fT              block%!20=qtmplay_handle%:block%!24=1:
  141.  "Wimp_DragBox",,block%+20
  142. gF            
  143.  2 : 
  144.  tune_loaded% 
  145.  "QTM_Stop":carousel_playing%=
  146.             
  147. i,              thumbtack%=thumbtack% 
  148. jE              
  149.  thumbtack% 
  150. set_icon_state(qtmplay_handle%,3)
  151. kE              
  152.  thumbtack% 
  153. clear_icon_state(qtmplay_handle%,3)
  154.             
  155. mP              
  156.  "XOS_CLI","Cat "+track_directory$+" { > null: }" 
  157.  ;worked%
  158. n[              
  159.  worked% 
  160. notify(
  161. msg("SillyTrackDir")+" "+track_directory$):
  162. oa              
  163.  trackdirheight%<=0 
  164. notify(
  165. msg("SillyTrackHeight")+" "+
  166. (trackdirheight%))
  167. p^              
  168.  trackdirwidth%<=0 
  169. notify(
  170. msg("SillyTrackWidth")+" "+
  171. (trackdirwidth%))
  172. q}              tail$=track_directory$+" "+
  173. (mx%+20)+" "+
  174. (my%)+" "+
  175. (trackdirwidth%)+" "+
  176. (trackdirheight%)+" -SmallIcons"
  177. r+              
  178. ("Filer_OpenDir "+tail$)
  179. s/              
  180. open_window(qtmplay_handle%)
  181.             
  182. u/              
  183. open_window(control_handle%)
  184. v(              control_window_open%=
  185. w*              
  186. update_position_display
  187.           
  188.         
  189. zP          
  190.  "Wimp_CreateMenu",,menu%,mx%-75,my%+8:menu_open%=
  191. :menu_time%=0
  192.       
  193. |        
  194.  control_handle%
  195.  ihan% 
  196. 9       
  197.  ctrl_pause%  : 
  198.  tune_loaded% 
  199.  "QTM_Pause"
  200.        
  201.  ctrl_rewind%
  202.          
  203.  mb% 
  204.            
  205. !             
  206.  tune_loaded% 
  207. ,              
  208.  "QTM_Pos",-1,-1 
  209.  cseq%
  210. &              
  211.  cseq%>0 
  212.  cseq%-=1
  213. &              
  214.  "QTM_Pos",cseq%,0
  215.               xseq%-=1
  216.              
  217.            
  218. (             
  219.  carousel_playing%>0 
  220. E               lasttrack%=
  221. last_carousel_track(carousel_playing%)
  222. <               
  223.  lasttrack%>0 
  224. play_carousel(lasttrack%)
  225.              
  226.           
  227.        
  228.  ctrl_forward%
  229.          
  230.  mb% 
  231.            
  232. !             
  233.  tune_loaded% 
  234. ,              
  235.  "QTM_Pos",-1,-1 
  236.  cseq%
  237. 1              
  238.  "QTM_ReadSongLength" 
  239.  mseq%
  240. ,              
  241.  cseq%<mseq%-1 
  242.  cseq%+=1
  243. &              
  244.  "QTM_Pos",cseq%,0
  245.              
  246.            
  247. (             
  248.  carousel_playing%>0 
  249. E               nexttrack%=
  250. next_carousel_track(carousel_playing%)
  251. <               
  252.  nexttrack%>0 
  253. play_carousel(nexttrack%)
  254.              
  255.          
  256.        
  257.  ctrl_carouselpath%
  258. .         
  259. play_carousel(carousel_pointer%)
  260.        
  261.  ctrl_viewing%
  262. ,         carousel$(carousel_pointer%)=""
  263. -         
  264. set_carousel(carousel_pointer%)
  265.        
  266.  ctrl_carouselleft%
  267. E         
  268.  carousel_pointer%>1 
  269. set_carousel(carousel_pointer%-1)
  270.         
  271.  ctrl_carouselright%
  272. G         
  273.  carousel_pointer%<255 
  274. set_carousel(carousel_pointer%+1)
  275.        
  276.  ctrl_download%
  277.           
  278. save_drag_initiate
  279.        
  280.  ctrl_samplesopen%
  281. *         
  282. open_window(samples_handle%)
  283.        
  284.  ctrl_toolbar%
  285. +         
  286. open_window(carousel_handle%)
  287.        
  288.          block%!0=whan%
  289. -         
  290.  "Wimp_GetWindowState",,block%
  291.          winx%=block%!4
  292.          winy%=block%!16
  293.          
  294.  mx%>volminx%+winx%-block%!20 
  295.  mx%<volmaxx%+winx%-block%!20 
  296.  my%>winy%+volminy%-block%!24 
  297.  my%<winy%+volmaxy%-block%!24 
  298. update_slider
  299.      
  300. !     
  301. update_position_display
  302.  choices_handle%
  303.  ihan% 
  304.       
  305.         
  306. get_choices
  307.         
  308. set_choices
  309.         
  310. save_config_file
  311. 4        
  312.  mb%=4 
  313. close_window(choices_handle%)
  314.       
  315.         
  316. get_choices
  317.         
  318. set_choices
  319. 4        
  320.  mb%=4 
  321. close_window(choices_handle%)
  322.       
  323.         
  324. put_choices
  325. 4        
  326.  mb%=4 
  327. close_window(choices_handle%)
  328.         
  329.  carousel_handle%
  330.  ihan% 
  331.       
  332. 2        cvol%=
  333. get_icon(carousel_handle%,2))
  334. "        
  335.  cvol%<200 
  336.  cvol%+=1
  337. 2        
  338. set_icon(carousel_handle%,2,
  339. (cvol%))
  340.       
  341. 2        cvol%=
  342. get_icon(carousel_handle%,2))
  343.          
  344.  cvol%>0 
  345.  cvol%-=1
  346. 2        
  347. set_icon(carousel_handle%,2,
  348. (cvol%))
  349.       
  350. -        
  351. play_carousel(carousel_pointer%)
  352.       
  353. +        carousel$(carousel_pointer%)=""
  354. ,        
  355. set_carousel(carousel_pointer%)
  356.       
  357.         oldvol%=
  358. volume
  359. M        carousel_vol%(carousel_pointer%)=
  360. get_icon(carousel_handle%,2))
  361. U        
  362.  carousel_vol%(carousel_pointer%)=0 
  363.  carousel_vol%(carousel_pointer%)=1
  364. J        
  365.  (carousel_playing%=carousel_pointer%) 
  366. set_volume(oldvol%)
  367. 5        
  368.  mb%=4 
  369. close_window(carousel_handle%)
  370.         
  371. poll_menu
  372. menu_open%=
  373.  (block%!0)+1 
  374.  2           : 
  375. open_window(choices_handle%)
  376.  menu_items% : quit%=
  377. error
  378. ("Error Error in error trapping procedure : "+
  379. $+" at line "+
  380. ("Error "+
  381. $+" at line "+
  382. wimp_error
  383. ("Error Error in error trapping procedure : "+
  384. $+" at line "+
  385. !error%=
  386. L$(error%+4)=
  387. $+" at line "+
  388. )+" (OK to continue, Cancel to quit)"+
  389.  "Wimp_ReportError",error%,(1<<0) 
  390.  (1<<1),"QTM Player" 
  391.  ,selected%
  392.  selected%=2 
  393.  quit%=
  394. tidy_exit:
  395. open_window(window_handle%)
  396. !block%=window_handle%
  397.  "Wimp_GetWindowState",,block%
  398. block%!28=-1
  399.  "Wimp_OpenWindow",,block%
  400. close_window(window_handle%)
  401. !block%=window_handle%
  402.  "Wimp_GetWindowState",,block%
  403.  "Wimp_CloseWindow",,block%
  404. load_and_play(file$)
  405. Hfile%=
  406. (file$):
  407.  file%=0 
  408. msg("WhereIsIt")+" "+file$ 
  409. #file%
  410.  "QTM_Load",file$,0
  411. tune_loaded%=
  412.  "QTM_Start"
  413.  "QTM_Info" 
  414.  track_address%,author_address%
  415. set_icon(control_handle%,ctrl_tunepath%,file$)
  416. set_icon(control_handle%,ctrl_tunename%,
  417. string_address(track_address%))
  418.  author_address%=0 
  419. set_icon(control_handle%,ctrl_tuneauthor%,"Author unknown")
  420. set_icon(control_handle%,ctrl_tuneauthor%,
  421. string_address(author_address%))
  422. update_position_display
  423. xseq%=0
  424.  "Wimp_ForceRedraw",samples_handle%,-(1<<29),-(1<<29),1<<29,1<<29
  425. intercept_loaded
  426.  "QTM_Info" 
  427.  track_address%,author_address%
  428. set_icon(control_handle%,ctrl_tunename%,
  429. string_address(track_address%))
  430. set_icon(control_handle%,ctrl_tunepath%,"<Tune not loaded by QTMPlay>")
  431.  author_address%=0 
  432. set_icon(control_handle%,ctrl_tuneauthor%,"Author unknown")
  433. set_icon(control_handle%,ctrl_tuneauthor%,
  434. string_address(author_address%))
  435. update_position_display
  436. xseq%=0
  437. tune_loaded%=
  438. intercept_load
  439. track_type(block%!40) 
  440.  block%!12,block%!8
  441.   block%!16=4
  442.  "Wimp_SendMessage",19,block%,block%!4
  443. load_and_play(
  444. string_address(block%+44))
  445.   carousel_playing%=
  446. track_type(type%)
  447.  type%=&CB6 
  448.  type%=0 
  449.  typ