home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 04.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-09-10  |  7.0 KB  |  305 lines

  1. /*
  2.                                  Visual FX
  3.                                     For
  4.                                  Image FX
  5.                                SetUp Script
  6.                            Written By J.L. White
  7.  
  8.                          (C)1997 Merlin's Software
  9.  
  10. */
  11.  
  12. parse arg Num Frames
  13. options results
  14. address "IMAGEFX.1"
  15. ReDraw On
  16. Quotes = '22'X
  17.  
  18.     RequestResponse "Do You Need Instructions?"
  19.     if rc = 0 then do
  20.         call Docs()
  21.         end    
  22.  
  23. if exists("libs:flyer.library") then do
  24.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  25.         RequestNotify 'Flyer Must Be Running First!'
  26.         exit
  27.         end
  28.     call OpenFlyStuff()
  29.  
  30.  
  31.     Gadget.1 = 'D/110/22/120/ImageA Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  32.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  33.     if rc ~= 0 then do
  34.         call CloseStuff()
  35.         exit 0
  36.         end
  37.     else do
  38.         IAType = RESULT.1
  39.            end
  40.  
  41.     call GetA()
  42. end
  43. else do
  44.     Gadget.1 = 'D/110/22/120/ImageA Type/2/FRAME/SEQUENCE'
  45.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 250 60
  46.     if rc ~= 0 then do
  47.         call CloseStuff()
  48.         exit 0
  49.         end
  50.     else do
  51.         IAType = RESULT.1+2
  52.            end
  53.  
  54.     call GetA()
  55. end
  56. if FlyOn = 1 then
  57.     call CloseStuff()
  58.  
  59.     ColorA = 0
  60.     ColorB = 1
  61.     Border = -1
  62.  
  63.     Gadget.1 = ' Select Border Options! '
  64.     Gadget.2 = 'Use Checkerboard Boxes'
  65.     Gadget.3 = 'Use Beveled Edges'
  66.     Gadget.4 = 'Use Normal Edges'
  67.     ListRequest 4 Gadget
  68.     BorderType = 0
  69.     if result = 2 then BorderType = 0
  70.     if result = 3 then BorderType = 1
  71.     if result = 4 then BorderType = 2
  72.  
  73.     if BorderType = 0 then do
  74.         ActiveColor 0
  75.         RequestNotify "Click On Color To Use For 1st Color Then Click "Quotes"Okay"Quotes""
  76.         ActiveColor
  77.         ColorA = result
  78.         ActiveColor 1
  79.         RequestNotify "Click On Color To Use For 2nd Color Then Click "Quotes"Okay"Quotes""
  80.         ActiveColor
  81.         ColorB = result
  82.         ActiveColor 1
  83.  
  84.         end
  85.  
  86.     if BorderType = 1 then do
  87.         NumA = 1
  88.         NumB = 100
  89.         NumC = 30
  90.         RequestSlider '"Enter Thickness Of Bevel!"' NumA NumB NumC
  91.         Border = Result
  92.         end
  93.     CropAnswer = "None"
  94.     RequestResponse "Does Image Need To Be Cropped?"
  95.     if rc = 0 then do
  96.         i = Start
  97.         call LoadA()
  98.         call CropPic()
  99.         end    
  100.  
  101. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  102. call writeln TempFile,PicAName
  103. call writeln TempFile,Start
  104. call writeln TempFile,End
  105. call writeln TempFile,IAType
  106. call writeln TempFile,ColorA
  107. call writeln TempFile,ColorB
  108. call writeln TempFile,Border
  109. call writeln TempFile,BorderType
  110. call writeln TempFile,CropAnswer
  111. call close TempFile
  112. exit
  113.  
  114.  
  115.  
  116.  
  117. CropPic:
  118.     Learn "RAM:VFX" NoHeader Quiet Force
  119.     Crop
  120.     Learn Stop Quiet Force
  121.  
  122.     call open TempFile,"RAM:VFX.ifx",R
  123.     do until eof(TempFile)
  124.         line = readln(TempFile)
  125.         parse var line StartLine" "RestOfLine
  126.         if StartLine = "Crop" then CropAnswer = line
  127.         end
  128.     call close TempFile
  129.     address command "Delete >NIL: Ram:VFX.ifx"
  130.  
  131. return
  132.  
  133. GetFile:
  134.     parse Arg Title, Path
  135.     Address FLY_1 SetString Path
  136.     Address FLY_1 GetFileNameNT Title
  137. return result
  138.  
  139. GetFileName: procedure  
  140.    ARG CompleteName
  141.    c = lastpos("/",CompleteName)
  142.    if c = 0 then c = lastpos(":",CompleteName)
  143.    return substr(CompleteName, c + 1)
  144.  
  145.  
  146. GetA:
  147.  if IAType = 0 then do
  148.     call Switcher(TOSW)
  149.     PicAName = GetFile("Select Flyer Clip For ImageA!  ",DriveName)
  150.     Name = GetFileName(PicAName)
  151.     if Name = "" then do
  152.         Address FLY_1 OK_TEXT " OK "
  153.         Title = "You Must Enter A Valid Clip Name To Use!"
  154.         Address FLY_1 FYINT Title
  155.         Address FLY_1 Quit
  156.         call Switcher(TOWB)
  157.         exit
  158.         end
  159.     Address FLY_1 SetFileName PicAName
  160.     Address FLY_1 GetClipLength PicAName
  161.     End = result
  162.     Start = 0
  163.     Address FLY_1 Program "5"
  164.     Address FLY_1 StartNum Start
  165.     Address FLY_1 EndNum End
  166.     Address FLY_1 CurrentNum "0"
  167.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  168.     Start = word(result,1)*2
  169.     End = word(result,2)*2
  170.     Start  = Start + 1
  171.     End = End +2
  172.     call addlib('PROJECT_REXX_PORT' , 0)
  173.     call addlib(TOASTERLIB,0)
  174.     call Switcher(TOWB)
  175.     address command "C:Wait 1"
  176.     ScreenToFront
  177.     end
  178.    if IAType = 1 then do
  179.     RequestFile '"Select Flyer Still For ImageA!"' DriveName ' '
  180.     PicAName = result
  181.     Name = GetFileName(PicAName)
  182.     if Name = "" then do
  183.         Title = "You Must Enter A Valid Name To Use!"
  184.         RequestNotify Title
  185.         if FlyOn = 1 then Address FLY_1 Quit
  186.         exit
  187.         end
  188.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  189.     End = result
  190.     Start = 1
  191.     end
  192.    if IAType = 2 then do
  193.     RequestFile '"Select FileName For ImageA!"' 'SYS:' ' '
  194.     PicAName = result
  195.     Name = GetFileName(PicAName)
  196.     if Name = "" then do
  197.         Title = "You Must Enter A Valid Name To Use!"
  198.         RequestNotify Title
  199.         if FlyOn = 1 then Address FLY_1 Quit
  200.         exit
  201.         end
  202.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  203.     End = result
  204.     Start = 1
  205.     end
  206.    if IAType = 3 then do
  207.     RequestFile '"Select BaseName For ImageA! "' 'SYS:' ' '
  208.     PicAName = result
  209.     Name = GetFileName(PicAName)
  210.     if Name = "" then do
  211.         Title = "You Must Enter A Valid Name To Use!"
  212.         RequestNotify Title
  213.         if FlyOn = 1 then Address FLY_1 Quit
  214.         exit
  215.         end
  216.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  217.     End = result
  218.     Start = 1
  219.     end
  220. return
  221.  
  222. CloseStuff:
  223.     Address FLY_1 Quit
  224.     call remlib('ToasterARexx.port')
  225.     call remlib('PROJECT_REXX_PORT')
  226. return
  227.  
  228.  
  229. OpenFlyStuff:
  230.     FlyOn = 1
  231.     address command "run VFXIFX:FLY" 
  232.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  233.         address command "wait 1"
  234.         end
  235.     TOASTERLIB="ToasterARexx.port"
  236.     call remlib('ToasterARexx.port')
  237.     call remlib('PROJECT_REXX_PORT')
  238.     call addlib('PROJECT_REXX_PORT' , 0)
  239.     call addlib(TOASTERLIB,0)
  240.     DriveName = FindDrive()
  241. return
  242.  
  243.  
  244. FindDrive:
  245.     address command "C:Info >RAM:DriveList"
  246.     call open TempFile,"RAM:DriveList",R
  247.     do until eof(TempFile)
  248.         line = readln(TempFile)
  249.         parse var line Drive" "Rest
  250.         if Drive = "FA0:" then 
  251.             FlyVolume = word(Rest,7)":"
  252.     end
  253.     call close TempFile
  254.     address command "Delete >NIL: RAM:DriveList"
  255. return FlyVolume
  256.  
  257.  
  258.  
  259. LoadA:
  260.     if IAType = 0 then do
  261.         LoadBuffer PicAName Force i
  262.         end
  263.     if IAType = 1 then do
  264.         LoadBuffer PicAName Force 1
  265.         end
  266.     if IAType = 2 then do
  267.         LoadBuffer PicAName Force
  268.         end
  269.     if IAType = 3 then do
  270.         LoadBuffer PicAName""right(i,3,'0') Force
  271.         end
  272. return
  273.  
  274.  
  275. Docs:
  276.  
  277.     text1 = '"This effect takes an image, scales it and places it in"'
  278.     text2 = '"the center of the screen then surrounds that image with"'
  279.     text3 = '"small copies of itself. You have various options to place"'
  280.     text4 = '"borders or image process the smaller images."'
  281.     text5 = '" "'
  282.     text6 = '"The Crop Image option is there for Flyer Users. The clip"'
  283.     text7 = '"may have garbage on the edges, that are not seen because"'
  284.     text8 = '"of overscan but when scaled to the center, you can see it."'
  285.     text9 = '"This allows you to crop the garbage first, then it will"'
  286.     text10 = '"scale it back to the correct size."'
  287.  
  288.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  289.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  290.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  291.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  292.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  293.     Gadget.6  = 'TEXT LE=10 TE=54 LB='text6' '
  294.     Gadget.7  = 'TEXT LE=10 TE=64 LB='text7' '
  295.     Gadget.8  = 'TEXT LE=10 TE=74 LB='text8' '
  296.     Gadget.9  = 'TEXT LE=10 TE=84 LB='text9' '
  297.     Gadget.10  = 'TEXT LE=10 TE=94 LB='text10' '
  298.     Gadget.11 = 'END'
  299.     NewComplexRequest  '"Instructions For Effect #04"' Gadget 420 106
  300.  
  301. return
  302.  
  303.  
  304.  
  305.