summaryrefslogtreecommitdiff
path: root/apps/menus/recording_menu.c
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 /apps/menus/recording_menu.c
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 'apps/menus/recording_menu.c')
-rw-r--r--apps/menus/recording_menu.c30
1 files changed, 14 insertions, 16 deletions
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c
index 1bc84e90d2..62af2f94fe 100644
--- a/apps/menus/recording_menu.c
+++ b/apps/menus/recording_menu.c
@@ -67,21 +67,21 @@ int recmenu_callback(int action,const struct menu_item_ex *this_item);
67 67
68static int recsource_func(void) 68static int recsource_func(void)
69{ 69{
70 int n_opts = AUDIO_NUM_SOURCES; 70 int n_opts = REC_NUM_SOURCES;
71 71
72 static const struct opt_items names[AUDIO_NUM_SOURCES] = { 72 static const struct opt_items names[AUDIO_NUM_SOURCES] = {
73 [AUDIO_SRC_MIC] = { STR(LANG_RECORDING_SRC_MIC) }, 73 HAVE_MIC_REC_([AUDIO_SRC_MIC]
74 [AUDIO_SRC_LINEIN] = { STR(LANG_RECORDING_SRC_LINE) }, 74 = { STR(LANG_RECORDING_SRC_MIC) },)
75#ifdef HAVE_SPDIF_IN 75 HAVE_LINE_REC_([AUDIO_SRC_LINEIN]
76 [AUDIO_SRC_SPDIF] = { STR(LANG_RECORDING_SRC_DIGITAL) }, 76 = { STR(LANG_RECORDING_SRC_LINE) },)
77#endif 77 HAVE_SPDIF_REC_([AUDIO_SRC_SPDIF]
78#ifdef HAVE_FMRADIO_IN 78 = { STR(LANG_RECORDING_SRC_DIGITAL) },)
79 [AUDIO_SRC_FMRADIO] = { STR(LANG_FM_RADIO) } 79 HAVE_FMRADIO_REC_([AUDIO_SRC_FMRADIO]
80#endif 80 = { STR(LANG_FM_RADIO) },)
81 }; 81 };
82 82
83 /* caveat: assumes it's the last item! */ 83 /* caveat: assumes it's the last item! */
84#ifdef HAVE_FMRADIO_IN 84#ifdef HAVE_FMRADIO_REC
85 if (!radio_hardware_present()) 85 if (!radio_hardware_present())
86 n_opts--; 86 n_opts--;
87#endif 87#endif
@@ -145,15 +145,15 @@ static int recfrequency_func(void)
145 int rec_frequency; 145 int rec_frequency;
146 bool ret; 146 bool ret;
147 147
148#ifdef HAVE_SPDIF_IN 148#ifdef HAVE_SPDIF_REC
149 if (global_settings.rec_source == AUDIO_SRC_SPDIF) 149 if (global_settings.rec_source == REC_SRC_SPDIF)
150 { 150 {
151 /* Inform user that frequency follows the source's frequency */ 151 /* Inform user that frequency follows the source's frequency */
152 opts[0].string = ID2P(LANG_SOURCE_FREQUENCY); 152 opts[0].string = ID2P(LANG_SOURCE_FREQUENCY);
153 opts[0].voice_id = LANG_SOURCE_FREQUENCY; 153 opts[0].voice_id = LANG_SOURCE_FREQUENCY;
154 n_opts = 1; 154 n_opts = 1;
155 rec_frequency = 0; 155 rec_frequency = 0;
156} 156 }
157 else 157 else
158#endif 158#endif
159 { 159 {
@@ -189,9 +189,7 @@ static int recfrequency_func(void)
189 &rec_frequency, INT, opts, n_opts, NULL ); 189 &rec_frequency, INT, opts, n_opts, NULL );
190 190
191 if (!ret 191 if (!ret
192#ifdef HAVE_SPDIF_IN 192 HAVE_SPDIF_REC_( && global_settings.rec_source != REC_SRC_SPDIF)
193 && global_settings.rec_source != AUDIO_SRC_SPDIF
194#endif
195 ) 193 )
196 { 194 {
197 /* Translate back to full index */ 195 /* Translate back to full index */