'
'  vbplay.txt
'
'       Copyright (C) 1990, Autodesk, Inc.
'
'  This file contains the public definitions for AAPLAY.DLL. This file
'  should be included by Visual Basic applications that use AAPLAY.DLL.
'

'  AAOpen and AAClose are not really needed, except there is
'  a bug in Windows which prevents Libraries from being
'  freed in the Windows Exit Proc (WEP). So we use AAClose
'  to free the Libraries when the last task closes the
'  AAPlay DLL.
'
Declare Function aaOpen Lib "aaplay.dll" () As Integer
Declare Sub aaClose Lib "aaplay.dll" ()

'
'  aaLoad loads an animation. The file name is in lpzFileName
'  and the loading mode is in wMode.
'
Declare Function aaLoad Lib "aaplay.dll" (ByVal lpzFileName$, ByVal hWnd%, ByVal wMode%, ByVal x%, ByVal y%, ByVal wid%, ByVal hght%, ByVal orgx%, ByVal orgy%) As Integer

'
'  aaReLoad will load a new animation file into an old animation
'  handle. Notifications are lost, but the palette and window are
'  retained.
'
Declare Function aaReLoad Lib "aaplay.dll" (ByVal hAa%, ByVal lpzFileName$, ByVal wMode%, ByVal wMask%) As Integer

'
'  Valid flags in wMode. The low order eight bits of wMode
'  is used in aa_flags.
'
Global Const AA_MEMORYLOAD = &H1        ' Load into memory
Global Const AA_HIDEWINDOW = &H2        ' Hide the animation window
Global Const AA_NOPALETTE = &H4         ' Prevent palette animation
Global Const AA_RESERVEPALETTE = &H8    ' Reserve entire palette at start
Global Const AA_LOOPFRAME = &H10        ' Loaded with a loop frame
Global Const AA_FULLSCREEN = &H20       ' Use full screen for playing
Global Const AA_STOPNOTIFY = &H40       ' Prevent any notification messages
Global Const AA_STOPSTATUS = &H80       ' Prevent status messages
Global Const AA_NOFAIL = &H100          ' Reduce load type on fail
Global Const AA_DONTPAINT = &H200       ' Don't paByVal animation when loading
Global Const AA_BUILDSCRIPT = &H400     ' lpzFileName is script not name
Global Const AA_ALLMODES = &HFF


'
'  aaUnload unloads a loaded animation. FALSE is returned if
'  hAa is not the handle of a loaded animation.
'
Declare Function aaUnload Lib "aaplay.dll" (ByVal hAa%) As Integer


'
'  aaSound will open or close a sound for the animation. The sound
'  is opened if the file arguement is not null and not blank%,
'  otherwise the sound is closed. If device is null, the format
'  of the file is used to select an appropriate device.
'
Declare Function aaSound Lib "aaplay.dll" (ByVal hAa%, ByVal device$, ByVal file$, ByVal wMode%) As Integer

'
'  Valid flags for the sound mode.
'
Global Const AA_SNDFREEZE = &H1         ' Freeze frames until sound begins
Global Const AA_SNDDEVICEID = &H100     ' device is an ID not a name
Global Const AA_SNDBUILDALIAS = &H200   ' create sound device alias

'
'  aaPlay plays a loaded animation. TRUE is returned if the
'  animation is not stopped when aaPlay returns.
'
Declare Function aaPlay Lib "aaplay.dll" (ByVal hAa%) As Integer


'
'  aaNotify allows an application to be notified at specific frames
'  when an animation is playing. lPosition is the position at which
'  the notification is to take place. The wParam for this message is
'  hAa, and the lParam is copied from this call. Returns TRUE if the
'  notification is set.
'
Declare Function aaNotify Lib "aaplay.dll" (ByVal hAa%, ByVal lPosition&, ByVal lParam&) As Integer

'
'  This value for the loops will cause the animation to end when
'  the sound has finished. If no sound is playing, the animation
'  will loop forever.
'
Global Const AA_LOOPSOUND = &HFFFF

'
'  An automatic notify is sent when an animation in a script is
'  reloaded. The lParam of this message is defined below
'
Global Const AA_ANIMATIONLOADED = 0&

'
'  aaCancel allows an applicatin to cancel notifications set by aaNotify.
'  lLoPos and lHiPos give lower and upper limits on positions. Returns
'  the number of notifications canceled.
'
Declare Function aaCancel Lib "aaplay.dll" (ByVal hAa%, ByVal lLoPos&, ByVal lHiPos&) As Integer


'
'  aaStop will stop a playing animation. TRUE is returned if the
'  animation is stopped when aaStop returns.
'
Declare Function aaStop Lib "aaplay.dll" (ByVal hAa%) As Integer


'
'  aaPause will pause an animation. TRUE is returned if the animation
'  is paused when aaPause returns. To resume a paused animation, use
'  aaPlay.
'
Declare Function aaPause Lib "aaplay.dll" (ByVal hAa%) As Integer


'
'  aaPrompt will produce a dialog to prompt for user input. When
'  input is accepted, the handle is changed to reflect the new
'  parameters. The old handle is not destroyed until the new handle
'  has been created. aaPrompt returns NULL if the new handle cannot
'  be created, otherwise the new handle is returned.
'
Declare Function aaPrompt Lib "aaplay.dll" (ByVal hAa%, ByVal lpName$) As Integer

'
'  The parameter structure to be used for the animation.
'
Type AAPARMS
    AA_STATUS           As String * 1   '  Current status of animation
    AA_FILETYPE         As String * 1   '  Type of file on disk
    AA_MODE             As String * 1   '  Some flags
    aa_bitpix           As String * 1   '  bits per pixel

    AA_WINDOW           As Integer      '  Handle of window for status messages
    AA_X                As Integer      '  Left of display window
    AA_Y                As Integer      '  Top of display window
    AA_CX               As Integer      '  Width of display window
    AA_CY               As Integer      '  Height of display window
    AA_ORGX             As Integer      '  PoByVal in the animation displayed
    AA_ORGY             As Integer      '  in the upper left corner

    AA_SPEED            As Integer      '  Speed of animation%e msec per frame
    AA_DESIGNSPEED      As Integer      '  Designed milliseconds per frame

    AA_WIDTH            As Integer      '  Width of animation in pixels
    AA_HEIGHT           As Integer      '  Height of animation in pixels

    AA_FRAMES           As Integer      '  Number of frames in animation

    AA_POSITION         As Integer      '  Current frame position
    AA_LOOPS            As Integer      '  End of animation position
    AA_RPTSOUND         As Integer      '  Number of times to repeat sound
    AA_PAUSE            As Integer      '  Number of milliseconds to hold last frame
    AA_DELAYSND         As Integer      '  Delay Sound in milliseconds
    AA_TRANSIN          As String * 1   '  Transition at start of animation
    AA_TRANSOUT         As String * 1   '  Transition at end of animation
    AA_TIMEIN           As Integer      '  Length of transition in, milliseconds
    AA_TIMEOUT          As Integer      '  Length of transition out, milliseconds
    AA_CALLBACK         As Integer      '  message callback window
    AA_ANIMWND          As Integer      '  Animation Window Handle
End Type


'
'  aaGetParm will return information on an animation. Some of the
'  information can be set with aaSetParm, and other information is
'  state information maintined by AAPLAY.
'
Declare Function aaGetParm Lib "aaplay.dll" (ByVal hAa%, ByVal wType%) As Long

'
'  aaGetParmIndirect returns the same information as aaGetParm, in a
'  structure for easy access by Visual Basic applications.
'
Declare Function aaGetParmIndirect Lib "aaplay.dll" (ByVal hAa%, lpAp As AAPARMS, ByVal wSize%) As Integer


'
'  aaSetParm will set information on an animation
'
Declare Function aaSetParm Lib "aaplay.dll" (ByVal hAa%, ByVal wType%, ByVal wValue1%, ByVal lValue2&) As Integer

'
'  aaSetParmIndirect will set animation parameters from a structure
'
Declare Function aaSetParmIndirect Lib "aaplay.dll" (ByVal hAa%, ByVal dwType&, lpAp As AAPARMS, ByVal wMask%) As Integer


'
'  The parameter types that can be used with aaGetParm, and aaSetParm.
'
Global Const AA_STATUS = 1                      ' Get current status
Global Const AA_FILETYPE = 2                    ' Get Type of animation on disk
Global Const AA_MODE = 3                        ' Get/Set Animation Flags
Global Const AA_WINDOW = 4                      ' Set/Get animation window
Global Const AA_SPEED = 5                       ' Set/Get current speed
Global Const AA_DESIGNSPEED = 6                 ' Get design speed
Global Const AA_FRAMES = 7                      ' Get Number of frames
Global Const AA_POSITION = 8                    ' Set/Get current frame position
Global Const AA_LOOPS = 9                       ' Set/Get number of loops
Global Const AA_X = 10                          ' Set/Get Pos of display window
Global Const AA_Y = 11                          ' Set/Get Pos of display window
Global Const AA_CX = 12                         ' Set/Get extents of display window
Global Const AA_CY = 13                         ' Set/Get extents of display window
Global Const AA_ORGX = 14                       ' Set/Get Origin of display window
Global Const AA_ORGY = 15                       ' Set/Get Origin of display window
Global Const AA_WIDTH = 16                      ' Get Width of animation
Global Const AA_HEIGHT = 17                     ' Get Height of animation
Global Const AA_RPTSOUND = 18                   ' Set/Get sound repeats
Global Const AA_PAUSE = 19                      ' Set/Get pause time
Global Const AA_DELAYSND = 20                   ' Set/Get sound delay time
Global Const AA_TRANSIN = 21                    ' Set/Get Transition In type
Global Const AA_TRANSOUT = 22                   ' Set/Get Transition Out type
Global Const AA_TIMEIN = 23                     ' Set/Get Transition In time
Global Const AA_TIMEOUT = 24                    ' Set/Get Transition Out Time
Global Const AA_CALLBACK = 25                   ' Set/Get CallBack window
Global Const AA_ANIMWND = 26                    ' Get Animation Window Handle
Global Const AA_MODFLAG = 100                   ' Set/Get Script is modified flag
Global Const AA_SCRIPTNAME = 101                ' Set/Get Script name
Global Const AA_ANIMATION = 102                 ' Get/Set Script Animation
Global Const AA_ANIMATIONCOUNT = 103            ' Get Script Animation Count
Global Const AA_SCRIPTCONTENTS = 104            ' Get Script Contents
Global Const AA_LASTERROR = 1001                ' Get last error code
Global Const AA_LASTERRORMESSAGE = 1002         ' Get/Set last error messsage


'
'  The parameter type that can be used with aaSetParmIndirect
'
Global Const AA_SETMODE = &H1&                  ' Get/Set Animation Flags
Global Const AA_SETWINDOW = &H2&                ' Set/Get animation window
Global Const AA_SETSPEED = &H4&                 ' Set/Get current speed
Global Const AA_SETPOSITION = &H8&              ' Set/Get current frame position
Global Const AA_SETLOOPS = &H10&                ' Set/Get number of loops
Global Const AA_SETX = &H20&                    ' Set/Get left of display window
Global Const AA_SETY = &H40&                    ' Set/Get left of display window
Global Const AA_SETCX = &H80&                   ' Set/Get top of display window
Global Const AA_SETCY = &H100&                  ' Set/Get top of display window
Global Const AA_SETORGX = &H200&                ' Set/Get width of display window
Global Const AA_SETORGY = &H400&                ' Set/Get width of display window
Global Const AA_SETRPTSOUND = &H800&            ' Set/Get sound repeats
Global Const AA_SETPAUSE = &H1000&              ' Set/Get pause time
Global Const AA_SETDELAYSND = &H2000&           ' Set/Get sound delay time
Global Const AA_SETTRANSIN = &H4000&            ' Set/Get Transition In type
Global Const AA_SETTRANSOUT = &H8000&           ' Set/Get Transition Out type
Global Const AA_SETTIMEIN = &H10000             ' Set/Get Transition In time
Global Const AA_SETTIMEOUT = &H20000            ' Set/Get Transition Out Time
Global Const AA_SETCALLBACK = &H40000           ' Set/Get Callback window
Global Const AA_ALL = &HFFFFFFFF                ' Get/Set all parameters


'
'  Status values for an animation
'
Global Const AA_STOPPED = 1             ' Loaded but not playing
Global Const AA_QUEUED = 2              ' Animation is waiting to play
Global Const AA_PLAYING = 3             ' Animation is playing
Global Const AA_PAUSED = 4              ' Animation is paused
Global Const AA_DONE = 5                ' Animation has ended playing,
					' and is awaiting an aaStop call


'
'  File type definitions
'
Global Const AA_FLI = &H1               ' Autodesk Animator Fli format
Global Const AA_DIB = &H2               ' Windows DIB format
Global Const AA_NUMTYPES = &H2          ' Number of types
Global Const AA_SCRIPT = &H3            ' Script without an animation

'
'  Transition types
'
Global Const AA_CUT = &H0               ' Just stop one and start another
Global Const AA_FADEBLACK = &H1         ' Fade In/Out from to black
Global Const AA_FADEWHITE = &H2         ' Fade In/Out from to white


'
'  Error codes returned by aaGetParm(xxx, AA_LASTERROR)
'
Global Const AA_ERR_NOERROR = &H0       '  Unknown error

Global Const AA_ERR_NOMEMORY = &H100    '  Out of memory error
Global Const AA_ERR_BADHANDLE = &H101   '  Bad handle
Global Const AA_ERR_NOTIMERS = &H102    '  Cannot start timer
Global Const AA_ERR_BADSOUND = &H103    '  Bad sound spec
Global Const AA_ERR_NOSCRIPT = &H104    '  Requires a script
Global Const AA_ERR_WRITEERR = &H105    '  Write error for script
Global Const AA_ERR_BADANIMATION = &H106  '  Can not opem animation

Global Const AA_ERR_BADWINDOWHANDLE = &H200     '  Bad Window Handle
Global Const AA_ERR_WINDOWCREATE = &H201        '  Cannot create window
Global Const AA_ERR_DLGERROR = &H202    '  Dialog error

Global Const AA_ERR_INVALIDSTATUS = &H300       '  Invalid status
Global Const AA_ERR_BADDIBFORMAT = &H301        '  Bad dib file
Global Const AA_ERR_BADFLIFORMAT = &H302        '  Bad fli file
Global Const AA_ERR_UNRECOGNIZEDFORMAT = &H303  '  Unrecognized format
Global Const AA_ERR_NOSOUND = &H304     '  Sound not supported
Global Const AA_ERR_NOTVALIDFORSCRIPTS = &H305  '  Not valid for scripts
Global Const AA_ERR_INVALIDFILE = &H306 '  Bad file handle
Global Const AA_ERR_NOSCRIPTS = &H307   '  No Script files

Global Const AA_ERR_SPEED = &H400       '  Invalid speed
Global Const AA_ERR_LOOPS = &H401       '  invalid loops
Global Const AA_ERR_RPTSOUND = &H402    '  invalid repeat sound
Global Const AA_ERR_PAUSE = &H403       '  invalid pause
Global Const AA_ERR_TRANSIN = &H404     '  invalid transition
Global Const AA_ERR_TIMEIN = &H405      '  invalid transition
Global Const AA_ERR_TRANSOUT = &H406    '  invalid transition time
Global Const AA_ERR_TIMEOUT = &H407     '  invalid transition time
Global Const AA_ERR_DELAYSND = &H408    '  invalid sound delay
Global Const AA_ERR_INVALIDTYPE = &H409 '  invalid parameter type

Global Const AA_ERR_DUPLICATENOTIFY = &H500     '  duplicate notify

Global Const AA_ERR_NOSWITCH = &H600    '  no switch in script
Global Const AA_ERR_PARSELOOPS = &H601  '  Bad loops in script
Global Const AA_ERR_PARSESPEED = &H602  '  Bad speed in script
Global Const AA_ERR_BADRPTSOUND = &H603 '  Bad repeat sound in script
Global Const AA_ERR_PARSEPAUSE = &H604  '  Bad pause in script
Global Const AA_ERR_PARSETRANS = &H605  '  Bad tranisition in script
Global Const AA_ERR_PARSEDELAYSND = &H606'  Bad delay sound in script
Global Const AA_ERR_TOOMANYLINKS = &H607  '  Too many links


'
'  aaShow will show a single frame of an animation in a window.
'  The mode determines how the animation is drawn. The window used
'  is set using either aaSetParm or aaSetParmIndirect. aaShow returns
'  TRUE if the animation was successfully drawn.
'
Declare Function aaShow Lib "aaplay.dll" (ByVal hAa%, ByVal bShow%) As Integer


' result =aaGetFile(wFlags, lpszPath, wBufLen, lpszDriver, wDrvLen)
'
' Opens a dialog box querying the user for a file in the standard windows
' file open box style.  <dwFlags> determines how the dialog box will appear.
' It may be the following:
'       AA_GETFILE_MUSTEXIST    Selected file must satisfy conditions of
'                               OpenFile() flags, else dialog beeps.
'       AA_GETFILE_NOSHOWSPEC   DO NOT show the search spec in the edit box.
'                               Default IS to show the spec.
'       AA_GETFILE_SAVE         Ok button will show "Save".
'       AA_GETFILE_OPEN         Ok button will show "Open".
'       AA_GETFILE_USEFILE      Set the filename to the file in lpszPath
'       AA_GETFILE_UDEDIR       Change to the directory in lpszPath
'       AA_GETFILE_SOUND        Get sound file and driver
'       AA_GETFILE_SCRIPT       Get script file
'       AA_GETFILE_ANIMATION    Get Animation File (no scripts)
'
' <lpszPath> is a LPSTR to a string buffer into which the final fully
' qualified pathname will be written.  <wBufLen> is the length of this
' buffer.
'
' <lpszDriver> is a LPSTR to a string buffer into which a sound device
' selection is placed. <wDrvLen> is the length of this buffer.
'
' Return value is:      0 if cancel was hit
'                       -1 if OpenFile() failed but AA_GETFILE_MUSTEXIST was
'                       not specified.
'                       DOS file handle of selected file, otherwise. This
'                           handle is not open when aaOpenFile returns.
'

Declare Function aaGetFile Lib "aaplay.dll" (ByVal dwFlags%, ByVal lpszPath$, ByVal wBufLen%, ByVal lpszDriver$, ByVal wDrvLen%) As Integer

'
'  flags:
'     can be any of the following
'
Global Const AA_GETFILE_MUSTEXIST = &H1
Global Const AA_GETFILE_NOSHOWSPEC = &H2
Global Const AA_GETFILE_SAVE = &H4
Global Const AA_GETFILE_OPEN = &H8
Global Const AA_GETFILE_USEDIR = &H10
Global Const AA_GETFILE_USEFILE = &H20
Global Const AA_GETFILE_SOUND = &H40
Global Const AA_GETFILE_SCRIPT = &H80
Global Const AA_GETFILE_ANIMATION = &H100

'
'  Save a script
'
Declare Function aaSave Lib "aaplay.dll" (ByVal hAa%, ByVal wMode%) As Integer

'
'  wMode Values
'
Global Const AA_SAVE_IFMODIFIED = &H1
Global Const AA_SAVE_AS = &H2
Global Const AA_SAVE_CANCEL = &H4

'
'  Get Capabitities
'
Declare Function aaGetCaps Lib "aaplay.dll" (ByVal wType%) As Integer

'
' Capabitlities
'
Global Const AA_CAP_TIMER = 1
Global Const AA_CAP_SOUND = 2
Global Const AA_CAP_SCRIPT = 3

'
'  Animation status messages
'  Use RegisterWindowMessage to get the real message
'  numbers.
'
Global Const AA_NOTIFY = "AAPLAY Notify"        ' notification message
Global Const AA_STOP = "AAPLAY Stop"            ' stop message

'
'  These are sent in the low word of lParam with the AA_ERROR
'  message. They indicate the error that occured
'
Global Const AA_BADPLAY = 1             ' Error attempting to play
Global Const AA_BADNOTIFY = 2           ' Error attempting to notify
Global Const AA_BADSCRIPT = 3           ' Error attempting to animation
					' in script

