1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 by Michael Sevakis
12 * Convert caps masks into HAVE_* defines
14 * All files in this archive are subject to the GNU General Public License.
15 * See the file COPYING in the source tree root for full license agreement.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
24 /* NOTE: Playback is implied in all this. Make sense? :) */
30 #define SRC_CAP_MIC (1 << SRC_MIC)
31 #define SRC_CAP_LINEIN (1 << SRC_LINEIN)
32 #define SRC_CAP_SPDIF (1 << SRC_SPDIF)
33 #define SRC_CAP_FMRADIO (1 << SRC_FMRADIO)
35 /* audio monitor mux sources */
36 #ifndef INPUT_SRC_CAPS
37 #define INPUT_SRC_CAPS 0 /* Nothing but playback */
41 #if (INPUT_SRC_CAPS & SRC_CAP_MIC)
43 #define HAVE_MIC_IN_(...) __VA_ARGS__
45 #define HAVE_MIC_IN_(...)
48 #if (INPUT_SRC_CAPS & SRC_CAP_LINEIN)
50 #define HAVE_LINE_IN_(...) __VA_ARGS__
52 #define HAVE_LINE_IN_(...)
55 #if (INPUT_SRC_CAPS & SRC_CAP_SPDIF)
57 #define HAVE_SPDIF_IN_(...) __VA_ARGS__
59 #define HAVE_SPDIF_IN_(...)
62 #if (INPUT_SRC_CAPS & SRC_CAP_FMRADIO)
63 #define HAVE_FMRADIO_IN
64 #define HAVE_FMRADIO_IN_(...) __VA_ARGS__
66 #define HAVE_FMRADIO_IN_(...)
69 #if INPUT_SRC_CAPS != 0 && (INPUT_SRC_CAPS & (INPUT_SRC_CAPS-1)) != 0
70 #define HAVE_MULTI_INPUT_SRC
74 /* Recordable source implies it has the input as well */
76 /* For now there's no restrictions on any targets with which inputs
77 are recordable so define them as equivalent - if they do differ,
78 special handling is needed right now. */
80 #define REC_SRC_CAPS INPUT_SRC_CAPS
84 #if (REC_SRC_CAPS & SRC_CAP_MIC)
86 #define HAVE_MIC_REC_(...) __VA_ARGS__
88 #define HAVE_MIC_REC_(...)
91 #if (REC_SRC_CAPS & SRC_CAP_LINEIN)
93 #define HAVE_LINE_REC_(...) __VA_ARGS__
95 #define HAVE_LINE_REC_(...)
98 #if (REC_SRC_CAPS & SRC_CAP_SPDIF)
99 #define HAVE_SPDIF_REC
100 #define HAVE_SPDIF_REC_(...) __VA_ARGS__
102 #define HAVE_SPDIF_REC_(...)
105 #if (REC_SRC_CAPS & SRC_CAP_FMRADIO)
106 #define HAVE_FMRADIO_REC
107 #define HAVE_FMRADIO_REC_(...) __VA_ARGS__
109 #define HAVE_FMRADIO_REC_(...)
112 #if REC_SRC_CAPS != 0 && (REC_SRC_CAPS & (REC_SRC_CAPS-1)) != 0
113 #define HAVE_MULTI_REC_SRC
116 #endif /* HAVE_RECORDING */