home *** CD-ROM | disk | FTP | other *** search
/ Amiga ACS 1998 #4 / amigaacscoverdisc1998-041998.iso / utilities / shareware / music / mrmidi / play.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1998-03-08  |  3.3 KB  |  96 lines

  1. /* Play.rexx */
  2.  
  3. options results; address MrMIDI
  4.  
  5. MUIA_Disabled        = 0x80423661;    MUIA_Selected        = 0x8042654b
  6. MUIA_List_Entries    = 0x80421654;    MUIA_List_Active    = 0x8042391c
  7. MUIA_NoNotify        = 0x804237f9;    MUIA_Slider_Level    = 0x8042ae3a
  8. MUIV_List_Active_Down    = -5;        MUIV_List_Active_Top    = -2
  9.  
  10. getvar stopped
  11. if result = 1 then return
  12. check ID PLAY; playing = result
  13. if playing = 1 then do
  14.   do forever
  15.     check ID PLAY ATTRS MUIA_Disabled 1
  16.     setvar cont 0
  17.     list ID SLIST ATTRS MUIA_List_Entries
  18.     if result = 0 then call Eject.rexx
  19.     call PlayMain()
  20.     getvar cont
  21.     if result = 1 then iterate
  22.     check ID PLAY; playing = result
  23.     cycle ID REPT; repeat = result
  24.     if playing = 1 & repeat == 'Repeat All' then do
  25.       list ID SLIST ATTRS MUIA_List_Entries; max = result
  26.       if max = 0 then leave
  27.       list ID SLIST ATTRS MUIA_List_Active; current = result
  28.       list ID SLIST POS current; parse var result filename','dummy
  29.       getvar current_song; temp_song = result
  30.       if filename = temp_song & max ~= 1 then do
  31.         check ID RAND; rnd = result
  32.         if rnd = 1 then do
  33.           flag = 0
  34.           do while flag = 0
  35.             temp = random(0, max - 1, time('S'))
  36.             if temp ~= current then do
  37.               list ID SLIST ATTRS MUIA_List_Active temp
  38.               flag = 1
  39.             end
  40.           end /* of while flag */
  41.         end /* of if rnd */
  42.         else if current ~= max - 1 then list ID SLIST ATTRS MUIA_List_Active MUIV_List_Active_Down
  43.         else list ID SLIST ATTRS MUIA_List_Active MUIV_List_Active_Top
  44.       end /* of if filename */
  45.       else do /* current song ~= selected song */
  46.         /* slider ID PROG ATTRS MUIA_Slider_Level 0
  47.         setvar current_time '00:00'
  48.         text ID CURNT LABEL "\033b\033r00:00" */
  49.       end
  50.       iterate
  51.     end /* of repeat all */
  52.     else if playing = 1 & repeat == 'Repeat 1' then do
  53.       /* slider ID PROG ATTRS MUIA_Slider_Level 0
  54.       setvar current_time '00:00'
  55.       text ID CURNT LABEL "\033b\033r00:00" */
  56.       iterate
  57.     end /* of repeat 1 */
  58.     else if playing = 1 then do /* no repeat */
  59.       list ID SLIST ATTRS MUIA_List_Entries; max = result
  60.       if max = 0 then leave
  61.       list ID SLIST ATTRS MUIA_List_Active; current = result
  62.       list ID SLIST POS current; parse var result filename','dummy
  63.       getvar current_song; temp_song = result
  64.       if filename = temp_song & max ~= 1 then do
  65.         check ID RAND; rnd = result
  66.         if rnd = 1 then do
  67.           flag = 0
  68.           do while flag = 0
  69.             temp = random(0, max - 1, time('S'))
  70.             if temp ~= current then do
  71.               list ID SLIST ATTRS MUIA_List_Active temp
  72.               flag = 1
  73.             end
  74.           end /* of while flag */
  75.         end /* of if rnd */
  76.         else if current ~= max - 1 then list ID SLIST ATTRS MUIA_List_Active MUIV_List_Active_Down
  77.         else leave
  78.       end /* of if filename */
  79.       else if max = 1 then leave
  80.       else do /* current song ~= selected song */
  81.         /* slider ID PROG ATTRS MUIA_Slider_Level 0
  82.         setvar current_time '00:00'
  83.         text ID CURNT LABEL "\033b\033r00:00" */
  84.       end
  85.       iterate
  86.     end /* of no repeat */
  87.     else leave
  88.   end /* of do forever */
  89. end /* of if playing */
  90. check ID PLAY ATTRS MUIA_Selected 0 MUIA_NoNotify 1
  91. call setclip('MrMIDI_FLAG', 1)
  92. address command 'Kill >NIL: GMPlay'
  93. setvar stopped 0
  94. text ID PROG LABEL "Stopped."
  95. return
  96.