11387Ssos/*-
2230132Suqs * Copyright (c) 1994 S��ren Schmidt
31387Ssos * All rights reserved.
41387Ssos *
51387Ssos * Redistribution and use in source and binary forms, with or without
61387Ssos * modification, are permitted provided that the following conditions
71387Ssos * are met:
81387Ssos * 1. Redistributions of source code must retain the above copyright
93187Ssos *    notice, this list of conditions and the following disclaimer
103187Ssos *    in this position and unchanged.
111387Ssos * 2. Redistributions in binary form must reproduce the above copyright
121387Ssos *    notice, this list of conditions and the following disclaimer in the
131387Ssos *    documentation and/or other materials provided with the distribution.
141387Ssos * 3. The name of the author may not be used to endorse or promote products
1513765Smpp *    derived from this software without specific prior written permission
161387Ssos *
171387Ssos * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
181387Ssos * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
191387Ssos * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
201387Ssos * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
211387Ssos * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
221387Ssos * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
231387Ssos * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
241387Ssos * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
251387Ssos * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
261387Ssos * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
271387Ssos *
2850477Speter * $FreeBSD$
291387Ssos */
301387Ssos
3118444Sbde#ifndef	_MACHINE_PCAUDIOIO_H_
3218444Sbde#define	_MACHINE_PCAUDIOIO_H_
331387Ssos
3418444Sbde#include <sys/ioccom.h>
3518444Sbde
361387Ssostypedef struct audio_prinfo {
371387Ssos	unsigned	sample_rate;	/* samples per second */
381387Ssos	unsigned	channels;	/* # of channels (interleaved) */
391387Ssos	unsigned	precision;	/* sample size in bits */
401387Ssos	unsigned	encoding;	/* encoding method used */
411387Ssos
421387Ssos	unsigned	gain;		/* volume level: 0 - 255 */
431387Ssos	unsigned	port;		/* input/output device */
441387Ssos	unsigned	_fill1[4];
451387Ssos
461387Ssos	unsigned	samples;	/* samples played */
471387Ssos	unsigned	eof;		/* ?!? */
481387Ssos	unsigned char	pause;		/* !=0 pause, ==0 continue */
491387Ssos	unsigned char	error;		/* !=0 if overflow/underflow */
501387Ssos	unsigned char	waiting;	/* !=0 if others wants access */
511387Ssos	unsigned char	_fill2[3];
521387Ssos
531387Ssos	unsigned char	open; 		/* is device open */
541387Ssos	unsigned char	active;		/* !=0 if sound hardware is active */
551387Ssos} audio_prinfo_t;
561387Ssos
571387Ssostypedef struct audio_info {
581387Ssos	audio_prinfo_t	play;
598876Srgrimes	audio_prinfo_t	record;
601387Ssos	unsigned	monitor_gain;
611387Ssos	unsigned	_fill[4];
621387Ssos} audio_info_t;
631387Ssos
641387Ssos#define	AUDIO_ENCODING_ULAW	(1)	/* u-law encoding */
651387Ssos#define	AUDIO_ENCODING_ALAW	(2)	/* A-law encoding */
661387Ssos#define	AUDIO_ENCODING_RAW	(3)	/* linear encoding */
671387Ssos
681387Ssos#define	AUDIO_MIN_GAIN		(0)	/* minimum volume value */
691387Ssos#define	AUDIO_MAX_GAIN		(255)	/* maximum volume value */
701387Ssos
711387Ssos#define	AUDIO_INITINFO(i)	memset((void*)i, 0xff, sizeof(audio_info_t))
721387Ssos
731387Ssos#define	AUDIO_GETINFO		_IOR('A', 1, audio_info_t)
741387Ssos#define	AUDIO_SETINFO		_IOWR('A', 2, audio_info_t)
751387Ssos#define	AUDIO_DRAIN		_IO('A', 3)
761387Ssos#define	AUDIO_FLUSH		_IO('A', 4)
771387Ssos
7817203Sjoerg/* compatibility to /dev/audio */
7917203Sjoerg#define AUDIO_COMPAT_DRAIN	_IO('P', 1)
8017203Sjoerg#define AUDIO_COMPAT_FLUSH	_IO('P', 0)
8117203Sjoerg
8218444Sbde#endif /* !_MACHINE_PCAUDIOIO_H_ */
83