home *** CD-ROM | disk | FTP | other *** search
/ Digispeech DS201A Drivers / dsapi_v120.zip / SOURCE / DIGI.H < prev    next >
C/C++ Source or Header  |  1993-08-13  |  11KB  |  259 lines

  1. /* DIGI.H */
  2. /****************************************************************************/
  3. /*                                                                          */
  4. /*  Abstract: Digispeech Driver library literals.                           */
  5. /*                                                                          */
  6. /*  Language: Microsoft C, v6.00a  Model: LARGE    Machine type: IBM PC     */
  7. /*                                                                          */
  8. /*  DSP SOLUTIONS, INC. PROPRIETARY INFORMATION.  The following contains    */
  9. /*  information proprietary to DSP SOLUTIONS, INC., and may not be copied   */
  10. /*  nor disclosed except upon written agreement by DSP SOLUTIONS, INC.      */
  11. /*                                                                          */
  12. /*  COPYRIGHT 1993, DSP SOLUTIONS, INC.   ALL RIGHTS RESERVED.              */
  13. /****************************************************************************/
  14. /*
  15.  
  16.  REV  DATE       AUTHOR          DESCRIPTION
  17.  1.0  04-15-92   Lee Mulcahy     Initial version.
  18.  1.1  04-02-93   Lee Mulcahy     Reorganized DF_xx values.
  19.  1.2  07-19-93   Lee Mulcahy     Added CAPS_CALLIDLE
  20.                                  Added DID_301XM, E_SYNTH
  21.  ---  08-13-93   Lee Mulcahy     Latest change.
  22.  
  23. */
  24.  
  25. #ifndef _DIGI
  26. #define _DIGI
  27.  
  28.  
  29. /****************************************************************************/
  30. /*                                                                          */
  31. /*  DIGI.H - Miscellaneous                                                  */
  32. /*                                                                          */
  33. /****************************************************************************/
  34.  
  35. #ifndef TRUE
  36. #define TRUE    1
  37. #endif
  38. #ifndef FALSE
  39. #define FALSE   0
  40. #endif
  41.  
  42. #ifndef BYTE
  43. typedef unsigned char   BYTE;
  44. typedef unsigned int    WORD;
  45. typedef unsigned long   DWORD;
  46. #endif
  47.  
  48.     /* DSQuery flag word definitions.   */
  49.  
  50. #ifndef CAPS_EPCM
  51. #define CAPS_EPCM       0x0001      // DS201A Extended PCM features
  52. #define CAPS_LPC        0x0002      // Driver plays LPC data
  53. #define CAPS_TONE       0x0004      // Supports PCJr 3-voice tone generator
  54. #define CAPS_201A       0x0008      // Unit is DS201A (or compatible)
  55. #define CAPS_ADPCM      0x0010      // Driver plays OKI ADPCM
  56. #define CAPS_CALLB      0x0020      // Driver supports bank switch callback
  57. #define CAPS_LPCVOC     0x0040      // Driver contains LPC vocabulary.
  58. #define CAPS_PCMREC     0x0080      // Driver supports PCM recording
  59. #define CAPS_DRIVERID   0x0100      // DSQuery returns Driver ID in upper 16 bits.
  60. #define CAPS_301        0x0200      // If this bit is set, the following are valid:
  61. #define CAPS_DIGI       0x0400      // Driver supports Digispeech\CVSD\LPC formats
  62. #define CAPS_MIDI       0x0800      // Driver contains MIDI interpreter.
  63. #define CAPS_CALLIDLE   0x1000      // Driver supports Idle callback
  64.  
  65.     /* The upper 16 bits of the flag word contain the driver ID code.   */
  66.  
  67. #define DID_UNK         0           // Unknown driver (early version)
  68. #define DID_201         1           // LWDIGI DS201 driver (new version)
  69. #define DID_201A        2           // LWDIGI DS201A driver (new version)
  70. #define DID_301         3           // PDIGI Digital Audio only
  71. #define DID_301M        4           // PDIGI Digital Audio / MIDI Synthesizer
  72. #define DID_301V        5           // PDIGI Digital Audio / LPC Vocabulary
  73. #define DID_301MV       6           // PDIGI All features
  74. #define DID_301TD       7           // PDIGI Digispeech format only.
  75. #define DID_301E        8           // PDIGI Educational LPC Emulator
  76. #define DID_301XM       9           // Miles Design XMI Driver support
  77. #endif
  78.  
  79. /****************************************************************************/
  80. /*                                                                          */
  81. /*  DIGI.H - Driver Status Codes                                            */
  82. /*                                                                          */
  83. /****************************************************************************/
  84.  
  85. #ifndef E_OK
  86. #define E_OK            0x0000      // Everything is OK.
  87. #define E_UNDEFINED     0x0001      // Undefined command.
  88. #define E_BUF0          0x0002      // Current buffer is 0.
  89. #define E_BUF1          0x0102      // Current buffer is 1.
  90. #define E_MUSIC         0x0202      // Driver is in 3-tone gen mode.
  91. #define E_COM           0x0003      // Communication error.
  92. #define E_LPC           0x0004      // LPC index out of range.
  93. #define E_CVSDSPEED     0x0005      // CVSD speed is invalid.
  94. #define E_TIMEOUT       0x0006      // Audio Unit not responding.
  95. #define E_ERR           0x0007      // Audio Unit reported an error.
  96.  
  97. #define E_PAUSE         0x1002      // DS201 is paused.
  98. #define E_GAIN          0x2001      // Invalid gain index.
  99. #define E_INDEX         0x3001      // Buffer index is invalid.
  100. #define E_LENGTH        0x4001      // Buffer length is invalid.
  101. #define E_NOBUFFER      0x5001      // No buffers were defined.
  102. #define E_IGNORED       0x6001      // Command ignored.
  103. #define E_INVALID       0x6002      // Bad tone index specified.
  104. #define E_BUSY          0x6003      // Driver or device is busy
  105. #define E_SYNTH         0x6004      // Driver is playing synth
  106.  
  107. #define E_ARGUMENT      0x7001      // Invalid API call argument(s).
  108. #define E_RATE          0x7001      // Invalid RATE argument.
  109. #define E_FORMAT        0x7002      // Invalid FORMAT argument.
  110. #define E_MODE          0x7003      // Invalid MODE argument (REC/PLAY).
  111. #define E_VXD           0x7004      // VxD Request error.
  112. #define E_CHANNELS      0x7005      // Invalid channel count.
  113.  
  114. #endif
  115.  
  116. /****************************************************************************/
  117. /*                                                                          */
  118. /*  Miscellaneous                                                           */
  119. /*                                                                          */
  120. /****************************************************************************/
  121.  
  122. #define H_ADPCM         0x11
  123. #define H_PCMDVI        0x12
  124. #define H_MSADPCM       0x13
  125. #define H_SB4           0x14
  126. #define H_SB3           0x15
  127. #define H_SB2           0x16
  128.  
  129. #define H_DIGICVSD      0x44
  130. #define H_PCMA          0x55
  131. #define H_DIGISTD       0x77
  132. #define H_DIGIFIX       0x78
  133. #define H_DIGIREAL      0x79
  134. #define H_PCMRAW        0x80
  135. #define H_PCMRAW16      0xFE
  136. #define H_PCMMU         0xFF
  137.  
  138.     /* Codes for data format parameter. */
  139.  
  140. #define DF_PCM8         0
  141. #define DF_PCMMU        1
  142. #define DF_PCMA         2
  143. #define DF_PCM16        3
  144. #define DF_SB2          4
  145. #define DF_SB3          5
  146. #define DF_SB4          6
  147. #define DF_OKI4         7
  148. #define DF_DVI4         8
  149.  
  150. #define DF_DIGIREAL     9
  151. #define DF_DIGISTD      10
  152. #define DF_DIGIFIX      11
  153. #define DF_LPC          12
  154. #define DF_MSADPCM      13
  155. #define DF_CVSD         14
  156.  
  157. #define DF_BAD          -2
  158. #define DF_UNKNOWN      -1
  159.  
  160.     /* PlayTone() command parameters.   */
  161.  
  162. #define TONE_ENABLE     0
  163. #define TONE_DISABLE    1
  164. #define TONE_LEVEL      2
  165. #define TONE_FREQ       3
  166.  
  167. #define TONE_FREQ_MIN   175
  168. #define TONE_FREQ_MAX   3000
  169.  
  170.     /* Codes for Synthesizer Emulator function parameter.   */
  171.  
  172. #define SYNTH_INIT      0
  173. #define SYNTH_READ      1
  174. #define SYNTH_WRITE     2
  175. #define SYNTH_RESET     3
  176.  
  177.  
  178. /****************************************************************************/
  179. /*                                                                          */
  180. /*  Driver Low Level Prototypes                                             */
  181. /*                                                                          */
  182. /****************************************************************************/
  183.  
  184. int  DSReset(void);
  185. int  DSLPCStatus(void);
  186. int  DSFPlayLPC(int  index);
  187. int  DSFPlayULPC(char  _far *buf,int len);
  188. int  DSBPlayLPC(int  index);
  189. int  DSBPlayULPC( char _far *buf,int len);
  190. int  DSFRecCVSD( char _far *buf, WORD rate, WORD len );
  191. int  DSFPlayCVSD( char _far *buf, WORD rate, WORD len );
  192. int  DSFRecUCVSD( char _far *buf, int  speed, WORD len);
  193. int  DSFPlayUCVSD( char _far *buf, int speed, WORD len);
  194. int  DSGetStatus(void);
  195. WORD DSGetByteCount( DWORD _far *total );
  196. int  DSSetBuffer( int buffer, int len, char _far *buf);
  197. int  DSSetGain( int gain );
  198. int  DSPause(void);
  199. int  DSResume(void);
  200. int  DSSetCallback(void (_far *routine)() );
  201. int  DSSetCallIdle(void (_far *routine)() );
  202. int  DSBPlayCVSD( int rate, DWORD len );
  203. int  DSBRecCVSD( int rate, DWORD len );
  204. int  DSFPlayDigi( char _far *buf, WORD len );
  205. int  DSBPlayDigi( DWORD len );
  206. int  DSFPlayPCM( char _far *buf, WORD len );
  207. int  DSBPlay( int format, WORD freq, DWORD len );
  208. int  DSBPlayStereo( int pcmType, WORD freq, DWORD len );
  209. int  DSBPlayOKI( int pole, WORD freq, DWORD len );
  210. int  DSBRec( int format, WORD freq, DWORD len );
  211. int  DSToneStart(void);
  212. int  DSToneCmd( BYTE command);
  213. int  DSToneStop(void);
  214. int  DSUninstall(void);
  215. int  DSQuery( WORD _far *majorID, WORD _far *minorID, DWORD _far *caps );
  216. int  DSSetMixer(int  mix);
  217. int  (_far *DSGetEntry(void))(int, BYTE, BYTE );
  218. int  DriverInstalled(void);
  219.  
  220.  
  221. /****************************************************************************/
  222. /*                                                                          */
  223. /* Music Driver Prototypes                                                  */
  224. /*                                                                          */
  225. /****************************************************************************/
  226.  
  227. char  _far *DSSetStatusAddress(char  _far *addr);
  228. int  DSInitSynthesizer(int  mode);
  229. int  DSSetPatchTable(char  _far *lpInstPtr,int  count);
  230. int  DSMusicPlay(char  _far *lpMusicPtr);
  231. int  DSMusicStop(void);
  232. int  DSTranspose(int  cTranspose);
  233. int  DSMIDINoteOn( BYTE thisChannel, BYTE pitch, BYTE velocity );
  234. int  DSMIDINoteOff( BYTE thisChannel, BYTE pitch );
  235. int  DSMIDIPgmChange( BYTE thisChannel, BYTE newInstrument );
  236. int  DSMIDIPitchBend( BYTE thisChannel, BYTE newInstrument );
  237. BYTE _far *DSMIDIGetChannelsPtr(void);
  238. int  DSSetMusicRate(int  ticksPerSecond);
  239. int  DSMusicStatus(void);
  240. int  DSMusicOpen(int  mode);
  241. int  DSMusicClose(void);
  242.  
  243.  
  244. /****************************************************************************/
  245. /*                                                                          */
  246. /* Driver High Level Prototypes                                             */
  247. /*                                                                          */
  248. /****************************************************************************/
  249.  
  250. void _Wait( unsigned int  milliSeconds );
  251. int  Tone( int command, int tone, WORD freq);
  252. int  PlayOneTone( WORD freq, int duration);
  253. int  PlayThreeTone( WORD freq1, WORD freq2, WORD freq3, int duration);
  254. int  StartPlay( int format, WORD rate, int channels, DWORD len );
  255. int  StartRecord( int format, WORD rate, int channels, DWORD len );
  256.  
  257. #endif
  258.  
  259.