1 /* 2 * Copyright (c) 1991, 1992 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * This software was developed by the Computer Systems Engineering group 6 * at Lawrence Berkeley Laboratory under DARPA contract BG 91-66 and 7 * contributed to Berkeley. 8 * 9 * All advertising materials mentioning features or use of this software 10 * must display the following acknowledgement: 11 * This product includes software developed by the University of 12 * California, Lawrence Berkeley Laboratories. 13 * 14 * %sccs.include.redist.c% 15 * 16 * @(#)bsd_audioio.h 7.2 (Berkeley) 07/21/92 17 * 18 * from: $Header: bsd_audioio.h,v 1.4 92/07/13 00:31:22 torek Exp $ (LBL) 19 */ 20 21 #ifndef _BSD_AUDIOIO_H_ 22 #define _BSD_AUDIOIO_H_ 23 24 /* 25 * /dev/audio ioctls. needs comments! 26 */ 27 #define AUDIO_MIN_GAIN 0 28 #define AUDIO_MAX_GAIN 255 29 30 #define AUDIO_ENCODING_ULAW 1 31 #define AUDIO_ENCODING_ALAW 2 32 33 struct audio_prinfo { 34 u_int sample_rate; 35 u_int channels; 36 u_int precision; 37 u_int encoding; 38 u_int gain; 39 u_int port; 40 u_int samples; 41 42 u_char pause; 43 u_char error; 44 u_char waiting; 45 u_char open; 46 47 /* BSD extensions */ 48 u_long seek; 49 }; 50 51 struct audio_info { 52 struct audio_prinfo play; 53 struct audio_prinfo record; 54 u_int monitor_gain; 55 /* BSD extensions */ 56 u_int blocksize; /* input blocking threshold */ 57 u_int hiwat; /* output high water mark */ 58 u_int lowat; /* output low water mark */ 59 }; 60 typedef struct audio_info audio_info_t; 61 62 #define AUDIO_INITINFO(p)\ 63 (void)memset((void *)(p), 0xff, sizeof(struct audio_info)) 64 65 #if (defined(sun) || defined(ibm032)) && !defined(__GNUC__) 66 #define AUDIO_GETINFO _IOR(A, 1, struct audio_info) 67 #define AUDIO_SETINFO _IOWR(A, 2, struct audio_info) 68 #define AUDIO_DRAIN _IO(A, 3) 69 #define AUDIO_FLUSH _IO(A, 4) 70 #define AUDIO_WSEEK _IOR(A, 5, u_long) 71 #define AUDIO_RERROR _IOR(A, 6, int) 72 #define AUDIO_GETMAP _IOR(A, 20, struct mapreg) 73 #define AUDIO_SETMAP _IOW(A, 21, struct mapreg) 74 #else 75 #define AUDIO_GETINFO _IOR('A', 1, struct audio_info) 76 #define AUDIO_SETINFO _IOWR('A', 2, struct audio_info) 77 #define AUDIO_DRAIN _IO('A', 3) 78 #define AUDIO_FLUSH _IO('A', 4) 79 #define AUDIO_WSEEK _IOR('A', 5, u_long) 80 #define AUDIO_RERROR _IOR('A', 6, int) 81 #define AUDIO_GETMAP _IOR('A', 20, struct mapreg) 82 #define AUDIO_SETMAP _IOW('A', 21, struct mapreg) 83 #endif 84 85 #define AUDIO_SPEAKER 1 86 #define AUDIO_HEADPHONE 2 87 88 /* 89 * Low level interface. 90 */ 91 struct mapreg { 92 u_short mr_x[8]; 93 u_short mr_r[8]; 94 u_short mr_gx; 95 u_short mr_gr; 96 u_short mr_ger; 97 u_short mr_stgr; 98 u_short mr_ftgr; 99 u_short mr_atgr; 100 u_char mr_mmr1; 101 u_char mr_mmr2; 102 }; 103 104 #endif /* _BSD_AUDIOIO_H_ */ 105