summaryrefslogtreecommitdiff
path: root/firmware/export/audio.h
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2007-05-20 20:26:36 +0000
committerMichael Sevakis <jethead71@rockbox.org>2007-05-20 20:26:36 +0000
commit8f659ae8d3845b40ff93ebfa3692f7b2302e6c7e (patch)
treea54381487762ec69bdec99f69dd24b148d3400b9 /firmware/export/audio.h
parent731d7a16c3f606d586237fc8b4086ee54a0d0704 (diff)
downloadrockbox-8f659ae8d3845b40ff93ebfa3692f7b2302e6c7e.tar.gz
rockbox-8f659ae8d3845b40ff93ebfa3692f7b2302e6c7e.zip
Use bitmasks to define which inputs are available. Makes it easier to remove old assumptions of which are available. Inspired by e200 being unique in having FM Radio and Mic but no Line. Doesn't remove the assumption that Mic is available or that one of Mic and/or Line is available just to avoid excessive #ifdef'ing until needed.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13448 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'firmware/export/audio.h')
-rw-r--r--firmware/export/audio.h47
1 files changed, 26 insertions, 21 deletions
diff --git a/firmware/export/audio.h b/firmware/export/audio.h
index ebcb316cd9..a0da846215 100644
--- a/firmware/export/audio.h
+++ b/firmware/export/audio.h
@@ -127,32 +127,37 @@ enum rec_channel_modes
127#define CHN_CAP_ALL (CHN_CAP_STEREO | CHN_CAP_MONO) 127#define CHN_CAP_ALL (CHN_CAP_STEREO | CHN_CAP_MONO)
128#endif /* CONFIG_CODEC == SWCODEC */ 128#endif /* CONFIG_CODEC == SWCODEC */
129 129
130/* audio sources */
131enum audio_sources 130enum audio_sources
132{ 131{
133 AUDIO_SRC_PLAYBACK = -1, /* for audio playback (default) */ 132 AUDIO_SRC_PLAYBACK = -1, /* Virtual source */
134 AUDIO_SRC_MIC, /* monitor mic */ 133 HAVE_MIC_IN_(AUDIO_SRC_MIC,)
135 AUDIO_SRC_LINEIN, /* monitor line in */ 134 HAVE_LINE_IN_(AUDIO_SRC_LINEIN,)
136#ifdef HAVE_SPDIF_IN 135 HAVE_SPDIF_IN_(AUDIO_SRC_SPDIF,)
137 AUDIO_SRC_SPDIF, /* monitor spdif */ 136 HAVE_FMRADIO_IN_(AUDIO_SRC_FMRADIO,)
138#endif 137 AUDIO_NUM_SOURCES,
139#if defined(HAVE_FMRADIO_IN) || CONFIG_TUNER 138 AUDIO_SRC_MAX = AUDIO_NUM_SOURCES-1,
140 AUDIO_SRC_FMRADIO, /* monitor fm radio */ 139 AUDIO_SRC_DEFAULT = AUDIO_SRC_PLAYBACK
141#endif
142 /* define new audio sources above this line */
143 AUDIO_SOURCE_LIST_END,
144 /* AUDIO_SRC_FMRADIO must be declared #if CONFIG_TUNER but is not in
145 the list of recordable sources. HAVE_FMRADIO_IN implies CONFIG_TUNER. */
146#if defined(HAVE_FMRADIO_IN) || (CONFIG_TUNER == 0)
147 AUDIO_NUM_SOURCES = AUDIO_SOURCE_LIST_END,
148#else
149 AUDIO_NUM_SOURCES = AUDIO_SOURCE_LIST_END-1,
150#endif
151 AUDIO_SRC_MAX = AUDIO_NUM_SOURCES-1
152}; 140};
153 141
142#ifdef HAVE_RECORDING
143/* Recordable source implies it has the input as well */
144
145/* For now there's no restrictions on any targets with which inputs
146 are recordable so define them as equivalent - if they do differ,
147 special handling is needed right now. */
148enum rec_sources
149{
150 __REC_SRC_FIRST = -1,
151 HAVE_MIC_REC_(REC_SRC_MIC,)
152 HAVE_LINE_REC_(REC_SRC_LINEIN,)
153 HAVE_SPDIF_REC_(REC_SRC_SPDIF,)
154 HAVE_FMRADIO_REC_(REC_SRC_FMRADIO,)
155 REC_NUM_SOURCES
156};
157#endif /* HAVE_RECORDING */
158
154#if CONFIG_CODEC == SWCODEC 159#if CONFIG_CODEC == SWCODEC
155/* selects an audio source for recording or playback */ 160/* selects a source to monitor for recording or playback */
156#define SRCF_PLAYBACK 0x0000 /* default */ 161#define SRCF_PLAYBACK 0x0000 /* default */
157#define SRCF_RECORDING 0x1000 162#define SRCF_RECORDING 0x1000
158#if CONFIG_TUNER 163#if CONFIG_TUNER