Commit | Line | Data |
---|---|---|
90587a41 CT |
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 | * | |
b480239a KB |
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 | |
c8cc9df9 | 12 | * California, Lawrence Berkeley Laboratory. |
b480239a | 13 | * |
90587a41 CT |
14 | * %sccs.include.redist.c% |
15 | * | |
c8cc9df9 | 16 | * @(#)bsd_audioio.h 7.3 (Berkeley) %G% |
90587a41 | 17 | * |
c8cc9df9 | 18 | * from: $Header: bsd_audioio.h,v 1.5 92/11/21 20:46:46 van Exp $ (LBL) |
90587a41 CT |
19 | */ |
20 | ||
21 | #ifndef _BSD_AUDIOIO_H_ | |
22 | #define _BSD_AUDIOIO_H_ | |
23 | ||
24 | /* | |
25 | * /dev/audio ioctls. needs comments! | |
26 | */ | |
c8cc9df9 CT |
27 | #define AUDIO_MIN_GAIN (0) |
28 | #define AUDIO_MAX_GAIN (255) | |
90587a41 | 29 | |
c8cc9df9 CT |
30 | #define AUDIO_ENCODING_ULAW (1) |
31 | #define AUDIO_ENCODING_ALAW (2) | |
90587a41 CT |
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; | |
c8cc9df9 CT |
40 | u_long seek; /* BSD extension */ |
41 | u_int ispare[3]; | |
90587a41 | 42 | u_int samples; |
c8cc9df9 | 43 | u_int eof; |
90587a41 CT |
44 | |
45 | u_char pause; | |
46 | u_char error; | |
47 | u_char waiting; | |
c8cc9df9 | 48 | u_char cspare[3]; |
90587a41 | 49 | u_char open; |
c8cc9df9 | 50 | u_char active; |
90587a41 | 51 | |
90587a41 CT |
52 | }; |
53 | ||
54 | struct audio_info { | |
55 | struct audio_prinfo play; | |
56 | struct audio_prinfo record; | |
57 | u_int monitor_gain; | |
58 | /* BSD extensions */ | |
59 | u_int blocksize; /* input blocking threshold */ | |
60 | u_int hiwat; /* output high water mark */ | |
61 | u_int lowat; /* output low water mark */ | |
c8cc9df9 | 62 | u_int backlog; /* samples of output backlog to gen. */ |
90587a41 CT |
63 | }; |
64 | typedef struct audio_info audio_info_t; | |
65 | ||
66 | #define AUDIO_INITINFO(p)\ | |
67 | (void)memset((void *)(p), 0xff, sizeof(struct audio_info)) | |
68 | ||
69 | #if (defined(sun) || defined(ibm032)) && !defined(__GNUC__) | |
c8cc9df9 CT |
70 | #define AUDIO_GETINFO _IOR(A, 21, struct audio_info) |
71 | #define AUDIO_SETINFO _IOWR(A, 22, struct audio_info) | |
72 | #define AUDIO_DRAIN _IO(A, 23) | |
73 | #define AUDIO_FLUSH _IO(A, 24) | |
74 | #define AUDIO_WSEEK _IOR(A, 25, u_long) | |
75 | #define AUDIO_RERROR _IOR(A, 26, int) | |
76 | #define AUDIO_GETMAP _IOR(A, 27, struct mapreg) | |
77 | #define AUDIO_SETMAP _IOW(A, 28, struct mapreg) | |
90587a41 | 78 | #else |
c8cc9df9 CT |
79 | #define AUDIO_GETINFO _IOR('A', 21, struct audio_info) |
80 | #define AUDIO_SETINFO _IOWR('A', 22, struct audio_info) | |
81 | #define AUDIO_DRAIN _IO('A', 23) | |
82 | #define AUDIO_FLUSH _IO('A', 24) | |
83 | #define AUDIO_WSEEK _IOR('A', 25, u_long) | |
84 | #define AUDIO_RERROR _IOR('A', 26, int) | |
85 | #define AUDIO_GETMAP _IOR('A', 27, struct mapreg) | |
86 | #define AUDIO_SETMAP _IOW('A', 28, struct mapreg) | |
90587a41 CT |
87 | #endif |
88 | ||
89 | #define AUDIO_SPEAKER 1 | |
90 | #define AUDIO_HEADPHONE 2 | |
91 | ||
92 | /* | |
93 | * Low level interface. | |
94 | */ | |
95 | struct mapreg { | |
96 | u_short mr_x[8]; | |
97 | u_short mr_r[8]; | |
98 | u_short mr_gx; | |
99 | u_short mr_gr; | |
100 | u_short mr_ger; | |
101 | u_short mr_stgr; | |
102 | u_short mr_ftgr; | |
103 | u_short mr_atgr; | |
104 | u_char mr_mmr1; | |
105 | u_char mr_mmr2; | |
106 | }; | |
107 | ||
108 | #endif /* _BSD_AUDIOIO_H_ */ |