home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: Multimed
/
Multimed.zip
/
lame384.zip
/
lame-batch.cmd
< prev
next >
Wrap
OS/2 REXX Batch file
|
2000-06-23
|
3KB
|
113 lines
/********************************/
/* Nicks Lame Batch Processor */
/* */
/* gagravarr@softhome.net */
/* 14/06/2000 */
/********************************/
PARSE ARG args
'@ECHO OFF'
lastarg = WORDS( args ) - 2
IF lastarg < 0 THEN DO
SAY "Error - please use LAME style commandline options"
EXIT
END
infile = WORD( args, WORDS( args ) - 1 )
instart = ""
intemp = infile
go = 1
DO WHILE LENGTH( intemp ) > 0
PARSE VALUE intemp WITH next "\" intemp
IF LENGTH( intemp ) = 0 THEN DO
/* dum de dum */
END
ELSE DO
IF LENGTH( instart = 0 ) THEN instart = next
ELSE instart = instart"\"next
END
END
IF LENGTH( instart ) > 0 THEN instart = instart"\"
IF LENGTH( instart ) = 0 THEN DO
IF SUBSTR( infile, 2, 1 ) = ":" THEN instart = SUBSTR( infile, 1, 2 )
END
lamearg = ""
pos = 1
DO lastarg
lamearg = lamearg" "WORD( args, pos )
pos = pos + 1
END
tempfile = 'lamefind.out'
tempfileb = 'lamecheck.out'
PARSE SOURCE ran
go = 1
rpath = ""
lpath = ""
tpath = WORD( ran, 3 )
first = 1
DO WHILE go = 1
IF first = 0 THEN rpath = rpath""lpath"\"
PARSE VALUE tpath WITH lpath "\" tpath
IF LENGTH( tpath ) = 0 THEN go = 0
first = 0
END
'DIR 'infile' /b /-p > 'tempfile
rc = LINEIN( tempfile,,0 )
DO WHILE LINES( tempfile )
infilename = LINEIN( tempfile )
infilename = instart""infilename
PARSE VALUE infilename WITH filename ".wav" junk
PARSE VALUE filename WITH filename ".WAV" junk
posstar = COMPARE(filename,infile)
newwork = " "WORD( args, WORDS( args ) )
PARSE VALUE newwork WITH newstart "*" newend
newstart = RIGHT( newstart, LENGTH(newstart) - 1 )
wanted = RIGHT( filename, LENGTH( filename ) + 1 - posstar )
'DIR 'newstart''wanted''newend' /b /-p 2>&1 | 'rpath'lame-batch2.cmd RECURSIVE FILE CHECK 'tempfileb
fl = LINEIN( tempfileb )
rc = STREAM(tempfileb,'c','close')
go = 1
/* SAY "**"WORD( fl, 1 )"**" */
IF WORD( fl, 1 ) = "SYS0002:" THEN NOP
ELSE DO
SAY "Warning - Target File ("newstart''wanted''newend") Exists!"
SAY "Overwrite?"
PARSE UPPER PULL ow
IF SUBSTR( ow, 1, 1 ) = "Y" THEN go = 1
ELSE go = 0
END
IF go = 1 THEN DO
SAY "Encoding "infilename "As "newstart''wanted''newend
'LAME 'lamearg' "'infilename'" "'newstart''wanted''newend'"'
END
ELSE DO
SAY "Encoding of "infilename "skipped"
END
END
rc = STREAM(tempfile,'c','close')
'ERASE 'tempfile
'ERASE 'tempfileb
EXIT