home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / albmppb6.zip / encode_all.cmd < prev    next >
OS/2 REXX Batch file  |  1996-12-11  |  1KB  |  63 lines

  1. /*╔════════════════════════════════════════════════════════════════════╗
  2.   ╚════════════════════════════════════════════════════════════════════╝*/
  3.  
  4. /* check whether RxFuncs are loaded, if not, load them */
  5. IF RxFuncQuery('SysLoadFuncs') THEN
  6. DO
  7.     /* load the load-function */
  8.     CALL RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
  9.  
  10.     /* load the Sys* utilities */
  11.     CALL SysLoadFuncs
  12. END
  13.  
  14. ARG Arg1
  15.  
  16. /* Print title */
  17. SAY ''
  18. SAY 'Encode All by Norbert Heller '
  19.  
  20. /* check for options */
  21. Option = "FO"
  22. GotError = 0
  23.  
  24. /* DO UNTIL Arg2 = '' */
  25. Files. = ''
  26.  
  27. PARSE VAR Arg1 Filespec
  28.  
  29. /* Get files & directories, according to Option */
  30. call SysFileTree '*.wav', 'Files', Option
  31.  
  32. /* For each filespec, try to obtain the icon */
  33. DO i = 1 TO Files.0
  34.  
  35.     /* length of the string incl path */
  36.     lengthfile = LENGTH(Files.i)
  37.  
  38.     /* without ending .xyz */
  39.     name    = LEFT(Files.i, lengthfile-4)
  40.  
  41.     /* last position of "\" */
  42.     s = LASTPOS( "\", Files.i)
  43.  
  44.     /* now filename length without path and extension */
  45.     t = lengthfile-4-s
  46.  
  47.     /* copy string from the right side */
  48.     name1   = RIGHT(name, t)
  49.  
  50.     /* now we have the name of the file */
  51.     say "name of file " || name1 || ".mp2"
  52.  
  53.  
  54.     "encode "|| Files.i || " " || name1||".mp2  -b192"
  55.  
  56.     rc=stream(Files.i, 'c', 'close')
  57.  
  58.     "del "|| Files.i
  59.  
  60. END
  61.  
  62.  
  63.