icardmid.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. **********************************************************************
  3. * isblive_mid.h
  4. * Copyright 1999, 2000 Creative Labs, Inc.
  5. *
  6. **********************************************************************
  7. *
  8. * Date Author Summary of changes
  9. * ---- ------ ------------------
  10. * October 20, 1999 Bertrand Lee base code release
  11. *
  12. **********************************************************************
  13. *
  14. * This program is free software; you can redistribute it and/or
  15. * modify it under the terms of the GNU General Public License as
  16. * published by the Free Software Foundation; either version 2 of
  17. * the License, or (at your option) any later version.
  18. *
  19. * This program is distributed in the hope that it will be useful,
  20. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  21. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  22. * GNU General Public License for more details.
  23. *
  24. * You should have received a copy of the GNU General Public
  25. * License along with this program; if not, write to the Free
  26. * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
  27. * USA.
  28. *
  29. **********************************************************************
  30. */
  31. #ifndef _ICARDMIDI_H
  32. #define _ICARDMIDI_H
  33. /* MIDI defines */
  34. #define MIDI_DATA_FIRST 0x00
  35. #define MIDI_DATA_LAST 0x7F
  36. #define MIDI_STATUS_FIRST 0x80
  37. #define MIDI_STATUS_LAST 0xFF
  38. /* Channel status bytes */
  39. #define MIDI_STATUS_CHANNEL_FIRST 0x80
  40. #define MIDI_STATUS_CHANNEL_LAST 0xE0
  41. #define MIDI_STATUS_CHANNEL_MASK 0xF0
  42. /* Channel voice messages */
  43. #define MIDI_VOICE_NOTE_OFF 0x80
  44. #define MIDI_VOICE_NOTE_ON 0x90
  45. #define MIDI_VOICE_POLY_PRESSURE 0xA0
  46. #define MIDI_VOICE_CONTROL_CHANGE 0xB0
  47. #define MIDI_VOICE_PROGRAM_CHANGE 0xC0
  48. #define MIDI_VOICE_CHANNEL_PRESSURE 0xD0
  49. #define MIDI_VOICE_PITCH_BEND 0xE0
  50. /* Channel mode messages */
  51. #define MIDI_MODE_CHANNEL MIDI_VOICE_CONTROL_CHANGE
  52. /* System status bytes */
  53. #define MIDI_STATUS_SYSTEM_FIRST 0xF0
  54. #define MIDI_STATUS_SYSTEM_LAST 0xFF
  55. /* System exclusive messages */
  56. #define MIDI_SYSEX_BEGIN 0xF0
  57. #define MIDI_SYSEX_EOX 0xF7
  58. /* System common messages */
  59. #define MIDI_COMMON_TCQF 0xF1 /* Time code quarter frame */
  60. #define MIDI_COMMON_SONG_POSITION 0xF2
  61. #define MIDI_COMMON_SONG_SELECT 0xF3
  62. #define MIDI_COMMON_UNDEFINED_F4 0xF4
  63. #define MIDI_COMMON_UNDEFINED_F5 0xF5
  64. #define MIDI_COMMON_TUNE_REQUEST 0xF6
  65. /* System real-time messages */
  66. #define MIDI_RTIME_TIMING_CLOCK 0xF8
  67. #define MIDI_RTIME_UNDEFINED_F9 0xF9
  68. #define MIDI_RTIME_START 0xFA
  69. #define MIDI_RTIME_CONTINUE 0xFB
  70. #define MIDI_RTIME_STOP 0xFC
  71. #define MIDI_RTIME_UNDEFINED_FD 0xFD
  72. #define MIDI_RTIME_ACTIVE_SENSING 0xFE
  73. #define MIDI_RTIME_SYSTEM_RESET 0xFF
  74. /* Flags for flags parm of midiOutCachePatches(), midiOutCacheDrumPatches() */
  75. #define MIDI_CACHE_ALL 1
  76. #define MIDI_CACHE_BESTFIT 2
  77. #define MIDI_CACHE_QUERY 3
  78. #define MIDI_UNCACHE 4
  79. /* Event declarations for MPU IRQ Callbacks */
  80. #define ICARDMIDI_INLONGDATA 0x00000001 /* MIM_LONGDATA */
  81. #define ICARDMIDI_INLONGERROR 0x00000002 /* MIM_LONGERROR */
  82. #define ICARDMIDI_OUTLONGDATA 0x00000004 /* MOM_DONE for MPU OUT buffer */
  83. #define ICARDMIDI_INDATA 0x00000010 /* MIM_DATA */
  84. #define ICARDMIDI_INDATAERROR 0x00000020 /* MIM_ERROR */
  85. /* Declaration for flags in CARDMIDIBUFFERHDR */
  86. /* Make it the same as MHDR_DONE, MHDR_INQUEUE in mmsystem.h */
  87. #define MIDIBUF_DONE 0x00000001
  88. #define MIDIBUF_INQUEUE 0x00000004
  89. /* Declaration for msg parameter in midiCallbackFn */
  90. #define ICARDMIDI_OUTBUFFEROK 0x00000001
  91. #define ICARDMIDI_INMIDIOK 0x00000002
  92. /* Declaration for technology in struct midi_caps */
  93. #define MT_MIDIPORT 0x00000001 /* In original MIDIOUTCAPS structure */
  94. #define MT_FMSYNTH 0x00000004 /* In original MIDIOUTCAPS structure */
  95. #define MT_AWESYNTH 0x00001000
  96. #define MT_PCISYNTH 0x00002000
  97. #define MT_PCISYNTH64 0x00004000
  98. #define CARDMIDI_AWEMASK 0x0000F000
  99. enum LocalErrorCode
  100. {
  101. CTSTATUS_NOTENABLED = 0x7000,
  102. CTSTATUS_READY,
  103. CTSTATUS_BUSY,
  104. CTSTATUS_DATAAVAIL,
  105. CTSTATUS_NODATA,
  106. CTSTATUS_NEXT_BYTE
  107. };
  108. /* MIDI data block header */
  109. struct midi_hdr
  110. {
  111. u8 *reserved; /* Pointer to original locked data block */
  112. u32 bufferlength; /* Length of data in data block */
  113. u32 bytesrecorded; /* Used for input only */
  114. u32 user; /* For client's use */
  115. u32 flags; /* Assorted flags (see defines) */
  116. struct list_head list; /* Reserved for driver */
  117. u8 *data; /* Second copy of first pointer */
  118. };
  119. /* Enumeration for SetControl */
  120. enum
  121. {
  122. MIDIOBJVOLUME = 0x1,
  123. MIDIQUERYACTIVEINST
  124. };
  125. struct midi_queue
  126. {
  127. struct midi_queue *next;
  128. u32 qtype; /* 0 = short message, 1 = long data */
  129. u32 length;
  130. u32 sizeLeft;
  131. u8 *midibyte;
  132. unsigned long refdata;
  133. };
  134. struct midi_openinfo
  135. {
  136. u32 cbsize;
  137. u32 flags;
  138. unsigned long refdata;
  139. u32 streamid;
  140. };
  141. int emu10k1_midi_callback(unsigned long , unsigned long, unsigned long *);
  142. #endif /* _ICARDMIDI_H */