home *** CD-ROM | disk | FTP | other *** search
- /*
- ** _VT_Display
- **
- ** $VER: _VT_Display 1.2.0 (30.12.93)
- **
- ** This program can be run from ADPro's savers list to display the current
- ** raw image data to the current Video Toaster frame buffer.
- **
- ** This script required ADPro v2.5.0 (or higher).
- **
- ** Copyright © 1993 ASDG, Incorporated
- ** All Rights Reserved
- */
-
-
- OPTIONS FAILAT 20
- OPTIONS RESULTS
-
- NL = '0A'X
- SQ = '27'X
- DQ = '22'X
- TRUE = 1
- FALSE = 0
- TempFramestoreDir = "RAM:Framestore"
- TempFramestore = "RAM:Framestore/999.FS.ADProTemp"
- ToasterWidth = 752
- ToasterHeight = 480
- TempImageDir = "T:"
- TempImageName = "ADProTempImage"
-
- ADDRESS "ADPro"
-
- IF (~SHOW( 'P', "ToasterARexx.port" )) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Switcher is not running!"
- ADPRO_TO_BACK
- CALL ErrorOut 10
- END
-
-
- /*
- ** See what type of data is loaded in ADPro/MorphPlus.
- */
-
- CALL "FREDSCRIPTS:FREDFunctions/CheckForRawImageData" TRUE
- IF (RESULT ~= 0) THEN
- CALL ErrorOut 10
-
- IF (~EXISTS( TempFramestoreDir )) THEN
- ADDRESS COMMAND "MakeDir " || TempFramestoreDir
-
- XSIZE
- ImageWidth = ADPRO_RESULT
-
- YSIZE
- ImageHeight = ADPRO_RESULT
-
- IF (ImageWidth ~= ToasterWidth) | (ImageHeight ~= ToasterHeight) THEN DO
- ADPRO_TO_FRONT
-
- OKAY2 "Scale to fill" ToasterWidth "x" ToasterHeight || "?" || NL || NL ||,
- "Select OK to scale image" || NL ||,
- "or Cancel to leave unaltered"
-
- IF (RC = TRUE) THEN DO
- /*
- ** Adjust the pixel aspect of the image.
- */
-
- OPERATOR "DEFINE_PXL_ASPECT" 22 26
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Could not scale to aspect."
- ADPRO_TO_BACK
- CALL ErrorOut 10
- END
-
-
- /*
- ** Scale the image to fill a ToasterWidth x ToasterHeight screen.
- */
-
- ABS_SCALE ToasterWidth ToasterHeight
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Could not scale by percentage."
- ADPRO_TO_BACK
- CALL ErrorOut 10
- END
- END
- END
-
- IF (EXISTS( TempFramestore )) THEN DO
- ADPRO_TO_FRONT
-
- OKAYN '"_VT_Display"' '"Frame 999 already exists. Delete it?"' '"Delete|Cancel"'
- IF (RC = 0) THEN
- CALL ErrorOut 10
- ELSE
- ADDRESS COMMAND "Delete >NIL:" TempFramestore
-
- ADPRO_TO_BACK
- END
-
- SAVER "FRAMESTORE" TempFramestore "RAW" "COMPRESS" 1
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Error saving temp file."
- ADPRO_TO_BACK
- CALL ErrorOut 10
- END
-
- IF (~SHOW( 'L', "ToasterARexx.port" )) THEN
- ADDLIB( "ToasterARexx.port", -1 )
-
- oldFS = Switcher( FSNM )
-
- Switcher( TOSW )
- IF (oldFS = "RAM:") THEN
- /*
- ** IF FSDEV is already RAM:, just re-read it
- */
-
- Switcher( FSBD )
- ELSE DO
- /*
- ** Change the FSDEV to RAM:
- */
-
- IF (Switcher( FSDV, "RAM:" ) ~= SWITCHER) THEN DO
- Switcher( TOWB )
- ADPRO_TO_FRONT
- OKAY1 "Could not change Framestore device."
- ADPRO_TO_BACK
- CALL ErrorOut 10
- END
- END
-
-
- /*
- ** Make sure the frame is really there
- */
-
- FS = Switcher( FMXI, 999 )
- IF (FS = 0) THEN DO
- Switcher( TOWB )
- ADPRO_TO_FRONT
- OKAY1 "Could not load frame into Switcher."
- ADPRO_TO_BACK
- CALL ErrorOut 10
- END
-
-
- /*
- ** Load the frame
- */
-
- IF (Switcher( FMLD, 999 ) ~= SWITCHER) THEN DO
- Switcher( TOWB )
- ADPRO_TO_FRONT
- OKAY1 "Could not load frame into Switcher."
- ADPRO_TO_BACK
- CALL ErrorOut 10
- END
-
- Switcher( TAKE ) /* Display the frame */
- Switcher( TOWB ) /* Go back to ADPro */
-
-
- /*
- ** Reset FSDEV to what it was before
- */
-
- Switcher( FSDV, oldFS )
-
- CALL ErrorOut 0
-
-
- ErrorOut:
- PARSE ARG ExitCode
-
- IF (EXISTS( TempDefaults )) THEN DO
- LOAD_DEFAULTS TempDefaults
- IF (RC ~= 0) THEN DO
- ADPRO_TO_FRONT
- OKAY1 "Error restoring settings."
- ADPRO_TO_BACK
- END
-
- ADDRESS COMMAND "Delete >NIL:" TempDefaults
- END
-
- IF (EXISTS( TempFramestore )) THEN
- ADDRESS COMMAND "Delete >NIL:" TempFramestore
-
- IF (oldFS ~= "OLDFS") THEN
- Switcher( FSDV, oldFS )
-
- REMLIB( "ToasterARexx.port" )
-
- EXIT ExitCode
-