home *** CD-ROM | disk | FTP | other *** search
/ Audio 4.94 - Over 11,000 Files / audio-11000.iso / os2 / mpudd103 / program.doc < prev    next >
Text File  |  1992-11-12  |  6KB  |  175 lines

  1.                         Generic MPU-401 Device Driver
  2.                  Copyright (C) 1990-1992, Delta Music Systems
  3.  
  4.  
  5.                            Developer Instructions
  6.  
  7.  
  8.  
  9. Introduction
  10.  
  11. The generic MPU-401 Device Driver is for MIDI interfaces in AT compatible
  12. systems with an ISA bus.  It was written under OS/2 1.21, and has been
  13. tested under 1.21, 1.3, and 2.0.
  14.  
  15. The device driver supports the complete set of MPU commands.  Extensions
  16. specific to OS/2 have been added, and are available through the DMS MPU
  17. Interface Library.  If you are interested in purchasing the library, please
  18. use the order form (see the file ORDER.FRM).
  19.  
  20. This software is not in the public domain; however, it may be distributed
  21. freely so long as it is not bundled with any commercial product, or any fee
  22. beyond duplication and shipping is charged for distribution.  If you would
  23. like information on distributing this software with another product, please
  24. contact us at the address below.
  25.  
  26. Delta Music Systems
  27. 2615 Ginghamsburg-Frederick Rd.
  28. Tipp City, OH  45371
  29.  
  30. If you would like to be notified of future products from Delta Music Systems,
  31. please fill out and return the registration form (see the file REGISTER.FRM).
  32.  
  33.  
  34.  
  35. Developer Instructions
  36.  
  37. The generic MPU-401 device driver is accessed through the DOS API provided
  38. by OS/2.  The published interface includes only those functions that provide
  39. complete MPU-401 compatibility.  Additional functionality, such as blocking
  40. reads and packet-oriented messages, is available through the DMS MPU 
  41. Interface
  42. Library.
  43.  
  44. The following table lists the published interface to the generic MPU-401
  45. device driver.  All numbers are in hexadecimal unless otherwise indicated.
  46.  
  47. ****************************************************************************
  48.  
  49. USHORT DosOpen("MPU401",
  50.                PHFILE  phf,
  51.                PUSHORT pusAction, 
  52.                0L, 
  53.                FILE_NORMAL,
  54.                FILE_OPEN, 
  55.                OPEN_ACCESS_READWRITE | OPEN_SHARE_DENYREADWRITE,
  56.                0L)
  57.  
  58. phf          The address of the variable that receives the handle returned by
  59.              OS/2.  This handle will be used for all other functions.
  60.  
  61. pusAction    This variable is not utilized, but must still be present.
  62.  
  63. Return Value
  64.  
  65. The return value is zero if the function is successful. Otherwise, it is an
  66. error value, which may be one of the following:
  67.  
  68.      ERROR_ACCESS_DENIED
  69.      ERROR_FILE_NOT_FOUND
  70.      ERROR_INVALID_ACCESS
  71.      ERROR_INVALID_PARAMETER
  72.      ERROR_OPEN_FAILED
  73.      ERROR_PATH_NOT_FOUND
  74.      ERROR_SHARING_BUFFER_EXCEEDED
  75.      ERROR_SHARING_VIOLATION
  76.      ERROR_TOO_MANY_OPEN_FILES
  77.  
  78. ****************************************************************************
  79.  
  80. USHORT DosClose(HFILE hf)
  81.  
  82. hf         Identifies the device to close. This handle must have been created
  83.            by using the DosOpen function.
  84.  
  85. Return Value
  86.  
  87. The return value is zero if the function is successful. Otherwise, it is an
  88. error value, which may be one of the following:
  89.  
  90.      ERROR_ACCESS_DENIED
  91.      ERROR_FILE_NOT_FOUND
  92.      ERROR_INVALID_HANDLE
  93.  
  94. ****************************************************************************
  95.  
  96. USHORT DosRead(HFILE hf, BYTE *Buffer, USHORT BufSize, PUSHORT BytesRead)
  97.  
  98. The DosRead function reads up to a specified number of bytes of data from a
  99. file into a buffer. The function may read fewer than the specified number of
  100. bytes if it reaches the end of the file.
  101.  
  102. hf            Identifies the device to be read. This handle must have been
  103.               created by using the DosOpen function.
  104.  
  105. Buffer        Points to the buffer that receives the data.
  106.  
  107. BufSize       Specifies the size of the buffer.
  108.  
  109. pcbBytesRead  Points to the variable that receives the number of bytes read
  110.               from the file.  If no data has been received by the interface,
  111.               this value may be zero.
  112.  
  113. Return Value
  114.  
  115. The return value is zero if the function is successful. Otherwise, it is an
  116. error value, which may be one of the following:
  117.  
  118.      ERROR_ACCESS_DENIED
  119.      ERROR_INVALID_HANDLE
  120.  
  121. ****************************************************************************
  122.  
  123. USHORT DosWrite(HFILE hf, BYTE *Buffer, USHORT BufSize, PUSHORT pBytesWritten)
  124.  
  125. hf             Identifies the device that receives the data. This handle
  126.                must have been created by using the DosOpen function.
  127.  
  128. Buffer         Points to the buffer that contains the data to write.
  129.  
  130. BufSize        Specifies the size of the Buffer.
  131.  
  132. pBytesWritten  Points to the variable receiving the number of bytes written.
  133.  
  134. Return Value
  135.  
  136. The return value is zero if the function is successful. Otherwise, it is an
  137. error value, which may be one of the following:
  138.  
  139.      ERROR_ACCESS_DENIED
  140.      ERROR_INVALID_HANDLE
  141.  
  142. ****************************************************************************
  143.  
  144. USHORT DosDevIOCtl(PVOID  pvData,
  145.                    PVOID  pvParms,
  146.                    USHORT usFunction,
  147.                    USHORT usCategory,
  148.                    HFILE  hf)
  149.  
  150. pvData      Points to a buffer that contains the length of the Parm buffer
  151.                                                 for variable length messages.
  152.  
  153. pvParms     Points to a buffer that contains any data to be transmitted, or
  154.             to store data being returned.  The length of this buffer is not
  155.             checked by the device driver.
  156.  
  157. usFunction  the function number is equivalent to the MPU command number.
  158.             For example, to reset the device, use a function code of FF.
  159.  
  160. usCategory  Category 80 is used for MPU commands
  161.  
  162. hf          Identifies the device that receives the command. This handle
  163.             must have been created by using the DosOpen function.
  164.  
  165. Return Value
  166.  
  167. In addition to the system error values, the DosDevIOCtl function returns
  168. device driver return-value information.
  169.  
  170. The error value may be one of the following:
  171.  
  172.      ERROR_INVALID_CATEGORY
  173.  
  174. ****************************************************************************
  175.