home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga MA Magazine 1998 #6
/
amigamamagazinepolishissue1998.iso
/
www
/
www.amiga.org
/
prowave
/
abb.lha
/
BlackBox.rexx
< prev
next >
Wrap
OS/2 REXX Batch file
|
1997-10-01
|
8KB
|
326 lines
/* This is Black Box */
/* Batch mode is now enabled */
OPTIONS RESULTS
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
call addlib('PROJECT_REXX_PORT' , 0)
call ADDLIB('ToasterARexx.port' , 0)
call req_error("Audio Black Box ")
IO = req_tell("BlackBox Audio Convertor", "Click Continue to Import Audio", "Click Cancel to Export Audio")
if IO = 1 then do
call req_error("Audio Black Box --- Load various Audio formats to Flyer Drives")
batch = req_tell("Select Mode of Import","Single File or Batch Load","Click Continue for Single File","Click Cancel for Batch Loading")
SAY "This is Batch "
SAY batch
if batch = 0 then do
SAY "File is Open"
OPEN(myfile,"ram:bbimport.txt",'Write')
end
Blackbox = 1
do while Blackbox = 1
count = req_tell("Import Audio to Flyer","Select Number of Input Files","Click Continue for 1 File","Click Cancel for 2 Files")
if count = 0 then do
rx startfilereq("Select Left Audio Source")
exit=1
do while exit=1
filename1=queryfilereq()
if filename1=0 then call quit
else NOOP
if filename1~="" then exit=0
else NOOP
address command "c:wait 1"
end
call req_close()
rx startfilereq("Select Right Audio Source","","")
exit=1
do while exit=1
filename2=queryfilereq()
if filename2=0 then call quit
else NOOP
if filename2~="" then exit=0
else NOOP
address command "c:wait 1"
end
call req_close()
end
if count = 1 then do
rx startfilereq("Select Audio Source")
exit=1
do while exit=1
filename1=queryfilereq()
if filename1=0 then call quit
if filename1~="" then exit=0
address command "c:wait 1"
end
call req_close()
end
rx startfilereq("Output Filename","","")
exit=1
do while exit=1
filename3=queryfilereq()
if filename3=0 then call quit
if filename3~="" then exit=0
address command "c:wait 1"
end
call req_close()
call strip
if batch = 1 then do
call req_open("Processing... Please Wait.")
if count = 1 then
address command "prowave:BBWrite "||filename1||" "||filename3
else
address command "prowave:BBWrite "||filename1||" "||filename2||" "||filename3
call req_close()
call req_error("All done.")
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
exit
end
if batch = 0 then do
if count = 1 then do
SAY "Writeln is done"
WRITELN(myfile,"prowave:BBWrite "||filename1||" "||filename3);
end
if count = 2 then do
SAY "Writeln is 3"
WRITELN(myfile,"prowave:BBWrite "||filename1||" "||filename2||" "||filename3);
end
end
mytest = req_tell("Add Another File","Click Continue to Add File","Click Cancel to Process")
SAY mytest
if mytest = 0 then do
CLOSE(myfile)
SAY "We are Almost done"
address command "execute ram:bbimport.txt"
Leave
end
end
end
if IO = 0 then do
call req_error("Audio Black Box --- Save Flyer Audio to Various Formats")
batch = req_tell("Select Mode of Export","Single File or Batch SAVE","Click Continue for Single File","Click Cancel for Batch Loading")
SAY "This is Batch "
SAY batch
if batch = 0 then do
SAY "File is Open"
OPEN(myfile,"ram:bbexport.txt",'Write')
end
Blackbox = 1
do while Blackbox = 1
rx startfilereq("Select Audio Source")
exit=1
do while exit=1
filename1=queryfilereq()
if filename1=0 then call quit
if filename1~="" then exit=0
address command "c:wait 1"
end
call req_close()
count = req_tell("Export Audio from Flyer","Select Number of Output Files","Click Continue for 1 File","Click Cancel for 2 Files")
if count = 0 then do
alpha = 2
rx startfilereq("Left Output Filename")
exit=1
do while exit=1
filename2=queryfilereq()
if filename2=0 then call quit
else NOOP
if filename2~="" then exit=0
else NOOP
address command "c:wait 1"
end
call req_close()
rx startfilereq("Right Output Filename","","")
exit=1
do while exit=1
filename3=queryfilereq()
if filename3=0 then call quit
else NOOP
if filename3~="" then exit=0
else NOOP
address command "c:wait 1"
end
call req_close()
end
if count = 1 then do
rx startfilereq("Output Filename","","")
exit=1
do while exit=1
filename3=queryfilereq()
if filename3=0 then call quit
if filename3~="" then exit=0
address command "c:wait 1"
end
call req_close()
end
warlock2 = 0
warlock = req_buttons("Pick Output Format",1000,"AIFF","AD516","WAV","MORE");
if warlock = CANCEL then call quit
if warlock = 0001 then do
warlock2 = req_buttons("Pick Output Format",1000,"RAW 16 Bit","Amiga IFF","VOC","Sun/Next AU");
end
if warlock = 0 then call quit
if warlock >= 1000 then
type = 1
else
if warlock >= 100 then
type = 2
else
type = 3
if warlock2 >= 1000 then
type = 4
else
if warlock2 >= 100 then
type = 5
else
if warlock2 >= 10 then
type = 6
else
if warlock2 > 0 then
type = 7
if warlock2 = CANCEL then call quit
SAY Type
call strip
SAY "This is Count "||count
if batch = 1 then do
call req_open("Processing... Please Wait.")
if count = 1 then do
address command "prowave:BBRead "||type||" "||'"'||filename1||'"'||" "||'"'||filename3||'"'
end
if count = 0 then do
address command "prowave:BBRead "||type||" "||'"'||filename1||'"'||" "||'"'||filename2||'"'||" "||'"'||filename3||'"'
end
call req_close()
exit
end
if batch = 0 then do
if count = 1 then do
WRITELN(myfile,"prowave:BBRead "||type||" "||filename1||" "||filename3);
end
if count = 0 then do
WRITELN(myfile,"prowave:BBread "||type||" "||filename1||" "||filename2||" "||filename3);
end
mytest = req_tell("Add Another File","Click Continue to Add File","Click Cancel to Process")
SAY mytest
if mytest = 0 then do
CLOSE(myfile)
SAY "We are Almost done"
address command "execute ram:bbexport.txt"
Leave
end
end
call req_close()
end
quit:
call req_error("Canceled.")
call remlib('ToasterARexx.port')
call remlib('PROJECT_REXX_PORT')
exit
strip:
say filename1
position1 = lastpos(':',filename1)
position2 = lastpos(':',filename1,position1-1)
if position2 ~= 0 then do
filename1 = right(filename1,length(filename1)-position2)
end
say filename1
if alpha = 2 then do
say filename2
position1 = lastpos(':',filename2)
if position2 ~= 0 then do
position2 = lastpos(':',filename2,position1-1)
end
if position2 ~= 0 then do
filename2 = right(filename3,length(filename2)-position2)
end
say filename2
end
say filename3
position1 = lastpos(':',filename3)
position2 = lastpos(':',filename3,position1-1)
if position2 ~= 0 then do
filename3 = right(filename3,length(filename3)-position2)
end
say filename3
return