home *** CD-ROM | disk | FTP | other *** search
- /*
- ** FrameBuilder.fred.pre
- **
- ** $VER: FrameBuilder.fred.pre 1.3.0 (5.11.93)
- **
- ** If the FrameBuilder.fred script appears in the InvokeADPro list,
- ** this program will ask the user how the fields are organized and
- ** named in the sequence.
- **
- ** This script assumes that the even field will be listed before the
- ** odd field (i.e., even,odd ordering).
- **
- ** Clips Exported:
- ** FREDNumberOfFrames - Total frames selected
- ** FREDSameBaseName - ~0 if field 0 and 1 basenames are the same
- ** 0 if they are different
- ** FREDUsesFieldExt - ~0 if field 0 and 1 have extensions
- ** 0 if they don't
- ** FREDEvenFieldExt - Filename extension for even fields
- ** FREDOddFieldExt - Filename extension for odd fields
- ** FREDFieldBaseNameToUse - 0 if the even field's base name
- ** should be used for the new frame
- ** 1 if the odd field's base name
- ** should be used
- ** FREDNextFieldFlag - 0 if ready for new field pair
- ** 1 if ready to work on second field
- **
- ** NOTE: Clip names are case sensitive.
- **
- ** This script requires FRED v1.4.0 (or higher) to run. Also required is
- ** ADPro v2.5.0 (or higher).
- **
- ** Copyright © 1992-1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- ADDRESS "ADPro"
- OPTIONS RESULTS
-
- PARSE ARG NumberOfCells NumberOfFrames
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
-
-
- /*
- ** Ensure that at least two frames are to be processed and that there
- ** is an even number of frames to build.
- */
-
- IF (NumberOfFrames < 2) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Frame count must be more than 2." || NL ||,
- "You currently have only " || NumberOfFrames || NL ||,
- "frames in this sequence."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
- IF ((NumberOfFrames // 2) ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "There must me an even number" || NL ||,
- "of frames in the sequence." || NL ||,
- "You currently have " || NumberOfFrames || NL ||,
- "frames in this sequence."
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
-
-
- /*
- ** Ask the user if the frame for the even field and odd field have
- ** a distinguishable filename extension. If they do, get the extensions
- ** for the even and odd fields.
- */
-
- ADPRO_TO_FRONT
-
- OKAYN '"FrameBuilder.fred"' '"Are same basenames used?"' '"Yes|No|Cancel"'
- IF (RC = 0) THEN DO
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE
- SameBaseName = 2 - RC
-
- IF (SameBaseName = 0) THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"FrameBuilder.fred"' '"Use basename from which field?"' '"Odd Field|Even Field|Cancel"'
- IF (RC = 0) THEN DO
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE
- FieldBaseNameToUse = 2 - RC
-
- ADPRO_TO_FRONT
-
- OKAYN '"FrameBuilder.fred"' '"Are field extensions used?"' '"Yes|No|Cancel"'
- IF (RC = 0) THEN DO
- SCREEN_TO_FRONT "FRED"
- EXIT 10
- END
- ELSE
- UsesFieldExt = 2 - RC
- END
- ELSE
- UsesFieldExt = 1
-
- IF (UsesFieldExt ~= 0) THEN DO
- continue = 0
- DO UNTIL (continue = 1)
- ADPRO_TO_FRONT
-
- GETSTRING '"Extension for even fields"' ".0"
- EvenFieldExt = ADPRO_RESULT
- IF (RC = 0) THEN DO
- IF (EvenFieldExt = "") THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"FrameBuilder.fred"' '"An extension is required."' '"Retry|Cancel"'
- IF (RC = 0) THEN
- EXIT 10
- END
- ELSE IF (INDEX( EvenFieldExt, "." ) ~= 1) THEN DO
- text = "You must enter an extension" || NL ||,
- "in the form of: .<extension>"
-
- ADPRO_TO_FRONT
-
- OKAYN '"FrameBuilder.fred"' '"'text'"' '"Retry|Cancel"'
- IF (RC = 0) THEN
- EXIT 10
- END
- ELSE
- continue = 1
- END
- ELSE
- EXIT 10
- END
-
- continue = 0
- DO UNTIL (continue = 1)
- ADPRO_TO_FRONT
-
- GETSTRING '"Extension for odd fields"' ".1"
- OddFieldExt = ADPRO_RESULT
- IF (RC = 0) THEN DO
- IF (OddFieldExt = "") THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"FrameBuilder.fred"' '"An extension is required."' '"Retry|Cancel"'
- IF (RC = 0) THEN
- EXIT 10
- END
- ELSE IF (INDEX( OddFieldExt, "." ) ~= 1) THEN DO
- text = "You must enter an extension" || NL ||,
- "in the form of: .<extension>"
-
- ADPRO_TO_FRONT
-
- OKAYN '"FrameBuilder.fred"' '"'text'"' '"Retry|Cancel"'
- IF (RC = 0) THEN
- EXIT 10
- END
- ELSE
- continue = 1
- END
- ELSE
- EXIT 10
- END
- END
-
- SCREEN_TO_FRONT "FRED"
-
-
- /*
- ** Update the clips.
- */
-
- SETCLIP( "FREDNumberOfFrames", NumberOfFrames )
- SETCLIP( "FREDSameBaseName", SameBaseName )
- SETCLIP( "FREDUsesFieldExt", UsesFieldExt )
- SETCLIP( "FREDEvenFieldExt", EvenFieldExt )
- SETCLIP( "FREDOddFieldExt", OddFieldExt )
- SETCLIP( "FREDFieldBaseNameToUse", FieldBaseNameToUse )
- SETCLIP( "FREDNextFieldFlag", 0 )
-
- EXIT 0
-