home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / header45.zip / evcb.h < prev    next >
C/C++ Source or Header  |  1999-03-15  |  15KB  |  259 lines

  1. /****************************************************************************/
  2. /*                                                                          */
  3. /* Module Name: EVCB.H                                                      */
  4. /*                                                                          */
  5. /* OS/2 2.0 Multimedia Extensions Sync/Stream Manager Event Control         */
  6. /* Block defintitions.                                                      */
  7. /*                                                                          */
  8. /* Copyright (c) International Business Machines Corporation 1991, 1992     */
  9. /*                        All Rights Reserved                               */
  10. /*                                                                          */
  11. /****************************************************************************/
  12. /* NOINC */
  13. #ifdef __cplusplus
  14.    extern "C" {
  15. #endif
  16. /* INC */
  17.  
  18.  
  19.  
  20. /* XLATOFF */
  21. #pragma pack(4)
  22. /* XLATON */
  23.  
  24. /**********************************************
  25.  * List of Implicit events:
  26.  *    EVENT_EOS                 - Use IMPL_EVCB
  27.  *    EVENT_ERROR               - Use IMPL_EVCB
  28.  *    EVENT_STREAM_STOPPED      - Use IMPL_EVCB
  29.  *    EVENT_SYNC_PREROLLED      - Use IMPL_EVCB
  30.  *    EVENT_PLAYLISTMESSAGE     - Use PLAYL_EVCB
  31.  *    EVENT_PLAYLISTCUEPOINT    - Use PLAYL_EVCB
  32.  *    EVENT_QUEUE_OVERFLOW      - Use IMPL_EVCB
  33.  **********************************************/
  34.  
  35. /**********************************************
  36.  * List of Explicit events:
  37.  *    EVENT_SYNCOVERRUN         - Use OVRU_EVCB
  38.  *    EVENT_CUE_TIME            - Use TIME_EVCB
  39.  *    EVENT_CUE_DATA            - Use DATA_EVCB
  40.  *    EVENT_DATAUNDERRUN        - Use EVCB
  41.  *    EVENT_DATAOVERRUN         - Use EVCB
  42.  *    EVENT_CUE_TIME_PAUSE      - Use TIME_EVCB
  43.  **********************************************/
  44. #define EVENT_SYNCOVERRUN       4L
  45. #define EVENT_CUE_TIME          5L       /* Cue point in terms of stream time*/
  46. #define EVENT_CUE_DATA          6L       /* Cue point in terms of data items */
  47. #define EVENT_DATAUNDERRUN      7L       /* data underrun event from SH    */
  48. #define EVENT_DATAOVERRUN       8L       /* data underrun event from SH    */
  49. #define EVENT_CUE_TIME_PAUSE    9L       /* Pause when cue-point reached.  */
  50. #define EVENT_STATUS_LEVEL      10L      /* Report status level            */
  51.  
  52.  
  53.  
  54. /**********************************************
  55.  * SYNC_EVCB - Sync Pulse Event Control Block
  56.  *             (This event is only seen by
  57.  *              stream handlers)
  58.  **********************************************/
  59. #define EVENT_SYNC              1L     /* Synchronization point in stream  */
  60. typedef struct  _SYNC_EVCB { /* syevcb                                     */
  61.    ULONG   ulType;                     /* EVENT_SYNC                       */
  62.    ULONG   ulSubType;                  /* Not used                         */
  63.    ULONG   ulSyncFlags;                /* 0 (input),status (output)        */
  64.    HSTREAM hstream;                    /* handle to stream for this event  */
  65.    HID     hid;                        /* Handler id                       */
  66.    ULONG   ulStatus;                   /* Event status (output)            */
  67.    MMTIME  mmtimeStart;                /* Filled in by Sync/Stream manager */
  68.                                        /*  at SpiEnableSync time. (input)  */
  69.    MMTIME  mmtimeMaster;               /* Filled in by Master SH (input)   */
  70.    MMTIME  mmtimeSlave;                /* Filled in by slave SH. (output)  */
  71.    } SYNC_EVCB;
  72. typedef SYNC_EVCB  FAR  *PSYNC_EVCB;             /* Ptr to a  EVCB       */
  73.  
  74. /* ulSyncFlags:                                                            */
  75. #define  SYNCOVERRUN        0x0001L    /* Set by SSM if sync pulse comes in before    */
  76.                                        /*  a has processed the current sync pulse.    */
  77. #define  SYNCPOLLING        0x0002L    /* SSM set this after filling the handler EVCB.*/
  78.                                        /*  Handler resets it after it processes the   */
  79.                                        /*  contents of EVCB. The SSM must check this  */
  80.                                        /*  bit before modifying EVCB. If bit already  */
  81.                                        /*  set, set the SYNC overrun bit.             */
  82.  
  83.  
  84. #define EVENT_RESERVED          2L     /* RESERVED                         */
  85.  
  86.  
  87. /**********************************************
  88.  * IMPL_EVCB - Implicit Event Control Block
  89.  *             (This is a parameter on the
  90.  *              SpiCreatStrem API)
  91.  **********************************************/
  92. #define EVENT_IMPLICIT_TYPE     3L     /* These events are always supported*/
  93. typedef struct  _IMPL_EVCB { /* imevcb                                     */
  94.    ULONG   ulType;                     /* EVENT_IMPLICIT_TYPE              */
  95.    ULONG   ulSubType;                  /* One of the implicit events (input) */
  96.    ULONG   ulFlags;                    /* 0 (Input), status (Output)         */
  97.    HSTREAM hstream;                    /* handle to stream for this event (input/output) */
  98.    HID     hid;                        /* 0 (input), handler Id (output)     */
  99.    ULONG   ulStatus;                   /* Event status/error return code (output) */
  100.    ULONG   unused1;                    /* 0 (input)                        */
  101.    ULONG   unused2;                    /* 0 (input)                        */
  102.    ULONG   unused3;                    /* 0 (input)                        */
  103.    } IMPL_EVCB;
  104. typedef IMPL_EVCB FAR *PIMPL_EVCB;
  105.  
  106. /* ulSubtype:                                                              */
  107. #define EVENT_EOS               1L     /* End of Stream                    */
  108. #define EVENT_ERROR             2L     /* Error in Stream handler or device driver        */
  109. #define EVENT_STREAM_STOPPED    3L     /* Stream is in a stopped state (Discard or Flush) */
  110. #define EVENT_SYNC_PREROLLED    4L     /* All streams are prerolled (buffers   */
  111.                                        /*  have been filled by the Source SH's.*/
  112. #define EVENT_PLAYLISTMESSAGE   5L     /* Memory SH playlist message event     */
  113. #define EVENT_PLAYLISTCUEPOINT  6L     /* Memory SH playlist cue point         */
  114. #define EVENT_QUEUE_OVERFLOW    7L     /* Event Queue overflow. Indicates lost */
  115.                                        /*  events. Application must use this   */
  116.                                        /*  to clear any waiting conditions.    */
  117. #define EVENT_START             8L     /* Start stream                         */
  118.  
  119.  
  120. /**********************************************
  121.  * PLAYL_EVCB - Playlist Message Event Control Block
  122.  **********************************************/
  123. /* (IMPLICIT EVENT)                                                        */
  124. typedef struct  _PLAYL_EVCB { /* plevcb                                    */
  125.    ULONG   ulType;                     /* EVENT_IMPLICIT_TYPE              */
  126.    ULONG   ulSubType;                  /* EVENT_PLAYLISTMESSAGE or EVENT_PLAYLISTCUEPOINT */
  127.    ULONG   ulFlags;                    /* 0 (input), status (output)                      */
  128.    HSTREAM hstream;                    /* handle to stream for this event (input/output)  */
  129.    HID     hid;                        /* 0 (input), handler Id (output)                  */
  130.    ULONG   ulStatus;                   /* Playlist Instruction number (output)            */
  131.    ULONG   ulMessageParm;              /* 0 (input), Message from playlist (output)       */
  132.    ULONG   unused1;                    /* 0 (input)                        */
  133.    ULONG   unused2;                    /* 0 (input)                        */
  134.    } PLAYL_EVCB;
  135. typedef PLAYL_EVCB  FAR  *PPLAYL_EVCB;             /* Ptr to a  EVCB       */
  136.  
  137.  
  138. /**********************************************
  139.  * OVRU_EVCB - Sync Overrun Event Control Block
  140.  *             (Applications can request to be
  141.  *              notified whenever a Sync overrun
  142.  *              occurs.
  143.  **********************************************/
  144. typedef struct  _OVRU_EVCB { /* ovevcb */
  145.    ULONG   ulType;                     /* EVENT_SYNCOVERRUN                */
  146.    ULONG   ulSubType;                  /* Not used                         */
  147.    ULONG   ulFlags;                    /* 0 (input), status (output)       */
  148.    HSTREAM hstream;                    /* handle to stream for this event (input/output) */
  149.    HID     hid;                        /* handler Id (input/output)        */
  150.    ULONG   ulStatus;                   /* Event status/error return code (output) */
  151.    MMTIME  mmtimeSlave;                /* 0 (input), Slave stream time (output)   */
  152.    MMTIME  mmtimeStart;                /* 0 (input), Slave start offset (offset)  */
  153.    MMTIME  mmtimeMaster;               /* 0 (input), Master stream time (output)  */
  154.    } OVRU_EVCB;
  155. typedef OVRU_EVCB  FAR  *POVRU_EVCB;             /* Ptr to a  EVCB       */
  156.  
  157.  
  158. /**********************************************
  159.  * TIME_EVCB - Cue Time Event Control Block
  160.  *             (Applications can request to be
  161.  *              notified for a time cue point)
  162.  **********************************************/
  163. typedef struct  _TIME_EVCB { /* tievcb                                     */
  164.    ULONG   ulType;                     /* EVENT_CUE_TIME                   */
  165.    ULONG   ulSubType;                  /* Not used                         */
  166.    ULONG   ulFlags;                    /* Single/Recurring(input/output)   */
  167.    HSTREAM hstream;                    /* handle to stream for this event (input/output)*/
  168.    HID     hid;                        /* handler Id (input/output)                     */
  169.    ULONG   ulStatus;                   /* Event status/error return code (output)       */
  170.    MMTIME  mmtimeStream;               /* Stream time (input/output)       */
  171.    ULONG   unused1;                    /* 0 (input)                        */
  172.    ULONG   unused2;                    /* 0 (input)                        */
  173.    } TIME_EVCB;
  174. typedef TIME_EVCB  FAR  *PTIME_EVCB;             /* Ptr to a  EVCB       */
  175.  
  176. /*                                                                         */
  177. /* ulFlags:                                                                */
  178. #define EVENT_SINGLE            0L     /* This is single one time event    */
  179. #define EVENT_RECURRING         1L     /* This is recurring event          */
  180.  
  181.  
  182. /**********************************************
  183.  * DATA_EVCB - Cue Data Event Control Block
  184.  *             (Applications can request to be
  185.  *              notified for a data cue point)
  186.  **********************************************/
  187. typedef struct  _DATA_EVCB { /* daevcb                                     */
  188.    ULONG   ulType;                     /* EVENT_CUE_DATA                   */
  189.    ULONG   ulSubType;                  /* Event SubType                    */
  190.    ULONG   ulFlags;                    /* Single/Recurring(input/output)   */
  191.    HSTREAM hstream;                    /* handle to stream for this event (input/output) */
  192.    HID     hid;                        /* handler Id (input/output)                      */
  193.    ULONG   ulStatus;                   /* Event status/error return code (output)        */
  194.    MMTIME  mmtimeStream;               /* Stream time (input/output)                     */
  195.    ULONG   ulEventParm1;               /* Data to Cue on (input/output)                  */
  196.                                        /*  This is interpreted by the stream handler     */
  197.    ULONG   ulEventParm2;               /* Length of data cue buffer (input/output)       */
  198.    } DATA_EVCB;
  199. typedef DATA_EVCB  FAR  *PDATA_EVCB;             /* Ptr to a  EVCB       */
  200.  
  201. /* ulFlags:                                                                */
  202. /*#define EVENT_SINGLE          0L        This is single one time event    */
  203. /*#define EVENT_RECURRING       1L        This is recurring event          */
  204. #define EVENT_DATAPTR           2L     /* ulEventParm1 if ptr to buffer and*/
  205.                                        /*  ulEventParm2 is a length of buffer, */
  206.                                        /*  else ulEventParm1 is data.          */
  207.  
  208.  
  209. /******************
  210.  * EVCB_ulType:  (Stream Handler defined types)
  211.  ******************/
  212. #define SH_TYPE           0x80000000L  /* Stream Handler defined types must */
  213.                                        /* have the high order bit set in the*/
  214.                                        /* ulType field.                     */
  215.                                        /* events: 0H - 7FFFFFFFH are reserved!*/
  216.  
  217. /**********************************************
  218.  * EVCB - Generic Event Control Block (Use the
  219.  *        specific one in the SSM.H if possible)
  220.  **********************************************/
  221. typedef struct  _EVCB { /* evcb */
  222.    ULONG   ulType;                     /* Event type (input)               */
  223.    ULONG   ulSubType;                  /* Event SubType (input)            */
  224.    ULONG   ulFlags;                    /* 0 (Input), status (Output)       */
  225.    HSTREAM hstream;                    /* handle to stream for this event  */
  226.    HID     hid;                        /* handler Id (input/output)        */
  227.    ULONG   ulStatus;                   /* Event status (output)            */
  228.    ULONG   ulEventParm1;               /* Event parameters (input), HID if implicit event */
  229.    ULONG   ulEventParm2;               /* Event parameters (input)         */
  230.    ULONG   ulEventParm3;               /* Event parameters (input)         */
  231.    } EVCB;
  232. typedef EVCB  FAR  *PEVCB;             /* Ptr to a  EVCB       */
  233.  
  234. /**********************************************
  235.  * STATUS_LEVEL_EVCB - Status Level Event Control Block
  236.  **********************************************/
  237. typedef struct  _STATUS_LEVEL_EVCB { /* stevcb */
  238.    /* standard part */
  239.    ULONG   ulType;                     /* Event type (input)               */
  240.    ULONG   ulSubType;                  /* Event SubType (input)            */
  241.    ULONG   pMCDInstance;               /* for MCD use */
  242.    HSTREAM hstream;                    /* handle to stream for this event  */
  243.    HID     hid;                        /* handler Id (input/output)        */
  244.    /* custom part */
  245.    ULONG   ulSample[4];                /* Samples */
  246.    } STATUS_LEVEL_EVCB;
  247. typedef STATUS_LEVEL_EVCB  FAR  *PSTATUS_EVCB;     /* Ptr to a  EVCB       */
  248.  
  249. /* XLATOFF */
  250. #pragma pack()
  251. /* XLATON */
  252.  
  253. /* NOINC */
  254. #ifdef __cplusplus
  255. }
  256. #endif
  257. /* INC */
  258.  
  259.