home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v6.zip / MMPM2TK / TK / H / SHDD.H < prev    next >
C/C++ Source or Header  |  1993-02-15  |  13KB  |  238 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. /* DDCMD's:                                                                */
  30.  
  31. #define     DDCMD_SETUP         0L
  32. #define     DDCMD_READ          1L
  33. #define     DDCMD_WRITE         2L
  34. #define     DDCMD_STATUS        3L
  35. #define     DDCMD_CONTROL       4L
  36. #define     DDCMD_REG_STREAM    5L
  37. #define     DDCMD_DEREG_STREAM  6L
  38.  
  39.  
  40. /* SHD's:                                                                   */
  41. #define     SHD_REPORT_INT      0L      /* PDD reports interrupt has arrived*/
  42. #define     SHD_REPORT_EVENT    1L      /* PDD reports cuetime has arrived  */
  43.  
  44.  
  45.  
  46. /****************************************************************************/
  47. /*                       S T R U C T U R E S                                */
  48. /****************************************************************************/
  49.  
  50. /* XLATOFF */
  51. #pragma pack(4)
  52. /* XLATON */
  53.  
  54. /**************************************/
  55. /****   DDCMD's                      **/
  56. /**************************************/
  57. typedef struct  _ddcmd_common_parm {            /* comm  - common to all DD cmds */
  58.                         ULONG   ulFunction;     /* Function requested by SH */
  59.                         HSTREAM hStream;        /* data stream instance     */
  60.                       } DDCMDCOMMON;
  61. typedef DDCMDCOMMON    FAR     *PDDCMDCOMMON;
  62.  
  63. typedef struct  _ddcmd_setup_parm {             /* setu */
  64.                         ULONG   ulFunction;     /* Function requested by SH */
  65.                         HSTREAM hStream;
  66.                         PVOID   pSetupParm;      /* see SETUP_PARM struct   */
  67.                         ULONG   ulSetupParmSize; /* see SETUP_PARM struct   */
  68.                       } DDCMDSETUP;
  69. typedef DDCMDSETUP     FAR     *PDDCMDSETUP;
  70.  
  71.                 /**********************************************/
  72.                 /* SETUP_PARM structure                       */
  73.                 /**********************************************/
  74. typedef struct  _SETUP_PARM { /*  setu_parm  - DDCMDSETUP parameter block    */
  75.                         ULONG   ulStreamTime; /* stream time in milliseconds */
  76.                         ULONG   ulFlags;      /* various flags (input/output)*/
  77.                         /* NOTE: new fields will be added here               */
  78.                       } SETUP_PARM;
  79. typedef SETUP_PARM  FAR  *PSETUP_PARM;
  80.  
  81.                 /**********************************************/
  82.                 /* ulFlag defines                             */
  83.                 /**********************************************/
  84. #define SETUP_RECURRING_EVENTS    0x00000001
  85.                 /* the device driver sets this flag on return from the     */
  86.                 /* DDCMD_SETUP command if the device driver assumes events */
  87.                 /* are recurring events---in this case, the stream handler */
  88.                 /* will not have to re-enable a recurring event each time  */
  89.                 /* the event occurs by sending a DDCMD_CONTROL command to  */
  90.                 /* the device driver.  this is useful when CUE_TIME or     */
  91.                 /* DATA_CUE events are expected to be used as RECURRING    */
  92.  
  93. typedef struct  _ddcmd_readwrite_parm {         /* read */
  94.                         ULONG   ulFunction;     /* Function requested by SH */
  95.                         HSTREAM hStream;
  96.                         PVOID   pBuffer;
  97.                         ULONG   ulBufferSize;
  98.                       } DDCMDREADWRITE;
  99. typedef DDCMDREADWRITE FAR     *PDDCMDREADWRITE;
  100.  
  101. typedef struct  _ddcmd_status_parm {            /* stat */
  102.                         ULONG   ulFunction;     /* Function requested by SH */
  103.                         HSTREAM hStream;
  104.                         PVOID   pStatus;        /* (output)ptr to current position time */
  105.                         ULONG   ulStatusSize;   /* (output)size of position time        */
  106.                       } DDCMDSTATUS;
  107. typedef DDCMDSTATUS    FAR     *PDDCMDSTATUS;
  108.  
  109.                 /**********************************************/
  110.                 /* STATUS_PARM structure                      */
  111.                 /**********************************************/
  112. typedef struct  _STATUS_PARM { /*  stat_parm  - DDCMDSTATUS parameter block                */
  113.                         ULONG   ulTime;       /* current position time in milliseconds     */
  114.                         /* NOTE: new fields will be added here                             */
  115.                       } STATUS_PARM;
  116. typedef STATUS_PARM  FAR  *PSTATUS_PARM;
  117.  
  118. typedef struct  _ddcmd_control_parm {           /* cont */
  119.                         ULONG   ulFunction;     /* Function requested by SH */
  120.                         HSTREAM hStream;
  121.                         HEVENT  hEvent;         /* used for EVENTS only                 */
  122.                         ULONG   ulCmd;
  123.                         PVOID   pParm;          /* see CONTROL_PARM structure  */
  124.                         ULONG   ulParmSize;     /* see CONTROL_PARM structure */
  125.                       } DDCMDCONTROL;
  126. typedef DDCMDCONTROL   FAR     *PDDCMDCONTROL;
  127.  
  128.                 /**********************************************/
  129.                 /* ulCmd defines                              */
  130.                 /**********************************************/
  131.                                           /* CHANGE and WAIT not implemented                   */
  132. #define DDCMD_START       1               /* start device                                      */
  133. #define DDCMD_STOP        2               /* stop device and return current position in pParm  */
  134. #define DDCMD_PAUSE       3               /* pause device and return current position in pParm */
  135. #define DDCMD_RESUME      4               /* resume device                                     */
  136. #define DDCMD_ENABLE_EVENT  5             /* ask PDD to create this event                      */
  137. #define DDCMD_DISABLE_EVENT 6             /* ask PDD to purge this event                       */
  138.  
  139.                 /**********************************************/
  140.                 /* CONTROL_PARM structure                     */
  141.                 /**********************************************/
  142. typedef struct  _CONTROL_PARM { /*  cont_parm  - DDCMDCONTROL parameter block               */
  143.                         ULONG   ulTime;       /* time in milliseconds                       */
  144.                                               /* SH sets cuetime when ulCmd is ENABLE_EVENT */
  145.                                               /* PDD returns current time for STOP, PAUSE   */
  146.                         /* NOTE: new fields will be added here                              */
  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.                       } DDCMDREGISTER;
  164. typedef DDCMDREGISTER  FAR     *PDDCMDREGISTER;
  165.  
  166.                 /*****************************/
  167.                 /* ulStreamOperation  defines*/
  168.                 /*****************************/
  169. #define STREAM_OPERATION_MASK     0xC000
  170. #define STREAM_OPERATION_CONSUME  0x8000
  171. #define STREAM_OPERATION_PRODUCE  0xC000
  172.  
  173.                 /*******************************************************************************/
  174.                 /* ulAddressType  defines                                                      */
  175.                 /* The PDD will tell the SH what type of address ptr it expects the data buffer*/
  176.                 /* to be.  The SH will then request this address type to the SSM, so that the  */
  177.                 /* SSM will send the correct type of each buffer request.                      */
  178.                 /*******************************************************************************/
  179. #define ADDRESS_TYPE_VIRTUAL    0L
  180. #define ADDRESS_TYPE_PHYSICAL   1L              /*default                  */
  181. #define ADDRESS_TYPE_LINEAR     2L
  182.  
  183.  
  184. typedef struct  _ddcmd_deregister_parm {        /* dere */
  185.                         ULONG   ulFunction;     /* Function requested by SH */
  186.                         HSTREAM hStream;        /* Stream handle needed @ interrupt time */
  187.                       } DDCMDDEREGISTER;
  188. typedef DDCMDDEREGISTER FAR    *PDDCMDDEREGISTER;
  189.  
  190.  
  191. /**************************************/
  192. /****   SHD's                        **/
  193. /**************************************/
  194. typedef struct  _shd_common_parm {              /* shdc */
  195.                         ULONG   ulFunction;     /* Function requested by PDD               */
  196.                         HSTREAM hStream;        /* Stream handle needed @ interrupt time   */
  197.                         }SHD_COMMON;
  198. typedef SHD_COMMON      FAR  *PSHD_COMMON;
  199.  
  200. typedef struct  _shd_reportint_parm {           /* repi */
  201.                         ULONG   ulFunction;     /* Function requested by PDD*/
  202.                         HSTREAM hStream;        /* so SH knows which stream to process     */
  203.                         PVOID   pBuffer;        /* return ptr to last used buffer          */
  204.                         ULONG   ulFlag;         /* reason for interrupt     */
  205.                         ULONG   ulStatus;       /* rc or bytes read/written */
  206.                         ULONG   ulStreamTime;   /* time in milliseconds of stream position  */
  207.                       } SHD_REPORTINT;
  208. typedef SHD_REPORTINT   FAR  *PSHD_REPORTINT;
  209.  
  210.                 /*******************/
  211.                 /* ulFlag settings */
  212.                 /*******************/
  213. #define ERROR               0x80L
  214. #define SHD_READ_COMPLETE   1L
  215. #define SHD_WRITE_COMPLETE  2L
  216.  
  217. typedef struct  _shd_reportevent_parm {         /* repe */
  218.                         ULONG   ulFunction;     /* Function requested by PDD*/
  219.                         HSTREAM hStream;        /* so SH knows which stream to process     */
  220.                         HEVENT  hEvent;         /* event handle pass back to stream handler*/
  221.                         ULONG   ulStreamTime;   /* time in milliseconds of stream position  */
  222.                       } SHD_REPORTEVENT;
  223. typedef SHD_REPORTEVENT FAR  *PSHD_REPORTEVENT;
  224.  
  225. /* XLATOFF */
  226. #pragma pack()
  227. /* XLATON */
  228.  
  229. /****************************************************************************/
  230. /*              F U N C T I O N   P R O T O T Y P E S                       */
  231. /****************************************************************************/
  232.  
  233. /* XLATOFF */
  234. RC  FAR         SHDEntryPoint(PSHD_COMMON pCommon);
  235. RC  FAR         DDCMDEntryPoint(PDDCMDCOMMON pCommon);
  236. /* XLATON  */
  237.  
  238.