|
|
1.1 root 1: /*++ BUILD Version: 0001 // Increment this if a change has global effects
2:
3: Copyright (c) 1990-1993 Microsoft Corporation
4:
5: Module Name:
6:
7: ntddmidi.h
8:
9: Abstract:
10:
11: This include file defines all constants and types for
12: accessing an NT wave device.
13:
14: Author:
15:
16: Robin Speed (RobinSp) 12-Dec-91
17:
18: Revision History:
19:
20: --*/
21:
22: #ifndef _NTDDMIDI_
23: #define _NTDDMIDI_
24:
25: #include <ntddsnd.h> // general sound stuff
26:
27: //
28: // Device Name - this string is the name of the device. It is the name
29: // that when added to the name of the root of the device tree and with
30: // the device number appended, gives the name of the device required for
31: // a call to NtOpenFile.
32: // So for example, if the root is \Device and the Device type is
33: // MidiIn and the device number is 2, the full name is \Device\MidiIn2
34: //
35:
36: #define DD_MIDI_IN_DEVICE_NAME "\\Device\\MidiIn"
37: #define DD_MIDI_IN_DEVICE_NAME_U L"\\Device\\MidiIn"
38: #define DD_MIDI_OUT_DEVICE_NAME "\\Device\\MidiOut"
39: #define DD_MIDI_OUT_DEVICE_NAME_U L"\\Device\\MidiOut"
40:
41: //
42: // MIDI device driver IOCTL set
43: //
44:
45: #define IOCTL_MIDI_GET_CAPABILITIES CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
46: #define IOCTL_MIDI_SET_STATE CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
47: #define IOCTL_MIDI_GET_STATE CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
48: #define IOCTL_MIDI_SET_VOLUME CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
49: #define IOCTL_MIDI_GET_VOLUME CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0005, METHOD_BUFFERED, FILE_READ_ACCESS)
50: #define IOCTL_MIDI_PLAY CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0006, METHOD_NEITHER, FILE_WRITE_ACCESS)
51: #define IOCTL_MIDI_RECORD CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS)
52: #define IOCTL_MIDI_CACHE_PATCHES CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0008, METHOD_BUFFERED, FILE_WRITE_ACCESS)
53: #define IOCTL_MIDI_CACHE_DRUM_PATCHES CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS)
54:
55:
56: //
57: // IOCTL used in the debug build only
58: //
59:
60: #if DBG
61:
62: #define IOCTL_MIDI_SET_DEBUG_LEVEL CTL_CODE(IOCTL_SOUND_BASE, IOCTL_MIDI_BASE + 0x0040, METHOD_BUFFERED, FILE_READ_ACCESS)
63:
64: #endif // DBG
65:
66:
67: //
68: // Product Ids - see winmm.h
69: //
70:
71:
72: //
73: // Midi input output buffer format
74: //
75:
76: typedef struct {
77: LARGE_INTEGER Time; // Time when data received
78: // (in units of 100ns from when
79: // midi input was started)
80: UCHAR Data[sizeof(ULONG)]; // Data (at least 4 byts for
81: // alignment).
82: } MIDI_DD_INPUT_DATA, *PMIDI_DD_INPUT_DATA;
83:
84:
85: //
86: // Midi volume structure
87: //
88:
89: typedef struct _MIDI_DD_VOLUME {
90: ULONG Left;
91: ULONG Right;
92: } MIDI_DD_VOLUME, *PMIDI_DD_VOLUME;
93:
94: //
95: // Patch array structure
96: //
97:
98: //
99: // Midi cache patches structures
100: //
101:
102: typedef struct _MIDI_DD_CACHE_PATCHES {
103: ULONG Bank;
104: ULONG Flags;
105: USHORT Patches[128];
106: } MIDI_DD_CACHE_PATCHES, *PMIDI_DD_CACHE_PATCHES;
107:
108: //
109: // Midi cache drum patches structures
110: //
111:
112: typedef struct _MIDI_DD_CACHE_DRUM_PATCHES {
113: ULONG Patch;
114: ULONG Flags;
115: USHORT DrumPatches[128];
116: } MIDI_DD_CACHE_DRUM_PATCHES, *PMIDI_DD_CACHE_DRUM_PATCHES;
117:
118: //
119: // State flags used to set the state of a driver
120: //
121:
122: #define MIDI_DD_STOP 0x0001
123: #define MIDI_DD_PLAY 0x0002 // output devices only
124: #define MIDI_DD_RECORD 0x0003 // input devices only
125: #define MIDI_DD_RESET 0x0004
126:
127: //
128: // States returned by the get state ioctl
129: //
130:
131: #define MIDI_DD_IDLE 0x0000
132: #define MIDI_DD_STOPPED 0x0001 // stopped
133: #define MIDI_DD_PLAYING 0x0002 // output devices only
134: #define MIDI_DD_RECORDING 0x0003 // input devices only
135:
136: #endif // _NTDDMIDI_
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.