2009-01-31 22:13:30 +00:00
|
|
|
/*
|
|
|
|
ReactOS Sound System
|
|
|
|
NT4 Multimedia Audio Support (ntddsnd.h)
|
|
|
|
|
2009-08-20 12:27:08 +00:00
|
|
|
This file is in the public domain.
|
|
|
|
|
2009-01-31 22:13:30 +00:00
|
|
|
Author:
|
|
|
|
Andrew Greenwood (andrew.greenwood@silverblade.co.uk)
|
|
|
|
|
|
|
|
History:
|
|
|
|
24 May 2008 - Created
|
|
|
|
2 July 2008 - Added device names as seen from user-mode
|
|
|
|
5 July 2008 - Added macros for checking device type
|
2009-02-15 13:31:52 +00:00
|
|
|
14 Feb 2009 - Added base control codes for nonstandard extensions
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
This file contains definitions and structures for Windows NT4 style
|
|
|
|
multimedia drivers. The NT4 DDK has these split across multiple header
|
|
|
|
files: NTDDSND.H, NTDDWAVE.H, NTDDMIDI.H, NTDDMIX.H and NTDDAUX.H
|
|
|
|
|
|
|
|
Should you have an unstoppable urge to build an NT4 multimedia driver
|
|
|
|
against these headers, just create the other files listed above and make
|
|
|
|
them #include this one.
|
|
|
|
|
|
|
|
There are also a number of additional enhancements within this file
|
|
|
|
not found in the originals (such as DOS device name strings and device
|
|
|
|
type IDs).
|
|
|
|
*/
|
|
|
|
|
2009-02-15 13:31:52 +00:00
|
|
|
#ifndef NTDDSND_H
|
|
|
|
#define NTDDSND_H
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define SOUND_MAX_DEVICES 100
|
2009-02-15 13:31:52 +00:00
|
|
|
#define SOUND_MAX_DEVICE_NAME 80
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Base control codes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define IOCTL_SOUND_BASE FILE_DEVICE_SOUND
|
|
|
|
#define IOCTL_WAVE_BASE 0x0000
|
|
|
|
#define IOCTL_MIDI_BASE 0x0080
|
|
|
|
#define IOCTL_AUX_BASE 0x0100
|
|
|
|
#define IOCTL_MIX_BASE 0x0180
|
|
|
|
|
|
|
|
/*
|
|
|
|
Helper macros for defining control codes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define WAVE_CTL_CODE(subcode, iomethod, access) \
|
2010-08-10 20:50:55 +00:00
|
|
|
CTL_CODE(FILE_DEVICE_SOUND, IOCTL_WAVE_BASE + subcode, iomethod, access)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define MIDI_CTL_CODE(subcode, iomethod, access) \
|
2010-08-10 20:50:55 +00:00
|
|
|
CTL_CODE(FILE_DEVICE_SOUND, IOCTL_MIDI_BASE + subcode, iomethod, access)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define MIX_CTL_CODE(subcode, iomethod, access) \
|
2010-08-10 20:50:55 +00:00
|
|
|
CTL_CODE(FILE_DEVICE_SOUND, IOCTL_MIX_BASE + subcode, iomethod, access)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define AUX_CTL_CODE(subcode, iomethod, access) \
|
2010-08-10 20:50:55 +00:00
|
|
|
CTL_CODE(FILE_DEVICE_SOUND, IOCTL_AUX_BASE + subcode, iomethod, access)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Wave device control codes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define IOCTL_WAVE_QUERY_FORMAT \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_SET_FORMAT \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_GET_CAPABILITIES \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_SET_STATE \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x0004, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_GET_STATE \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x0005, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_GET_POSITION \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x0006, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_SET_VOLUME \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x0007, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_GET_VOLUME \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x0008, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_SET_PITCH \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_GET_PITCH \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x000A, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_SET_PLAYBACK_RATE \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x000B, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_GET_PLAYBACK_RATE \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x000C, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_PLAY \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x000D, METHOD_IN_DIRECT, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_RECORD \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x000E, METHOD_OUT_DIRECT, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_BREAK_LOOP \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x000F, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_WAVE_SET_LOW_PRIORITY \
|
2010-08-10 20:50:55 +00:00
|
|
|
WAVE_CTL_CODE(0x0010, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#if DBG
|
2010-08-10 20:50:55 +00:00
|
|
|
/* Debug-only control code */
|
|
|
|
#define IOCTL_WAVE_SET_DEBUG_LEVEL \
|
|
|
|
WAVE_CTL_CODE(0x0040, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
MIDI device control codes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define IOCTL_MIDI_GET_CAPABILITIES \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIDI_CTL_CODE(0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_MIDI_SET_STATE \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIDI_CTL_CODE(0x0002, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_MIDI_GET_STATE \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIDI_CTL_CODE(0x0003, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_MIDI_SET_VOLUME \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIDI_CTL_CODE(0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_MIDI_GET_VOLUME \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIDI_CTL_CODE(0x0005, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_MIDI_PLAY \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIDI_CTL_CODE(0x0006, METHOD_NEITHER, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_MIDI_RECORD \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIDI_CTL_CODE(0x0007, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_MIDI_CACHE_PATCHES \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIDI_CTL_CODE(0x0008, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_MIDI_CACHE_DRUM_PATCHES \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIDI_CTL_CODE(0x0009, METHOD_BUFFERED, FILE_WRITE_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#if DBG
|
2010-08-10 20:50:55 +00:00
|
|
|
/* Debug-only control code */
|
|
|
|
#define IOCTL_MIDI_SET_DEBUG_LEVEL \
|
|
|
|
WAVE_CTL_CODE(0x0040, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
Mixer device control codes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define IOCTL_MIX_GET_CONFIGURATION \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIX_CTL_CODE(0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_MIX_GET_CONTROL_DATA \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIX_CTL_CODE(0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_MIX_GET_LINE_DATA \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIX_CTL_CODE(0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_MIX_REQUEST_NOTIFY \
|
2010-08-10 20:50:55 +00:00
|
|
|
MIX_CTL_CODE(0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Auxiliary device control codes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define IOCTL_AUX_GET_CAPABILITIES \
|
2010-08-10 20:50:55 +00:00
|
|
|
AUX_CTL_CODE(0x0001, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_AUX_SET_VOLUME \
|
2010-08-10 20:50:55 +00:00
|
|
|
AUX_CTL_CODE(0x0002, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_AUX_GET_VOLUME \
|
2010-08-10 20:50:55 +00:00
|
|
|
AUX_CTL_CODE(0x0003, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
#define IOCTL_SOUND_GET_CHANGED_VOLUME \
|
2010-08-10 20:50:55 +00:00
|
|
|
AUX_CTL_CODE(0x0004, METHOD_BUFFERED, FILE_READ_ACCESS)
|
2009-01-31 22:13:30 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
Wave structures & states
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define WAVE_DD_MAX_VOLUME 0xFFFFFFFF
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _WAVE_DD_VOLUME {
|
|
|
|
ULONG Left;
|
|
|
|
ULONG Right;
|
2009-01-31 22:13:30 +00:00
|
|
|
} WAVE_DD_VOLUME, *PWAVE_DD_VOLUME;
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _WAVE_DD_PITCH {
|
|
|
|
ULONG Pitch;
|
2009-01-31 22:13:30 +00:00
|
|
|
} WAVE_DD_PITCH, *PWAVE_DD_PITCH;
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _WAVE_DD_PLAYBACK_RATE {
|
|
|
|
ULONG Rate;
|
2009-01-31 22:13:30 +00:00
|
|
|
} WAVE_DD_PLAYBACK_RATE, *PWAVE_DD_PLAYBACK_RATE;
|
|
|
|
|
|
|
|
/* IOCTL_WAVE_SET_STATE commands */
|
|
|
|
#define WAVE_DD_STOP 0x0001
|
|
|
|
#define WAVE_DD_PLAY 0x0002
|
|
|
|
#define WAVE_DD_RECORD 0x0003
|
|
|
|
#define WAVE_DD_RESET 0x0004
|
|
|
|
|
|
|
|
/* IOCTL_WAVE_GET_STATE responses */
|
|
|
|
#define WAVE_DD_IDLE 0x0000
|
|
|
|
#define WAVE_DD_STOPPED 0x0001
|
|
|
|
#define WAVE_DD_PLAYING 0x0002
|
|
|
|
#define WAVE_DD_RECORDING 0x0003
|
|
|
|
|
|
|
|
/*
|
|
|
|
MIDI structures & states
|
|
|
|
*/
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _MIDI_DD_INPUT_DATA {
|
|
|
|
LARGE_INTEGER Time;
|
|
|
|
UCHAR Data[sizeof(ULONG)];
|
2009-01-31 22:13:30 +00:00
|
|
|
} MIDI_DD_INPUT_DATA, *PMIDI_DD_INPUT_DATA;
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _MIDI_DD_VOLUME {
|
|
|
|
ULONG Left;
|
|
|
|
ULONG Right;
|
2009-01-31 22:13:30 +00:00
|
|
|
} MIDI_DD_VOLUME, *PMIDI_DD_VOLUME;
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _MIDI_DD_CACHE_PATCHES {
|
|
|
|
ULONG Bank;
|
|
|
|
ULONG Flags;
|
|
|
|
ULONG Patches[128];
|
2009-01-31 22:13:30 +00:00
|
|
|
} MIDI_DD_CACHE_PATCHES, *PMIDI_DD_CACHE_PATCHES;
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _MIDI_DD_CACHE_DRUM_PATCHES {
|
|
|
|
ULONG Patch;
|
|
|
|
ULONG Flags;
|
|
|
|
ULONG DrumPatches[128];
|
2009-01-31 22:13:30 +00:00
|
|
|
} MIDI_DD_CACHE_DRUM_PATCHES, *PMIDI_DD_CACHE_DRUM_PATCHES;
|
|
|
|
|
|
|
|
/* IOCTL_MIDI_SET_STATE commands */
|
|
|
|
#define MIDI_DD_STOP 0x0001
|
|
|
|
#define MIDI_DD_PLAY 0x0002
|
|
|
|
#define MIDI_DD_RECORD 0x0003
|
|
|
|
#define MIDI_DD_RESET 0x0004
|
|
|
|
|
|
|
|
/* IOCTL_MIDI_GET_STATE responses */
|
|
|
|
#define MIDI_DD_IDLE 0x0000
|
|
|
|
#define MIDI_DD_STOPPED 0x0001
|
|
|
|
#define MIDI_DD_PLAYING 0x0002
|
|
|
|
#define MIDI_DD_RECORDING 0x0003
|
|
|
|
|
|
|
|
/*
|
|
|
|
Mixer structures
|
|
|
|
TODO: This is incomplete (see NTDDMIX.H in NT4 DDK)
|
|
|
|
*/
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _MIXER_DD_READ_DATA {
|
|
|
|
ULONG Id;
|
2009-01-31 22:13:30 +00:00
|
|
|
} MIXER_DD_READ_DATA, *PMIXER_DD_READ_DATA;
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _MIXER_DD_LINE_DATA {
|
|
|
|
ULONG fdwLine;
|
2009-01-31 22:13:30 +00:00
|
|
|
} MIXER_DD_LINE_DATA, *PMIXER_DD_LINE_DATA;
|
|
|
|
|
|
|
|
/*
|
|
|
|
Auxiliary structures
|
|
|
|
*/
|
|
|
|
|
|
|
|
#define AUX_DD_MAX_VOLUME 0xFFFFFFFF
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
typedef struct _AUX_DD_VOLUME {
|
|
|
|
ULONG Left;
|
|
|
|
ULONG Right;
|
2009-01-31 22:13:30 +00:00
|
|
|
} AUX_DD_VOLUME, *PAUX_DD_VOLUME;
|
|
|
|
|
|
|
|
|
2010-08-10 20:50:55 +00:00
|
|
|
#endif /* NTDDSND_H */
|