home *** CD-ROM | disk | FTP | other *** search
/ Microsoft Multimedia Jumpstart 1.1a / CD_ROM.BIN / develpmt / source / hotspot / viewer / hotspot.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-10-07  |  4.5 KB  |  127 lines

  1. /**************************************************************************
  2.  *
  3.  *  THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
  4.  *  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
  5.  *  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
  6.  *  PURPOSE.
  7.  *
  8.  *  Copyright (c) 1993  Microsoft Corporation.  All Rights Reserved.
  9.  * 
  10.  **************************************************************************/
  11. #ifndef HOTSPOT_H
  12. #define HOTSPOT_H
  13.  
  14. typedef struct _HOTSPOT
  15. {
  16.     struct _HOTSPOT FAR *pNext;
  17.     struct _HOTSPOT FAR *pPrev;
  18.     
  19.     RECT rc;
  20.     LPSTR pszCommand;
  21.     LPSTR pszHotspotID;
  22.     DWORD BeginFrame;
  23.     DWORD EndFrame;
  24.     int OnClick;
  25.     int ToFrame;                // if OnClick == ID_JUMP, ToFrame should be set
  26.     
  27. } HOTSPOT, FAR *PHOTSPOT;
  28.  
  29. typedef struct _MOVIEINFO       // associate this with a window
  30. {
  31.     PHOTSPOT pHotspotList;
  32.     
  33.     WORD wMCIDeviceID;
  34.     HWND hwndMovie;
  35.     HWND hwndParent;            // set this before OPEN
  36.     RECT rcMovie;
  37.     BOOL fPlaying;
  38.     BOOL fMovieOpen;
  39.     
  40.     DWORD dwMovieLength;
  41.     DWORD dwCurrentFrame;
  42.     FARPROC     lpfnOldProc;                // far ptr to old proc before subclass
  43.     FARPROC     lpfnhspAVICallback;
  44.     
  45.     char szAVIFileName[129];
  46.     char szIniFileName[129];    
  47.     
  48. } MOVIEINFO, FAR *PMOVIEINFO;
  49.  
  50. /* typedef struct
  51. {
  52.     HWND   hwndViewer;
  53. } VWRINFO, FAR *LPVWRINFO; */
  54.  
  55. /*
  56.  * MVMCI keeps a linked list of all currently opened ViewerMCI windows.
  57.  * This is used to allow linking of hotspots to control media elements,
  58.  * either opened by another hotspot or in an embedded window.
  59.  * This list is also used in printing.
  60.  */
  61. /* typedef struct _WindowNode {        // Node for list of ViewerMCI windows
  62.     HANDLE        hTask;                            // Task that opened it
  63.     HWND        hwndParent;                        // Parent window handle
  64.     HWND        hwndViewerMCI;                    // Handle to the ViewerMCI
  65.     BOOL        fEmbedded;                        // TRUE=embedded window
  66.     HANDLE        hNext;                            // Next node in list
  67. } WindowNode, FAR * PWindowNode; */
  68.  
  69. //extern HANDLE    ghWindowList;    // List of window nodes
  70.  
  71. HANDLE __hMem;
  72.  
  73. #define ALLOCATE(s) ((__hMem = GlobalAlloc(GHND, (DWORD)(s))) ? GlobalLock(__hMem) : NULL)
  74. #define FREE(p) (GlobalUnlock((HANDLE)HIWORD(p)),GlobalFree((HANDLE)HIWORD(p)))
  75. #define SIZE(p) (GlobalSize((HANDLE)HIWORD(p)))
  76.  
  77. #define USHORT WORD
  78.  
  79. LONG CALLBACK LDLLHandler(UINT msg, LONG lParam1, LONG lParam2);
  80. BOOL CALLBACK LibMain(HANDLE hModule, int cbHeap, LPSTR lpchCmdLine);
  81. LPSTR FindToken(LPSTR psz, char c);
  82. int StrToInt(LPSTR lpstr);
  83. BOOL InitHotspots(PMOVIEINFO pMovieInfo, LPSTR szIniFile);
  84. void DeleteHotspot(PMOVIEINFO pMovieInfo, PHOTSPOT pHotspot);
  85. void DeleteHotspotList(PMOVIEINFO pMovieInfo);
  86. void AddHotspot(PMOVIEINFO pMovieInfo, PHOTSPOT pHotspot);
  87. LONG CALLBACK __export hspPlayAVI(HWND hwnd, LPSTR szAVIFile, LPSTR szIniFile, FARPROC);
  88. LONG CALLBACK __export SbClsProc (HWND hwnd, USHORT msg, USHORT wp, LONG lp);
  89.  
  90. ///// avi.c --
  91. BOOL initAVI(void);
  92. void termAVI(void);
  93.  
  94. ///// movie.c --
  95. void fileOpenMovie(PMOVIEINFO pMovieInfo, LPSTR szFilename);
  96. void fileCloseMovie(PMOVIEINFO pMovieInfo, BOOL bUpdate);
  97. VOID positionMovie(PMOVIEINFO pMovieInfo);
  98. void playMovie(PMOVIEINFO pMovieInfo, WORD wDirection);
  99. void seekMovie(PMOVIEINFO pMovieInfo, WORD wAction);
  100. void stepMovie(PMOVIEINFO pMovieInfo, HWND hWnd, WORD wDirection);
  101. DWORD GetMovieFrame(PMOVIEINFO pMovieInfo);
  102. DWORD GetMovieLength(PMOVIEINFO pMovieInfo);
  103. void setMovie(PMOVIEINFO pMovieInfo, DWORD dwFrame, HWND hCallback);
  104. int OnButtonDown(PMOVIEINFO pMovieInfo, USHORT msg, USHORT wp, LONG lp);
  105.  
  106. #define ID_HOME     0
  107. #define ID_END      1
  108.  
  109. #define ID_CONTINUE                     1017        // defined in ..\avihed\resource.h
  110. #define ID_STOP                         1018        //
  111. #define ID_JUMP                         1019        //
  112.  
  113. #define Message(xx) OutputDebugString(xx); OutputDebugString("\n"); MessageBox(GetFocus(),xx,"Hotspot Message:",MB_OK)
  114. #define Messages(yy,xx) OutputDebugString(yy); OutputDebugString(": "); OutputDebugString(xx); OutputDebugString("\n"); MessageBox(GetFocus(),xx,yy,MB_OK)
  115.  
  116. //#define Message(xx) OutputDebugString(xx); OutputDebugString("\n")
  117. //#define Messages(yy,xx) OutputDebugString(yy); OutputDebugString(": "); OutputDebugString(xx); OutputDebugString("\n")
  118.  
  119. void cdecl DbgOut(LPSTR lpFormat, ...); 
  120. #define dprint(x) DbgOut x
  121. #define dbg(x) DbgOut(x)
  122.  
  123. #define szDrawPropName szMovieInfo
  124. extern char szMovieInfo[];
  125.  
  126. #endif
  127.