home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / ADPro251-3.DMS / ADPro251-3.adf / FREDScripts.lha / FREDSavers / FrameBuilder.fred.pre < prev    next >
Encoding:
Text File  |  1994-01-31  |  4.3 KB  |  195 lines

  1. /*
  2. ** FrameBuilder.fred.pre
  3. **
  4. ** $VER: FrameBuilder.fred.pre 1.3.0 (5.11.93)
  5. **
  6. ** If the FrameBuilder.fred script appears in the InvokeADPro list,
  7. ** this program will ask the user how the fields are organized and
  8. ** named in the sequence.
  9. **
  10. ** This script assumes that the even field will be listed before the
  11. ** odd field (i.e., even,odd ordering).
  12. **
  13. ** Clips Exported:
  14. **    FREDNumberOfFrames    -    Total frames selected
  15. **    FREDSameBaseName    -    ~0 if field 0 and 1 basenames are the same
  16. **                    0 if they are different
  17. **    FREDUsesFieldExt    -    ~0 if field 0 and 1 have extensions
  18. **                    0 if they don't
  19. **    FREDEvenFieldExt    -    Filename extension for even fields
  20. **    FREDOddFieldExt        -    Filename extension for odd fields
  21. **    FREDFieldBaseNameToUse    -    0 if the even field's base name
  22. **                    should be used for the new frame
  23. **                    1 if the odd field's base name
  24. **                    should be used
  25. **    FREDNextFieldFlag    -    0 if ready for new field pair
  26. **                    1 if ready to work on second field
  27. **
  28. ** NOTE: Clip names are case sensitive.
  29. **
  30. ** This script requires FRED v1.4.0 (or higher) to run.  Also required is
  31. ** ADPro v2.5.0 (or higher).
  32. **
  33. ** Copyright © 1992-1993 ASDG, Incorporated
  34. ** All Rights Reserved
  35. */
  36.  
  37.  
  38. ADDRESS "ADPro"
  39. OPTIONS RESULTS
  40.  
  41. PARSE ARG NumberOfCells NumberOfFrames
  42.  
  43. NL = '0A'X
  44. SQ = '27'X
  45. DQ = '22'X
  46. TRUE  = 1
  47. FALSE = 0
  48.  
  49.  
  50. /*
  51. ** Ensure that at least two frames are to be processed and that there
  52. ** is an even number of frames to build.
  53. */
  54.  
  55. IF (NumberOfFrames < 2) THEN DO
  56.     ADPRO_TO_FRONT
  57.     OKAY1 "Frame count must be more than 2." || NL ||,
  58.         "You currently have only " || NumberOfFrames || NL ||,
  59.         "frames in this sequence."
  60.     SCREEN_TO_FRONT "FRED"
  61.     EXIT 10
  62. END
  63.  
  64. IF ((NumberOfFrames // 2) ~= 0) THEN DO
  65.     ADPRO_TO_FRONT
  66.     OKAY1 "There must me an even number" || NL ||,
  67.         "of frames in the sequence." || NL ||,
  68.         "You currently have " || NumberOfFrames || NL ||,
  69.         "frames in this sequence."
  70.     SCREEN_TO_FRONT "FRED"
  71.     EXIT 10
  72. END
  73.  
  74.  
  75. /*
  76. ** Ask the user if the frame for the even field and odd field have
  77. ** a distinguishable filename extension.  If they do, get the extensions
  78. ** for the even and odd fields.
  79. */
  80.  
  81. ADPRO_TO_FRONT
  82.  
  83. OKAYN '"FrameBuilder.fred"' '"Are same basenames used?"' '"Yes|No|Cancel"'
  84. IF (RC = 0) THEN DO
  85.     SCREEN_TO_FRONT "FRED"
  86.     EXIT 10
  87. END
  88. ELSE
  89.     SameBaseName = 2 - RC
  90.  
  91. IF (SameBaseName = 0) THEN DO
  92.     ADPRO_TO_FRONT
  93.  
  94.     OKAYN '"FrameBuilder.fred"' '"Use basename from which field?"' '"Odd Field|Even Field|Cancel"'
  95.     IF (RC = 0) THEN DO
  96.         SCREEN_TO_FRONT "FRED"
  97.         EXIT 10
  98.     END
  99.     ELSE
  100.         FieldBaseNameToUse = 2 - RC
  101.  
  102.     ADPRO_TO_FRONT
  103.  
  104.     OKAYN '"FrameBuilder.fred"' '"Are field extensions used?"' '"Yes|No|Cancel"'
  105.     IF (RC = 0) THEN DO
  106.         SCREEN_TO_FRONT "FRED"
  107.         EXIT 10
  108.     END
  109.     ELSE
  110.         UsesFieldExt = 2 - RC
  111. END
  112. ELSE
  113.     UsesFieldExt = 1
  114.  
  115. IF (UsesFieldExt ~= 0) THEN DO
  116.     continue = 0
  117.     DO UNTIL (continue = 1)
  118.         ADPRO_TO_FRONT
  119.  
  120.         GETSTRING '"Extension for even fields"' ".0"
  121.         EvenFieldExt = ADPRO_RESULT
  122.         IF (RC = 0) THEN DO
  123.             IF (EvenFieldExt = "") THEN DO
  124.                 ADPRO_TO_FRONT
  125.  
  126.                 OKAYN '"FrameBuilder.fred"' '"An extension is required."' '"Retry|Cancel"'
  127.                 IF (RC = 0) THEN
  128.                     EXIT 10
  129.             END
  130.             ELSE IF (INDEX( EvenFieldExt, "." ) ~= 1) THEN DO
  131.                 text = "You must enter an extension" || NL ||,
  132.                     "in the form of:  .<extension>"
  133.  
  134.                 ADPRO_TO_FRONT
  135.  
  136.                 OKAYN '"FrameBuilder.fred"' '"'text'"' '"Retry|Cancel"'
  137.                 IF (RC = 0) THEN
  138.                     EXIT 10
  139.             END
  140.             ELSE
  141.                 continue = 1
  142.         END
  143.         ELSE
  144.             EXIT 10
  145.     END
  146.  
  147.     continue = 0
  148.     DO UNTIL (continue = 1)
  149.         ADPRO_TO_FRONT
  150.  
  151.         GETSTRING '"Extension for odd fields"' ".1"
  152.         OddFieldExt = ADPRO_RESULT
  153.         IF (RC = 0) THEN DO
  154.             IF (OddFieldExt = "") THEN DO
  155.                 ADPRO_TO_FRONT
  156.  
  157.                 OKAYN '"FrameBuilder.fred"' '"An extension is required."' '"Retry|Cancel"'
  158.                 IF (RC = 0) THEN
  159.                     EXIT 10
  160.             END
  161.             ELSE IF (INDEX( OddFieldExt, "." ) ~= 1) THEN DO
  162.                 text = "You must enter an extension" || NL ||,
  163.                     "in the form of:  .<extension>"
  164.  
  165.                 ADPRO_TO_FRONT
  166.  
  167.                 OKAYN '"FrameBuilder.fred"' '"'text'"' '"Retry|Cancel"'
  168.                 IF (RC = 0) THEN
  169.                     EXIT 10
  170.             END
  171.             ELSE
  172.                 continue = 1
  173.         END
  174.         ELSE
  175.             EXIT 10
  176.     END
  177. END
  178.  
  179. SCREEN_TO_FRONT "FRED"
  180.  
  181.  
  182. /*
  183. ** Update the clips.
  184. */
  185.  
  186. SETCLIP( "FREDNumberOfFrames", NumberOfFrames )
  187. SETCLIP( "FREDSameBaseName", SameBaseName )
  188. SETCLIP( "FREDUsesFieldExt", UsesFieldExt )
  189. SETCLIP( "FREDEvenFieldExt", EvenFieldExt )
  190. SETCLIP( "FREDOddFieldExt", OddFieldExt )
  191. SETCLIP( "FREDFieldBaseNameToUse", FieldBaseNameToUse )
  192. SETCLIP( "FREDNextFieldFlag", 0 )
  193.  
  194. EXIT 0
  195.