1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2006 by Michael Sevakis
12 * All files in this archive are subject to the GNU General Public License.
13 * See the file COPYING in the source tree root for full license agreement.
15 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
16 * KIND, either express or implied.
18 ****************************************************************************/
24 #define HW_SAMPR_CAPS SAMPR_CAP_44 /* if not defined, default to 44100 */
27 /* These must be macros for comparison with SAMPR_CAP_* flags by the
28 preprocessor. Add samplerate index in descending order renumbering
29 the ones later in the list if any */
42 #define SAMPR_NUM_FREQ 12
44 /* sample rate values in HZ */
45 #define SAMPR_96 96000
46 #define SAMPR_88 88200
47 #define SAMPR_64 64000
48 #define SAMPR_48 48000
49 #define SAMPR_44 44100
50 #define SAMPR_32 32000
51 #define SAMPR_24 24000
52 #define SAMPR_22 22050
53 #define SAMPR_16 16000
54 #define SAMPR_12 12000
55 #define SAMPR_11 11025
58 /* sample rate capability bits */
59 #define SAMPR_CAP_96 (1 << FREQ_96)
60 #define SAMPR_CAP_88 (1 << FREQ_88)
61 #define SAMPR_CAP_64 (1 << FREQ_64)
62 #define SAMPR_CAP_48 (1 << FREQ_48)
63 #define SAMPR_CAP_44 (1 << FREQ_44)
64 #define SAMPR_CAP_32 (1 << FREQ_32)
65 #define SAMPR_CAP_24 (1 << FREQ_24)
66 #define SAMPR_CAP_22 (1 << FREQ_22)
67 #define SAMPR_CAP_16 (1 << FREQ_16)
68 #define SAMPR_CAP_12 (1 << FREQ_12)
69 #define SAMPR_CAP_11 (1 << FREQ_11)
70 #define SAMPR_CAP_8 (1 << FREQ_8)
71 #define SAMPR_CAP_ALL (SAMPR_CAP_96 | SAMPR_CAP_88 | SAMPR_CAP_64 | \
72 SAMPR_CAP_48 | SAMPR_CAP_44 | SAMPR_CAP_32 | \
73 SAMPR_CAP_24 | SAMPR_CAP_22 | SAMPR_CAP_16 | \
74 SAMPR_CAP_12 | SAMPR_CAP_11 | SAMPR_CAP_8)
76 /* Master list of all "standard" rates supported. */
77 extern const unsigned long audio_master_sampr_list
[SAMPR_NUM_FREQ
];
79 /** Hardware sample rates **/
81 /* Enumeration of supported frequencies where 0 is the highest rate
82 supported and REC_NUM_FREQUENCIES is the number available */
85 __HW_FREQ_START_INDEX
= -1, /* Make sure first in list is 0 */
88 #if (HW_SAMPR_CAPS & SAMPR_CAP_96) /* Macros and enums for each FREQ: */
89 HW_FREQ_96
, /* Index in enumeration */
90 #define HW_HAVE_96 /* Defined if this FREQ is defined */
91 #define HW_HAVE_96_(...) __VA_ARGS__ /* Output its parameters for this FREQ */
93 #define HW_HAVE_96_(...) /* Discards its parameters for this FREQ */
96 #if (HW_SAMPR_CAPS & SAMPR_CAP_88)
99 #define HW_HAVE_88_(...) __VA_ARGS__
101 #define HW_HAVE_88_(...)
104 #if (HW_SAMPR_CAPS & SAMPR_CAP_64)
107 #define HW_HAVE_64_(...) __VA_ARGS__
109 #define HW_HAVE_64_(...)
112 #if (HW_SAMPR_CAPS & SAMPR_CAP_48)
115 #define HW_HAVE_48_(...) __VA_ARGS__
117 #define HW_HAVE_48_(...)
120 #if (HW_SAMPR_CAPS & SAMPR_CAP_44)
123 #define HW_HAVE_44_(...) __VA_ARGS__
125 #define HW_HAVE_44_(...)
128 #if (HW_SAMPR_CAPS & SAMPR_CAP_32)
131 #define HW_HAVE_32_(...) __VA_ARGS__
133 #define HW_HAVE_32_(...)
136 #if (HW_SAMPR_CAPS & SAMPR_CAP_24)
139 #define HW_HAVE_24_(...) __VA_ARGS__
141 #define HW_HAVE_24_(...)
144 #if (HW_SAMPR_CAPS & SAMPR_CAP_22)
147 #define HW_HAVE_22_(...) __VA_ARGS__
149 #define HW_HAVE_22_(...)
152 #if (HW_SAMPR_CAPS & SAMPR_CAP_16)
155 #define HW_HAVE_16_(...) __VA_ARGS__
157 #define HW_HAVE_16_(...)
160 #if (HW_SAMPR_CAPS & SAMPR_CAP_12)
163 #define HW_HAVE_12_(...) __VA_ARGS__
165 #define HW_HAVE_12_(...)
168 #if (HW_SAMPR_CAPS & SAMPR_CAP_11)
171 #define HW_HAVE_11_(...) __VA_ARGS__
173 #define HW_HAVE_11_(...)
176 #if (HW_SAMPR_CAPS & SAMPR_CAP_8 )
179 #define HW_HAVE_8_(...) __VA_ARGS__
181 #define HW_HAVE_8_(...)
184 HW_FREQ_DEFAULT
= HW_FREQ_44
,
185 HW_SAMPR_DEFAULT
= SAMPR_44
,
186 }; /* enum hw_freq_indexes */
188 /* list of hardware sample rates */
189 extern const unsigned long hw_freq_sampr
[HW_NUM_FREQ
];
191 #ifdef HAVE_RECORDING
192 /* Enumeration of supported frequencies where 0 is the highest rate
193 supported and REC_NUM_FREQUENCIES is the number available */
194 enum rec_freq_indexes
196 __REC_FREQ_START_INDEX
= -1, /* Make sure first in list is 0 */
199 #if (REC_SAMPR_CAPS & SAMPR_CAP_96) /* Macros and enums for each FREQ: */
200 REC_FREQ_96
, /* Index in enumeration */
201 #define REC_HAVE_96 /* Defined if this FREQ is defined */
202 #define REC_HAVE_96_(...) __VA_ARGS__ /* Output its parameters for this FREQ */
204 #define REC_HAVE_96_(...) /* Discards its parameters for this FREQ */
207 #if (REC_SAMPR_CAPS & SAMPR_CAP_88)
210 #define REC_HAVE_88_(...) __VA_ARGS__
212 #define REC_HAVE_88_(...)
215 #if (REC_SAMPR_CAPS & SAMPR_CAP_64)
218 #define REC_HAVE_64_(...) __VA_ARGS__
220 #define REC_HAVE_64_(...)
223 #if (REC_SAMPR_CAPS & SAMPR_CAP_48)
226 #define REC_HAVE_48_(...) __VA_ARGS__
228 #define REC_HAVE_48_(...)
231 #if (REC_SAMPR_CAPS & SAMPR_CAP_44)
234 #define REC_HAVE_44_(...) __VA_ARGS__
236 #define REC_HAVE_44_(...)
239 #if (REC_SAMPR_CAPS & SAMPR_CAP_32)
242 #define REC_HAVE_32_(...) __VA_ARGS__
244 #define REC_HAVE_32_(...)
247 #if (REC_SAMPR_CAPS & SAMPR_CAP_24)
250 #define REC_HAVE_24_(...) __VA_ARGS__
252 #define REC_HAVE_24_(...)
255 #if (REC_SAMPR_CAPS & SAMPR_CAP_22)
258 #define REC_HAVE_22_(...) __VA_ARGS__
260 #define REC_HAVE_22_(...)
263 #if (REC_SAMPR_CAPS & SAMPR_CAP_16)
266 #define REC_HAVE_16_(...) __VA_ARGS__
268 #define REC_HAVE_16_(...)
271 #if (REC_SAMPR_CAPS & SAMPR_CAP_12)
274 #define REC_HAVE_12_(...) __VA_ARGS__
276 #define REC_HAVE_12_(...)
279 #if (REC_SAMPR_CAPS & SAMPR_CAP_11)
282 #define REC_HAVE_11_(...) __VA_ARGS__
284 #define REC_HAVE_11_(...)
287 #if (REC_SAMPR_CAPS & SAMPR_CAP_8 )
290 #define REC_HAVE_8_(...) __VA_ARGS__
292 #define REC_HAVE_8_(...)
295 }; /* enum rec_freq_indexes */
297 /* Default to 44.1kHz if not otherwise specified */
298 #ifndef REC_FREQ_DEFAULT
299 #define REC_FREQ_DEFAULT REC_FREQ_44
302 #define REC_FREQ_CFG_VAL_LIST &REC_HAVE_96_(",96") REC_HAVE_88_(",88") \
303 REC_HAVE_64_(",64") REC_HAVE_48_(",48") \
304 REC_HAVE_44_(",44") REC_HAVE_32_(",32") \
305 REC_HAVE_24_(",24") REC_HAVE_22_(",22") \
306 REC_HAVE_16_(",16") REC_HAVE_12_(",12") \
307 REC_HAVE_11_(",11") REC_HAVE_8_(",8")[1]
309 /* List of recording supported sample rates (set or subset of master list) */
310 extern const unsigned long rec_freq_sampr
[REC_NUM_FREQ
];
311 #endif /* HAVE_RECORDING */
313 #endif /* PCM_SAMPR_H */