home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 15 / CD_ASCQ_15_070894.iso / news / 442 / qbxfli10 / test.bas < prev    next >
BASIC Source File  |  1993-12-16  |  3KB  |  64 lines

  1.   '───────────────────────────────────────────────────────────────────────────────
  2.   ' Simple Test Program For PLAYFLI 1.0
  3.   ' By Rich Geldreich, Jr. March 1994
  4.   '───────────────────────────────────────────────────────────────────────────────
  5.   ' Note:  The XMS.OBJ module hooks onto PDS's "B_OnExit" exit chain.
  6.   ' If my library crashes for some reason (that shouldn't happen!), all
  7.   ' allocated XMS handles will be released by this routine. This is true
  8.   ' in a compiled EXE and in the QBX environment.
  9.   '───────────────────────────────────────────────────────────────────────────────
  10.   DEFINT A-Z
  11.   '───────────────────────────────────────────────────────────────────────────────
  12.   CONST TRUE = -1, FALSE = 0
  13.   '───────────────────────────────────────────────────────────────────────────────
  14.   '$INCLUDE: 'PLAYFLI.BI'
  15.   '$INCLUDE: 'FLIASM.BI'
  16.   '───────────────────────────────────────────────────────────────────────────────
  17.  
  18.   ' You can also call BIOS to set the mode if you don't want to pull
  19.   ' in QBX's graphic library, because my routines do all of their own
  20.   ' dirty work.
  21.  
  22.   SCREEN 13
  23.  
  24.   Path$ = "C:\FLI\"         'modify this, of course!
  25.  
  26.   a$ = DIR$(Path$ + "*.FLI")
  27.  
  28.   DO WHILE LEN(a$)
  29.  
  30.     'Make sure you ALWAYS pass either TRUE (-1) or FALSE (0) to PlayFLI
  31.     'for parameters which require a true or false setting. Any other value
  32.     'may cause PlayFLI to act very strangely!!
  33.  
  34.     filename$ = Path$ + a$  'filename of FLI file to play
  35.     NumLoops% = 4           'number of loops to play, 0 = once, 1 = twice, etc.
  36.     Speed% = 0              'playback speed, 0 = normal, 1 - 400 = fast...slow
  37.     ShowDelay% = 24         'delay in 1/18.2's of a second before animation
  38.     ShownDelay% = 24        'delay in 1/18.2's of a second after animation
  39.     FadeInSpeed% = 4        'fade in speed, 0 = no fade, 1-256 = slow...fast
  40.     FadeOutSpeed% = 4       'fade out speed, 0 = no fade, 1-256 = slow...fast
  41.     AbortCheck% = TRUE      'if TRUE, check keyboard & mouse for user abort
  42.     UseXMS% = TRUE          'if TRUE, use XMS memory to cache FLI if possible
  43.  
  44.     i% = PlayFLI%(filename$, NumLoops%, Speed%, ShowDelay%, ShownDelay%, FadeInSpeed%, FadeOutSpeed%, AbortCheck%, UseXMS%)
  45.  
  46.     ' The -4 ABORTED error code will be returned if the user hits the
  47.     ' right mouse button or presses escape. ...see PLAYFLI.BI for more
  48.     ' error codes.
  49.  
  50.     IF i% THEN
  51.       IF i% <> ABORTED THEN
  52.         SCREEN 0
  53.         WIDTH 80, 25
  54.         PRINT "Error "; i%; "on file "; filename$
  55.         a$ = INPUT$(1)
  56.       END IF
  57.  
  58.       END
  59.     END IF
  60.  
  61.     a$ = DIR$
  62.   LOOP
  63.  
  64.