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