CTAWEAPI.H 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353
  1. /*
  2. Copyright (C) 1994-1995 Apogee Software, Ltd.
  3. This program is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU General Public License
  5. as published by the Free Software Foundation; either version 2
  6. of the License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  10. See the GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program; if not, write to the Free Software
  13. Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  14. */
  15. /****************************************************************************\
  16. * *
  17. * CTAWEAPI.H SB AWE32 DOS API header *
  18. * *
  19. * (C) Copyright Creative Technology Ltd. 1992-94. All rights reserved *
  20. * worldwide. *
  21. * *
  22. * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY *
  23. * KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE *
  24. * IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR *
  25. * PURPOSE. *
  26. * *
  27. * You have a royalty-free right to use, modify, reproduce and *
  28. * distribute the Sample Files (and/or any modified version) in *
  29. * any way you find useful, provided that you agree to *
  30. * the Creative's Software Licensing Aggreement and you also agree that *
  31. * Creative has no warranty obligations or liability for any Sample Files. *
  32. * *
  33. \****************************************************************************/
  34. /****************************************************************************\
  35. * File name : CTAWEAPI.H *
  36. * *
  37. * Programmer : Creative SB AWE32 Team *
  38. * Creative Technology Ltd, 1994. All rights reserved. *
  39. * *
  40. * Version : 2.0b *
  41. * *
  42. \****************************************************************************/
  43. #ifndef _CTAWEAPI
  44. #define _CTAWEAPI
  45. #define MAXBANKS 64 /* maximum number of banks */
  46. #define MAXNRPN 32 /* maximum number of NRPN */
  47. #if defined(__FLAT__) || defined(__HIGHC__) || defined(DOS386)
  48. #define PACKETSIZE 8192 /* packet size for 32bit libraries */
  49. #else
  50. #define PACKETSIZE 512 /* packet size for real mode libraries */
  51. #endif
  52. #if defined(__FLAT__)
  53. #define NEAR
  54. #define FAR
  55. #endif
  56. #if defined(__SC__)
  57. #pragma pack(1)
  58. #if defined(DOS386)
  59. #define NEAR
  60. #define FAR
  61. #endif
  62. #endif
  63. #if defined(__WATCOMC__)
  64. #pragma pack(1)
  65. #endif
  66. #if defined(__HIGHC__)
  67. #define NEAR
  68. #define FAR
  69. #define PASCAL _DCC((_DEFAULT_CALLING_CONVENTION|_CALLEE_POPS_STACK) & \
  70. ~ (_REVERSE_PARMS|_OVERLOADED))
  71. #pragma Push_align_members(1)
  72. #pragma Global_aliasing_convention("_%r")
  73. #endif
  74. typedef int BOOL;
  75. #define FALSE 0
  76. #define TRUE 1
  77. typedef unsigned char BYTE;
  78. typedef unsigned short WORD;
  79. typedef unsigned long DWORD;
  80. typedef short int SHORT;
  81. typedef unsigned int UINT;
  82. typedef signed long LONG;
  83. #ifndef FAR
  84. #define FAR __far
  85. #endif
  86. #ifndef HUGE
  87. #define HUGE __huge
  88. #endif
  89. #ifndef PASCAL
  90. #define PASCAL __pascal
  91. #endif
  92. typedef void FAR* LPVOID;
  93. typedef BYTE FAR* LPBYTE;
  94. typedef WORD FAR* LPWORD;
  95. typedef DWORD FAR* LPDWORD;
  96. #define LOBYTE(w) ((BYTE)(w))
  97. #define HIBYTE(w) ((BYTE)(((UINT)(w) >> 8) & 0xFF))
  98. #define LOWORD(l) ((WORD)(DWORD)(l))
  99. #define HIWORD(l) ((WORD)((((DWORD)(l)) >> 16) & 0xFFFF))
  100. #if defined(__cplusplus)
  101. extern "C" {
  102. #endif
  103. /* Start of modules */
  104. extern int* __midieng_code(void);
  105. extern int* __hardware_code(void);
  106. extern int* __sbkload_code(void);
  107. extern int* __nrpn_code(void);
  108. extern int __midivar_data;
  109. extern int __nrpnvar_data;
  110. extern int __embed_data;
  111. typedef char SCRATCH[702];
  112. typedef char SOUNDFONT[124];
  113. typedef char GCHANNEL[20];
  114. typedef char MIDICHANNEL[32];
  115. typedef char NRPNCHANNEL[96];
  116. typedef struct {
  117. SHORT bank_no; /* Slot number being used */
  118. SHORT total_banks; /* Total number of banks */
  119. LONG FAR* banksizes; /* Pointer to a list of bank sizes */
  120. LONG file_size; /* exact size of the sound font file */
  121. char FAR* data; /* Address of buffer of size >= PACKETSIZE */
  122. char FAR* presets; /* Allocated memory for preset data */
  123. LONG total_patch_ram; /* Total patch ram available */
  124. SHORT no_sample_packets;/* Number of packets of sound sample to stream */
  125. LONG sample_seek; /* Start file location of sound sample */
  126. LONG preset_seek; /* Address of preset_seek location */
  127. LONG preset_read_size; /* Number of bytes from preset_seek to allocate and read */
  128. LONG preset_size; /* Preset actual size */
  129. } SOUND_PACKET;
  130. typedef struct {
  131. SHORT tag; /* Must be 0x100 or 0x101 */
  132. SHORT preset_size; /* Preset table of this size is required */
  133. SHORT no_wave_packets; /* Number of packets of Wave sample to stream. */
  134. LONG reserved;
  135. SHORT bank_no; /* bank number */
  136. char FAR* data; /* Address of packet of size PACKETSIZE */
  137. char FAR* presets; /* Allocated memory for preset data */
  138. LONG sample_size; /* Sample size, i.e. number of samples */
  139. LONG samples_per_sec; /* Samples per second */
  140. SHORT bits_per_sample; /* Bits per sample, 8 or 16 */
  141. SHORT no_channels; /* Number of channels, 1=mono, 2=stereo */
  142. SHORT looping; /* Looping? 0=no, 1=yes */
  143. LONG startloop; /* if looping, then these are the addresses */
  144. LONG endloop;
  145. SHORT release; /* release time, 0=24ms, 8191=23.78s */
  146. } WAVE_PACKET;
  147. typedef struct {
  148. LPBYTE SPad1;
  149. LPBYTE SPad2;
  150. LPBYTE SPad3;
  151. LPBYTE SPad4;
  152. LPBYTE SPad5;
  153. LPBYTE SPad6;
  154. LPBYTE SPad7;
  155. } SOUNDPAD;
  156. /* AWE32 variables */
  157. extern WORD awe32NumG;
  158. extern WORD awe32BaseAddx;
  159. extern DWORD awe32DramSize;
  160. /* MIDI variables */
  161. extern SCRATCH awe32Scratch;
  162. extern SOUNDFONT awe32SFont[4];
  163. extern GCHANNEL awe32GChannel[32];
  164. extern MIDICHANNEL awe32MIDIChannel[16];
  165. extern SOUNDPAD awe32SoundPad;
  166. /* NRPN variables */
  167. extern NRPNCHANNEL awe32NRPNChannel[16];
  168. /* SoundFont objects */
  169. extern BYTE awe32SPad1Obj[];
  170. extern BYTE awe32SPad2Obj[];
  171. extern BYTE awe32SPad3Obj[];
  172. extern BYTE awe32SPad4Obj[];
  173. extern BYTE awe32SPad5Obj[];
  174. extern BYTE awe32SPad6Obj[];
  175. extern BYTE awe32SPad7Obj[];
  176. /* AWE register functions */
  177. extern void PASCAL awe32RegW(WORD, WORD);
  178. extern WORD PASCAL awe32RegRW(WORD);
  179. extern void PASCAL awe32RegDW(WORD, DWORD);
  180. extern DWORD PASCAL awe32RegRDW(WORD);
  181. /* MIDI support functions */
  182. extern WORD PASCAL awe32InitMIDI(void);
  183. extern WORD PASCAL awe32NoteOn(WORD, WORD, WORD);
  184. extern WORD PASCAL awe32NoteOff(WORD, WORD, WORD);
  185. extern WORD PASCAL awe32ProgramChange(WORD, WORD);
  186. extern WORD PASCAL awe32Controller(WORD, WORD, WORD);
  187. extern WORD PASCAL awe32PolyKeyPressure(WORD, WORD, WORD);
  188. extern WORD PASCAL awe32ChannelPressure(WORD, WORD);
  189. extern WORD PASCAL awe32PitchBend(WORD, WORD, WORD);
  190. extern WORD PASCAL awe32Sysex(WORD, LPBYTE, WORD);
  191. extern WORD PASCAL __awe32NoteOff(WORD, WORD, WORD, WORD);
  192. extern WORD PASCAL __awe32IsPlaying(WORD, WORD, WORD, WORD);
  193. /* NRPN support functions */
  194. extern WORD PASCAL awe32InitNRPN(void);
  195. /* Hardware support functions */
  196. extern WORD PASCAL awe32Detect(WORD);
  197. extern WORD PASCAL awe32InitHardware(void);
  198. extern WORD PASCAL awe32Terminate(void);
  199. /* SoundFont support functions */
  200. extern WORD PASCAL awe32TotalPatchRam(SOUND_PACKET FAR*);
  201. extern WORD PASCAL awe32DefineBankSizes(SOUND_PACKET FAR*);
  202. extern WORD PASCAL awe32SFontLoadRequest(SOUND_PACKET FAR*);
  203. extern WORD PASCAL awe32StreamSample(SOUND_PACKET FAR*);
  204. extern WORD PASCAL awe32SetPresets(SOUND_PACKET FAR*);
  205. extern WORD PASCAL awe32ReleaseBank(SOUND_PACKET FAR*);
  206. extern WORD PASCAL awe32ReleaseAllBanks(SOUND_PACKET FAR*);
  207. extern WORD PASCAL awe32WPLoadRequest(WAVE_PACKET FAR*);
  208. extern WORD PASCAL awe32WPLoadWave(WAVE_PACKET FAR*);
  209. extern WORD PASCAL awe32WPStreamWave(WAVE_PACKET FAR*);
  210. extern WORD PASCAL awe32WPBuildSFont(WAVE_PACKET FAR*);
  211. /* End of modules */
  212. extern int* __midieng_ecode(void);
  213. extern int* __hardware_ecode(void);
  214. extern int* __sbkload_ecode(void);
  215. extern int* __nrpn_ecode(void);
  216. extern int __midivar_edata;
  217. extern int __nrpnvar_edata;
  218. extern int __embed_edata;
  219. #if defined(__cplusplus)
  220. }
  221. #endif
  222. #if defined(__SC__)
  223. #pragma pack()
  224. #endif
  225. #if defined(__HIGHC__)
  226. #pragma Pop_align_members
  227. #pragma Global_aliasing_convention()
  228. #pragma Alias(awe32RegW,"AWE32REGW")
  229. #pragma Alias(awe32RegRW,"AWE32REGRW")
  230. #pragma Alias(awe32RegDW,"AWE32REGDW")
  231. #pragma Alias(awe32RegRDW,"AWE32REGRDW")
  232. #pragma Alias(awe32InitMIDI,"AWE32INITMIDI")
  233. #pragma Alias(awe32NoteOn,"AWE32NOTEON")
  234. #pragma Alias(awe32NoteOff,"AWE32NOTEOFF")
  235. #pragma Alias(awe32ProgramChange,"AWE32PROGRAMCHANGE")
  236. #pragma Alias(awe32Controller,"AWE32CONTROLLER")
  237. #pragma Alias(awe32PolyKeyPressure,"AWE32POLYKEYPRESSURE")
  238. #pragma Alias(awe32ChannelPressure,"AWE32CHANNELPRESSURE")
  239. #pragma Alias(awe32PitchBend,"AWE32PITCHBEND")
  240. #pragma Alias(awe32Sysex,"AWE32SYSEX")
  241. #pragma Alias(__awe32NoteOff,"__AWE32NOTEOFF")
  242. #pragma Alias(__awe32IsPlaying,"__AWE32ISPLAYING")
  243. #pragma Alias(awe32InitNRPN,"AWE32INITNRPN")
  244. #pragma Alias(awe32Detect,"AWE32DETECT")
  245. #pragma Alias(awe32InitHardware,"AWE32INITHARDWARE")
  246. #pragma Alias(awe32Terminate,"AWE32TERMINATE")
  247. #pragma Alias(awe32TotalPatchRam,"AWE32TOTALPATCHRAM")
  248. #pragma Alias(awe32DefineBankSizes,"AWE32DEFINEBANKSIZES")
  249. #pragma Alias(awe32SFontLoadRequest,"AWE32SFONTLOADREQUEST")
  250. #pragma Alias(awe32StreamSample,"AWE32STREAMSAMPLE")
  251. #pragma Alias(awe32SetPresets,"AWE32SETPRESETS")
  252. #pragma Alias(awe32ReleaseBank,"AWE32RELEASEBANK")
  253. #pragma Alias(awe32ReleaseAllBanks,"AWE32RELEASEALLBANKS")
  254. #pragma Alias(awe32WPLoadRequest,"AWE32WPLOADREQUEST")
  255. #pragma Alias(awe32WPLoadWave,"AWE32WPLOADWAVE")
  256. #pragma Alias(awe32WPStreamWave,"AWE32WPSTREAMWAVE")
  257. #pragma Alias(awe32WPBuildSFont,"AWE32WPBUILDSFONT")
  258. #endif
  259. #if defined(__WATCOMC__)
  260. #pragma pack()
  261. #pragma aux awe32NumG "_*"
  262. #pragma aux awe32BaseAddx "_*"
  263. #pragma aux awe32DramSize "_*"
  264. #pragma aux awe32Scratch "_*"
  265. #pragma aux awe32SFont "_*"
  266. #pragma aux awe32GChannel "_*"
  267. #pragma aux awe32MIDIChannel "_*"
  268. #pragma aux awe32SoundPad "_*"
  269. #pragma aux awe32NRPNChannel "_*"
  270. #pragma aux awe32SPad1Obj "_*"
  271. #pragma aux awe32SPad2Obj "_*"
  272. #pragma aux awe32SPad3Obj "_*"
  273. #pragma aux awe32SPad4Obj "_*"
  274. #pragma aux awe32SPad5Obj "_*"
  275. #pragma aux awe32SPad6Obj "_*"
  276. #pragma aux awe32SPad7Obj "_*"
  277. #pragma aux __midieng_code "_*"
  278. #pragma aux __midieng_ecode "_*"
  279. #pragma aux __hardware_code "_*"
  280. #pragma aux __hardware_ecode "_*"
  281. #pragma aux __sbkload_code "_*"
  282. #pragma aux __sbkload_ecode "_*"
  283. #pragma aux __nrpn_code "_*"
  284. #pragma aux __nrpn_ecode "_*"
  285. #pragma aux __midivar_data "_*"
  286. #pragma aux __midivar_edata "_*"
  287. #pragma aux __nrpnvar_data "_*"
  288. #pragma aux __nrpnvar_edata "_*"
  289. #pragma aux __embed_data "_*"
  290. #pragma aux __embed_edata "_*"
  291. #endif
  292. #endif /* _CTAWEAPI */