home *** CD-ROM | disk | FTP | other *** search
/ Visual FX for Image FX / VisualFX for Image FX 3.adf / Files / SetUp / 03 / 09.rexx < prev    next >
Encoding:
OS/2 REXX Batch file  |  1997-09-10  |  8.3 KB  |  348 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. parse arg Num Frames
  12. options results
  13. address "IMAGEFX.1"
  14. Quotes = '22'X
  15.  
  16.     RequestResponse "Do You Need Instructions?"
  17.     if rc = 0 then do
  18.         call Docs()
  19.         end    
  20.  
  21. if exists("libs:flyer.library") then do
  22.     if (POS('PROJECT_REXX_PORT',SHOW('Ports')) =0) then do
  23.         RequestNotify 'Flyer Must Be Running First!'
  24.         exit
  25.         end
  26.     call OpenFlyStuff()
  27.  
  28.  
  29.     Gadget.1 = 'D/130/22/120/Main Image Type/4/FLYER CLIP/FLYER STILL/FRAME/SEQUENCE'
  30.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 270 60
  31.     if rc ~= 0 then do
  32.         call CloseStuff()
  33.         exit 0
  34.         end
  35.     else do
  36.         IAType = RESULT.1
  37.            end
  38.  
  39.     call GetA()
  40. end
  41. else do
  42.     Gadget.1 = 'D/130/22/120/Main Image Type/2/FRAME/SEQUENCE'
  43.     ComplexRequest  '"Visual FX  SetUp Options"' 1 Gadget 270 60
  44.     if rc ~= 0 then do
  45.         call CloseStuff()
  46.         exit 0
  47.         end
  48.     else do
  49.         IAType = RESULT.1+2
  50.            end
  51.  
  52.     call GetA()
  53. end
  54.  
  55. if FlyOn = 1 then
  56.     call CloseStuff()
  57.  
  58.     Gadget.1 = ' Do You Want Beveled Borders? '
  59.     Gadget.2 = ' Beveled Borders '
  60.     Gadget.3 = ' No Beveled Borders '
  61.     ListRequest 3 Gadget
  62.     Borders= 0
  63.     if result = 2 then Borders = 1
  64.     if result = 3 then Borders = 0
  65.  
  66.     Gadget.1 = ' Do You Want Drop Shadows? '
  67.     Gadget.2 = ' Use Drop Shadows '
  68.     Gadget.3 = ' No Drop Shadows '
  69.     ListRequest 3 Gadget
  70.     Shadows= 0
  71.     if result = 2 then Shadows = 1
  72.     if result = 3 then Shadows = 0
  73.  
  74.  
  75.     Gadget.1 = ' Select Option For Top Border? '
  76.     Gadget.2 = ' Use Scrolling Image '
  77.     Gadget.3 = ' Use Color Shading '
  78.     ListRequest 3 Gadget
  79.     TopType= 0
  80.     if result = 2 then TopType = 0
  81.     if result = 3 then TopType = 1
  82.  
  83.     ReDraw On
  84.     if TopType = 0 then do
  85.         LoadBuffer "VFXIFX:Images/Pics/Seamless.Pic" Force
  86.         RequestNotify "Look At Examples For FileName Then Click "Quotes"Okay"Quotes""
  87.     
  88.         RequestFile '"Select File To Scroll At Top!" "VFXIFX:Images/Seamless" ""'
  89.         PicAName = result
  90.         text1 = '"Move X"'
  91.         text2 = '"Move Y"'
  92.         Gadget.1  = 'SLIDER LE=60 TE=4 WD=150 HT=14 LB='text1' IN=1 LO=-10 HI=10 LV=%-3ld'
  93.         Gadget.2  = 'SLIDER LE=60 TE=22 WD=150 HT=14 LB='text2' IN=1 LO=-10 HI=10 LV=%-3ld'
  94.         Gadget.3 = 'END'
  95.         NewComplexRequest  '"Select X & Y Movements!"' Gadget 250 42
  96.         if rc ~= 0 then do
  97.             XOffA = 0
  98.             YOffA = 0
  99.             end
  100.         else do
  101.             XOffA = RESULT.1
  102.             YOffA = RESULT.2
  103.             end
  104.         end
  105.     if TopType = 1 then do
  106.         RequestNotify "Click On Color To Use For Top Then Click "Quotes"Okay"Quotes""
  107.         ActiveColor
  108.         TopColor = result
  109.         end
  110.  
  111.     if Borders = 1 then do
  112.         RequestNotify "Click On Color To Use For Top Border Then Click "Quotes"Okay"Quotes""
  113.         ActiveColor
  114.         ColorA = result
  115.         end
  116.  
  117.     Gadget.1 = ' Select Option For Bottom Border? '
  118.     Gadget.2 = ' Use Scrolling Image '
  119.     Gadget.3 = ' Use Color Shading '
  120.     ListRequest 3 Gadget
  121.     BottomType= 0
  122.     if result = 2 then BottomType = 0
  123.     if result = 3 then BottomType = 1
  124.  
  125.     if BottomType = 0 then do
  126.  
  127.         if TopType = 1 then do
  128.             LoadBuffer "VFXIFX:Images/Pics/Seamless.Pic" Force
  129.             RequestNotify "Look At Examples For FileName Then Click "Quotes"Okay"Quotes""
  130.             end
  131.         RequestFile '"Select File To Scroll At Bottom!" "VFXIFX:Images/Seamless" ""'
  132.         PicBName = result
  133.         text1 = '"Move X"'
  134.         text2 = '"Move Y"'
  135.         Gadget.1  = 'SLIDER LE=60 TE=4 WD=150 HT=14 LB='text1' IN=-1 LO=-10 HI=10 LV=%-3ld'
  136.         Gadget.2  = 'SLIDER LE=60 TE=22 WD=150 HT=14 LB='text2' IN=1 LO=-10 HI=10 LV=%-3ld'
  137.         Gadget.3 = 'END'
  138.         NewComplexRequest  '"Select X & Y Movements!"' Gadget 250 42
  139.         if rc ~= 0 then do
  140.             XOffB = 0
  141.             YOffB = 0
  142.             end
  143.         else do
  144.             XOffB = RESULT.1
  145.             YOffB = RESULT.2
  146.             end
  147.         end
  148.     if BottomType = 1 then do
  149.         RequestNotify "Click On Color To Use For Bottom Then Click "Quotes"Okay"Quotes""
  150.         ActiveColor
  151.         BottomColor = result
  152.         end
  153.  
  154.     if Borders = 1 then do
  155.         RequestNotify "Click On Color To Use For Bottom Border Then Click "Quotes"Okay"Quotes""
  156.         ActiveColor
  157.         ColorB = result
  158.         end
  159.     ActiveColor 1
  160.  
  161.  
  162. call open TempFile,"VFXIFX:TempDrawer/"strip(Num),W
  163. call writeln TempFile,PicName
  164. call writeln TempFile,Start
  165. call writeln TempFile,End
  166. call writeln TempFile,IAType
  167. call writeln TempFile,PicAName
  168. call writeln TempFile,XOffA
  169. call writeln TempFile,YOffA
  170. call writeln TempFile,ColorA
  171. call writeln TempFile,PicBName
  172. call writeln TempFile,XOffB
  173. call writeln TempFile,YOffB
  174. call writeln TempFile,ColorB
  175. call writeln TempFile,Borders
  176. call writeln TempFile,Shadows
  177. call writeln TempFile,TopType
  178. call writeln TempFile,BottomType
  179. call writeln TempFile,TopColor
  180. call writeln TempFile,BottomColor
  181.  
  182. call close TempFile
  183. exit
  184.  
  185.  
  186.  
  187. GetFile:
  188.     parse Arg Title, Path
  189.     Address FLY_1 SetString Path
  190.     Address FLY_1 GetFileNameNT Title
  191. return result
  192.  
  193. GetFileName: procedure  
  194.    ARG CompleteName
  195.    c = lastpos("/",CompleteName)
  196.    if c = 0 then c = lastpos(":",CompleteName)
  197.    return substr(CompleteName, c + 1)
  198.  
  199.  
  200. GetA:
  201.  if IAType = 0 then do
  202.     call Switcher(TOSW)
  203.     PicName = GetFile("Select Flyer Clip For Main Image!  ",DriveName)
  204.     Name = GetFileName(PicName)
  205.     if Name = "" then do
  206.         Address FLY_1 OK_TEXT " OK "
  207.         Title = "You Must Enter A Valid Clip Name To Use!"
  208.         Address FLY_1 FYINT Title
  209.         Address FLY_1 Quit
  210.         call Switcher(TOWB)
  211.         exit
  212.         end
  213.     Address FLY_1 SetFileName PicName
  214.     Address FLY_1 GetClipLength PicName
  215.     End = result
  216.     Start = 0
  217.     Address FLY_1 Program "5"
  218.     Address FLY_1 StartNum Start
  219.     Address FLY_1 EndNum End
  220.     Address FLY_1 CurrentNum "0"
  221.     Address FLY_1 GetTimeNT "Select A Range Of Frames To Process!"
  222.     Start = word(result,1)*2
  223.     End = word(result,2)*2
  224.     Start  = Start + 1
  225.     End = End +2
  226.     call addlib('PROJECT_REXX_PORT' , 0)
  227.     call addlib(TOASTERLIB,0)
  228.     call Switcher(TOWB)
  229.     address command "C:Wait 1"
  230.     ScreenToFront
  231.     end
  232.    if IAType = 1 then do
  233.     RequestFile '"Select Flyer Still For Main Image!"' DriveName ' '
  234.     PicName = result
  235.     Name = GetFileName(PicName)
  236.     if Name = "" then do
  237.         Title = "You Must Enter A Valid Name To Use!"
  238.         RequestNotify Title
  239.         if FlyOn = 1 then Address FLY_1 Quit
  240.         exit
  241.         end
  242.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  243.     End = result
  244.     Start = 1
  245.     end
  246.    if IAType = 2 then do
  247.     RequestFile '"Select FileName For Main Image!"' 'SYS:' ' '
  248.     PicName = result
  249.     Name = GetFileName(PicName)
  250.     if Name = "" then do
  251.         Title = "You Must Enter A Valid Name To Use!"
  252.         RequestNotify Title
  253.         if FlyOn = 1 then Address FLY_1 Quit
  254.         exit
  255.         end
  256.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  257.     End = result
  258.     Start = 1
  259.     end
  260.    if IAType = 3 then do
  261.     RequestFile '"Select BaseName For Main Image! "' 'SYS:' ' '
  262.     PicName = result
  263.     Name = GetFileName(PicName)
  264.     if Name = "" then do
  265.         Title = "You Must Enter A Valid Name To Use!"
  266.         RequestNotify Title
  267.         if FlyOn = 1 then Address FLY_1 Quit
  268.         exit
  269.         end
  270.     RequestNumber '"Enter Number Of Frames To Process!"' Frames
  271.     End = result
  272.     Start = 1
  273.     end
  274. return
  275.  
  276. CloseStuff:
  277.     Address FLY_1 Quit
  278.     call remlib('ToasterARexx.port')
  279.     call remlib('PROJECT_REXX_PORT')
  280. return
  281.  
  282.  
  283. OpenFlyStuff:
  284.     FlyOn = 1
  285.     address command "run VFXIFX:FLY" 
  286.     do while (POS('FLY_1',SHOW('Ports')) = 0)
  287.         address command "wait 1"
  288.         end
  289.     TOASTERLIB="ToasterARexx.port"
  290.     call remlib('ToasterARexx.port')
  291.     call remlib('PROJECT_REXX_PORT')
  292.     call addlib('PROJECT_REXX_PORT' , 0)
  293.     call addlib(TOASTERLIB,0)
  294.     DriveName = FindDrive()
  295. return
  296.  
  297.  
  298. FindDrive:
  299.     address command "C:Info >RAM:DriveList"
  300.     call open TempFile,"RAM:DriveList",R
  301.     do until eof(TempFile)
  302.         line = readln(TempFile)
  303.         parse var line Drive" "Rest
  304.         if Drive = "FA0:" then 
  305.             FlyVolume = word(Rest,7)":"
  306.     end
  307.     call close TempFile
  308.     address command "Delete >NIL: RAM:DriveList"
  309. return FlyVolume
  310.  
  311.  
  312.  
  313. LoadA:
  314.     if IAType = 0 then do
  315.         LoadBuffer PicName Force Start
  316.         end
  317.     if IAType = 1 then do
  318.         LoadBuffer PicName Force 1
  319.         end
  320.     if IAType = 2 then do
  321.         LoadBuffer PicName Force
  322.         end
  323.     if IAType = 3 then do
  324.         LoadBuffer PicName""right(Start,3,'0') Force
  325.         end
  326. return
  327.  
  328.  
  329.  
  330. Docs:
  331.  
  332.     text1 = '"This effect takes an image and adds a scrolling Image"'
  333.     text2 = '"on the top and bottom of the screen. Each can scroll"'
  334.     text3 = '"in different directions and be different images. Both"'
  335.     text4 = '"will also have a beveled edge whose color is selected"'
  336.     text5 = '"by the user as well. "'
  337.  
  338.     Gadget.1  = 'TEXT LE=10 TE=4 LB='text1' '
  339.     Gadget.2  = 'TEXT LE=10 TE=14 LB='text2' '
  340.     Gadget.3  = 'TEXT LE=10 TE=24 LB='text3' '
  341.     Gadget.4  = 'TEXT LE=10 TE=34 LB='text4' '
  342.     Gadget.5  = 'TEXT LE=10 TE=44 LB='text5' '
  343.     Gadget.6 = 'END'
  344.     NewComplexRequest  '"Instructions For Effect #09"' Gadget 400 56
  345.  
  346. return
  347.  
  348.