/* ToastPresenter.rexx, Uses GPI trigger to run interactive presentations */
/* By Arnie Cachelin © 1992 NewTek Inc. */

/*
    This program will display ALL the frames in the current FrameStore
    directory in a slideshow manner, using whatever transition is currently
    selected.  It waits for input from the GPI trigger so you can control your
    your  presentation  slideshow  style.  You can easily give your Toaster
    GPI pulses by attaching a spare mouse or joystick to the second mouse
    port then clicking the button.  You can also find long joystick extender
    cables at places like Radio Shack.  You may want to move the frames you
    plan to show to another framestore directory, like RAM:, so that the
    presentation can loop, without displaying unwanted images.

		I haven't thought of an easy way to go back a slide, which would be pretty
		useful... I guess you should just have the keyboard handy, and not use this
		program at all if you will need to backtrack.  Since the program waits on
		the GPI trigger, the Toaster will not respond to anything 'til all the frames
		have been displayed.
*/

OPTIONS RESULTS
TOASTERLIB="ToasterARexx.port"
REXXLIB = "rexxsupport.library"

IF POS(REXXLIB , SHOW('Libraries')) = 0 THEN
  IF ~ADDLIB(REXXLIB , 0 , -30 , 0) THEN x=Bummer(" I don't get no support!")
IF POS(TOASTERLIB , SHOW('Libraries')) = 0 THEN
  IF ~ADDLIB(TOASTERLIB , 0) THEN x=Bummer(" Me No Find Toaster Library!")

Switcher(SGPI,POS)    /* Set GPI trigger to positive (leading edge of pulse) */
Switcher(MDV1)        /* put Program and Preview outputs on framestores */
Switcher(PDV2)
Switcher(GOLD)        /* Set keypad to frame loading */
N=Switcher(STAT,KNUM) /* Get the current keypad number, so we know where we started */
Switcher(KEYP)        /* hit the '+' key */
DO WHILE Switcher(STAT,KNUM)~=N   /* Go until we return to the starting frame */
  Switcher(DOEN)    /* hit enter key to load */
  Switcher(KEYP)    /* hit the '+' key */
  Switcher(WAIT,GPI)    /* Wait for GPI trigger to come in */
  Switcher(AUTO)    /* Do whatever transition is selected */
END

