home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus 1998 #5 / AmigaPlus_CD-ROM_Nr.5-98.iso / pd / musik / mrmpeg / delete.rexx < prev    next >
OS/2 REXX Batch file  |  1998-03-06  |  2KB  |  62 lines

  1. /* Delete.rexx */
  2.  
  3. options results; address MrMPEG; signal on syntax
  4.  
  5. MUIA_List_Active    = 0x8042391c;    MUIA_List_Entries    = 0x80421654
  6. MUIA_Slider_Level    = 0x8042ae3a;    MUIA_Window_Sleep    = 0x8042e7db
  7. MUIM_List_Remove    = 0x8042647e;    MUIV_List_Remove_Selected    = -3
  8.  
  9. window ID WIND1 ATTRS MUIA_Window_Sleep 1
  10. window ID WIND2 ATTRS MUIA_Window_Sleep 1
  11. need_to_stop = 1
  12. getvar current_song; playing_name = result
  13. list ID SLIST ATTRS MUIA_List_Entries; entries = result
  14. if entries = 0 then do
  15.   window ID WIND2 ATTRS MUIA_Window_Sleep 0
  16.   window ID WIND1 ATTRS MUIA_Window_Sleep 0
  17.   return
  18. end
  19. method ID SLIST MUIM_List_Remove MUIV_List_Remove_Selected
  20. /* list ID SLIST REMOVE POS MUIV_List_Remove_Selected */
  21. list ID SLIST ATTRS MUIA_List_Active
  22. if result = 4294967295 then list ID SLIST ATTRS MUIA_List_Active 0
  23.  
  24. list ID SLIST ATTRS MUIA_List_Entries; temp_max = result
  25. setvar max temp_max
  26. text ID MAX LABEL "\033b\033r"right(temp_max, 3)
  27. temp_total_time = 0
  28. do i = 0 to temp_max - 1
  29.   list ID SLIST POS i
  30.   parse var result temp_name','temp_song_time','dummy
  31.   temp_total_time = temp_total_time + left(temp_song_time, 2) * 60 + right(temp_song_time, 2)
  32.   if temp_name = playing_name then do
  33.     need_to_stop = 0
  34.     list ID SLIST ATTRS MUIA_List_Active i
  35.     setvar active i
  36.     text ID ACTIV LABEL "\033b\033r"right(i + 1, 3)
  37.   end
  38. end
  39. temp_string = right(temp_total_time % 3600, 2, 0)||":"||,
  40.   right(temp_total_time // 3600 % 60, 2, 0)":"right(temp_total_time // 60, 2, 0)
  41. setvar total_time temp_string
  42. text ID TOTAL LABEL "\033b\033r"temp_string
  43.  
  44. if need_to_stop then do
  45.   string ID FNAME CONTENT "No song is loaded."
  46.   text ID LCD LABEL "MrMIDI is also available from Aminet."
  47.   text ID ACTIV LABEL "\033b\033r  0"
  48.   text ID CURNT LABEL "\033b\033r00:00"
  49.   check ID PLAY
  50.   if result = 1 then call Stop.rexx
  51.   else slider ID PROG ATTRS MUIA_Slider_Level 0
  52. end
  53. window ID WIND2 ATTRS MUIA_Window_Sleep 0
  54. window ID WIND1 ATTRS MUIA_Window_Sleep 0
  55. return
  56.  
  57. syntax:
  58.   request ID WARN GADGETS '"OK"' '"\033b\033cError 'RC' in line 'SIGL':\033n\012\033c'errortext(RC)'"'
  59.   window ID WIND2 ATTRS MUIA_Window_Sleep 0
  60.   window ID WIND1 ATTRS MUIA_Window_Sleep 0
  61.   return
  62.