home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / warptlk3.zip / TOOLKIT / H / SHDD.H < prev    next >
C/C++ Source or Header  |  1995-08-24  |  15KB  |  289 lines

  1. /***************************************************************************\
  2. *
  3. * Module Name: SHDD.H
  4. *
  5. * OS/2 2.0 Multimedia Extensions Stream Handler Device Driver Interfaces
  6. * Block defintions.
  7. *
  8. * Copyright (c) International Business Machines Corporation 1990,1991
  9. *                         All Rights Reserved
  10. *
  11. \***************************************************************************/
  12.  
  13. /****************************************************************************/
  14. /*                         D E F I N E S                                    */
  15. /****************************************************************************/
  16.  
  17. /* XLATOFF */
  18. typedef RC (FAR *PSHDFN)        (PVOID pParmIn);
  19. typedef RC (FAR *PDDCMDFN)      (PVOID pParmIn);
  20. /* XLATON */
  21. #ifdef XXXXX                                 /* Picked up by H2INC only    */
  22. typedef PVOID PSHDFN;                        /* Because previous function  */
  23. typedef PVOID PDDCMDFN;                      /* prototypes generate errors */
  24.                                              /* when parsed by H2INC.      */
  25. #endif                                       /*                            */
  26.  
  27.  
  28.  
  29.  
  30.  
  31. /****************************************************************************/
  32. /*                       S T R U C T U R E S                                */
  33. /****************************************************************************/
  34.  
  35. /* XLATOFF */
  36. #pragma pack(4)
  37. /* XLATON */
  38.  
  39. /****************************************************************************/
  40. /****   DDCMD Interface                                                    **/
  41. /****************************************************************************/
  42.  
  43. /* DDCMD Defines */
  44. #define     DDCMD_SETUP         0L
  45. #define     DDCMD_READ          1L
  46. #define     DDCMD_WRITE         2L
  47. #define     DDCMD_STATUS        3L
  48. #define     DDCMD_CONTROL       4L
  49. #define     DDCMD_REG_STREAM    5L
  50. #define     DDCMD_DEREG_STREAM  6L
  51.  
  52. typedef struct  _ddcmd_common_parm {            /* comm  - common to all DD cmds */
  53.                         ULONG   ulFunction;     /* Function requested by SH */
  54.                         HSTREAM hStream;        /* data stream instance     */
  55.                       } DDCMDCOMMON;
  56. typedef DDCMDCOMMON    FAR     *PDDCMDCOMMON;
  57.  
  58. typedef struct  _ddcmd_setup_parm {             /* setu */
  59.                         ULONG   ulFunction;     /* Function requested by SH */
  60.                         HSTREAM hStream;
  61.                         PVOID   pSetupParm;      /* see SETUP_PARM struct   */
  62.                         ULONG   ulSetupParmSize; /* see SETUP_PARM struct   */
  63.                       } DDCMDSETUP;
  64. typedef DDCMDSETUP     FAR     *PDDCMDSETUP;
  65.  
  66.                 /**********************************************/
  67.                 /* SETUP_PARM structure                       */
  68.                 /**********************************************/
  69. typedef struct  _SETUP_PARM { /*  setu_parm  - DDCMDSETUP parameter block    */
  70.                         ULONG   ulStreamTime; /* stream time in milliseconds */
  71.                         ULONG   ulFlags;      /* various flags (input/output)*/
  72.                         /* NOTE: new fields will be added here               */
  73.                       } SETUP_PARM;
  74. typedef SETUP_PARM  FAR  *PSETUP_PARM;
  75.  
  76.                 /**********************************************/
  77.                 /* ulFlag defines                             */
  78.                 /**********************************************/
  79. #define SETUP_RECURRING_EVENTS    0x00000001
  80.                 /* the device driver sets this flag on return from the     */
  81.                 /* DDCMD_SETUP command if the device driver assumes events */
  82.                 /* are recurring events---in this case, the stream handler */
  83.                 /* will not have to re-enable a recurring event each time  */
  84.                 /* the event occurs by sending a DDCMD_CONTROL command to  */
  85.                 /* the device driver.  this is useful when CUE_TIME or     */
  86.                 /* DATA_CUE events are expected to be used as RECURRING    */
  87.  
  88. typedef struct  _ddcmd_readwrite_parm {         /* read */
  89.                         ULONG   ulFunction;     /* Function requested by SH */
  90.                         HSTREAM hStream;
  91.                         PVOID   pBuffer;
  92.                         ULONG   ulBufferSize;
  93.                         PVOID   pProcessLin;
  94.                       } DDCMDREADWRITE;
  95. typedef DDCMDREADWRITE FAR     *PDDCMDREADWRITE;
  96. typedef PDDCMDREADWRITE FAR     *PPDDCMDREADWRITE;
  97.  
  98. typedef struct  _ddcmd_status_parm {            /* stat */
  99.                         ULONG   ulFunction;     /* Function requested by SH */
  100.                         HSTREAM hStream;
  101.                         PVOID   pStatus;        /* (output)ptr to current position time */
  102.                         ULONG   ulStatusSize;   /* (output)size of position time        */
  103.                       } DDCMDSTATUS;
  104. typedef DDCMDSTATUS    FAR     *PDDCMDSTATUS;
  105.  
  106.                 /**********************************************/
  107.                 /* STATUS_PARM structure                      */
  108.                 /**********************************************/
  109. typedef struct  _STATUS_PARM { /*  stat_parm  - DDCMDSTATUS parameter block                */
  110.                         ULONG   ulTime;       /* current position time in milliseconds     */
  111.                         /* NOTE: new fields will be added here                             */
  112.                       } STATUS_PARM;
  113. typedef STATUS_PARM  FAR  *PSTATUS_PARM;
  114.  
  115. typedef struct  _ddcmd_control_parm {           /* cont */
  116.                         ULONG   ulFunction;     /* Function requested by SH */
  117.                         HSTREAM hStream;
  118.                         HEVENT  hEvent;         /* used for EVENTS only                 */
  119.                         ULONG   ulCmd;
  120.                         PVOID   pParm;          /* see CONTROL_PARM structure  */
  121.                         ULONG   ulParmSize;     /* see CONTROL_PARM structure */
  122.                       } DDCMDCONTROL;
  123. typedef DDCMDCONTROL   FAR     *PDDCMDCONTROL;
  124.  
  125.                 /**********************************************/
  126.                 /* ulCmd defines                              */
  127.                 /**********************************************/
  128.                                           /* CHANGE and WAIT not implemented                   */
  129. #define DDCMD_START         1             /* start device                                      */
  130. #define DDCMD_STOP          2             /* stop device and return current position in pParm  */
  131. #define DDCMD_PAUSE         3             /* pause device and return current position in pParm */
  132. #define DDCMD_RESUME        4             /* resume device                                     */
  133. #define DDCMD_ENABLE_EVENT  5             /* ask PDD to create this event                      */
  134. #define DDCMD_DISABLE_EVENT 6             /* ask PDD to purge this event                       */
  135. #define DDCMD_PAUSE_TIME    7             /* pause time keeping, but not the stream            */
  136. #define DDCMD_RESUME_TIME   8             /* resume time keeping.                              */
  137.  
  138.                 /**********************************************/
  139.                 /* CONTROL_PARM structure                     */
  140.                 /**********************************************/
  141. typedef struct  _CONTROL_PARM { /*  cont_parm  - DDCMDCONTROL parameter block               */
  142.                         ULONG   ulTime;       /* time in milliseconds                       */
  143.                                               /* SH sets cuetime when ulCmd is ENABLE_EVENT */
  144.                                               /* PDD returns current time for STOP, PAUSE   */
  145.                         TIME_EVCB evcb;
  146.  
  147.                       } CONTROL_PARM;
  148. typedef CONTROL_PARM  FAR  *PCONTROL_PARM;
  149.  
  150.  
  151. typedef struct  _ddcmd_register_parm {          /* regi */
  152.                         ULONG   ulFunction;     /* Function requested by SH                    */
  153.                         HSTREAM hStream;        /* Stream handle needed @ interrupt time       */
  154.                         ULONG   ulSysFileNum;   /* Device Handle so pdd can map device instance to hstream */
  155.                         PSHDFN  pSHDEntryPoint; /* Stream handler entry point                  */
  156.                         ULONG   ulStreamOperation; /* SH input Record or play                  */
  157.                         SPCBKEY spcbkey;
  158.                         ULONG   ulBufSize;      /* PDD output (optional) buffer size in bytes for SPCB */
  159.                         ULONG   ulNumBufs;      /* PDD output (optional) # of buffers for SPCB         */
  160.                         ULONG   ulAddressType;  /* PDD output (required) addr ptr type to data buffer  */
  161.                         ULONG   ulBytesPerUnit; /*PDD output (required)                                */
  162.                         MMTIME  mmtimePerUnit;  /*PDD output (required)                                */
  163.                         E_DCB   dcbAudio;       /* SH input Device Control Block */
  164.                         HID     hid;            /* SH input stream handler id */
  165.                       } DDCMDREGISTER;
  166. typedef DDCMDREGISTER  FAR     *PDDCMDREGISTER;
  167.  
  168.                 /*****************************/
  169.                 /* ulStreamOperation  defines*/
  170.                 /*****************************/
  171. #define STREAM_OPERATION_MASK     0xC000
  172. #define STREAM_OPERATION_CONSUME  0x8000
  173. #define STREAM_OPERATION_PRODUCE  0xC000
  174.  
  175.                 /*******************************************************************************/
  176.                 /* ulAddressType  defines                                                      */
  177.                 /* The PDD will tell the SH what type of address ptr it expects the data buffer*/
  178.                 /* to be.  The SH will then request this address type to the SSM, so that the  */
  179.                 /* SSM will send the correct type of each buffer request.                      */
  180.                 /*******************************************************************************/
  181. #define ADDRESS_TYPE_VIRTUAL    0L
  182. #define ADDRESS_TYPE_PHYSICAL   1L              /*default                  */
  183. #define ADDRESS_TYPE_LINEAR     2L
  184.  
  185.  
  186. typedef struct  _ddcmd_deregister_parm {        /* dere */
  187.                         ULONG   ulFunction;     /* Function requested by SH */
  188.                         HSTREAM hStream;        /* Stream handle needed @ interrupt time */
  189.                       } DDCMDDEREGISTER;
  190. typedef DDCMDDEREGISTER FAR    *PDDCMDDEREGISTER;
  191.  
  192.  
  193.  
  194. /****************************************************************************/
  195. /**** RING 0 Stream Handler SHD Interfaces                                ***/
  196. /****************************************************************************/
  197.  
  198. /* RING 0 Stream Handler  SHD's:                                            */
  199. #define     SHD_REPORT_INT      0L      /* PDD reports interrupt has arrived*/
  200. #define     SHD_REPORT_EVENT    1L      /* PDD reports cuetime has arrived  */
  201.  
  202. typedef struct  _shd_common_parm {              /* shdc */
  203.                         ULONG   ulFunction;     /* Function requested by PDD               */
  204.                         HSTREAM hStream;        /* Stream handle needed @ interrupt time   */
  205.                         }SHD_COMMON;
  206. typedef SHD_COMMON      FAR  *PSHD_COMMON;
  207.  
  208. typedef struct  _shd_reportint_parm {           /* repi */
  209.                         ULONG   ulFunction;     /* Function requested by PDD*/
  210.                         HSTREAM hStream;        /* so SH knows which stream to process     */
  211.                         PVOID   pBuffer;        /* return ptr to last used buffer          */
  212.                         ULONG   ulFlag;         /* reason for interrupt     */
  213.                         ULONG   ulStatus;       /* rc or bytes read/written */
  214.                         ULONG   ulStreamTime;   /* time in milliseconds of stream position  */
  215.                       } SHD_REPORTINT;
  216. typedef SHD_REPORTINT   FAR  *PSHD_REPORTINT;
  217.  
  218.                 /*******************/
  219.                 /* ulFlag settings */
  220.                 /*******************/
  221. #define ERROR               0x80L
  222. #define STREAM_STOP_NOW     0x40L
  223. #define SHD_READ_COMPLETE   1L
  224. #define SHD_WRITE_COMPLETE  2L
  225.  
  226. typedef struct  _shd_reportevent_parm {         /* repe */
  227.                         ULONG   ulFunction;     /* Function requested by PDD*/
  228.                         HSTREAM hStream;        /* so SH knows which stream to process     */
  229.                         HEVENT  hEvent;         /* event handle pass back to stream handler*/
  230.                         ULONG   ulStreamTime;   /* time in milliseconds of stream position  */
  231.                       } SHD_REPORTEVENT;
  232. typedef SHD_REPORTEVENT FAR  *PSHD_REPORTEVENT;
  233.  
  234.  
  235.  
  236. /****************************************************************************/
  237. /**** RING 3 Stream Handler SHD Interfaces                                ***/
  238. /****************************************************************************/
  239.  
  240. /* RING 3 Stream Handler  SHD's: (Uses SpiSendMsg as interface) */
  241. #define     SHC_REPORT_INT      0x80000000L   /* ulMsgType for SHD_REPORT_INT */
  242. #define     SHC_REPORT_EVENT    0x80000001L   /* ulMsgType for SHD_REPORT_EVENT */
  243.  
  244. /**********************************************
  245.  *
  246.  * MSG_REPORTINT Control Block.
  247.  *  pMsg field of SpiSendMsg api
  248.  *
  249.  **********************************************/
  250. typedef struct  _MSG_REPORTINT { /* msgrepi */
  251.    ULONG   ulMsgLen;       /* Length of structure                     */
  252.    PVOID   pBuffer;        /* return ptr to last used buffer          */
  253.    ULONG   ulFlag;         /* reason for interrupt                    */
  254.    ULONG   ulStatus;       /* rc or bytes read/written                */
  255.    ULONG   ulStreamTime;   /* time in milliseconds of stream position */
  256.    } MSG_REPORTINT, FAR  *PMSG_REPORTINT;
  257.  
  258.    /* For ulFlag defines, refer to the _shd_reportint_parm structure */
  259.  
  260.  
  261.  
  262. /**********************************************
  263.  *
  264.  * MSG_REPORTEVENT Control Block.
  265.  *  pMsg field of SpiSendMsg api
  266.  *
  267.  **********************************************/
  268. typedef struct  _MSG_REPORTEVENT { /* msgrepe */
  269.    ULONG   ulMsgLen;       /* Length of structure                      */
  270.    HEVENT  hevent;         /* event handle pass back to stream handler */
  271.    ULONG   ulStreamTime;   /* time in milliseconds of stream position  */
  272.    } MSG_REPORTEVENT, FAR  *PMSG_REPORTEVENT;
  273.  
  274.  
  275.  
  276. /* XLATOFF */
  277. #pragma pack()
  278. /* XLATON */
  279.  
  280. /****************************************************************************/
  281. /*              F U N C T I O N   P R O T O T Y P E S                       */
  282. /****************************************************************************/
  283.  
  284. /* XLATOFF */
  285. RC  FAR         SHDEntryPoint(PSHD_COMMON pCommon);
  286. RC  FAR         DDCMDEntryPoint(PDDCMDCOMMON pCommon);
  287. /* XLATON  */
  288.  
  289.