linux/include/uapi/linux/soundcard.h

/*
 * Copyright by Hannu Savolainen 1993-1997
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are
 * met: 1. Redistributions of source code must retain the above copyright
 * notice, this list of conditions and the following disclaimer. 2.
 * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 */
#ifndef _UAPISOUNDCARD_H
#define _UAPISOUNDCARD_H


/*
 * OSS interface version. With versions earlier than 3.6 this value is
 * an integer with value less than 361. In versions 3.6 and later
 * it's a six digit hexadecimal value. For example value
 * of 0x030600 represents OSS version 3.6.0.
 * Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
 * the currently active driver.
 */
#define SOUND_VERSION
#define OPEN_SOUND_SYSTEM

/* In Linux we need to be prepared for cross compiling */
#include <linux/ioctl.h>

/* Endian macros. */
#ifndef __KERNEL__
#  include <endian.h>
#endif

/*
 *	Supported card ID numbers (Should be somewhere else?)
 */

#define SNDCARD_ADLIB
#define SNDCARD_SB
#define SNDCARD_PAS
#define SNDCARD_GUS
#define SNDCARD_MPU401
#define SNDCARD_SB16
#define SNDCARD_SB16MIDI
#define SNDCARD_UART6850
#define SNDCARD_GUS16
#define SNDCARD_MSS
#define SNDCARD_PSS
#define SNDCARD_SSCAPE
#define SNDCARD_PSS_MPU
#define SNDCARD_PSS_MSS
#define SNDCARD_SSCAPE_MSS
#define SNDCARD_TRXPRO
#define SNDCARD_TRXPRO_SB
#define SNDCARD_TRXPRO_MPU
#define SNDCARD_MAD16
#define SNDCARD_MAD16_MPU
#define SNDCARD_CS4232
#define SNDCARD_CS4232_MPU
#define SNDCARD_MAUI
#define SNDCARD_PSEUDO_MSS
#define SNDCARD_GUSPNP
#define SNDCARD_UART401
/* Sound card numbers 27 to N are reserved. Don't add more numbers here. */

/***********************************
 * IOCTL Commands for /dev/sequencer
 */

#ifndef _SIOWR
#if defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__sparc__) && !defined(__INCioctlh) && !defined(__Lynx__)))
/* Use already defined ioctl defines if they exist (except with Sun or Sparc) */
#define SIOCPARM_MASK
#define SIOC_VOID
#define SIOC_OUT
#define SIOC_IN
#define SIOC_INOUT
#define _SIOC_SIZE
#define _SIOC_DIR
#define _SIOC_NONE
#define _SIOC_READ
#define _SIOC_WRITE
#define _SIO
#define _SIOR
#define _SIOW
#define _SIOWR
#else

/* Ioctl's have the command encoded in the lower word,
 * and the size of any in or out parameters in the upper
 * word.  The high 2 bits of the upper word are used
 * to encode the in/out status of the parameter; for now
 * we restrict parameters to at most 8191 bytes.
 */
/* #define	SIOCTYPE		(0xff<<8) */
#define SIOCPARM_MASK
#define SIOC_VOID
#define SIOC_OUT
#define SIOC_IN
#define SIOC_INOUT
/* the 0x20000000 is so we can distinguish new ioctl's from old */
#define _SIO
#define _SIOR
#define _SIOW
/* this should be _SIORW, but stdio got there first */
#define _SIOWR
#define _SIOC_SIZE	
#define _SIOC_DIR
#define _SIOC_NONE
#define _SIOC_READ
#define _SIOC_WRITE
#  endif /* _IOWR */
#endif  /* !_SIOWR */

#define SNDCTL_SEQ_RESET
#define SNDCTL_SEQ_SYNC
#define SNDCTL_SYNTH_INFO
#define SNDCTL_SEQ_CTRLRATE
#define SNDCTL_SEQ_GETOUTCOUNT
#define SNDCTL_SEQ_GETINCOUNT
#define SNDCTL_SEQ_PERCMODE
#define SNDCTL_FM_LOAD_INSTR
#define SNDCTL_SEQ_TESTMIDI
#define SNDCTL_SEQ_RESETSAMPLES
#define SNDCTL_SEQ_NRSYNTHS
#define SNDCTL_SEQ_NRMIDIS
#define SNDCTL_MIDI_INFO
#define SNDCTL_SEQ_THRESHOLD
#define SNDCTL_SYNTH_MEMAVL
#define SNDCTL_FM_4OP_ENABLE
#define SNDCTL_SEQ_PANIC
#define SNDCTL_SEQ_OUTOFBAND
#define SNDCTL_SEQ_GETTIME
#define SNDCTL_SYNTH_ID
#define SNDCTL_SYNTH_CONTROL
#define SNDCTL_SYNTH_REMOVESAMPLE

synth_control;

remove_sample;

seq_event_rec;

#define SNDCTL_TMR_TIMEBASE
#define SNDCTL_TMR_START
#define SNDCTL_TMR_STOP
#define SNDCTL_TMR_CONTINUE
#define SNDCTL_TMR_TEMPO
#define SNDCTL_TMR_SOURCE
#define TMR_INTERNAL
#define TMR_EXTERNAL
#define TMR_MODE_MIDI
#define TMR_MODE_FSK
#define TMR_MODE_CLS
#define TMR_MODE_SMPTE
#define SNDCTL_TMR_METRONOME
#define SNDCTL_TMR_SELECT

/*
 * Some big endian/little endian handling macros
 */

#define _LINUX_PATCHKEY_H_INDIRECT
#include <linux/patchkey.h>
#undef _LINUX_PATCHKEY_H_INDIRECT

#if !defined(__KERNEL__)
# if defined(__BYTE_ORDER)
#  if __BYTE_ORDER == __BIG_ENDIAN
#define AFMT_S16_NE
#  elif __BYTE_ORDER == __LITTLE_ENDIAN
#define AFMT_S16_NE
#  else
#    error "could not determine byte order"
#  endif
# endif
#endif

/*
 *	Sample loading mechanism for internal synthesizers (/dev/sequencer)
 *	The following patch_info structure has been designed to support
 *	Gravis UltraSound. It tries to be universal format for uploading
 *	sample based patches but is probably too limited.
 *
 *      (PBD) As Hannu guessed, the GUS structure is too limited for 
 *      the WaveFront, but this is the right place for a constant definition.
 */

struct patch_info {};

struct sysex_info {};

/*
 * /dev/sequencer input events.
 *
 * The data written to the /dev/sequencer is a stream of events. Events
 * are records of 4 or 8 bytes. The first byte defines the size. 
 * Any number of events can be written with a write call. There
 * is a set of macros for sending these events. Use these macros if you
 * want to maximize portability of your program.
 *
 * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
 * (All input events are currently 4 bytes long. Be prepared to support
 * 8 byte events also. If you receive any event having first byte >= 128,
 * it's a 8 byte event.
 *
 * The events are documented at the end of this file.
 *
 * Normal events (4 bytes)
 * There is also a 8 byte version of most of the 4 byte events. The
 * 8 byte one is recommended.
 */
#define SEQ_NOTEOFF
#define SEQ_FMNOTEOFF
#define SEQ_NOTEON
#define SEQ_FMNOTEON
#define SEQ_WAIT
#define SEQ_PGMCHANGE
#define SEQ_FMPGMCHANGE
#define SEQ_SYNCTIMER
#define SEQ_MIDIPUTC
#define SEQ_DRUMON
#define SEQ_DRUMOFF
#define SEQ_ECHO
#define SEQ_AFTERTOUCH
#define SEQ_CONTROLLER

/*******************************************
 *	Midi controller numbers
 *******************************************
 * Controllers 0 to 31 (0x00 to 0x1f) and
 * 32 to 63 (0x20 to 0x3f) are continuous
 * controllers.
 * In the MIDI 1.0 these controllers are sent using
 * two messages. Controller numbers 0 to 31 are used
 * to send the MSB and the controller numbers 32 to 63
 * are for the LSB. Note that just 7 bits are used in MIDI bytes.
 */

#define CTL_BANK_SELECT
#define CTL_MODWHEEL
#define CTL_BREATH
/*		undefined		0x03 */
#define CTL_FOOT
#define CTL_PORTAMENTO_TIME
#define CTL_DATA_ENTRY
#define CTL_MAIN_VOLUME
#define CTL_BALANCE
/*		undefined		0x09 */
#define CTL_PAN
#define CTL_EXPRESSION
/*		undefined		0x0c */
/*		undefined		0x0d */
/*		undefined		0x0e */
/*		undefined		0x0f */
#define CTL_GENERAL_PURPOSE1
#define CTL_GENERAL_PURPOSE2
#define CTL_GENERAL_PURPOSE3
#define CTL_GENERAL_PURPOSE4
/*		undefined		0x14 - 0x1f */

/*		undefined		0x20 */
/* The controller numbers 0x21 to 0x3f are reserved for the */
/* least significant bytes of the controllers 0x00 to 0x1f. */
/* These controllers are not recognised by the driver. */

/* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
/* 0=OFF and 127=ON (intermediate values are possible) */
#define CTL_DAMPER_PEDAL
#define CTL_SUSTAIN
#define CTL_HOLD
#define CTL_PORTAMENTO
#define CTL_SOSTENUTO
#define CTL_SOFT_PEDAL
/*		undefined		0x44 */
#define CTL_HOLD2
/*		undefined		0x46 - 0x4f */

#define CTL_GENERAL_PURPOSE5
#define CTL_GENERAL_PURPOSE6
#define CTL_GENERAL_PURPOSE7
#define CTL_GENERAL_PURPOSE8
/*		undefined		0x54 - 0x5a */
#define CTL_EXT_EFF_DEPTH
#define CTL_TREMOLO_DEPTH
#define CTL_CHORUS_DEPTH
#define CTL_DETUNE_DEPTH
#define CTL_CELESTE_DEPTH
#define CTL_PHASER_DEPTH
#define CTL_DATA_INCREMENT
#define CTL_DATA_DECREMENT
#define CTL_NONREG_PARM_NUM_LSB
#define CTL_NONREG_PARM_NUM_MSB
#define CTL_REGIST_PARM_NUM_LSB
#define CTL_REGIST_PARM_NUM_MSB
/*		undefined		0x66 - 0x78 */
/*		reserved		0x79 - 0x7f */

/* Pseudo controllers (not midi compatible) */
#define CTRL_PITCH_BENDER
#define CTRL_PITCH_BENDER_RANGE
#define CTRL_EXPRESSION
#define CTRL_MAIN_VOLUME
#define SEQ_BALANCE
#define SEQ_VOLMODE

/*
 * Volume mode decides how volumes are used
 */

#define VOL_METHOD_ADAGIO
#define VOL_METHOD_LINEAR

/*
 * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
 *	 input events.
 */

/*
 * Event codes 0xf0 to 0xfc are reserved for future extensions.
 */

#define SEQ_FULLSIZE
/*
 *	SEQ_FULLSIZE events are used for loading patches/samples to the
 *	synthesizer devices. These events are passed directly to the driver
 *	of the associated synthesizer device. There is no limit to the size
 *	of the extended events. These events are not queued but executed
 *	immediately when the write() is called (execution can take several
 *	seconds of time). 
 *
 *	When a SEQ_FULLSIZE message is written to the device, it must
 *	be written using exactly one write() call. Other events cannot
 *	be mixed to the same write.
 *	
 *	For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the 
 *	/dev/sequencer. Don't write other data together with the instrument structure
 *	Set the key field of the structure to FM_PATCH. The device field is used to
 *	route the patch to the corresponding device.
 *
 *	For wave table use struct patch_info. Initialize the key field
 *      to WAVE_PATCH.
 */
#define SEQ_PRIVATE
#define SEQ_EXTENDED

/*
 * Record for FM patches
 */

sbi_instr_data;

struct sbi_instrument {};

struct synth_info {};

struct sound_timer_info {};

#define MIDI_CAP_MPU401

struct midi_info {};

/********************************************
 * ioctl commands for the /dev/midi##
 */
mpu_command_rec;

#define SNDCTL_MIDI_PRETIME
#define SNDCTL_MIDI_MPUMODE
#define SNDCTL_MIDI_MPUCMD

/********************************************
 * IOCTL commands for /dev/dsp and /dev/audio
 */

#define SNDCTL_DSP_RESET
#define SNDCTL_DSP_SYNC
#define SNDCTL_DSP_SPEED
#define SNDCTL_DSP_STEREO
#define SNDCTL_DSP_GETBLKSIZE
#define SNDCTL_DSP_SAMPLESIZE
#define SNDCTL_DSP_CHANNELS
#define SOUND_PCM_WRITE_CHANNELS
#define SOUND_PCM_WRITE_FILTER
#define SNDCTL_DSP_POST
#define SNDCTL_DSP_SUBDIVIDE
#define SNDCTL_DSP_SETFRAGMENT

/*	Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) */
#define SNDCTL_DSP_GETFMTS
#define SNDCTL_DSP_SETFMT
#define AFMT_QUERY
#define AFMT_MU_LAW
#define AFMT_A_LAW
#define AFMT_IMA_ADPCM
#define AFMT_U8
#define AFMT_S16_LE
#define AFMT_S16_BE
#define AFMT_S8
#define AFMT_U16_LE
#define AFMT_U16_BE
#define AFMT_MPEG
#define AFMT_AC3

/*
 * Buffer status queries.
 */
audio_buf_info;

#define SNDCTL_DSP_GETOSPACE
#define SNDCTL_DSP_GETISPACE
#define SNDCTL_DSP_NONBLOCK
#define SNDCTL_DSP_GETCAPS
#define DSP_CAP_REVISION
#define DSP_CAP_DUPLEX
#define DSP_CAP_REALTIME
#define DSP_CAP_BATCH
							/* internal buffers which may */
							/* cause some delays and */
							/* decrease precision of timing */
#define DSP_CAP_COPROC
							/* Sometimes it's a DSP */
							/* but usually not */
#define DSP_CAP_TRIGGER
#define DSP_CAP_MMAP
#define DSP_CAP_MULTI
#define DSP_CAP_BIND


#define SNDCTL_DSP_GETTRIGGER
#define SNDCTL_DSP_SETTRIGGER
#define PCM_ENABLE_INPUT
#define PCM_ENABLE_OUTPUT

count_info;

#define SNDCTL_DSP_GETIPTR
#define SNDCTL_DSP_GETOPTR

buffmem_desc;
#define SNDCTL_DSP_MAPINBUF
#define SNDCTL_DSP_MAPOUTBUF
#define SNDCTL_DSP_SETSYNCRO
#define SNDCTL_DSP_SETDUPLEX
#define SNDCTL_DSP_GETODELAY

#define SNDCTL_DSP_GETCHANNELMASK
#define SNDCTL_DSP_BIND_CHANNEL
#define DSP_BIND_QUERY
#define DSP_BIND_FRONT
#define DSP_BIND_SURR
#define DSP_BIND_CENTER_LFE
#define DSP_BIND_HANDSET
#define DSP_BIND_MIC
#define DSP_BIND_MODEM1
#define DSP_BIND_MODEM2
#define DSP_BIND_I2S
#define DSP_BIND_SPDIF

#define SNDCTL_DSP_SETSPDIF
#define SNDCTL_DSP_GETSPDIF
#define SPDIF_PRO
#define SPDIF_N_AUD
#define SPDIF_COPY
#define SPDIF_PRE
#define SPDIF_CC
#define SPDIF_L
#define SPDIF_DRS
#define SPDIF_V

/*
 * Application's profile defines the way how playback underrun situations should be handled.
 * 
 *	APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
 *	playback buffer whenever an underrun occurs. This consumes some time
 *	prevents looping the existing buffer.
 *	APF_CPUINTENS is intended to be set by CPU intensive applications which
 *	are likely to run out of time occasionally. In this mode the buffer cleanup is
 *	disabled which saves CPU time but also let's the previous buffer content to
 *	be played during the "pause" after the underrun.
 */
#define SNDCTL_DSP_PROFILE
#define APF_NORMAL
#define APF_NETWORK
#define APF_CPUINTENS

#define SOUND_PCM_READ_RATE
#define SOUND_PCM_READ_CHANNELS
#define SOUND_PCM_READ_BITS
#define SOUND_PCM_READ_FILTER

/* Some alias names */
#define SOUND_PCM_WRITE_BITS
#define SOUND_PCM_WRITE_RATE
#define SOUND_PCM_POST
#define SOUND_PCM_RESET
#define SOUND_PCM_SYNC
#define SOUND_PCM_SUBDIVIDE
#define SOUND_PCM_SETFRAGMENT
#define SOUND_PCM_GETFMTS
#define SOUND_PCM_SETFMT
#define SOUND_PCM_GETOSPACE
#define SOUND_PCM_GETISPACE
#define SOUND_PCM_NONBLOCK
#define SOUND_PCM_GETCAPS
#define SOUND_PCM_GETTRIGGER
#define SOUND_PCM_SETTRIGGER
#define SOUND_PCM_SETSYNCRO
#define SOUND_PCM_GETIPTR
#define SOUND_PCM_GETOPTR
#define SOUND_PCM_MAPINBUF
#define SOUND_PCM_MAPOUTBUF

/*
 * ioctl calls to be used in communication with coprocessors and
 * DSP chips.
 */

copr_buffer;

copr_debug_buf;

copr_msg;

#define SNDCTL_COPR_RESET
#define SNDCTL_COPR_LOAD
#define SNDCTL_COPR_RDATA
#define SNDCTL_COPR_RCODE
#define SNDCTL_COPR_WDATA
#define SNDCTL_COPR_WCODE
#define SNDCTL_COPR_RUN
#define SNDCTL_COPR_HALT
#define SNDCTL_COPR_SENDMSG
#define SNDCTL_COPR_RCVMSG

/*********************************************
 * IOCTL commands for /dev/mixer
 */
	
/* 
 * Mixer devices
 *
 * There can be up to 20 different analog mixer channels. The
 * SOUND_MIXER_NRDEVICES gives the currently supported maximum. 
 * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
 * the devices supported by the particular mixer.
 */

#define SOUND_MIXER_NRDEVICES
#define SOUND_MIXER_VOLUME
#define SOUND_MIXER_BASS
#define SOUND_MIXER_TREBLE
#define SOUND_MIXER_SYNTH
#define SOUND_MIXER_PCM
#define SOUND_MIXER_SPEAKER
#define SOUND_MIXER_LINE
#define SOUND_MIXER_MIC
#define SOUND_MIXER_CD
#define SOUND_MIXER_IMIX
#define SOUND_MIXER_ALTPCM
#define SOUND_MIXER_RECLEV
#define SOUND_MIXER_IGAIN
#define SOUND_MIXER_OGAIN
/* 
 * The AD1848 codec and compatibles have three line level inputs
 * (line, aux1 and aux2). Since each card manufacturer have assigned
 * different meanings to these inputs, it's inpractical to assign
 * specific meanings (line, cd, synth etc.) to them.
 */
#define SOUND_MIXER_LINE1
#define SOUND_MIXER_LINE2
#define SOUND_MIXER_LINE3
#define SOUND_MIXER_DIGITAL1
#define SOUND_MIXER_DIGITAL2
#define SOUND_MIXER_DIGITAL3
#define SOUND_MIXER_PHONEIN
#define SOUND_MIXER_PHONEOUT
#define SOUND_MIXER_VIDEO
#define SOUND_MIXER_RADIO
#define SOUND_MIXER_MONITOR

/* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */
/* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */
#define SOUND_ONOFF_MIN
#define SOUND_ONOFF_MAX

/* Note!	Number 31 cannot be used since the sign bit is reserved */
#define SOUND_MIXER_NONE

/*
 * The following unsupported macros are no longer functional.
 * Use SOUND_MIXER_PRIVATE# macros in future.
 */
#define SOUND_MIXER_ENHANCE
#define SOUND_MIXER_MUTE
#define SOUND_MIXER_LOUD


#define SOUND_DEVICE_LABELS

#define SOUND_DEVICE_NAMES

/*	Device bitmask identifiers	*/

#define SOUND_MIXER_RECSRC
#define SOUND_MIXER_DEVMASK
#define SOUND_MIXER_RECMASK
#define SOUND_MIXER_CAPS
#define SOUND_CAP_EXCL_INPUT
#define SOUND_MIXER_STEREODEVS
#define SOUND_MIXER_OUTSRC
#define SOUND_MIXER_OUTMASK

/*	Device mask bits	*/

#define SOUND_MASK_VOLUME
#define SOUND_MASK_BASS
#define SOUND_MASK_TREBLE
#define SOUND_MASK_SYNTH
#define SOUND_MASK_PCM
#define SOUND_MASK_SPEAKER
#define SOUND_MASK_LINE
#define SOUND_MASK_MIC
#define SOUND_MASK_CD
#define SOUND_MASK_IMIX
#define SOUND_MASK_ALTPCM
#define SOUND_MASK_RECLEV
#define SOUND_MASK_IGAIN
#define SOUND_MASK_OGAIN
#define SOUND_MASK_LINE1
#define SOUND_MASK_LINE2
#define SOUND_MASK_LINE3
#define SOUND_MASK_DIGITAL1
#define SOUND_MASK_DIGITAL2
#define SOUND_MASK_DIGITAL3
#define SOUND_MASK_PHONEIN
#define SOUND_MASK_PHONEOUT
#define SOUND_MASK_RADIO
#define SOUND_MASK_VIDEO
#define SOUND_MASK_MONITOR

/* Obsolete macros */
#define SOUND_MASK_MUTE
#define SOUND_MASK_ENHANCE
#define SOUND_MASK_LOUD

#define MIXER_READ(dev)
#define SOUND_MIXER_READ_VOLUME
#define SOUND_MIXER_READ_BASS
#define SOUND_MIXER_READ_TREBLE
#define SOUND_MIXER_READ_SYNTH
#define SOUND_MIXER_READ_PCM
#define SOUND_MIXER_READ_SPEAKER
#define SOUND_MIXER_READ_LINE
#define SOUND_MIXER_READ_MIC
#define SOUND_MIXER_READ_CD
#define SOUND_MIXER_READ_IMIX
#define SOUND_MIXER_READ_ALTPCM
#define SOUND_MIXER_READ_RECLEV
#define SOUND_MIXER_READ_IGAIN
#define SOUND_MIXER_READ_OGAIN
#define SOUND_MIXER_READ_LINE1
#define SOUND_MIXER_READ_LINE2
#define SOUND_MIXER_READ_LINE3

/* Obsolete macros */
#define SOUND_MIXER_READ_MUTE
#define SOUND_MIXER_READ_ENHANCE
#define SOUND_MIXER_READ_LOUD

#define SOUND_MIXER_READ_RECSRC
#define SOUND_MIXER_READ_DEVMASK
#define SOUND_MIXER_READ_RECMASK
#define SOUND_MIXER_READ_STEREODEVS
#define SOUND_MIXER_READ_CAPS

#define MIXER_WRITE(dev)
#define SOUND_MIXER_WRITE_VOLUME
#define SOUND_MIXER_WRITE_BASS
#define SOUND_MIXER_WRITE_TREBLE
#define SOUND_MIXER_WRITE_SYNTH
#define SOUND_MIXER_WRITE_PCM
#define SOUND_MIXER_WRITE_SPEAKER
#define SOUND_MIXER_WRITE_LINE
#define SOUND_MIXER_WRITE_MIC
#define SOUND_MIXER_WRITE_CD
#define SOUND_MIXER_WRITE_IMIX
#define SOUND_MIXER_WRITE_ALTPCM
#define SOUND_MIXER_WRITE_RECLEV
#define SOUND_MIXER_WRITE_IGAIN
#define SOUND_MIXER_WRITE_OGAIN
#define SOUND_MIXER_WRITE_LINE1
#define SOUND_MIXER_WRITE_LINE2
#define SOUND_MIXER_WRITE_LINE3

/* Obsolete macros */
#define SOUND_MIXER_WRITE_MUTE
#define SOUND_MIXER_WRITE_ENHANCE
#define SOUND_MIXER_WRITE_LOUD

#define SOUND_MIXER_WRITE_RECSRC

mixer_info;

_old_mixer_info;

#define SOUND_MIXER_INFO
#define SOUND_OLD_MIXER_INFO

/*
 * A mechanism for accessing "proprietary" mixer features. This method
 * permits passing 128 bytes of arbitrary data between a mixer application
 * and the mixer driver. Interpretation of the record is defined by
 * the particular mixer driver.
 */
mixer_record;

#define SOUND_MIXER_ACCESS

/*
 * Two ioctls for special souncard function
 */
#define SOUND_MIXER_AGC
#define SOUND_MIXER_3DSE

/*
 * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
 * These features can be used when accessing device specific features.
 */
#define SOUND_MIXER_PRIVATE1
#define SOUND_MIXER_PRIVATE2
#define SOUND_MIXER_PRIVATE3
#define SOUND_MIXER_PRIVATE4
#define SOUND_MIXER_PRIVATE5

/*
 * SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
 * for querying current mixer settings from the driver and for loading
 * default volume settings _prior_ activating the mixer (loading
 * doesn't affect current state of the mixer hardware). These calls
 * are for internal use only.
 */

mixer_vol_table;

#define SOUND_MIXER_GETLEVELS
#define SOUND_MIXER_SETLEVELS

/* 
 * An ioctl for identifying the driver version. It will return value
 * of the SOUND_VERSION macro used when compiling the driver.
 * This call was introduced in OSS version 3.6 and it will not work
 * with earlier versions (returns EINVAL).
 */
#define OSS_GETVERSION

/*
 * Level 2 event types for /dev/sequencer
 */

/*
 * The 4 most significant bits of byte 0 specify the class of
 * the event: 
 *
 *	0x8X = system level events,
 *	0x9X = device/port specific events, event[1] = device/port,
 *		The last 4 bits give the subtype:
 *			0x02	= Channel event (event[3] = chn).
 *			0x01	= note event (event[4] = note).
 *			(0x01 is not used alone but always with bit 0x02).
 *	       event[2] = MIDI message code (0x80=note off etc.)
 *
 */

#define EV_SEQ_LOCAL
#define EV_TIMING
#define EV_CHN_COMMON
#define EV_CHN_VOICE
#define EV_SYSEX
/*
 * Event types 200 to 220 are reserved for application use.
 * These numbers will not be used by the driver.
 */

/*
 * Events for event type EV_CHN_VOICE
 */

#define MIDI_NOTEOFF
#define MIDI_NOTEON
#define MIDI_KEY_PRESSURE

/*
 * Events for event type EV_CHN_COMMON
 */

#define MIDI_CTL_CHANGE
#define MIDI_PGM_CHANGE
#define MIDI_CHN_PRESSURE
#define MIDI_PITCH_BEND

#define MIDI_SYSTEM_PREFIX

/*
 * Timer event types
 */
#define TMR_WAIT_REL
#define TMR_WAIT_ABS
#define TMR_STOP
#define TMR_START
#define TMR_CONTINUE
#define TMR_TEMPO
#define TMR_ECHO
#define TMR_CLOCK
#define TMR_SPP
#define TMR_TIMESIG

/*
 *	Local event types
 */
#define LOCL_STARTAUDIO

#if !defined(__KERNEL__) || defined(USE_SEQ_MACROS)
/*
 *	Some convenience macros to simplify programming of the
 *	/dev/sequencer interface
 *
 *	This is a legacy interface for applications written against
 *	the OSSlib-3.8 style interface. It is no longer possible
 *	to actually link against OSSlib with this header, but we
 *	still provide these macros for programs using them.
 *
 *	If you want to use OSSlib, it is recommended that you get
 *	the GPL version of OSS-4.x and build against that version
 *	of the header.
 *
 *	We redefine the extern keyword so that usr/include/headers_check.pl
 *	does not complain about SEQ_USE_EXTBUF.
 */
#define SEQ_DECLAREBUF

void seqbuf_dump(void);	/* This function must be provided by programs */

#define SEQ_PM_DEFINES

#define SEQ_LOAD_GMINSTR
#define SEQ_LOAD_GMDRUM

#define _SEQ_EXTERN
#define SEQ_USE_EXTBUF

#ifndef USE_SIMPLE_MACROS
/* Sample seqbuf_dump() implementation:
 *
 *	SEQ_DEFINEBUF (2048);	-- Defines a buffer for 2048 bytes
 *
 *	int seqfd;		-- The file descriptor for /dev/sequencer.
 *
 *	void
 *	seqbuf_dump ()
 *	{
 *	  if (_seqbufptr)
 *	    if (write (seqfd, _seqbuf, _seqbufptr) == -1)
 *	      {
 *		perror ("write /dev/sequencer");
 *		exit (-1);
 *	      }
 *	  _seqbufptr = 0;
 *	}
 */

#define SEQ_DEFINEBUF
#define _SEQ_NEEDBUF
#define _SEQ_ADVBUF
#define SEQ_DUMPBUF
#else
/*
 * This variation of the sequencer macros is used just to format one event
 * using fixed buffer.
 * 
 * The program using the macro library must define the following macros before
 * using this library.
 *
 * #define _seqbuf 		 name of the buffer (unsigned char[]) 
 * #define _SEQ_ADVBUF(len)	 If the applic needs to know the exact
 *				 size of the event, this macro can be used.
 *				 Otherwise this must be defined as empty.
 * #define _seqbufptr		 Define the name of index variable or 0 if
 *				 not required. 
 */
#define _SEQ_NEEDBUF
#endif

#define SEQ_VOLUME_MODE

/*
 * Midi voice messages
 */

#define _CHN_VOICE

#define SEQ_START_NOTE

#define SEQ_STOP_NOTE

#define SEQ_KEY_PRESSURE

/*
 * Midi channel messages
 */

#define _CHN_COMMON
/*
 * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
 * sending any MIDI bytes but it's absolutely not possible. Trying to do
 * so _will_ cause problems with MPU401 intelligent mode).
 *
 * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be 
 * sent by calling SEQ_SYSEX() several times (there must be no other events
 * between them). First sysex fragment must have 0xf0 in the first byte
 * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
 * between these sysex start and end markers cannot be larger than 0x7f. Also
 * lengths of each fragments (except the last one) must be 6.
 *
 * Breaking the above rules may work with some MIDI ports but is likely to
 * cause fatal problems with some other devices (such as MPU401).
 */
#define SEQ_SYSEX

#define SEQ_CHN_PRESSURE

#define SEQ_SET_PATCH
#define SEQ_PGM_CHANGE

#define SEQ_CONTROL

#define SEQ_BENDER


#define SEQ_V2_X_CONTROL
/*
 * The following 5 macros are incorrectly implemented and obsolete.
 * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
 */
#define SEQ_PITCHBEND
#define SEQ_BENDER_RANGE
#define SEQ_EXPRESSION
#define SEQ_MAIN_VOLUME
#define SEQ_PANNING

/*
 * Timing and synchronization macros
 */

#define _TIMER_EVENT

#define SEQ_START_TIMER
#define SEQ_STOP_TIMER
#define SEQ_CONTINUE_TIMER
#define SEQ_WAIT_TIME
#define SEQ_DELTA_TIME
#define SEQ_ECHO_BACK
#define SEQ_SET_TEMPO
#define SEQ_SONGPOS
#define SEQ_TIME_SIGNATURE

/*
 * Local control events
 */

#define _LOCAL_EVENT

#define SEQ_PLAYAUDIO
/*
 * Events for the level 1 interface only 
 */

#define SEQ_MIDIOUT

/*
 * Patch loading.
 */
#define SEQ_WRPATCH
#define SEQ_WRPATCH2

#endif
#endif /* _UAPISOUNDCARD_H */