1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 by Michael Sevakis
12 * Convert caps masks into HAVE_* defines
14 * This program is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU General Public License
16 * as published by the Free Software Foundation; either version 2
17 * of the License, or (at your option) any later version.
19 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 * KIND, either express or implied.
22 ****************************************************************************/
26 /* NOTE: Playback is implied in all this. Make sense? :) */
32 #define SRC_CAP_MIC (1 << SRC_MIC)
33 #define SRC_CAP_LINEIN (1 << SRC_LINEIN)
34 #define SRC_CAP_SPDIF (1 << SRC_SPDIF)
35 #define SRC_CAP_FMRADIO (1 << SRC_FMRADIO)
37 /* audio monitor mux sources */
38 #ifndef INPUT_SRC_CAPS
39 #define INPUT_SRC_CAPS 0 /* Nothing but playback */
43 #if (INPUT_SRC_CAPS & SRC_CAP_MIC)
45 #define HAVE_MIC_IN_(...) __VA_ARGS__
47 #define HAVE_MIC_IN_(...)
50 #if (INPUT_SRC_CAPS & SRC_CAP_LINEIN)
52 #define HAVE_LINE_IN_(...) __VA_ARGS__
54 #define HAVE_LINE_IN_(...)
57 #if (INPUT_SRC_CAPS & SRC_CAP_SPDIF)
59 #define HAVE_SPDIF_IN_(...) __VA_ARGS__
61 #define HAVE_SPDIF_IN_(...)
64 #if (INPUT_SRC_CAPS & SRC_CAP_FMRADIO)
65 #define HAVE_FMRADIO_IN
66 #define HAVE_FMRADIO_IN_(...) __VA_ARGS__
68 #define HAVE_FMRADIO_IN_(...)
71 #if INPUT_SRC_CAPS != 0 && (INPUT_SRC_CAPS & (INPUT_SRC_CAPS-1)) != 0
72 #define HAVE_MULTI_INPUT_SRC
76 /* Recordable source implies it has the input as well */
78 /* For now there's no restrictions on any targets with which inputs
79 are recordable so define them as equivalent - if they do differ,
80 special handling is needed right now. */
82 #define REC_SRC_CAPS INPUT_SRC_CAPS
86 #if (REC_SRC_CAPS & SRC_CAP_MIC)
88 #define HAVE_MIC_REC_(...) __VA_ARGS__
90 #define HAVE_MIC_REC_(...)
93 #if (REC_SRC_CAPS & SRC_CAP_LINEIN)
95 #define HAVE_LINE_REC_(...) __VA_ARGS__
97 #define HAVE_LINE_REC_(...)
100 #if (REC_SRC_CAPS & SRC_CAP_SPDIF)
101 #define HAVE_SPDIF_REC
102 #define HAVE_SPDIF_REC_(...) __VA_ARGS__
104 #define HAVE_SPDIF_REC_(...)
107 #if (REC_SRC_CAPS & SRC_CAP_FMRADIO)
108 #define HAVE_FMRADIO_REC
109 #define HAVE_FMRADIO_REC_(...) __VA_ARGS__
111 #define HAVE_FMRADIO_REC_(...)
114 #if REC_SRC_CAPS != 0 && (REC_SRC_CAPS & (REC_SRC_CAPS-1)) != 0
115 #define HAVE_MULTI_REC_SRC
118 #endif /* HAVE_RECORDING */