home *** CD-ROM | disk | FTP | other *** search
/ ftp.microsoft.com / 2002-07-02_ftp.microsoft.com.zip / developr / drg / Multimedia / MMP.H < prev   
C/C++ Source or Header  |  1992-03-04  |  8KB  |  179 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /*        MMP.H - Include file for Multimedia Movie Player                  */
  4. /*                                                                          */
  5. /*        Note: You must include WINDOWS.H before including this file.      */
  6. /*                                                                          */
  7. /*        Copyright (c) 1990-1991, Microsoft Corp.  All rights reserved.    */
  8. /*        Copyright (c) 1990-1991, MacroMind Inc.  All rights reserved.     */
  9. /*                                                                          */
  10. /****************************************************************************/
  11.  
  12.  
  13.  
  14. /****************************************************************************
  15.  
  16.                           MMP error return values
  17.  
  18. ****************************************************************************/
  19.                     
  20. #define MMPERR_NO_ERROR        0        // no error
  21. #define MMPERR_FATAL_ERROR     (-101)   // fatal error
  22. #define MMPERR_STAGE_ERROR     (-102)   // error creating stage window
  23. #define MMPERR_FILE_VER        (-110)   // wrong file version
  24. #define MMPERR_FILE_TYPE       (-111)   // not an MMP movie file
  25. #define MMPERR_OPEN_ERROR      (-112)   // DOS error opening file
  26. #define MMPERR_READ_ERROR      (-113)   // DOS read error on file
  27. #define MMPERR_EOF_ERROR       (-115)   // unexpected end of file
  28. #define MMPERR_REC_HEADER      (-116)   // invalid record header
  29. #define MMPERR_CAST_ERROR      (-117)   // error reading cast
  30. #define MMPERR_CAST_MAP_ERROR  (-118)   // cast/bitmap mismatch
  31. #define MMPERR_MEM_ALLOC       (-121)   // memory allocation error 
  32. #define MMPERR_USER_ABORT      (-122)   // user canceled operation
  33. #define MMPERR_MMP_BUSY        (-412)   // re-entered from frame callback or
  34.                                         // other task with different ID
  35. #define MMPERR_BAD_PARM        (-426)   // bad parameters  
  36.  
  37. #define MMP_MOVEOK             1        // boolean field definition
  38. #define SCRIPTCHANNEL          (-1)     // script channel action code
  39.  
  40. #define MMP_MAXERRORLENGTH     128      // maximum length of error strings
  41.  
  42.  
  43. /****************************************************************************
  44.  
  45.                               MMP constants
  46.  
  47. ****************************************************************************/
  48.  
  49. // flags for wOptions parameter of mmpGoToFrame() function
  50. #define MMP_FRAME_FIRST      1
  51. #define MMP_FRAME_LAST       0x7FFF
  52.  
  53. // messages passed to wMsg parameter of frame callback
  54. #define MMP_HOOK_FRAME       0x0003
  55. #define MMP_HOOK_SCRIPT      0x0004
  56. #define MMP_HOOK_LOAD        0x0005
  57.  
  58. // flags for nTempo parameter of mmpSetTempo() function
  59. #define MMPTEMPO_SOUNDWAIT1  (-121)
  60. #define MMPTEMPO_MOUSEWAIT   (-128)
  61.  
  62. // animation status returned from mmpAnimate() and mmpAnimStatus() functions
  63. #define MMP_TEMPO_WAIT        1     // waiting to advance frame
  64. #define MMP_ANIM_DRAW         2     // drawing in progress
  65. #define MMP_ANIM_DRAWN        3     // frame drawn, frame callback not called
  66. #define MMP_SCRIPT_PROCESSED  4     // frame callback just executed
  67. #define MMP_FRAME_DONE        5     // all processing for current frame done
  68. #define MMP_MOUSE_WAIT        (-1)  // waiting for mouse click
  69. #define MMP_DEVICE_WAIT       (-2)  // waiting for device to finish
  70. #define MMP_ANIM_STOPPED      (-3)  // animation is stopped
  71.  
  72. // flags for nIndex parameter of mmpGetInfo() function
  73. #define MMPINFO_LABELLIST   (-6)    // label-list array
  74. #define MMPINFO_LABELTEXT   (-7)    // label-text block
  75. #define MMPINFO_LABELCOUNT  (-8)    // count of label entries
  76. #define MMPINFO_ACTIONLIST  (-9)    // action-list array
  77. #define MMPINFO_ACTIONTEXT  (-10)   // action-text block
  78. #define MMPINFO_ACTIONCOUNT (-11)   // count of action entries
  79.  
  80. // flags for wOptions parameter of mmpSetStage() and mmpGetStage() functions
  81. #define MMP_STAGE_CENTER    0x1     // centered in stage window
  82. #define MMP_STAGE_OFFSET    0x2     // offset to a fixed location
  83. #define MMP_STAGE_BORDER    0x4     // border is drawn around stage rect
  84. #define MMP_STAGE_FIXED     0x8     // stage size isconstant between movies
  85.  
  86. // flags for wOptions parameter of mmpLoadFile() function
  87. #define MMP_LOAD_REFERENCED 0x1     // load if referenced from score
  88. #define MMP_LOAD_NOSTATIC   0x2     // use system reserved colors
  89. #define MMP_LOAD_ONDEMAND   0x8     // load DIBs as they are used
  90. #define MMP_LOAD_EXPANDDIBS 0x10    // convert DIBs to RLE format at load time
  91. #define MMP_DRAW_FRAME      0xC000  // draw frame
  92. #define MMP_ERASE_FRAME     0x2000  // erase entire stage
  93.  
  94.  
  95. /****************************************************************************
  96.  
  97.                               MMP data types
  98.  
  99. ****************************************************************************/
  100.  
  101. // movie ID
  102. typedef DWORD   MMPID;
  103.  
  104. // frame callback function
  105. typedef BOOL (FAR PASCAL *LPMMPFRAMEHOOK)(MMPID idMovie, WORD wMsg,
  106.     WORD wParam, LONG lParam);
  107.  
  108. // movie information structure
  109. typedef struct {
  110.     DWORD  dwFileVersion;
  111.     DWORD  dwTotalFrames;
  112.     DWORD  dwInitialFramesPerSecond;
  113.     WORD   wPixelDepth;
  114.     DWORD  dwMovieExtentX;
  115.     DWORD  dwMovieExtentY;
  116.     char   achFullMacName[32];
  117. } MMPINFO, FAR *LPMMPINFO;
  118. typedef MMPINFO MMPMOVIEINFO;
  119. typedef LPMMPINFO LPMMPMOVIEINFO;
  120.  
  121. // label-list information structure
  122. typedef struct {
  123.     WORD wFrameNum;
  124.     WORD wTextOffset;
  125. } MMPLABEL;
  126.  
  127. // action-list information structure
  128. typedef struct {
  129.     BYTE bMenuItem;
  130.     BYTE bActionCode;
  131.     WORD wTextOffset;
  132. } MMPACTION;
  133.  
  134. /****************************************************************************
  135.  
  136.                            MMP function prototypes
  137.  
  138. ****************************************************************************/
  139.  
  140. extern MMPID FAR PASCAL mmpOpen(HWND hWndStage, WORD wOptions);
  141. extern BOOL FAR PASCAL mmpClose(MMPID idMovie, WORD wOptions);
  142. extern BOOL FAR PASCAL mmpStartAnimating(MMPID idMovie, WORD wOptions);
  143. extern int FAR PASCAL mmpAnimate(MMPID idMovie);
  144. extern int FAR PASCAL mmpAnimStatus(MMPID idMovie);
  145. extern BOOL FAR PASCAL mmpStopAnimating(MMPID idMovie, WORD wOptions);
  146. extern BOOL FAR PASCAL mmpGoToFrame(MMPID idMovie, short sNewFrame,
  147.     WORD wOptions);
  148. extern BOOL FAR PASCAL mmpUpdate(MMPID idMovie, HDC hDC, LPRECT lprectArea);
  149. extern BOOL FAR PASCAL mmpSetFrameHook(MMPID idMovie,
  150.     LPMMPFRAMEHOOK lpFrameHook);
  151. extern LPMMPFRAMEHOOK FAR PASCAL mmpGetFrameHook(MMPID idMovie);
  152. extern BOOL FAR PASCAL mmpGetFileInfo(LPSTR lpszFileName,
  153.     LPMMPMOVIEINFO lpInfo);
  154. extern BOOL FAR PASCAL mmpGetMovieInfo(MMPID idMovie, LPMMPMOVIEINFO lpInfo);
  155. extern BOOL FAR PASCAL mmpLoadFile(MMPID idMovie, LPSTR lpszFileName,
  156.     WORD wOptions);
  157. extern BOOL FAR PASCAL mmpFreeFile(MMPID idMovie, WORD wOptions);
  158. extern BOOL FAR PASCAL mmpFileLoaded(MMPID idMovie);
  159. extern short FAR PASCAL mmpError(MMPID idMovie, LPSTR szErrorString,
  160.     WORD wLen);
  161. extern BOOL FAR PASCAL mmpAnimStopped(MMPID idMovie);
  162. extern short FAR PASCAL mmpGetCurFrame(MMPID idMovie);
  163. extern BOOL FAR PASCAL mmpGetMute(MMPID idMovie);
  164. extern BOOL FAR PASCAL mmpSetMute(MMPID idMovie, BOOL bMuteOn);
  165. extern BOOL FAR PASCAL mmpSetStage(MMPID idMovie, HWND hWndStage,
  166.     LPRECT lprectStage, WORD wOptions);
  167. extern BOOL FAR PASCAL mmpGetStage(MMPID idMovie, HWND FAR *lphWndStage,
  168.     LPRECT lprectStage, LPWORD lpwOptions);
  169. extern BOOL FAR PASCAL mmpSetRepeat(MMPID idMovie, BOOL bbRepeat);
  170. extern BOOL FAR PASCAL mmpGetRepeat(MMPID idMovie);
  171. extern BOOL FAR PASCAL mmpSetDC(MMPID idMovie, HDC hDC);
  172. extern HPALETTE FAR PASCAL mmpGetPaletteHandle(MMPID idMovie);
  173. extern BOOL FAR PASCAL mmpSetTempo(MMPID idMovie, short sTempo);
  174. extern short FAR PASCAL mmpGetTempo(MMPID idMovie);
  175. extern BOOL FAR PASCAL  mmpGetInfo(MMPID idMovie, int nIndex, LPVOID lpData,
  176.     WORD wLen);
  177. extern BOOL FAR PASCAL mmpSetInfo(MMPID idMovie, int nIndex, LPVOID lpData,
  178.     WORD wLen);
  179.