annotate Plugins/Output/OSS/soundcard.h @ 61:fa848bd484d8 trunk

[svn] Move plugins to Plugins/
author nenolod
date Fri, 28 Oct 2005 22:58:11 -0700
parents
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1 #ifndef SOUNDCARD_H
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
2 #define SOUNDCARD_H
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
3 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
4 * Copyright by Hannu Savolainen 1993-2000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
5 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
6 * Redistribution and use in source and binary forms, with or without
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
7 * modification, are permitted provided that the following conditions are
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
8 * met: 1. Redistributions of source code must retain the above copyright
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
9 * notice, this list of conditions and the following disclaimer. 2.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
10 * Redistributions in binary form must reproduce the above copyright notice,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
11 * this list of conditions and the following disclaimer in the documentation
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
12 * and/or other materials provided with the distribution.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
13 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
14 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
15 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
16 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
17 * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
18 * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
20 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
21 * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
24 * SUCH DAMAGE.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
25 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
26
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
27 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
28 * IMPORTANT NOTICE!
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
29 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
30 * This header file contains many obsolete definitions (for compatibility
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
31 * purposes). Please check the OSS Programmer's guide for descriptions
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
32 * of the supported API details (http://www.opensound.com/pguide).
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
33 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
34
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
35 #if defined(__cplusplus)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
36 #define EXTERNC extern "C"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
37 #else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
38 #define EXTERNC extern
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
39 #endif /* EXTERN_C_WRAPPERS */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
40
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
41 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
42 * OSS interface version. With versions earlier than 3.6 this value is
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
43 * an integer with value less than 361. In versions 3.6 and later
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
44 * it's a six digit hexadecimal value. For example value
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
45 * of 0x030600 represents OSS version 3.6.0.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
46 * Use ioctl(fd, OSS_GETVERSION, &int) to get the version number of
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
47 * the currently active driver.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
48 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
49 #define SOUND_VERSION 0x030960
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
50 #define OPEN_SOUND_SYSTEM
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
51
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
52 #if defined(__hpux) && !defined(_HPUX_SOURCE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
53 # error "-D_HPUX_SOURCE must be used when compiling OSS applications"
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
54 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
55
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
56 #ifdef __hpux
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
57 #include <sys/ioctl.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
58 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
59
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
60 #ifdef linux
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
61 /* In Linux we need to be prepared for cross compiling */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
62 #include <linux/ioctl.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
63 #else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
64 # ifdef __FreeBSD__
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
65 # include <sys/ioccom.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
66 # else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
67 # include <sys/ioctl.h>
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
68 # endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
69 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
70
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
71 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
72 * Supported card ID numbers (OBSOLETE. NOT USED ANY MORE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
73 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
74
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
75 #define SNDCARD_ADLIB 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
76 #define SNDCARD_SB 2
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
77 #define SNDCARD_PAS 3
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
78 #define SNDCARD_GUS 4
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
79 #define SNDCARD_MPU401 5
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
80 #define SNDCARD_SB16 6
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
81 #define SNDCARD_SB16MIDI 7
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
82 #define SNDCARD_UART6850 8
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
83 #define SNDCARD_GUS16 9
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
84 #define SNDCARD_MSS 10
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
85 #define SNDCARD_PSS 11
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
86 #define SNDCARD_SSCAPE 12
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
87 #define SNDCARD_PSS_MPU 13
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
88 #define SNDCARD_PSS_MSS 14
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
89 #define SNDCARD_SSCAPE_MSS 15
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
90 #define SNDCARD_TRXPRO 16
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
91 #define SNDCARD_TRXPRO_SB 17
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
92 #define SNDCARD_TRXPRO_MPU 18
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
93 #define SNDCARD_MAD16 19
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
94 #define SNDCARD_MAD16_MPU 20
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
95 #define SNDCARD_CS4232 21
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
96 #define SNDCARD_CS4232_MPU 22
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
97 #define SNDCARD_MAUI 23
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
98 #define SNDCARD_PSEUDO_MSS 24
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
99 #define SNDCARD_GUSPNP 25
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
100 #define SNDCARD_UART401 26
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
101 /* Sound card numbers 27 to N are reserved. Don't add more numbers here */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
102
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
103 /***********************************
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
104 * IOCTL Commands for /dev/sequencer
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
105 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
106
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
107 #ifndef __SIOWR
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
108 #if defined(__hpux) || (defined(_IOWR) && (defined(_AIX) || (!defined(sun) && !defined(sparc) && !defined(__INCioctlh) && !defined(__Lynx__))))
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
109 /* Use already defined ioctl defines if they exist (except with Sun and some others) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
110 #define SIOCPARM_MASK IOCPARM_MASK
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
111 #define SIOC_VOID IOC_VOID
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
112 #define SIOC_OUT IOC_OUT
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
113 #define SIOC_IN IOC_IN
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
114 #define SIOC_INOUT IOC_INOUT
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
115 #define __SIOC_SIZE _IOC_SIZE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
116 #define __SIOC_DIR _IOC_DIR
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
117 #define __SIOC_NONE _IOC_NONE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
118 #define __SIOC_READ _IOC_READ
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
119 #define __SIOC_WRITE _IOC_WRITE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
120 #define __SIO _IO
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
121 #define __SIOR _IOR
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
122 #define __SIOW _IOW
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
123 #define __SIOWR _IOWR
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
124 #else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
125
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
126 /* Ioctl's have the command encoded in the lower word,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
127 * and the size of any in or out parameters in the upper
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
128 * word. The high 2 bits of the upper word are used
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
129 * to encode the in/out status of the parameter; for now
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
130 * we restrict parameters to at most 8191 bytes.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
131 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
132 /* #define SIOCTYPE (0xff<<8) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
133 #define SIOCPARM_MASK 0x1fff /* parameters must be < 8192 bytes */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
134 #define SIOC_VOID 0x00000000 /* no parameters */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
135 #define SIOC_OUT 0x20000000 /* copy out parameters */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
136 #define SIOC_IN 0x40000000 /* copy in parameters */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
137 #define SIOC_INOUT (SIOC_IN|SIOC_OUT)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
138 /* the 0x20000000 is so we can distinguish new ioctl's from old */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
139 #define __SIO(x,y) ((int)(SIOC_VOID|(x<<8)|y))
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
140 #define __SIOR(x,y,t) ((int)(SIOC_OUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
141 #define __SIOW(x,y,t) ((int)(SIOC_IN|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
142 #define __SIOWR(x,y,t) ((int)(SIOC_INOUT|((sizeof(t)&SIOCPARM_MASK)<<16)|(x<<8)|y))
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
143 #define __SIOC_SIZE(x) ((x>>16)&SIOCPARM_MASK)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
144 #define __SIOC_DIR(x) (x & 0xf0000000)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
145 #define __SIOC_NONE SIOC_VOID
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
146 #define __SIOC_READ SIOC_OUT
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
147 #define __SIOC_WRITE SIOC_IN
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
148 # endif /* _IOWR */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
149 #endif /* !__SIOWR */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
150
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
151 #define SNDCTL_SEQ_RESET __SIO ('Q', 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
152 #define SNDCTL_SEQ_SYNC __SIO ('Q', 1)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
153 #define SNDCTL_SYNTH_INFO __SIOWR('Q', 2, struct synth_info)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
154 #define SNDCTL_SEQ_CTRLRATE __SIOWR('Q', 3, int) /* Set/get timer resolution (HZ) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
155 #define SNDCTL_SEQ_GETOUTCOUNT __SIOR ('Q', 4, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
156 #define SNDCTL_SEQ_GETINCOUNT __SIOR ('Q', 5, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
157 #define SNDCTL_SEQ_PERCMODE __SIOW ('Q', 6, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
158 #define SNDCTL_FM_LOAD_INSTR __SIOW ('Q', 7, struct sbi_instrument) /* Obsolete. Don't use!!!!!! */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
159 #define SNDCTL_SEQ_TESTMIDI __SIOW ('Q', 8, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
160 #define SNDCTL_SEQ_RESETSAMPLES __SIOW ('Q', 9, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
161 #define SNDCTL_SEQ_NRSYNTHS __SIOR ('Q',10, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
162 #define SNDCTL_SEQ_NRMIDIS __SIOR ('Q',11, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
163 #define SNDCTL_MIDI_INFO __SIOWR('Q',12, struct midi_info)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
164 #define SNDCTL_SEQ_THRESHOLD __SIOW ('Q',13, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
165 #define SNDCTL_SYNTH_MEMAVL __SIOWR('Q',14, int) /* in=dev#, out=memsize */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
166 #define SNDCTL_FM_4OP_ENABLE __SIOW ('Q',15, int) /* in=dev# */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
167 #define SNDCTL_SEQ_PANIC __SIO ('Q',17)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
168 #define SNDCTL_SEQ_OUTOFBAND __SIOW ('Q',18, struct seq_event_rec)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
169 #define SNDCTL_SEQ_GETTIME __SIOR ('Q',19, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
170 #define SNDCTL_SYNTH_ID __SIOWR('Q',20, struct synth_info)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
171 #define SNDCTL_SYNTH_CONTROL __SIOWR('Q',21, struct synth_control)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
172 #define SNDCTL_SYNTH_REMOVESAMPLE __SIOWR('Q',22, struct remove_sample) /* Reserved for future use */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
173 #define SNDCTL_SEQ_TIMING_ENABLE __SIO ('Q', 23) /* Enable incoming MIDI timing messages */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
174 #define SNDCTL_SEQ_ACTSENSE_ENABLE __SIO ('Q', 24) /* Enable incoming active sensing messages */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
175 #define SNDCTL_SEQ_RT_ENABLE __SIO ('Q', 25) /* Enable other incoming realtime messages */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
176
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
177 typedef struct synth_control {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
178 int devno; /* Synthesizer # */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
179 char data[4000]; /* Device spesific command/data record */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
180 } synth_control;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
181
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
182 typedef struct remove_sample {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
183 int devno; /* Synthesizer # */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
184 int bankno; /* MIDI bank # (0=General MIDI) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
185 int instrno; /* MIDI instrument number */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
186 } remove_sample;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
187
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
188 typedef struct seq_event_rec {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
189 unsigned char arr[8];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
190 } seq_event_rec;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
191
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
192 #define SNDCTL_TMR_TIMEBASE __SIOWR('T', 1, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
193 #define SNDCTL_TMR_START __SIO ('T', 2)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
194 #define SNDCTL_TMR_STOP __SIO ('T', 3)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
195 #define SNDCTL_TMR_CONTINUE __SIO ('T', 4)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
196 #define SNDCTL_TMR_TEMPO __SIOWR('T', 5, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
197 #define SNDCTL_TMR_SOURCE __SIOWR('T', 6, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
198 # define TMR_INTERNAL 0x00000001
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
199 # define TMR_EXTERNAL 0x00000002
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
200 # define TMR_MODE_MIDI 0x00000010
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
201 # define TMR_MODE_FSK 0x00000020
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
202 # define TMR_MODE_CLS 0x00000040
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
203 # define TMR_MODE_SMPTE 0x00000080
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
204 #define SNDCTL_TMR_METRONOME __SIOW ('T', 7, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
205 #define SNDCTL_TMR_SELECT __SIOW ('T', 8, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
206
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
207 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
208 * Some big endian/little endian handling macros (native endian and opposite
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
209 * endian formats)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
210 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
211
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
212 #if defined(_AIX) || defined(AIX) || defined(sparc) || defined(__hppa) || defined(PPC) || defined(__powerpc__) && !defined(i386) && !defined(__i386) && !defined(__i386__)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
213 /* Big endian machines */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
214 # define _PATCHKEY(id) (0xfd00|id)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
215 # define AFMT_S16_NE AFMT_S16_BE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
216 # define AFMT_U16_NE AFMT_U16_BE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
217 # define AFMT_S32_NE AFMT_S32_BE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
218 # define AFMT_S24_NE AFMT_S24_BE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
219 # define AFMT_S16_OE AFMT_S16_LE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
220 # define AFMT_S32_OE AFMT_S32_LE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
221 # define AFMT_S24_OE AFMT_S24_LE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
222 #else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
223 # define _PATCHKEY(id) ((id<<8)|0xfd)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
224 # define AFMT_S16_NE AFMT_S16_LE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
225 # define AFMT_U16_NE AFMT_U16_LE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
226 # define AFMT_S32_NE AFMT_S32_LE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
227 # define AFMT_S24_NE AFMT_S24_LE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
228 # define AFMT_S16_OE AFMT_S16_BE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
229 # define AFMT_S32_OE AFMT_S32_BE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
230 # define AFMT_S24_OE AFMT_S24_BE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
231 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
232
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
233 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
234 * Sample loading mechanism for internal synthesizers (/dev/sequencer)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
235 * The following patch_info structure has been designed to support
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
236 * Gravis UltraSound. It tries to be universal format for uploading
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
237 * sample based patches but is probably too limited.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
238 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
239
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
240 struct patch_info {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
241 unsigned short key; /* Use WAVE_PATCH here */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
242 #define WAVE_PATCH _PATCHKEY(0x04)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
243 #define GUS_PATCH WAVE_PATCH
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
244 #define WAVEFRONT_PATCH _PATCHKEY(0x06)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
245
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
246 short device_no; /* Synthesizer number */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
247 short instr_no; /* Midi pgm# */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
248
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
249 unsigned int mode;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
250 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
251 * The least significant byte has the same format than the GUS .PAT
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
252 * files
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
253 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
254 #define WAVE_16_BITS 0x01 /* bit 0 = 8 or 16 bit wave data. */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
255 #define WAVE_UNSIGNED 0x02 /* bit 1 = Signed - Unsigned data. */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
256 #define WAVE_LOOPING 0x04 /* bit 2 = looping enabled-1. */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
257 #define WAVE_BIDIR_LOOP 0x08 /* bit 3 = Set is bidirectional looping. */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
258 #define WAVE_LOOP_BACK 0x10 /* bit 4 = Set is looping backward. */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
259 #define WAVE_SUSTAIN_ON 0x20 /* bit 5 = Turn sustaining on. (Env. pts. 3) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
260 #define WAVE_ENVELOPES 0x40 /* bit 6 = Enable envelopes - 1 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
261 #define WAVE_FAST_RELEASE 0x80 /* bit 7 = Shut off immediately after note off */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
262 /* (use the env_rate/env_offs fields). */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
263 /* Linux specific bits */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
264 #define WAVE_VIBRATO 0x00010000 /* The vibrato info is valid */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
265 #define WAVE_TREMOLO 0x00020000 /* The tremolo info is valid */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
266 #define WAVE_SCALE 0x00040000 /* The scaling info is valid */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
267 #define WAVE_FRACTIONS 0x00080000 /* Fraction information is valid */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
268 /* Reserved bits */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
269 #define WAVE_ROM 0x40000000 /* For future use */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
270 #define WAVE_MULAW 0x20000000 /* For future use */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
271 /* Other bits must be zeroed */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
272
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
273 int len; /* Size of the wave data in bytes */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
274 int loop_start, loop_end; /* Byte offsets from the beginning */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
275
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
276 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
277 * The base_freq and base_note fields are used when computing the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
278 * playback speed for a note. The base_note defines the tone frequency
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
279 * which is heard if the sample is played using the base_freq as the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
280 * playback speed.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
281 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
282 * The low_note and high_note fields define the minimum and maximum note
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
283 * frequencies for which this sample is valid. It is possible to define
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
284 * more than one samples for an instrument number at the same time. The
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
285 * low_note and high_note fields are used to select the most suitable one.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
286 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
287 * The fields base_note, high_note and low_note should contain
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
288 * the note frequency multiplied by 1000. For example value for the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
289 * middle A is 440*1000.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
290 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
291
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
292 unsigned int base_freq;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
293 unsigned int base_note;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
294 unsigned int high_note;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
295 unsigned int low_note;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
296 int panning; /* -128=left, 127=right */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
297 int detuning;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
298
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
299 /* New fields introduced in version 1.99.5 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
300
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
301 /* Envelope. Enabled by mode bit WAVE_ENVELOPES */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
302 unsigned char env_rate[6]; /* GUS HW ramping rate */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
303 unsigned char env_offset[6]; /* 255 == 100% */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
304
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
305 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
306 * The tremolo, vibrato and scale info are not supported yet.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
307 * Enable by setting the mode bits WAVE_TREMOLO, WAVE_VIBRATO or
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
308 * WAVE_SCALE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
309 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
310
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
311 unsigned char tremolo_sweep;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
312 unsigned char tremolo_rate;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
313 unsigned char tremolo_depth;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
314
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
315 unsigned char vibrato_sweep;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
316 unsigned char vibrato_rate;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
317 unsigned char vibrato_depth;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
318
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
319 int scale_frequency;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
320 unsigned int scale_factor; /* from 0 to 2048 or 0 to 2 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
321
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
322 int volume;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
323 int fractions;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
324 int reserved1;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
325 int spare[2];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
326 char data[1]; /* The waveform data starts here */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
327 };
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
328
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
329 struct sysex_info {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
330 short key; /* Use SYSEX_PATCH or MAUI_PATCH here */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
331 #define SYSEX_PATCH _PATCHKEY(0x05)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
332 #define MAUI_PATCH _PATCHKEY(0x06)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
333 short device_no; /* Synthesizer number */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
334 int len; /* Size of the sysex data in bytes */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
335 unsigned char data[1]; /* Sysex data starts here */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
336 };
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
337
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
338 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
339 * /dev/sequencer input events.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
340 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
341 * The data written to the /dev/sequencer is a stream of events. Events
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
342 * are records of 4 or 8 bytes. The first byte defines the size.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
343 * Any number of events can be written with a write call. There
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
344 * is a set of macros for sending these events. Use these macros if you
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
345 * want to maximize portability of your program.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
346 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
347 * Events SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO. Are also input events.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
348 * (All input events are currently 4 bytes long. Be prepared to support
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
349 * 8 byte events also. If you receive any event having first byte >= 128,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
350 * it's a 8 byte event.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
351 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
352 * The events are documented at the end of this file.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
353 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
354 * Normal events (4 bytes)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
355 * There is also a 8 byte version of most of the 4 byte events. The
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
356 * 8 byte one is recommended.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
357 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
358 * NOTE! All 4 byte events are now obsolete. Applications should not write
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
359 * them. However 4 byte events are still used as inputs from
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
360 * /dev/sequencer (/dev/music uses only 8 byte ones).
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
361 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
362 #define SEQ_NOTEOFF 0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
363 #define SEQ_FMNOTEOFF SEQ_NOTEOFF /* Just old name */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
364 #define SEQ_NOTEON 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
365 #define SEQ_FMNOTEON SEQ_NOTEON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
366 #define SEQ_WAIT TMR_WAIT_ABS
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
367 #define SEQ_PGMCHANGE 3
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
368 #define SEQ_FMPGMCHANGE SEQ_PGMCHANGE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
369 #define SEQ_SYNCTIMER TMR_START
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
370 #define SEQ_MIDIPUTC 5
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
371 #define SEQ_DRUMON 6 /*** OBSOLETE ***/
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
372 #define SEQ_DRUMOFF 7 /*** OBSOLETE ***/
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
373 #define SEQ_ECHO TMR_ECHO /* For synching programs with output */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
374 #define SEQ_AFTERTOUCH 9
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
375 #define SEQ_CONTROLLER 10
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
376
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
377 /*******************************************
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
378 * Midi controller numbers
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
379 *******************************************
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
380 * Controllers 0 to 31 (0x00 to 0x1f) and
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
381 * 32 to 63 (0x20 to 0x3f) are continuous
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
382 * controllers.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
383 * In the MIDI 1.0 these controllers are sent using
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
384 * two messages. Controller numbers 0 to 31 are used
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
385 * to send the MSB and the controller numbers 32 to 63
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
386 * are for the LSB. Note that just 7 bits are used in MIDI bytes.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
387 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
388
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
389 #define CTL_BANK_SELECT 0x00
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
390 #define CTL_MODWHEEL 0x01
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
391 #define CTL_BREATH 0x02
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
392 /* undefined 0x03 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
393 #define CTL_FOOT 0x04
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
394 #define CTL_PORTAMENTO_TIME 0x05
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
395 #define CTL_DATA_ENTRY 0x06
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
396 #define CTL_MAIN_VOLUME 0x07
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
397 #define CTL_BALANCE 0x08
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
398 /* undefined 0x09 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
399 #define CTL_PAN 0x0a
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
400 #define CTL_EXPRESSION 0x0b
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
401 /* undefined 0x0c */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
402 /* undefined 0x0d */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
403 /* undefined 0x0e */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
404 /* undefined 0x0f */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
405 #define CTL_GENERAL_PURPOSE1 0x10
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
406 #define CTL_GENERAL_PURPOSE2 0x11
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
407 #define CTL_GENERAL_PURPOSE3 0x12
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
408 #define CTL_GENERAL_PURPOSE4 0x13
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
409 /* undefined 0x14 - 0x1f */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
410
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
411 /* undefined 0x20 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
412 /* The controller numbers 0x21 to 0x3f are reserved for the */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
413 /* least significant bytes of the controllers 0x00 to 0x1f. */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
414 /* These controllers are not recognised by the driver. */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
415
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
416 /* Controllers 64 to 69 (0x40 to 0x45) are on/off switches. */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
417 /* 0=OFF and 127=ON (intermediate values are possible) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
418 #define CTL_DAMPER_PEDAL 0x40
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
419 #define CTL_SUSTAIN 0x40 /* Alias */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
420 #define CTL_HOLD 0x40 /* Alias */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
421 #define CTL_PORTAMENTO 0x41
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
422 #define CTL_SOSTENUTO 0x42
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
423 #define CTL_SOFT_PEDAL 0x43
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
424 /* undefined 0x44 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
425 #define CTL_HOLD2 0x45
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
426 /* undefined 0x46 - 0x4f */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
427
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
428 #define CTL_GENERAL_PURPOSE5 0x50
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
429 #define CTL_GENERAL_PURPOSE6 0x51
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
430 #define CTL_GENERAL_PURPOSE7 0x52
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
431 #define CTL_GENERAL_PURPOSE8 0x53
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
432 /* undefined 0x54 - 0x5a */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
433 #define CTL_EXT_EFF_DEPTH 0x5b
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
434 #define CTL_TREMOLO_DEPTH 0x5c
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
435 #define CTL_CHORUS_DEPTH 0x5d
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
436 #define CTL_DETUNE_DEPTH 0x5e
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
437 #define CTL_CELESTE_DEPTH 0x5e /* Alias for the above one */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
438 #define CTL_PHASER_DEPTH 0x5f
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
439 #define CTL_DATA_INCREMENT 0x60
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
440 #define CTL_DATA_DECREMENT 0x61
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
441 #define CTL_NONREG_PARM_NUM_LSB 0x62
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
442 #define CTL_NONREG_PARM_NUM_MSB 0x63
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
443 #define CTL_REGIST_PARM_NUM_LSB 0x64
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
444 #define CTL_REGIST_PARM_NUM_MSB 0x65
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
445 /* undefined 0x66 - 0x78 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
446 /* reserved 0x79 - 0x7f */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
447
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
448 /* Pseudo controllers (not midi compatible) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
449 #define CTRL_PITCH_BENDER 255
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
450 #define CTRL_PITCH_BENDER_RANGE 254
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
451 #define CTRL_EXPRESSION 253 /* Obsolete */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
452 #define CTRL_MAIN_VOLUME 252 /* Obsolete */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
453 #define SEQ_BALANCE 11
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
454 #define SEQ_VOLMODE 12
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
455
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
456 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
457 * Volume mode defines how volumes are used
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
458 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
459
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
460 #define VOL_METHOD_ADAGIO 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
461 #define VOL_METHOD_LINEAR 2
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
462
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
463 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
464 * Note! SEQ_WAIT, SEQ_MIDIPUTC and SEQ_ECHO are used also as
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
465 * input events.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
466 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
467
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
468 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
469 * Event codes 0xf0 to 0xfc are reserved for future extensions.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
470 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
471
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
472 #define SEQ_FULLSIZE 0xfd /* Long events */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
473 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
474 * SEQ_FULLSIZE events are used for loading patches/samples to the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
475 * synthesizer devices. These events are passed directly to the driver
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
476 * of the associated synthesizer device. There is no limit to the size
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
477 * of the extended events. These events are not queued but executed
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
478 * immediately when the write() is called (execution can take several
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
479 * seconds of time).
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
480 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
481 * When a SEQ_FULLSIZE message is written to the device, it must
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
482 * be written using exactly one write() call. Other events cannot
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
483 * be mixed to the same write.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
484 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
485 * For FM synths (YM3812/OPL3) use struct sbi_instrument and write it to the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
486 * /dev/sequencer. Don't write other data together with the instrument structure
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
487 * Set the key field of the structure to FM_PATCH. The device field is used to
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
488 * route the patch to the corresponding device.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
489 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
490 * For wave table use struct patch_info. Initialize the key field
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
491 * to WAVE_PATCH.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
492 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
493 #define SEQ_PRIVATE 0xfe /* Low level HW dependent events (8 bytes) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
494 #define SEQ_EXTENDED 0xff /* Extended events (8 bytes) OBSOLETE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
495
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
496 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
497 * Record for FM patches
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
498 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
499
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
500 typedef unsigned char sbi_instr_data[32];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
501
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
502 struct sbi_instrument {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
503 unsigned short key; /* FM_PATCH or OPL3_PATCH */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
504 #define FM_PATCH _PATCHKEY(0x01)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
505 #define OPL3_PATCH _PATCHKEY(0x03)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
506 short device; /* Synth# (0-4) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
507 int channel; /* Program# to be initialized */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
508 sbi_instr_data operators; /* Register settings for operator cells (.SBI format) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
509 };
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
510
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
511 struct synth_info { /* Read only */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
512 char name[30];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
513 int device; /* 0-N. INITIALIZE BEFORE CALLING */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
514 int synth_type;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
515 #define SYNTH_TYPE_FM 0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
516 #define SYNTH_TYPE_SAMPLE 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
517 #define SYNTH_TYPE_MIDI 2 /* Midi interface */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
518
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
519 int synth_subtype;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
520 #define FM_TYPE_ADLIB 0x00
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
521 #define FM_TYPE_OPL3 0x01
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
522 #define MIDI_TYPE_MPU401 0x401
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
523
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
524 #define SAMPLE_TYPE_BASIC 0x10
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
525 #define SAMPLE_TYPE_GUS SAMPLE_TYPE_BASIC
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
526 #define SAMPLE_TYPE_WAVEFRONT 0x11
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
527
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
528 int perc_mode; /* No longer supported */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
529 int nr_voices;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
530 int nr_drums; /* Obsolete field */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
531 int instr_bank_size;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
532 unsigned int capabilities;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
533 #define SYNTH_CAP_PERCMODE 0x00000001 /* No longer used */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
534 #define SYNTH_CAP_OPL3 0x00000002 /* Set if OPL3 supported */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
535 #define SYNTH_CAP_INPUT 0x00000004 /* Input (MIDI) device */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
536 int dummies[19]; /* Reserve space */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
537 };
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
538
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
539 struct sound_timer_info {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
540 char name[32];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
541 int caps;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
542 };
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
543
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
544 #define MIDI_CAP_MPU401 1 /* MPU-401 intelligent mode */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
545
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
546 struct midi_info {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
547 char name[30];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
548 int device; /* 0-N. INITIALIZE BEFORE CALLING */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
549 unsigned int capabilities; /* To be defined later */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
550 int dev_type;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
551 int dummies[18]; /* Reserve space */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
552 };
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
553
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
554 /********************************************
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
555 * ioctl commands for the /dev/midi##
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
556 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
557 typedef struct {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
558 unsigned char cmd;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
559 char nr_args, nr_returns;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
560 unsigned char data[30];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
561 } mpu_command_rec;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
562
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
563 #define SNDCTL_MIDI_PRETIME __SIOWR('m', 0, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
564 #define SNDCTL_MIDI_MPUMODE __SIOWR('m', 1, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
565 #define SNDCTL_MIDI_MPUCMD __SIOWR('m', 2, mpu_command_rec)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
566
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
567 /********************************************
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
568 * IOCTL commands for /dev/dsp and /dev/audio
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
569 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
570
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
571 #define SNDCTL_DSP_RESET __SIO ('P', 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
572 #define SNDCTL_DSP_SYNC __SIO ('P', 1)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
573 #define SNDCTL_DSP_SPEED __SIOWR('P', 2, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
574 #define SNDCTL_DSP_STEREO __SIOWR('P', 3, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
575 #define SNDCTL_DSP_GETBLKSIZE __SIOWR('P', 4, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
576 #define SNDCTL_DSP_SAMPLESIZE SNDCTL_DSP_SETFMT
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
577 #define SNDCTL_DSP_CHANNELS __SIOWR('P', 6, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
578 #define SOUND_PCM_WRITE_CHANNELS SNDCTL_DSP_CHANNELS
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
579 #define SOUND_PCM_WRITE_FILTER __SIOWR('P', 7, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
580 #define SNDCTL_DSP_POST __SIO ('P', 8)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
581 #define SNDCTL_DSP_SUBDIVIDE __SIOWR('P', 9, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
582 #define SNDCTL_DSP_SETFRAGMENT __SIOWR('P',10, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
583
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
584 /* Audio data formats (Note! U8=8 and S16_LE=16 for compatibility) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
585 #define SNDCTL_DSP_GETFMTS __SIOR ('P',11, int) /* Returns a mask */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
586 #define SNDCTL_DSP_SETFMT __SIOWR('P',5, int) /* Selects ONE fmt */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
587 # define AFMT_QUERY 0x00000000 /* Return current fmt */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
588 # define AFMT_MU_LAW 0x00000001
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
589 # define AFMT_A_LAW 0x00000002
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
590 # define AFMT_IMA_ADPCM 0x00000004
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
591 # define AFMT_U8 0x00000008
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
592 # define AFMT_S16_LE 0x00000010 /* Little endian signed 16 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
593 # define AFMT_S16_BE 0x00000020 /* Big endian signed 16 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
594 # define AFMT_S8 0x00000040
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
595 # define AFMT_U16_LE 0x00000080 /* Little endian U16 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
596 # define AFMT_U16_BE 0x00000100 /* Big endian U16 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
597 # define AFMT_MPEG 0x00000200 /* MPEG (2) audio */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
598
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
599 /* AC3 _compressed_ bitstreams (See Programmer's Guide for details). */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
600 # define AFMT_AC3 0x00000400
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
601 /* Ogg Vorbis _compressed_ bit streams */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
602 # define AFMT_VORBIS 0x00000800
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
603
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
604 /* 32 bit formats (MSB aligned) formats */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
605 # define AFMT_S32_LE 0x00001000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
606 # define AFMT_S32_BE 0x00002000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
607
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
608 /* Reserved for _native_ endian double precision IEEE floating point */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
609 # define AFMT_FLOAT 0x00004000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
610
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
611 /* 24 bit formats (LSB aligned in 32 bit word) formats */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
612 # define AFMT_S24_LE 0x00008000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
613 # define AFMT_S24_BE 0x00010000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
614
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
615 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
616 * S/PDIF raw format. In this format the S/PDIF frames (including all
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
617 * control and user bits) are included in the data stream. Each sample
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
618 * is stored in a 32 bit frame (see IEC-958 for more info). This format
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
619 * is supported by very few devices and it's only usable for purposes
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
620 * where full access to the control/user bits is required (real time control).
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
621 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
622 # define AFMT_SPDIF_RAW 0x00020000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
623
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
624 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
625 * Buffer status queries.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
626 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
627 typedef struct audio_buf_info {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
628 int fragments; /* # of available fragments (partially usend ones not counted) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
629 int fragstotal; /* Total # of fragments allocated */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
630 int fragsize; /* Size of a fragment in bytes */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
631
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
632 int bytes; /* Available space in bytes (includes partially used fragments) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
633 /* Note! 'bytes' could be more than fragments*fragsize */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
634 } audio_buf_info;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
635
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
636 #define SNDCTL_DSP_GETOSPACE __SIOR ('P',12, audio_buf_info)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
637 #define SNDCTL_DSP_GETISPACE __SIOR ('P',13, audio_buf_info)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
638 #define SNDCTL_DSP_NONBLOCK __SIO ('P',14) /* Obsolete. Not supported */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
639 #define SNDCTL_DSP_GETCAPS __SIOR ('P',15, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
640 # define DSP_CAP_REVISION 0x000000ff /* Bits for revision level (0 to 255) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
641 # define DSP_CAP_DUPLEX 0x00000100 /* Full duplex record/playback */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
642 # define DSP_CAP_REALTIME 0x00000200 /* Not in use */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
643 # define DSP_CAP_BATCH 0x00000400 /* Device has some kind of */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
644 /* internal buffers which may */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
645 /* cause some delays and */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
646 /* decrease precision of timing */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
647 # define DSP_CAP_COPROC 0x00000800 /* Has a coprocessor */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
648 /* Sometimes it's a DSP */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
649 /* but usually not */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
650 # define DSP_CAP_TRIGGER 0x00001000 /* Supports SETTRIGGER */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
651 # define DSP_CAP_MMAP 0x00002000 /* Supports mmap() */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
652 # define DSP_CAP_MULTI 0x00004000 /* Supports multiple open */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
653 # define DSP_CAP_BIND 0x00008000 /* Supports binding to front/rear/center/lfe */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
654 # define DSP_CAP_INPUT 0x00010000 /* Supports recording */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
655 # define DSP_CAP_OUTPUT 0x00020000 /* Supports playback */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
656 #define DSP_CAP_VIRTUAL 0x00040000 /* Virtuial device */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
657 /* 0x00040000 and 0x00080000 reserved for future use */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
658
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
659 /* Analog/digital control capabilities */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
660 # define DSP_CAP_ANALOGOUT 0x00100000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
661 # define DSP_CAP_ANALOGIN 0x00200000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
662 # define DSP_CAP_DIGITALOUT 0x00400000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
663 # define DSP_CAP_DIGITALIN 0x00800000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
664 # define DSP_CAP_ADMASK 0x00f00000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
665 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
666 * NOTE! (capabilities & DSP_CAP_ADMASK)==0 means just that the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
667 * digital/analog interface control features are not supported by the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
668 * device/driver. However the device still supports analog, digital or
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
669 * both inputs/outputs (depending on the device). See the OSS Programmer's
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
670 * Guide for full details.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
671 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
672 # define DSP_CAP_SHADOW 0x01000000 /* "Shadow" device */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
673
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
674
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
675 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
676 * Preferred channel usage. These bits can be used to
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
677 * give recommendations to the application. Used by few drivers.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
678 * For example if ((caps & DSP_CH_MASK) == DSP_CH_MONO) means that
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
679 * the device works best in mono mode. However it doesn't necessarily mean
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
680 * that the device cannot be used in stereo. These bits should only be used
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
681 * special applications such as multi track hard disk recorders to find out
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
682 * the initial setup. However the user should be able to override this
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
683 * selection.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
684 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
685 * To find out which modes are actually supported the application should
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
686 * try to select them using SNDCTL_DSP_CHANNELS.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
687 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
688 # define DSP_CH_MASK 0x06000000 /* Mask */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
689 # define DSP_CH_ANY 0x00000000 /* No preferred mode */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
690 # define DSP_CH_MONO 0x02000000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
691 # define DSP_CH_STEREO 0x04000000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
692 # define DSP_CH_MULTI 0x06000000 /* More than two channels */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
693
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
694 # define DSP_CAP_SLAVE 0x08000000 /* "Slave" device */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
695
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
696 #define SNDCTL_DSP_GETTRIGGER __SIOR ('P',16, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
697 #define SNDCTL_DSP_SETTRIGGER __SIOW ('P',16, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
698 # define PCM_ENABLE_INPUT 0x00000001
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
699 # define PCM_ENABLE_OUTPUT 0x00000002
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
700
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
701 typedef struct count_info {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
702 int bytes; /* Total # of bytes processed */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
703 int blocks; /* # of fragment transitions since last time */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
704 int ptr; /* Current DMA pointer value */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
705 } count_info;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
706
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
707 #define SNDCTL_DSP_GETIPTR __SIOR ('P',17, count_info)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
708 #define SNDCTL_DSP_GETOPTR __SIOR ('P',18, count_info)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
709
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
710 typedef struct buffmem_desc {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
711 unsigned *buffer;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
712 int size;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
713 } buffmem_desc;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
714 #define SNDCTL_DSP_MAPINBUF __SIOR ('P', 19, buffmem_desc)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
715 #define SNDCTL_DSP_MAPOUTBUF __SIOR ('P', 20, buffmem_desc)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
716 #define SNDCTL_DSP_SETSYNCRO __SIO ('P', 21)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
717 #define SNDCTL_DSP_SETDUPLEX __SIO ('P', 22)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
718
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
719 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
720 * Application's profile defines the way how playback underrun situations should be handled.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
721 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
722 * APF_NORMAL (the default) and APF_NETWORK make the driver to cleanup the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
723 * playback buffer whenever an underrun occurs. This consumes some time
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
724 * prevents looping the existing buffer.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
725 * APF_CPUINTENS is intended to be set by CPU intensive applications which
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
726 * are likely to run out of time occasionally. In this mode the buffer cleanup is
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
727 * disabled which saves CPU time but also let's the previous buffer content to
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
728 * be played during the "pause" after the underrun.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
729 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
730 #define SNDCTL_DSP_PROFILE __SIOW ('P', 23, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
731 #define APF_NORMAL 0 /* Normal applications */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
732 #define APF_NETWORK 1 /* Underruns probably caused by an "external" delay */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
733 #define APF_CPUINTENS 2 /* Underruns probably caused by "overheating" the CPU */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
734
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
735 #define SNDCTL_DSP_GETODELAY __SIOR ('P', 23, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
736 #define SNDCTL_DSP_GETOUTVOL __SIOR ('P', 24, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
737 #define SNDCTL_DSP_SETOUTVOL __SIOWR('P', 24, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
738
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
739 typedef struct audio_errinfo {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
740 int play_underruns;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
741 int rec_overruns;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
742 unsigned int play_ptradjust;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
743 unsigned int rec_ptradjust;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
744 int play_errorcount;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
745 int rec_errorcount;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
746 int play_lasterror;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
747 int rec_lasterror;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
748 long play_errorparm;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
749 long rec_errorparm;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
750 int filler[16];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
751 } audio_errinfo;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
752
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
753 #define SNDCTL_DSP_GETERROR __SIOR ('P', 25, audio_errinfo)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
754
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
755 typedef struct oss_digital_control {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
756 unsigned int caps;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
757 #define DIG_CBITIN_NONE 0x00000000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
758 #define DIG_CBITIN_LIMITED 0x00000001
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
759 #define DIG_CBITIN_DATA 0x00000002
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
760 #define DIG_CBITIN_BYTE0 0x00000004
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
761 #define DIG_CBITIN_FULL 0x00000008
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
762 #define DIG_CBITIN_MASK 0x0000000f
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
763 #define DIG_CBITOUT_NONE 0x00000000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
764 #define DIG_CBITOUT_LIMITED 0x00000010
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
765 #define DIG_CBITOUT_BYTE0 0x00000020
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
766 #define DIG_CBITOUT_FULL 0x00000040
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
767 #define DIG_CBITOUT_DATA 0x00000080
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
768 #define DIG_CBITOUT_MASK 0x000000f0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
769 #define DIG_UBITIN 0x00000100
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
770 #define DIG_UBITOUT 0x00000200
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
771 #define DIG_VBITOUT 0x00000400
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
772 #define DIG_OUTRATE 0x00000800
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
773 #define DIG_INRATE 0x00001000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
774 #define DIG_INBITS 0x00002000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
775 #define DIG_OUTBITS 0x00004000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
776 #define DIG_EXACT 0x00010000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
777 #define DIG_PRO 0x00020000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
778 #define DIG_CONSUMER 0x00040000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
779 #define DIG_PASSTHROUGH 0x00080000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
780 #define DIG_OUTSEL 0x00100000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
781
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
782 unsigned int valid;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
783 #define VAL_CBITIN 0x00000001
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
784 #define VAL_UBITIN 0x00000002
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
785 #define VAL_CBITOUT 0x00000004
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
786 #define VAL_UBITOUT 0x00000008
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
787 #define VAL_ISTATUS 0x00000010
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
788 #define VAL_IRATE 0x00000020
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
789 #define VAL_ORATE 0x00000040
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
790 #define VAL_INBITS 0x00000080
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
791 #define VAL_OUTBITS 0x00000100
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
792 #define VAL_REQUEST 0x00000200
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
793 #define VAL_OUTSEL 0x00000400
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
794
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
795 #define VAL_OUTMASK (VAL_CBITOUT|VAL_UBITOUT|VAL_ORATE|VAL_OUTBITS|VAL_OUTSEL)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
796
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
797 unsigned int request, param;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
798 #define SPD_RQ_PASSTHROUGH 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
799
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
800 unsigned char cbitin[24];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
801 unsigned char ubitin[24];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
802 unsigned char cbitout[24];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
803 unsigned char ubitout[24];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
804
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
805 unsigned int outsel;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
806 #define OUTSEL_DIGITAL 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
807 #define OUTSEL_ANALOG 2
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
808 #define OUTSEL_BOTH (OUTSEL_DIGITAL|OUTSEL_ANALOG)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
809
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
810 int in_data; /* Audio/data if autodetectable by the receiver */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
811 #define IND_UNKNOWN 0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
812 #define IND_AUDIO 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
813 #define IND_DATA 2
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
814
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
815 int in_locked; /* Receiver locked */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
816 #define LOCK_NOT_INDICATED 0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
817 #define LOCK_UNLOCKED 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
818 #define LOCK_LOCKED 2
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
819
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
820 int in_quality; /* Input signal quality */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
821 #define IN_QUAL_NOT_INDICATED 0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
822 #define IN_QUAL_POOR 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
823 #define IN_QUAL_GOOD 2
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
824
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
825 int in_vbit, out_vbit; /* V bits */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
826 #define VBIT_NOT_INDICATED 0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
827 #define VBIT_OFF 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
828 #define VBIT_ON 2
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
829
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
830 unsigned int in_errors; /* Various input errro conditions */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
831 #define INERR_CRC 0x0001
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
832 #define INERR_QCODE_CRC 0x0002
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
833 #define INERR_PARITY 0x0004
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
834 #define INERR_BIPHASE 0x0008
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
835
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
836 int srate_in, srate_out;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
837 int bits_in, bits_out;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
838
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
839 int filler[32];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
840 } oss_digital_control;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
841
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
842 #define SNDCTL_DSP_READCTL __SIOWR('P', 26, oss_digital_control)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
843 #define SNDCTL_DSP_WRITECTL __SIOWR('P', 27, oss_digital_control)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
844
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
845 typedef struct oss_syncgroup {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
846 int id;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
847 int mode;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
848 } oss_syncgroup;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
849
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
850 #define SNDCTL_DSP_SYNCGROUP __SIOWR('P', 28, oss_syncgroup)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
851 #define SNDCTL_DSP_SYNCSTART __SIOW ('P', 29, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
852
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
853 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
854 * "cooked" mode enables software based conversions for sample rate, sample
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
855 * format (bits) and number of channels (mono/stereo). These conversions are
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
856 * required with some devices that support only one sample rate or just stereo
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
857 * to let the applications to use other formats. The cooked mode is enabled by
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
858 * default. However it's necessary to disable this mode when mmap() is used or
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
859 * when very deterministic timing is required. SNDCTL_DSP_COOKEDMODE is an
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
860 * optional call introduced in OSS 3.9.6f. It's _error return must be ignored_
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
861 * since normally this call will return erno=EINVAL.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
862 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
863 * SNDCTL_DSP_COOKEDMODE must be called immediately after open before doing
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
864 * anything else. Otherwise the call will not have any effect.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
865 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
866 #define SNDCTL_DSP_COOKEDMODE __SIOW ('P', 30, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
867
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
868 #define SNDCTL_DSP_GETCHANNELMASK __SIOWR('P', 64, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
869 #define SNDCTL_DSP_BIND_CHANNEL __SIOWR('P', 65, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
870 # define DSP_BIND_QUERY 0x00000000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
871 # define DSP_BIND_FRONT 0x00000001
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
872 # define DSP_BIND_SURR 0x00000002
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
873 # define DSP_BIND_CENTER_LFE 0x00000004
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
874 # define DSP_BIND_HANDSET 0x00000008
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
875 # define DSP_BIND_MIC 0x00000010
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
876 # define DSP_BIND_MODEM1 0x00000020
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
877 # define DSP_BIND_MODEM2 0x00000040
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
878 # define DSP_BIND_I2S 0x00000080
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
879 # define DSP_BIND_SPDIF 0x00000100
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
880
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
881 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
882 * SOUND_PCM_* calls are obsolete. Use the SNDCTL_DSP_ ones instead.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
883 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
884
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
885 #define SOUND_PCM_READ_RATE __SIOR ('P', 2, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
886 #define SOUND_PCM_READ_CHANNELS __SIOR ('P', 6, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
887 #define SOUND_PCM_READ_BITS __SIOR ('P', 5, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
888 #define SOUND_PCM_READ_FILTER __SIOR ('P', 7, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
889
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
890 /* Some alias names (obsolete) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
891 #define SOUND_PCM_WRITE_BITS SNDCTL_DSP_SETFMT
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
892 #define SOUND_PCM_WRITE_RATE SNDCTL_DSP_SPEED
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
893 #define SOUND_PCM_POST SNDCTL_DSP_POST
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
894 #define SOUND_PCM_RESET SNDCTL_DSP_RESET
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
895 #define SOUND_PCM_SYNC SNDCTL_DSP_SYNC
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
896 #define SOUND_PCM_SUBDIVIDE SNDCTL_DSP_SUBDIVIDE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
897 #define SOUND_PCM_SETFRAGMENT SNDCTL_DSP_SETFRAGMENT
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
898 #define SOUND_PCM_GETFMTS SNDCTL_DSP_GETFMTS
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
899 #define SOUND_PCM_SETFMT SNDCTL_DSP_SETFMT
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
900 #define SOUND_PCM_GETOSPACE SNDCTL_DSP_GETOSPACE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
901 #define SOUND_PCM_GETISPACE SNDCTL_DSP_GETISPACE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
902 #define SOUND_PCM_NONBLOCK SNDCTL_DSP_NONBLOCK
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
903 #define SOUND_PCM_GETCAPS SNDCTL_DSP_GETCAPS
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
904 #define SOUND_PCM_GETTRIGGER SNDCTL_DSP_GETTRIGGER
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
905 #define SOUND_PCM_SETTRIGGER SNDCTL_DSP_SETTRIGGER
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
906 #define SOUND_PCM_SETSYNCRO SNDCTL_DSP_SETSYNCRO
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
907 #define SOUND_PCM_GETIPTR SNDCTL_DSP_GETIPTR
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
908 #define SOUND_PCM_GETOPTR SNDCTL_DSP_GETOPTR
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
909 #define SOUND_PCM_MAPINBUF SNDCTL_DSP_MAPINBUF
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
910 #define SOUND_PCM_MAPOUTBUF SNDCTL_DSP_MAPOUTBUF
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
911
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
912 /*********************************************
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
913 * IOCTL commands for /dev/mixer
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
914 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
915
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
916 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
917 * Mixer devices
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
918 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
919 * There can be up to 20 different analog mixer channels. The
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
920 * SOUND_MIXER_NRDEVICES gives the currently supported maximum.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
921 * The SOUND_MIXER_READ_DEVMASK returns a bitmask which tells
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
922 * the devices supported by the particular mixer.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
923 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
924
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
925 #define SOUND_MIXER_NRDEVICES 28
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
926 #define SOUND_MIXER_VOLUME 0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
927 #define SOUND_MIXER_BASS 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
928 #define SOUND_MIXER_TREBLE 2
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
929 #define SOUND_MIXER_SYNTH 3
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
930 #define SOUND_MIXER_PCM 4
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
931 #define SOUND_MIXER_SPEAKER 5
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
932 #define SOUND_MIXER_LINE 6
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
933 #define SOUND_MIXER_MIC 7
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
934 #define SOUND_MIXER_CD 8
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
935 #define SOUND_MIXER_IMIX 9 /* Recording monitor */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
936 #define SOUND_MIXER_ALTPCM 10
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
937 #define SOUND_MIXER_RECLEV 11 /* Recording level */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
938 #define SOUND_MIXER_IGAIN 12 /* Input gain */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
939 #define SOUND_MIXER_OGAIN 13 /* Output gain */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
940 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
941 * The AD1848 codec and compatibles have three line level inputs
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
942 * (line, aux1 and aux2). Since each card manufacturer have assigned
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
943 * different meanings to these inputs, it's inpractical to assign
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
944 * specific meanings (line, cd, synth etc.) to them.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
945 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
946 #define SOUND_MIXER_LINE1 14 /* Input source 1 (aux1) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
947 #define SOUND_MIXER_LINE2 15 /* Input source 2 (aux2) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
948 #define SOUND_MIXER_LINE3 16 /* Input source 3 (line) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
949 #define SOUND_MIXER_DIGITAL1 17 /* Digital (input) 1 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
950 #define SOUND_MIXER_DIGITAL2 18 /* Digital (input) 2 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
951 #define SOUND_MIXER_DIGITAL3 19 /* Digital (input) 3 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
952 #define SOUND_MIXER_PHONEIN 20 /* Phone input */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
953 #define SOUND_MIXER_PHONEOUT 21 /* Phone output */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
954 #define SOUND_MIXER_VIDEO 22 /* Video/TV (audio) in */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
955 #define SOUND_MIXER_RADIO 23 /* Radio in */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
956 #define SOUND_MIXER_MONITOR 24 /* Monitor (usually mic) volume */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
957 #define SOUND_MIXER_DEPTH 25 /* 3D "depth"/"space" parameter */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
958 #define SOUND_MIXER_CENTER 26 /* 3D "center" parameter */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
959 #define SOUND_MIXER_MIDI 27 /* Alternative for "synth" */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
960
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
961 /* Some on/off settings (SOUND_SPECIAL_MIN - SOUND_SPECIAL_MAX) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
962 /* Not counted to SOUND_MIXER_NRDEVICES, but use the same number space */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
963 #define SOUND_ONOFF_MIN 28
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
964 #define SOUND_ONOFF_MAX 30
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
965
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
966 /* Note! Number 31 cannot be used since the sign bit is reserved */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
967 #define SOUND_MIXER_NONE 31
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
968
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
969 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
970 * The following unsupported macros are no longer functional.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
971 * Use SOUND_MIXER_PRIVATE# macros in future.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
972 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
973 #define SOUND_MIXER_ENHANCE SOUND_MIXER_NONE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
974 #define SOUND_MIXER_MUTE SOUND_MIXER_NONE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
975 #define SOUND_MIXER_LOUD SOUND_MIXER_NONE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
976
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
977
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
978 #define SOUND_DEVICE_LABELS {"Vol ", "Bass ", "Trebl", "Synth", "Pcm ", "Spkr ", "Line ", \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
979 "Mic ", "CD ", "Mix ", "Pcm2 ", "Rec ", "IGain", "OGain", \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
980 "Line1", "Line2", "Line3", "Digital1", "Digital2", "Digital3", \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
981 "PhoneIn", "PhoneOut", "Video", "Radio", "Monitor", \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
982 "Depth", "Center", "MIDI"}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
983
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
984 #define SOUND_DEVICE_NAMES {"vol", "bass", "treble", "synth", "pcm", "speaker", "line", \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
985 "mic", "cd", "mix", "pcm2", "rec", "igain", "ogain", \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
986 "line1", "line2", "line3", "dig1", "dig2", "dig3", \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
987 "phin", "phout", "video", "radio", "monitor", \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
988 "depth", "center", "midi"}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
989
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
990 /* Device bitmask identifiers */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
991
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
992 #define SOUND_MIXER_RECSRC 0xff /* Arg contains a bit for each recording source */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
993 #define SOUND_MIXER_DEVMASK 0xfe /* Arg contains a bit for each supported device */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
994 #define SOUND_MIXER_RECMASK 0xfd /* Arg contains a bit for each supported recording source */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
995 #define SOUND_MIXER_CAPS 0xfc
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
996 # define SOUND_CAP_EXCL_INPUT 0x00000001 /* Only one recording source at a time */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
997 #define SOUND_MIXER_STEREODEVS 0xfb /* Mixer channels supporting stereo */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
998
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
999 /* OSS/Free ONLY */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1000 #define SOUND_MIXER_OUTSRC 0xfa /* Arg contains a bit for each input source to output */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1001 #define SOUND_MIXER_OUTMASK 0xf9 /* Arg contains a bit for each supported input source to output */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1002 /* OSS/Free ONLY */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1003
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1004 /* Device mask bits */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1005
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1006 #define SOUND_MASK_VOLUME (1 << SOUND_MIXER_VOLUME)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1007 #define SOUND_MASK_BASS (1 << SOUND_MIXER_BASS)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1008 #define SOUND_MASK_TREBLE (1 << SOUND_MIXER_TREBLE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1009 #define SOUND_MASK_SYNTH (1 << SOUND_MIXER_SYNTH)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1010 #define SOUND_MASK_PCM (1 << SOUND_MIXER_PCM)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1011 #define SOUND_MASK_SPEAKER (1 << SOUND_MIXER_SPEAKER)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1012 #define SOUND_MASK_LINE (1 << SOUND_MIXER_LINE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1013 #define SOUND_MASK_MIC (1 << SOUND_MIXER_MIC)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1014 #define SOUND_MASK_CD (1 << SOUND_MIXER_CD)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1015 #define SOUND_MASK_IMIX (1 << SOUND_MIXER_IMIX)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1016 #define SOUND_MASK_ALTPCM (1 << SOUND_MIXER_ALTPCM)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1017 #define SOUND_MASK_RECLEV (1 << SOUND_MIXER_RECLEV)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1018 #define SOUND_MASK_IGAIN (1 << SOUND_MIXER_IGAIN)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1019 #define SOUND_MASK_OGAIN (1 << SOUND_MIXER_OGAIN)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1020 #define SOUND_MASK_LINE1 (1 << SOUND_MIXER_LINE1)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1021 #define SOUND_MASK_LINE2 (1 << SOUND_MIXER_LINE2)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1022 #define SOUND_MASK_LINE3 (1 << SOUND_MIXER_LINE3)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1023 #define SOUND_MASK_DIGITAL1 (1 << SOUND_MIXER_DIGITAL1)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1024 #define SOUND_MASK_DIGITAL2 (1 << SOUND_MIXER_DIGITAL2)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1025 #define SOUND_MASK_DIGITAL3 (1 << SOUND_MIXER_DIGITAL3)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1026 #define SOUND_MASK_PHONEIN (1 << SOUND_MIXER_PHONEIN)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1027 #define SOUND_MASK_PHONEOUT (1 << SOUND_MIXER_PHONEOUT)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1028 #define SOUND_MASK_RADIO (1 << SOUND_MIXER_RADIO)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1029 #define SOUND_MASK_VIDEO (1 << SOUND_MIXER_VIDEO)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1030 #define SOUND_MASK_MONITOR (1 << SOUND_MIXER_MONITOR)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1031 #define SOUND_MASK_DEPTH (1 << SOUND_MIXER_DEPTH)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1032 #define SOUND_MASK_CENTER (1 << SOUND_MIXER_CENTER)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1033 #define SOUND_MASK_MIDI (1 << SOUND_MIXER_MIDI)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1034
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1035 /* Obsolete macros */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1036 #define SOUND_MASK_MUTE (1 << SOUND_MIXER_MUTE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1037 #define SOUND_MASK_ENHANCE (1 << SOUND_MIXER_ENHANCE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1038 #define SOUND_MASK_LOUD (1 << SOUND_MIXER_LOUD)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1039
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1040 #define MIXER_READ(dev) __SIOR('M', dev, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1041 #define SOUND_MIXER_READ_VOLUME MIXER_READ(SOUND_MIXER_VOLUME)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1042 #define SOUND_MIXER_READ_BASS MIXER_READ(SOUND_MIXER_BASS)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1043 #define SOUND_MIXER_READ_TREBLE MIXER_READ(SOUND_MIXER_TREBLE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1044 #define SOUND_MIXER_READ_SYNTH MIXER_READ(SOUND_MIXER_SYNTH)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1045 #define SOUND_MIXER_READ_PCM MIXER_READ(SOUND_MIXER_PCM)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1046 #define SOUND_MIXER_READ_SPEAKER MIXER_READ(SOUND_MIXER_SPEAKER)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1047 #define SOUND_MIXER_READ_LINE MIXER_READ(SOUND_MIXER_LINE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1048 #define SOUND_MIXER_READ_MIC MIXER_READ(SOUND_MIXER_MIC)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1049 #define SOUND_MIXER_READ_CD MIXER_READ(SOUND_MIXER_CD)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1050 #define SOUND_MIXER_READ_IMIX MIXER_READ(SOUND_MIXER_IMIX)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1051 #define SOUND_MIXER_READ_ALTPCM MIXER_READ(SOUND_MIXER_ALTPCM)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1052 #define SOUND_MIXER_READ_RECLEV MIXER_READ(SOUND_MIXER_RECLEV)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1053 #define SOUND_MIXER_READ_IGAIN MIXER_READ(SOUND_MIXER_IGAIN)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1054 #define SOUND_MIXER_READ_OGAIN MIXER_READ(SOUND_MIXER_OGAIN)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1055 #define SOUND_MIXER_READ_LINE1 MIXER_READ(SOUND_MIXER_LINE1)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1056 #define SOUND_MIXER_READ_LINE2 MIXER_READ(SOUND_MIXER_LINE2)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1057 #define SOUND_MIXER_READ_LINE3 MIXER_READ(SOUND_MIXER_LINE3)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1058
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1059 /* Obsolete macros */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1060 #define SOUND_MIXER_READ_MUTE MIXER_READ(SOUND_MIXER_MUTE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1061 #define SOUND_MIXER_READ_ENHANCE MIXER_READ(SOUND_MIXER_ENHANCE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1062 #define SOUND_MIXER_READ_LOUD MIXER_READ(SOUND_MIXER_LOUD)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1063
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1064 #define SOUND_MIXER_READ_RECSRC MIXER_READ(SOUND_MIXER_RECSRC)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1065 #define SOUND_MIXER_READ_DEVMASK MIXER_READ(SOUND_MIXER_DEVMASK)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1066 #define SOUND_MIXER_READ_RECMASK MIXER_READ(SOUND_MIXER_RECMASK)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1067 #define SOUND_MIXER_READ_STEREODEVS MIXER_READ(SOUND_MIXER_STEREODEVS)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1068 #define SOUND_MIXER_READ_CAPS MIXER_READ(SOUND_MIXER_CAPS)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1069
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1070 #define MIXER_WRITE(dev) __SIOWR('M', dev, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1071 #define SOUND_MIXER_WRITE_VOLUME MIXER_WRITE(SOUND_MIXER_VOLUME)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1072 #define SOUND_MIXER_WRITE_BASS MIXER_WRITE(SOUND_MIXER_BASS)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1073 #define SOUND_MIXER_WRITE_TREBLE MIXER_WRITE(SOUND_MIXER_TREBLE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1074 #define SOUND_MIXER_WRITE_SYNTH MIXER_WRITE(SOUND_MIXER_SYNTH)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1075 #define SOUND_MIXER_WRITE_PCM MIXER_WRITE(SOUND_MIXER_PCM)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1076 #define SOUND_MIXER_WRITE_SPEAKER MIXER_WRITE(SOUND_MIXER_SPEAKER)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1077 #define SOUND_MIXER_WRITE_LINE MIXER_WRITE(SOUND_MIXER_LINE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1078 #define SOUND_MIXER_WRITE_MIC MIXER_WRITE(SOUND_MIXER_MIC)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1079 #define SOUND_MIXER_WRITE_CD MIXER_WRITE(SOUND_MIXER_CD)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1080 #define SOUND_MIXER_WRITE_IMIX MIXER_WRITE(SOUND_MIXER_IMIX)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1081 #define SOUND_MIXER_WRITE_ALTPCM MIXER_WRITE(SOUND_MIXER_ALTPCM)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1082 #define SOUND_MIXER_WRITE_RECLEV MIXER_WRITE(SOUND_MIXER_RECLEV)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1083 #define SOUND_MIXER_WRITE_IGAIN MIXER_WRITE(SOUND_MIXER_IGAIN)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1084 #define SOUND_MIXER_WRITE_OGAIN MIXER_WRITE(SOUND_MIXER_OGAIN)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1085 #define SOUND_MIXER_WRITE_LINE1 MIXER_WRITE(SOUND_MIXER_LINE1)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1086 #define SOUND_MIXER_WRITE_LINE2 MIXER_WRITE(SOUND_MIXER_LINE2)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1087 #define SOUND_MIXER_WRITE_LINE3 MIXER_WRITE(SOUND_MIXER_LINE3)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1088
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1089 /* Obsolete macros */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1090 #define SOUND_MIXER_WRITE_MUTE MIXER_WRITE(SOUND_MIXER_MUTE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1091 #define SOUND_MIXER_WRITE_ENHANCE MIXER_WRITE(SOUND_MIXER_ENHANCE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1092 #define SOUND_MIXER_WRITE_LOUD MIXER_WRITE(SOUND_MIXER_LOUD)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1093
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1094 #define SOUND_MIXER_WRITE_RECSRC MIXER_WRITE(SOUND_MIXER_RECSRC)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1095
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1096 typedef struct mixer_info {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1097 char id[16];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1098 char name[32];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1099 int modify_counter;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1100 int fillers[10];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1101 } mixer_info;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1102
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1103 typedef struct _old_mixer_info { /* Obsolete */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1104 char id[16];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1105 char name[32];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1106 } _old_mixer_info;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1107
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1108 #define SOUND_MIXER_INFO __SIOR ('M', 101, mixer_info)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1109 #define SOUND_OLD_MIXER_INFO __SIOR ('M', 101, _old_mixer_info)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1110
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1111 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1112 * A mechanism for accessing "proprietary" mixer features. This method
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1113 * permits passing 128 bytes of arbitrary data between a mixer application
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1114 * and the mixer driver. Interpretation of the record is defined by
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1115 * the particular mixer driver.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1116 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1117 typedef unsigned char mixer_record[128];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1118
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1119 #define SOUND_MIXER_ACCESS __SIOWR('M', 102, mixer_record)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1120
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1121 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1122 * Two ioctls for special souncard function (OSS/Free only)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1123 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1124 #define SOUND_MIXER_AGC _SIOWR('M', 103, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1125 #define SOUND_MIXER_3DSE _SIOWR('M', 104, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1126 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1127 * The SOUND_MIXER_PRIVATE# commands can be redefined by low level drivers.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1128 * These features can be used when accessing device specific features.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1129 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1130 #define SOUND_MIXER_PRIVATE1 __SIOWR('M', 111, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1131 #define SOUND_MIXER_PRIVATE2 __SIOWR('M', 112, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1132 #define SOUND_MIXER_PRIVATE3 __SIOWR('M', 113, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1133 #define SOUND_MIXER_PRIVATE4 __SIOWR('M', 114, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1134 #define SOUND_MIXER_PRIVATE5 __SIOWR('M', 115, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1135
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1136
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1137 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1138 * SOUND_MIXER_GETLEVELS and SOUND_MIXER_SETLEVELS calls can be used
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1139 * for querying current mixer settings from the driver and for loading
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1140 * default volume settings _prior_ activating the mixer (loading
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1141 * doesn't affect current state of the mixer hardware). These calls
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1142 * are for internal use only.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1143 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1144
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1145 typedef struct mixer_vol_table {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1146 int num; /* Index to volume table */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1147 char name[32];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1148 int levels[32];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1149 } mixer_vol_table;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1150
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1151 #define SOUND_MIXER_GETLEVELS __SIOWR('M', 116, mixer_vol_table)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1152 #define SOUND_MIXER_SETLEVELS __SIOWR('M', 117, mixer_vol_table)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1153
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1154 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1155 * An ioctl for identifying the driver version. It will return value
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1156 * of the SOUND_VERSION macro used when compiling the driver.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1157 * This call was introduced in OSS version 3.6 and it will not work
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1158 * with earlier versions (returns EINVAL).
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1159 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1160 #define OSS_GETVERSION __SIOR ('M', 118, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1161 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1162 * Calls to set/get the recording gain for the currently active
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1163 * recording source. These calls automatically map to the right control.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1164 * Note that these calls are not supported by all drivers. In this case
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1165 * the call will return -1 with errno set to EINVAL
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1166 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1167 * The _MONGAIN work in similar way but set/get the monitoring gain for
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1168 * the currently selected recording source.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1169 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1170 #define SOUND_MIXER_READ_RECGAIN __SIOR ('M', 119, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1171 #define SOUND_MIXER_WRITE_RECGAIN __SIOWR('M', 119, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1172 #define SOUND_MIXER_READ_MONGAIN __SIOR ('M', 120, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1173 #define SOUND_MIXER_WRITE_MONGAIN __SIOWR('M', 120, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1174
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1175 /*************************************************
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1176 * Extended mixer interface (OSS 4.0 and later) *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1177 *************************************************/
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1178 #define SYSINFO_FILL_SIZE 256
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1179
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1180 typedef struct oss_sysinfo {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1181 char product[32]; /* For example OSS/Free, OSS/Linux or OSS/Solaris */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1182 char version[32]; /* For example 4.0a */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1183 int versionnum; /* See OSS_GETVERSION */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1184 char options[128]; /* Reserved */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1185
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1186 int numaudios; /* # of audio/dsp devices */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1187 int openedaudio[8]; /* Bit mask telling which audio devices are busy */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1188
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1189 int numsynths; /* # of availavle synth devices */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1190 int nummidis; /* # of available MIDI ports */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1191 int numtimers; /* # of available timer devices */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1192 int nummixers; /* # of mixer devices */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1193
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1194 int filler[SYSINFO_FILL_SIZE]; /* For future expansion (set to -1) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1195 } oss_sysinfo;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1196
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1197 typedef struct oss_mixext {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1198 int dev; /* Mixer device number */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1199 int ctrl; /* Controller number */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1200 int type; /* Entry type */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1201 # define MIXT_DEVROOT 0 /* Device root entry */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1202 # define MIXT_GROUP 1 /* Controller group */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1203 # define MIXT_ONOFF 2 /* OFF (0) or ON (1) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1204 # define MIXT_ENUM 3 /* Enumerated (0 to maxvalue) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1205 # define MIXT_MONOSLIDER 4 /* Mono slider (0 to 100) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1206 # define MIXT_STEREOSLIDER 5 /* Stereo slider (dual 0 to 100) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1207 # define MIXT_MESSAGE 6 /* (Readable) textual message */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1208 # define MIXT_MONOVU 7 /* VU meter value (mono) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1209 # define MIXT_STEREOVU 8 /* VU meter value (stereo) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1210 # define MIXT_MONOPEAK 9 /* VU meter peak value (mono) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1211 # define MIXT_STEREOPEAK 10 /* VU meter peak value (stereo) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1212 # define MIXT_RADIOGROUP 11 /* Radio button group */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1213 # define MIXT_MARKER 12 /* Separator between normal and extension entries */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1214 # define MIXT_VALUE 13 /* Decimal value entry */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1215 # define MIXT_HEXVALUE 14 /* Hexadecimal value entry */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1216 # define MIXT_MONODB 15 /* Mono atten. slider (0 to -144) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1217 # define MIXT_STEREODB 16 /* Stereo atten. slider (dual 0 to -144) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1218 # define MIXT_SLIDER 17 /* Slider (mono) with full integer range */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1219 # define MIXT_3D 18
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1220
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1221
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1222 /* Possible value range (minvalue to maxvalue) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1223 /* Note that maxvalue may also be smaller than minvalue */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1224 int maxvalue;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1225 int minvalue;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1226
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1227 int flags;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1228 # define MIXF_READABLE 0x00000001 /* Has readable value */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1229 # define MIXF_WRITEABLE 0x00000002 /* Has writeable value */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1230 char id[16]; /* Mnemonic ID (for linking with user space info) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1231 int parent; /* Entry# of parent (group) node (-1 if root) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1232
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1233 int dummy; /* Internal use */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1234
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1235 int timestamp;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1236
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1237 char data[64]; /* Misc data (entry type dependent) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1238 unsigned int enum_mask; /* Mask of allowed enum values */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1239 int control_no; /* SOUND_MIXER_VOLUME..SOUND_MIXER_MIDI */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1240 /* (-1 means not indicated) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1241 int desc; /* Descriptive code. For future use. */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1242 int filler[16];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1243 } oss_mixext;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1244
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1245 typedef struct oss_mixext_root {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1246 char id[16];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1247 char name[48];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1248 } oss_mixext_root;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1249
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1250 typedef struct oss_mixer_value {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1251 int dev;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1252 int ctrl;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1253 int value;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1254 int flags; /* Reserved for future use. Initialize to 0 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1255 int timestamp; /* Must be set to oss_mixext.timestamp */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1256 int filler[8]; /* Reserved for future use. Initialize to 0 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1257 } oss_mixer_value;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1258
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1259 #define OPEN_READ PCM_ENABLE_INPUT
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1260 #define OPEN_WRITE PCM_ENABLE_OUTPUT
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1261 #define OPEN_READWRITE (OPEN_READ|OPEN_WRITE)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1262
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1263 typedef struct oss_audioinfo {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1264 int dev; /* Audio device number */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1265 char name[64];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1266 int busy; /* 0, OPEN_READ, OPEN_WRITE or OPEN_READWRITE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1267 int pid;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1268 int caps; /* DSP_CAP_INPUT, DSP_CAP_OUTPUT */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1269 int iformats, oformats;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1270 int magic; /* Reserved for internal use */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1271 char cmd[64]; /* Command using the device */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1272 int card_number;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1273 int port_number;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1274 int mixer_dev;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1275 int real_device; /* This is the right /dev/dsp# device to open */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1276 int enabled; /* 1=enabled, 0=device not ready at this moment */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1277 int filler[251];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1278 } oss_audioinfo;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1279
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1280 #define OSS_SYSINFO __SIOR ('X', 1, oss_sysinfo)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1281
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1282 #define SNDCTL_MIX_NRMIX __SIOR ('X', 2, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1283 #define SNDCTL_MIX_NREXT __SIOWR('X', 3, int)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1284 #define SNDCTL_MIX_EXTINFO __SIOWR('X', 4, oss_mixext)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1285 #define SNDCTL_MIX_READ __SIOWR('X', 5, oss_mixer_value)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1286 #define SNDCTL_MIX_WRITE __SIOWR('X', 6, oss_mixer_value)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1287
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1288 #define SNDCTL_AUDIOINFO __SIOWR('X', 7, oss_audioinfo)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1289
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1290 /* ioctl codes 'X', 200-255 are reserved for internal use */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1291
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1292
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1293 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1294 * Level 2 event types for /dev/sequencer
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1295 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1296
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1297 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1298 * The 4 most significant bits of byte 0 specify the class of
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1299 * the event:
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1300 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1301 * 0x8X = system level events,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1302 * 0x9X = device/port specific events, event[1] = device/port,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1303 * The last 4 bits give the subtype:
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1304 * 0x02 = Channel event (event[3] = chn).
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1305 * 0x01 = note event (event[4] = note).
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1306 * (0x01 is not used alone but always with bit 0x02).
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1307 * event[2] = MIDI message code (0x80=note off etc.)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1308 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1309 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1310
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1311 #define EV_SEQ_LOCAL 0x80
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1312 #define EV_TIMING 0x81
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1313 #define EV_CHN_COMMON 0x92
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1314 #define EV_CHN_VOICE 0x93
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1315 #define EV_SYSEX 0x94
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1316 #define EV_SYSTEM 0x95 /* MIDI system and real time messages (input only) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1317 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1318 * Event types 200 to 220 are reserved for application use.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1319 * These numbers will not be used by the driver.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1320 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1321
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1322 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1323 * Events for event type EV_CHN_VOICE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1324 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1325
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1326 #define MIDI_NOTEOFF 0x80
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1327 #define MIDI_NOTEON 0x90
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1328 #define MIDI_KEY_PRESSURE 0xA0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1329
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1330 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1331 * Events for event type EV_CHN_COMMON
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1332 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1333
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1334 #define MIDI_CTL_CHANGE 0xB0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1335 #define MIDI_PGM_CHANGE 0xC0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1336 #define MIDI_CHN_PRESSURE 0xD0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1337 #define MIDI_PITCH_BEND 0xE0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1338
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1339 #define MIDI_SYSTEM_PREFIX 0xF0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1340
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1341 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1342 * Timer event types
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1343 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1344 #define TMR_WAIT_REL 1 /* Time relative to the prev time */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1345 #define TMR_WAIT_ABS 2 /* Absolute time since TMR_START */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1346 #define TMR_STOP 3
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1347 #define TMR_START 4
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1348 #define TMR_CONTINUE 5
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1349 #define TMR_TEMPO 6
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1350 #define TMR_ECHO 8
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1351 #define TMR_CLOCK 9 /* MIDI clock */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1352 #define TMR_SPP 10 /* Song position pointer */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1353 #define TMR_TIMESIG 11 /* Time signature */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1354
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1355 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1356 * Local event types
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1357 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1358 #define LOCL_STARTAUDIO 1
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1359 #define LOCL_STARTAUDIO2 2
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1360 #define LOCL_STARTAUDIO3 3
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1361 #define LOCL_STARTAUDIO4 4
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1362
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1363 #if (!defined(__KERNEL__) && !defined(KERNEL) && !defined(INKERNEL) && !defined(_KERNEL)) || defined(USE_SEQ_MACROS)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1364 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1365 * Some convenience macros to simplify programming of the
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1366 * /dev/sequencer interface
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1367 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1368 * These macros define the API which should be used when possible.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1369 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1370 #define SEQ_DECLAREBUF() SEQ_USE_EXTBUF()
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1371
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1372 void seqbuf_dump(void); /* This function must be provided by programs */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1373
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1374 EXTERNC int OSS_init(int seqfd, int buflen);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1375 EXTERNC void OSS_seqbuf_dump(int fd, unsigned char *buf, int buflen);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1376 EXTERNC void OSS_seq_advbuf(int len, int fd, unsigned char *buf,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1377 int buflen);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1378 EXTERNC void OSS_seq_needbuf(int len, int fd, unsigned char *buf,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1379 int buflen);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1380 EXTERNC void OSS_patch_caching(int dev, int chn, int patch, int fd,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1381 unsigned char *buf, int buflen);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1382 EXTERNC void OSS_drum_caching(int dev, int chn, int patch, int fd,
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1383 unsigned char *buf, int buflen);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1384 EXTERNC void OSS_write_patch(int fd, unsigned char *buf, int len);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1385 EXTERNC int OSS_write_patch2(int fd, unsigned char *buf, int len);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1386
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1387 #define SEQ_PM_DEFINES int __foo_bar___
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1388 #ifdef OSSLIB
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1389 # define SEQ_USE_EXTBUF() \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1390 EXTERNC unsigned char *_seqbuf; \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1391 EXTERNC int _seqbuflen;EXTERNC int _seqbufptr
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1392 # define SEQ_DEFINEBUF(len) SEQ_USE_EXTBUF();static int _requested_seqbuflen=len
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1393 # define _SEQ_ADVBUF(len) OSS_seq_advbuf(len, seqfd, _seqbuf, _seqbuflen)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1394 # define _SEQ_NEEDBUF(len) OSS_seq_needbuf(len, seqfd, _seqbuf, _seqbuflen)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1395 # define SEQ_DUMPBUF() OSS_seqbuf_dump(seqfd, _seqbuf, _seqbuflen)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1396
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1397 # define SEQ_LOAD_GMINSTR(dev, instr) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1398 OSS_patch_caching(dev, -1, instr, seqfd, _seqbuf, _seqbuflen)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1399 # define SEQ_LOAD_GMDRUM(dev, drum) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1400 OSS_drum_caching(dev, -1, drum, seqfd, _seqbuf, _seqbuflen)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1401 #else /* !OSSLIB */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1402
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1403 # define SEQ_LOAD_GMINSTR(dev, instr)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1404 # define SEQ_LOAD_GMDRUM(dev, drum)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1405
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1406 # define SEQ_USE_EXTBUF() \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1407 EXTERNC unsigned char _seqbuf[]; \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1408 EXTERNC int _seqbuflen;EXTERNC int _seqbufptr
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1409
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1410 #ifndef USE_SIMPLE_MACROS
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1411 /* Sample seqbuf_dump() implementation:
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1412 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1413 * SEQ_DEFINEBUF (2048); -- Defines a buffer for 2048 bytes
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1414 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1415 * int seqfd; -- The file descriptor for /dev/sequencer.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1416 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1417 * void
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1418 * seqbuf_dump ()
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1419 * {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1420 * if (_seqbufptr)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1421 * if (write (seqfd, _seqbuf, _seqbufptr) == -1)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1422 * {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1423 * perror ("write /dev/sequencer");
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1424 * exit (-1);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1425 * }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1426 * _seqbufptr = 0;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1427 * }
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1428 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1429
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1430 #define SEQ_DEFINEBUF(len) unsigned char _seqbuf[len]; int _seqbuflen = len;int _seqbufptr = 0
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1431 #define _SEQ_NEEDBUF(len) if ((_seqbufptr+(len)) > _seqbuflen) seqbuf_dump()
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1432 #define _SEQ_ADVBUF(len) _seqbufptr += len
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1433 #define SEQ_DUMPBUF seqbuf_dump
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1434 #else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1435 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1436 * This variation of the sequencer macros is used just to format one event
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1437 * using fixed buffer.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1438 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1439 * The program using the macro library must define the following macros before
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1440 * using this library.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1441 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1442 * #define _seqbuf name of the buffer (unsigned char[])
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1443 * #define _SEQ_ADVBUF(len) If the applic needs to know the exact
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1444 * size of the event, this macro can be used.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1445 * Otherwise this must be defined as empty.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1446 * #define _seqbufptr Define the name of index variable or 0 if
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1447 * not required.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1448 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1449 #define _SEQ_NEEDBUF(len) /* empty */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1450 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1451 #endif /* !OSSLIB */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1452
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1453 #define SEQ_VOLUME_MODE(dev, mode) {_SEQ_NEEDBUF(8);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1454 _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1455 _seqbuf[_seqbufptr+1] = SEQ_VOLMODE;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1456 _seqbuf[_seqbufptr+2] = (dev);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1457 _seqbuf[_seqbufptr+3] = (mode);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1458 _seqbuf[_seqbufptr+4] = 0;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1459 _seqbuf[_seqbufptr+5] = 0;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1460 _seqbuf[_seqbufptr+6] = 0;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1461 _seqbuf[_seqbufptr+7] = 0;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1462 _SEQ_ADVBUF(8);}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1463
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1464 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1465 * Midi voice messages
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1466 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1467
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1468 #define _CHN_VOICE(dev, event, chn, note, parm) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1469 {_SEQ_NEEDBUF(8);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1470 _seqbuf[_seqbufptr] = EV_CHN_VOICE;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1471 _seqbuf[_seqbufptr+1] = (dev);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1472 _seqbuf[_seqbufptr+2] = (event);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1473 _seqbuf[_seqbufptr+3] = (chn);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1474 _seqbuf[_seqbufptr+4] = (note);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1475 _seqbuf[_seqbufptr+5] = (parm);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1476 _seqbuf[_seqbufptr+6] = (0);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1477 _seqbuf[_seqbufptr+7] = 0;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1478 _SEQ_ADVBUF(8);}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1479
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1480 #define SEQ_START_NOTE(dev, chn, note, vol) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1481 _CHN_VOICE(dev, MIDI_NOTEON, chn, note, vol)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1482
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1483 #define SEQ_STOP_NOTE(dev, chn, note, vol) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1484 _CHN_VOICE(dev, MIDI_NOTEOFF, chn, note, vol)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1485
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1486 #define SEQ_KEY_PRESSURE(dev, chn, note, pressure) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1487 _CHN_VOICE(dev, MIDI_KEY_PRESSURE, chn, note, pressure)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1488
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1489 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1490 * Midi channel messages
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1491 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1492
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1493 #define _CHN_COMMON(dev, event, chn, p1, p2, w14) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1494 {_SEQ_NEEDBUF(8);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1495 _seqbuf[_seqbufptr] = EV_CHN_COMMON;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1496 _seqbuf[_seqbufptr+1] = (dev);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1497 _seqbuf[_seqbufptr+2] = (event);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1498 _seqbuf[_seqbufptr+3] = (chn);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1499 _seqbuf[_seqbufptr+4] = (p1);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1500 _seqbuf[_seqbufptr+5] = (p2);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1501 *(short *)&_seqbuf[_seqbufptr+6] = (w14);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1502 _SEQ_ADVBUF(8);}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1503 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1504 * SEQ_SYSEX permits sending of sysex messages. (It may look that it permits
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1505 * sending any MIDI bytes but it's absolutely not possible. Trying to do
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1506 * so _will_ cause problems with MPU401 intelligent mode).
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1507 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1508 * Sysex messages are sent in blocks of 1 to 6 bytes. Longer messages must be
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1509 * sent by calling SEQ_SYSEX() several times (there must be no other events
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1510 * between them). First sysex fragment must have 0xf0 in the first byte
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1511 * and the last byte (buf[len-1] of the last fragment must be 0xf7. No byte
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1512 * between these sysex start and end markers cannot be larger than 0x7f. Also
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1513 * lengths of each fragments (except the last one) must be 6.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1514 *
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1515 * Breaking the above rules may work with some MIDI ports but is likely to
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1516 * cause fatal problems with some other devices (such as MPU401).
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1517 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1518 #define SEQ_SYSEX(dev, buf, len) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1519 {int ii, ll=(len); \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1520 unsigned char *bufp=buf;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1521 if (ll>6)ll=6;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1522 _SEQ_NEEDBUF(8);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1523 _seqbuf[_seqbufptr] = EV_SYSEX;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1524 _seqbuf[_seqbufptr+1] = (dev);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1525 for(ii=0;ii<ll;ii++)\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1526 _seqbuf[_seqbufptr+ii+2] = bufp[ii];\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1527 for(ii=ll;ii<6;ii++)\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1528 _seqbuf[_seqbufptr+ii+2] = 0xff;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1529 _SEQ_ADVBUF(8);}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1530
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1531 #define SEQ_CHN_PRESSURE(dev, chn, pressure) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1532 _CHN_COMMON(dev, MIDI_CHN_PRESSURE, chn, pressure, 0, 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1533
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1534 #define SEQ_SET_PATCH SEQ_PGM_CHANGE
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1535 #ifdef OSSLIB
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1536 # define SEQ_PGM_CHANGE(dev, chn, patch) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1537 {OSS_patch_caching(dev, chn, patch, seqfd, _seqbuf, _seqbuflen); \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1538 _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0);}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1539 #else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1540 # define SEQ_PGM_CHANGE(dev, chn, patch) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1541 _CHN_COMMON(dev, MIDI_PGM_CHANGE, chn, patch, 0, 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1542 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1543
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1544 #define SEQ_CONTROL(dev, chn, controller, value) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1545 _CHN_COMMON(dev, MIDI_CTL_CHANGE, chn, controller, 0, value)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1546
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1547 #define SEQ_BENDER(dev, chn, value) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1548 _CHN_COMMON(dev, MIDI_PITCH_BEND, chn, 0, 0, value)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1549
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1550
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1551 #define SEQ_V2_X_CONTROL(dev, voice, controller, value) {_SEQ_NEEDBUF(8);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1552 _seqbuf[_seqbufptr] = SEQ_EXTENDED;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1553 _seqbuf[_seqbufptr+1] = SEQ_CONTROLLER;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1554 _seqbuf[_seqbufptr+2] = (dev);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1555 _seqbuf[_seqbufptr+3] = (voice);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1556 _seqbuf[_seqbufptr+4] = (controller);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1557 _seqbuf[_seqbufptr+5] = ((value)&0xff);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1558 _seqbuf[_seqbufptr+6] = ((value>>8)&0xff);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1559 _seqbuf[_seqbufptr+7] = 0;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1560 _SEQ_ADVBUF(8);}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1561 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1562 * The following 5 macros are incorrectly implemented and obsolete.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1563 * Use SEQ_BENDER and SEQ_CONTROL (with proper controller) instead.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1564 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1565 #define SEQ_PITCHBEND(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER, value)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1566 #define SEQ_BENDER_RANGE(dev, voice, value) SEQ_V2_X_CONTROL(dev, voice, CTRL_PITCH_BENDER_RANGE, value)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1567 #define SEQ_EXPRESSION(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_EXPRESSION, value*128)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1568 #define SEQ_MAIN_VOLUME(dev, voice, value) SEQ_CONTROL(dev, voice, CTL_MAIN_VOLUME, (value*16383)/100)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1569 #define SEQ_PANNING(dev, voice, pos) SEQ_CONTROL(dev, voice, CTL_PAN, (pos+128) / 2)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1570
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1571 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1572 * Timing and syncronization macros
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1573 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1574
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1575 #define _TIMER_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1576 _seqbuf[_seqbufptr+0] = EV_TIMING; \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1577 _seqbuf[_seqbufptr+1] = (ev); \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1578 _seqbuf[_seqbufptr+2] = 0;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1579 _seqbuf[_seqbufptr+3] = 0;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1580 *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1581 _SEQ_ADVBUF(8);}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1582
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1583 #define SEQ_START_TIMER() _TIMER_EVENT(TMR_START, 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1584 #define SEQ_STOP_TIMER() _TIMER_EVENT(TMR_STOP, 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1585 #define SEQ_CONTINUE_TIMER() _TIMER_EVENT(TMR_CONTINUE, 0)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1586 #define SEQ_WAIT_TIME(ticks) _TIMER_EVENT(TMR_WAIT_ABS, ticks)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1587 #define SEQ_DELTA_TIME(ticks) _TIMER_EVENT(TMR_WAIT_REL, ticks)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1588 #define SEQ_ECHO_BACK(key) _TIMER_EVENT(TMR_ECHO, key)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1589 #define SEQ_SET_TEMPO(value) _TIMER_EVENT(TMR_TEMPO, value)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1590 #define SEQ_SONGPOS(pos) _TIMER_EVENT(TMR_SPP, pos)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1591 #define SEQ_TIME_SIGNATURE(sig) _TIMER_EVENT(TMR_TIMESIG, sig)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1592
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1593 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1594 * Local control events
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1595 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1596
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1597 #define _LOCAL_EVENT(ev, parm) {_SEQ_NEEDBUF(8);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1598 _seqbuf[_seqbufptr+0] = EV_SEQ_LOCAL; \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1599 _seqbuf[_seqbufptr+1] = (ev); \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1600 _seqbuf[_seqbufptr+2] = 0;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1601 _seqbuf[_seqbufptr+3] = 0;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1602 *(unsigned int *)&_seqbuf[_seqbufptr+4] = (parm); \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1603 _SEQ_ADVBUF(8);}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1604
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1605 #define SEQ_PLAYAUDIO(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO, devmask)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1606 #define SEQ_PLAYAUDIO2(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO2, devmask)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1607 #define SEQ_PLAYAUDIO3(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO3, devmask)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1608 #define SEQ_PLAYAUDIO4(devmask) _LOCAL_EVENT(LOCL_STARTAUDIO4, devmask)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1609 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1610 * Events for the level 1 interface only
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1611 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1612
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1613 #define SEQ_MIDIOUT(device, byte) {_SEQ_NEEDBUF(4);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1614 _seqbuf[_seqbufptr] = SEQ_MIDIPUTC;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1615 _seqbuf[_seqbufptr+1] = (byte);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1616 _seqbuf[_seqbufptr+2] = (device);\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1617 _seqbuf[_seqbufptr+3] = 0;\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1618 _SEQ_ADVBUF(4);}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1619
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1620 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1621 * Patch loading.
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1622 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1623 #ifdef OSSLIB
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1624 # define SEQ_WRPATCH(patchx, len) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1625 OSS_write_patch(seqfd, (char*)(patchx), len)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1626 # define SEQ_WRPATCH2(patchx, len) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1627 OSS_write_patch2(seqfd, (char*)(patchx), len)
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1628 #else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1629 # define SEQ_WRPATCH(patchx, len) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1630 {if (_seqbufptr) SEQ_DUMPBUF();\
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1631 if (write(seqfd, (char*)(patchx), len)==-1) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1632 perror("Write patch: /dev/sequencer");}
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1633 # define SEQ_WRPATCH2(patchx, len) \
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1634 (SEQ_DUMPBUF(), write(seqfd, (char*)(patchx), len))
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1635 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1636
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1637 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1638
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1639
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1640 #ifdef OSSLIB
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1641 extern int osslib_open(const char *path, int flags, int dummy);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1642 extern void ossclose(int fd);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1643 extern int osslib_write(int fd, const void *buf, int count);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1644 extern int osslib_read(int fd, void *buf, int count);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1645 extern int osslib_ioctl(int fd, unsigned int request, void *arg);
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1646 #else
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1647 # define osslib_open open
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1648 # define osslib_close close
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1649 # define osslib_write write
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1650 # define osslib_read read
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1651 # define osslib_ioctl ioctl
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1652 #endif
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1653
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1654 /*
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1655 * ioctl calls to be used in communication with coprocessors and
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1656 * DSP chips. ******** OBSOLETE CALLS - OSS/Free only **********
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1657 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1658
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1659 typedef struct copr_buffer {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1660 int command; /* Set to 0 if not used */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1661 int flags;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1662 #define CPF_NONE 0x0000
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1663 #define CPF_FIRST 0x0001 /* First block */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1664 #define CPF_LAST 0x0002 /* Last block */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1665 int len;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1666 int offs; /* If required by the device (0 if not used) */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1667
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1668 unsigned char data[4000]; /* NOTE! 4000 is not 4k */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1669 } copr_buffer;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1670
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1671 typedef struct copr_debug_buf {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1672 int command; /* Used internally. Set to 0 */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1673 int parm1;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1674 int parm2;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1675 int flags;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1676 int len; /* Length of data in bytes */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1677 } copr_debug_buf;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1678
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1679 typedef struct copr_msg {
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1680 int len;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1681 unsigned char data[4000];
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1682 } copr_msg;
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1683
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1684 #define SNDCTL_COPR_RESET __SIO ('C', 0) /* OBSOLETE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1685 #define SNDCTL_COPR_LOAD __SIOWR('C', 1, copr_buffer) /* OBSOLETE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1686 #define SNDCTL_COPR_RDATA __SIOWR('C', 2, copr_debug_buf) /* OBSOLETE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1687 #define SNDCTL_COPR_RCODE __SIOWR('C', 3, copr_debug_buf) /* OBSOLETE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1688 #define SNDCTL_COPR_WDATA __SIOW ('C', 4, copr_debug_buf) /* OBSOLETE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1689 #define SNDCTL_COPR_WCODE __SIOW ('C', 5, copr_debug_buf) /* OBSOLETE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1690 #define SNDCTL_COPR_RUN __SIOWR('C', 6, copr_debug_buf) /* OBSOLETE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1691 #define SNDCTL_COPR_HALT __SIOWR('C', 7, copr_debug_buf) /* OBSOLETE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1692 #define SNDCTL_COPR_SENDMSG __SIOWR('C', 8, copr_msg) /* OBSOLETE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1693 #define SNDCTL_COPR_RCVMSG __SIOR ('C', 9, copr_msg) /* OBSOLETE */
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1694
fa848bd484d8 [svn] Move plugins to Plugins/
nenolod
parents:
diff changeset
1695 #endif