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