home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 18 REXX / 18-REXX.zip / ra2.zip / RA2.CMD next >
OS/2 REXX Batch file  |  1996-04-13  |  6KB  |  107 lines

  1. /******************************************************************************/
  2. /*                                                                            */
  3. /*    Program: RA2.CMD                                                        */
  4. /*                                                                            */
  5. /*     Author: Skip Osterhus                                                  */
  6. /*                                                                            */
  7. /*    Company: Soft Recovery Technology                                       */
  8. /*             3631 East Meadows Court                                        */
  9. /*             Okemos, MI  48864                                              */
  10. /*                                                                            */
  11. /* Work Voice: 517-349-9007                                                   */
  12. /*                                                                            */
  13. /*     E-MAIL: skipo@sojourn.com                                              */
  14. /*        CIS: 73776,122                                                      */
  15. /*    PRODIGY: RKRT45A                                                        */
  16. /*                                                                            */
  17. /*     Status: FreeWare                                                       */
  18. /*                                                                            */
  19. /******************************************************************************/
  20.  
  21.       parse arg TempFile
  22.  
  23.       RADirectory = 'c:\raplayer\'            /* User might change this here! */
  24.       RATempFile  = RADirectory||'ra2.tmp'
  25.       RAPlayer    = RADirectory||'raplayer.exe'
  26.  
  27.       RAHist      = 1                         /* 1 = keep track of URL's */
  28.       RAHistFile  = RADirectory||'ra2.hst'    /* History of URL's listened to */
  29.  
  30. /******************************************************************************/
  31. /*                                                                            */
  32. /* Step 1 ... Load the needed REXX functions.                                 */
  33. /*                                                                            */
  34. /******************************************************************************/
  35.  
  36.       Call RxFuncAdd 'SysLoadFuncs','REXXUTIL','SysLoadFuncs';
  37.       Call SysLoadFuncs;
  38.  
  39. /******************************************************************************/
  40. /*                                                                            */
  41. /* Step 2 ... Make sure the Real Audio file name was passed                   */
  42. /*                                                                            */
  43. /******************************************************************************/
  44.  
  45.      if TempFile == '' then do
  46.                                say '***No File parameter was passed!***'
  47.                                exit 1
  48.                             end
  49.  
  50. /******************************************************************************/
  51. /*                                                                            */
  52. /* Step 3 ... Create an addressable desktop object ( if not already created ).*/
  53. /*                                                                            */
  54. /******************************************************************************/
  55.  
  56.       SetupString=""||,
  57.       "DEFAULTVIEW=RUNNING;"||,
  58.       "MINWIN=DESKTOP;"||,
  59.       "NOPRINT=YES;"||,
  60.       "ASSOCFILTER=.RAM,"||,
  61.       ","||,
  62.       ";"||,
  63.       "EXENAME="RAPlayer";"||,
  64.       "PROGTYPE=PROG_31_ENHSEAMLESSCOMMON;"||,
  65.       "SET DPMI_MEMORY_LIMIT=64;"||,
  66.       "OBJECTID=<WP_RAPlayer>;"
  67.  
  68.       rc = SysCreateObject( "WPProgram",,
  69.                             "Real Audio",,
  70.                             "<WP_DESKTOP>",,
  71.                              SetupString,,
  72.                             "ReplaceIfExists" );
  73.  
  74.       if rc <> 1 then do
  75.                          say "***Real Audio desktop object could not be created/updated !***";
  76.                          say 'Result code='rc
  77.                          exit 2
  78.                       end
  79.  
  80. /******************************************************************************/
  81. /*                                                                            */
  82. /* Step 4 ... Copy the temporary Real Audio file to a permanent real file.    */
  83. /*                                                                            */
  84. /******************************************************************************/
  85.  
  86.       '@copy' TempFile RATempFile
  87.  
  88.       if RAHist = 1 then do while lines( TempFile ) > 0
  89.                             call lineout RAHistFile, linein( TempFile )
  90.                          end
  91.  
  92. /******************************************************************************/
  93. /*                                                                            */
  94. /* Step 5 ... Run the Real Audio program from the desktop icon.               */
  95. /*                                                                            */
  96. /******************************************************************************/
  97.  
  98.       call SysSetObjectData "<WP_RAPlayer>", "PARAMETERS="RATempFile";OPEN=DEFAULT;"
  99.  
  100. /******************************************************************************/
  101. /*                                                                            */
  102. /* Step 6 ... Reset the desktop icon to no parameters.                        */
  103. /*                                                                            */
  104. /******************************************************************************/
  105.  
  106.       call SysSetObjectData "<WP_RAPlayer>" , "PARAMETERS=%"
  107.