home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Multimed / Multimed.zip / mp3p.zip / mp3p.cmd < prev    next >
OS/2 REXX Batch file  |  1999-12-02  |  7KB  |  282 lines

  1. /* Arin mp3puristin rl99.12.03 v0.20
  2.    HaLPaRoTuKTioNS 1999
  3.    http://www.tec.puv.fi/~k3
  4.    e-mail:k3@sah.tec.puv.fi
  5.  
  6.  
  7. THIS SCRIPT NEEDS TO BE COMPETITELY REWRITTEN... THIS IS MY FIRST REXX SCRIPT
  8. KEEP THAT IN MIND WHILE INVESTIGATING THE SECRETS OF MP3PURISTIN
  9.  
  10. You can modify mp3puristin as much as you like! I've made this to fill my
  11. needs... so if you need something, just add it! Send me a copy of the modified
  12. version and some sort of description about the changes...
  13.  
  14.  
  15. */
  16. /*
  17. History: ! = fix ... + = added somethig ... - = removed something
  18.  
  19. 990914: + First working version... Everything new!!!
  20. 0.01    + Leech and Lame supported
  21.  
  22. 990915: ! Some major fixes
  23. 0.10    + Colors
  24.  
  25. 990916: + User can define which tracks to be encoded
  26. 0.15
  27.  
  28. 990922: ! Something...
  29. 0.16
  30.  
  31. 991013: + Mono encoding now uses -a switch
  32. 0.17    ! Some defaults added and redefined...
  33.  
  34. 991101: ! Uups! There was missing some sections, sorry.
  35. 0.18    ! Uuups uups... ...now fixed...
  36.  
  37. 991203  + variable filename ( by Andreas.Ebbert@gmx.de )
  38. 0.20    ! comments are now in english also.
  39.  
  40. */
  41.  
  42.  
  43. /* Main / Pääohjelma */
  44. TIME('E')
  45. CALL alustus
  46. CALL infoscreen
  47. IF modex ='Y' then CALL muuta
  48. CALL modes
  49. call infoscreen2
  50. IF modex ="Y" then CALL filenamechange
  51. CALL leech
  52. CALL lameta
  53.  
  54. SAY
  55. SAY
  56. SAY gr'Thank you for using this product for 'TIME('R')' seconds'
  57. SAY gr'Look also http://www.tec.puv.fi/~k3 for updates etc...'gray
  58. EXIT
  59.  
  60.  
  61. /* Infoscreen1 */
  62. INFOSCREEN:
  63.  
  64.     SAY cy'┬─────────────────────────────────────┐'
  65.     SAY cy'│ 'gr'MP3PuRiSTiN RL99.12.03 for OS/2     'cy'│'
  66.     SAY cy'│ 'gr'(v0.20)     (c)1999 HaLPaRoTuKTioNS 'cy'│'
  67.     SAY cy'└─────────────────────────────────────┘ '
  68.     SAY cy'Thanks to Andreas Ebbert for filenamechange option'
  69.     SAY
  70.     SAY gr'MP3PuRiSTiN is Freeware... if you like this send me e-mail!!!'
  71.     SAY gr'This version of MP3PuRiSTiN can only use 'bl'leech'gr' and'bl' lame'
  72.     SAY
  73.     SAY re'THERE IS NO CHECKINGS IN THIS SCRIPT, SO BE CAREFUL WHAT YOU TYPE IN!!!'
  74.     SAY re'If something goes wrong -> hit CTRL-C to exit...'
  75.     SAY
  76.     SAY wh'Default Parameters:'
  77.     SAY gr'Mode:    ' cy'joint stereo'
  78.     SAY gr'Bitrate: ' cy'128'
  79.     SAY gr'Quality: ' cy'High (less speed)'
  80.     SAY gr'Grabber: ' cy'Leech'
  81.     SAY gr'Encoder: ' cy'Lame'
  82.     SAY
  83.     SAY pu'Do you want to change these options?(y/n)'gray
  84.     PULL modex .
  85. RETURN
  86.     
  87. INFOSCREEN2:   /* infoscreen2 */
  88.     SAY
  89.     SAY gr'Filename: ' cy''filename
  90.     SAY
  91.     SAY pu'Do you want to change the filename?(y/n)'gray
  92.     PULL modex     
  93. RETURN
  94.     
  95. /* Let's make some colors and default parameters... / Tehdään muutama tarpeellinen väri... */
  96. ALUSTUS:  /*FORMAT*/
  97.  
  98.     'cls'
  99.     es='1b'x'[1;3'
  100.     re=es'1m'; gr=es'2m'; br=es'3m'; bl=es'4m'; pu=es'5m'; cy=es'6m'; wh=es'7m'
  101.     ez='1b'x'[;3'
  102.     gray=ez'7m'
  103.     
  104. /* Defaults / Alkuasetukset */
  105.     smode='-m j'
  106.     br=' 128'
  107.     quality='-h'
  108.     vari='  '
  109.     vbr= '  '
  110.     mono='  '
  111.     filename='track'    
  112. RETURN
  113.  
  114.  
  115. /* Show all the modes / Esitetään kaikki moodit */
  116. MODES:
  117.  
  118.     SAY wh'Here are all the switches... Ingnore if you do not undestand :)'
  119.     SAY gr'mode     'cy smode
  120.     SAY gr'bitrate  'cy br
  121.     SAY gr'quality  'cy quality
  122.  
  123.  
  124.     SAY
  125.     SAY gr'variable 'cy vari
  126.     SAY gr'vbr      'cy vbr
  127.     SAY wh'lame 'smode' -b'br' 'quality' 'vari' 'vbr' <in.wav> <out.mp3>'gray
  128.     SAY
  129.  
  130. RETURN
  131.  
  132. /* Getting some information about CD */
  133. LEECH:
  134.  
  135.     SAY pu'In which drive you have the audio cd...?'gray
  136.     SAY   'Give only the drive letter... without the :'
  137.     PULL drive
  138.     
  139.     SAY wh'Table of Contents'gray
  140.     '@leech f: toc'
  141.     SAY wh'Above is TOC, you can see there how many tracks there are on CD'
  142.     SAY pu'First track to encode?'gray
  143.     PULL track_first
  144.     SAY pu'Last track to encode?'gray
  145.     PULL track_last
  146. RETURN
  147.  
  148.  
  149. /* Leech & Lame / Nyt se alkaa, nääs se lametus ja leetsaus*/
  150.  
  151. LAMETA:
  152. DO WHILE track_first <= track_last
  153.     
  154.     '@leech 'drive': track ' track_first' "'filename'"'
  155.  
  156.     IF track_first < 10
  157.                
  158.     THEN
  159.     DO
  160.         filenameWAV = filename'_0'track_first'.wav'
  161.         filenameMP3 = filename'_0'track_first'.mp3'
  162.     END        
  163.     ELSE
  164.     DO
  165.         filenameWAV = filename'_'track_first'.wav'
  166.         filenameMP3 = filename'_'track_first'.mp3'
  167.     END
  168.     
  169.     
  170.     '@lame  'smode' -b 'br' 'quality' 'vari' 'vbr' 'mono' "'filenameWAV'" "'filenameMP3'"'
  171.     '@del "'filenameWAV'" >nul'
  172.  
  173.     track_first=track_first + 1
  174.     
  175. END    
  176. RETURN    
  177.  
  178.  
  179. /* Changing the options / Asetuksien muuttaminen tehdään täällä */
  180. MUUTA: /* muuta=change */
  181.  
  182.     SAY
  183.     SAY wh'Choose one of the following:'
  184.     SAY pu'a)'wh' Custom (make your own decicions)'
  185.     SAY pu'b)'wh' Stereo, br 160, High quality'
  186.     SAY pu'c)'wh' Stereo, br 192, High quality'
  187.     SAY pu'd)'wh' Joint Stereo, Variable br, min br 112, Vquality 4 (br will be 128-160)'
  188.     SAY pu'e)'wh' Stereo, Variable br, min br 128, Vquality 6...'
  189.     SAY pu'f)'wh' Mono, br 80... not so good...'
  190.     
  191.     PULL custom
  192.     IF custom='F' then
  193.         DO
  194.             smode=' -m m '
  195.             mono =' -a '
  196.             br=' 80 '
  197.             quality='  '
  198.             vari='  '
  199.             vbr=' '
  200.         RETURN
  201.         END
  202.     
  203.     IF custom='E' then
  204.         DO
  205.             smode=' -m s '
  206.             br=' 128 '
  207.             quality=' -h '
  208.             vari=' -v '
  209.             vbr=' -V 6'
  210.         RETURN
  211.         END
  212.     
  213.     
  214.     IF custom='D' then
  215.         DO
  216.             smode=' -m j '
  217.             br=' 112'
  218.             quality=' -h '
  219.             vari=' -v '
  220.             vbr=' -V 4'
  221.         RETURN
  222.         END
  223.     
  224.     
  225.     IF custom='C' then
  226.         DO
  227.             smode=' -m s '
  228.             br=' 192 '
  229.             quality=' -h '
  230.         RETURN
  231.         END
  232.     IF custom='B' then
  233.         DO
  234.             smode=" -m s "
  235.             br=' 160 '
  236.             quality=' -h '
  237.         RETURN
  238.         END
  239.     ELSE
  240.  
  241.     SAY gr'MODE:    'pu'(s)tereo (j)oint, (f)orce or (m)ono? 'gray
  242.     PULL smodex
  243.     if smodex='S' then smode="-m s"
  244.     if smodex='F' then smode="-m f"
  245.     if smodex='J' then smode="-m j"
  246.     if smodex='M' then do
  247.         smode="-m m"
  248.         mono=" -a "
  249.         END
  250.     
  251.     SAY gr'QUALITY: 'pu'(h)igh, (f)ast or (n)ormal?'gray
  252.     pull askq
  253.     if askq='H' then quality=' -h '
  254.     if askq='F' then quality=' -f '
  255.     if askq='N' then quality='    '
  256.  
  257.     SAY gr'VARIABLE BITRATE: 'pu'(y/n)'gray
  258.     PULL vari
  259.     IF vari='Y' then
  260.         DO
  261.             SAY gr'VBR QUALITY:'pu' 0=high quality... 9=lowest'gray
  262.             PULL vbr
  263.             tmp=vbr
  264.             vbr='-V 'tmp
  265.             SAY wh'OK, the next bitrate sets the allowed minimum bitrate'gray
  266.             vari=' -v '
  267.         END
  268.     ELSE vari=' '
  269.     
  270.     SAY   gr'BITRATE:'pu' 32,40,56,64,80,96,112,128,160,192,224,256 or 320? 'gray
  271.     PULL br
  272.     RETURN
  273.     
  274. FILENAMECHANGE:
  275.     SAY
  276.     SAY   gr'current filename:'pu filename gray
  277.     SAY   gr'new filename (may contain spaces, etc.): 'pu
  278.     PARSE PULL filename
  279.     
  280.     RETURN
  281.     
  282.