diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/recorder/recording.c | 23 | ||||
-rw-r--r-- | apps/settings.c | 6 | ||||
-rw-r--r-- | apps/sound_menu.c | 20 |
3 files changed, 39 insertions, 10 deletions
diff --git a/apps/recorder/recording.c b/apps/recorder/recording.c index cf361eea76..854e979ade 100644 --- a/apps/recorder/recording.c +++ b/apps/recorder/recording.c | |||
@@ -577,6 +577,11 @@ bool recording_screen(void) | |||
577 | #endif | 577 | #endif |
578 | talk_buffer_steal(); /* will use the mp3 buffer */ | 578 | talk_buffer_steal(); /* will use the mp3 buffer */ |
579 | 579 | ||
580 | #ifdef HAVE_SPDIF_POWER | ||
581 | /* Tell recording whether we want S/PDIF power enabled at all times */ | ||
582 | audio_set_spdif_power_setting(global_settings.spdif_enable); | ||
583 | #endif | ||
584 | |||
580 | audio_set_recording_options(global_settings.rec_frequency, | 585 | audio_set_recording_options(global_settings.rec_frequency, |
581 | global_settings.rec_quality, | 586 | global_settings.rec_quality, |
582 | global_settings.rec_source, | 587 | global_settings.rec_source, |
@@ -1011,6 +1016,7 @@ bool recording_screen(void) | |||
1011 | unsigned int dseconds, dhours, dminutes; | 1016 | unsigned int dseconds, dhours, dminutes; |
1012 | unsigned long num_recorded_bytes; | 1017 | unsigned long num_recorded_bytes; |
1013 | int pos = 0; | 1018 | int pos = 0; |
1019 | char spdif_sfreq[8]; | ||
1014 | 1020 | ||
1015 | update_countdown = 5; | 1021 | update_countdown = 5; |
1016 | last_seconds = seconds; | 1022 | last_seconds = seconds; |
@@ -1259,12 +1265,21 @@ bool recording_screen(void) | |||
1259 | 2+PM_HEIGHT, true); | 1265 | 2+PM_HEIGHT, true); |
1260 | } | 1266 | } |
1261 | } | 1267 | } |
1262 | 1268 | /* Can't measure S/PDIF sample rate on Archos yet */ | |
1269 | #if CONFIG_CODEC != MAS3587F && defined(HAVE_SPDIF_IN) | ||
1270 | if (global_settings.rec_source == SOURCE_SPDIF) | ||
1271 | snprintf(spdif_sfreq, 8, "%dHz", audio_get_spdif_sample_rate()); | ||
1272 | #else | ||
1273 | (void)spdif_sfreq; | ||
1274 | #endif | ||
1263 | snprintf(buf, 32, "%s %s", | 1275 | snprintf(buf, 32, "%s %s", |
1276 | #if CONFIG_CODEC != MAS3587F && defined(HAVE_SPDIF_IN) | ||
1277 | global_settings.rec_source == SOURCE_SPDIF ? | ||
1278 | spdif_sfreq : | ||
1279 | #endif | ||
1264 | freq_str[global_settings.rec_frequency], | 1280 | freq_str[global_settings.rec_frequency], |
1265 | global_settings.rec_channels? | 1281 | global_settings.rec_channels ? |
1266 | str(LANG_CHANNEL_MONO):str(LANG_CHANNEL_STEREO)); | 1282 | str(LANG_CHANNEL_MONO) : str(LANG_CHANNEL_STEREO)); |
1267 | |||
1268 | FOR_NB_SCREENS(i) | 1283 | FOR_NB_SCREENS(i) |
1269 | screens[i].puts(0, 5+PM_HEIGHT, buf); | 1284 | screens[i].puts(0, 5+PM_HEIGHT, buf); |
1270 | 1285 | ||
diff --git a/apps/settings.c b/apps/settings.c index ad1ec70c07..ccf0acd8f9 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -94,7 +94,7 @@ const char rec_base_directory[] = REC_BASE_DIR; | |||
94 | #include "dsp.h" | 94 | #include "dsp.h" |
95 | #endif | 95 | #endif |
96 | 96 | ||
97 | #define CONFIG_BLOCK_VERSION 41 | 97 | #define CONFIG_BLOCK_VERSION 42 |
98 | #define CONFIG_BLOCK_SIZE 512 | 98 | #define CONFIG_BLOCK_SIZE 512 |
99 | #define RTC_BLOCK_SIZE 44 | 99 | #define RTC_BLOCK_SIZE 44 |
100 | 100 | ||
@@ -504,7 +504,11 @@ static const struct bit_entry hd_bits[] = | |||
504 | "off,00:05,00:10,00:15,00:30,01:00,01:14,01:20,02:00,04:00,06:00,08:00,10:00,12:00,18:00,24:00" }, | 504 | "off,00:05,00:10,00:15,00:30,01:00,01:14,01:20,02:00,04:00,06:00,08:00,10:00,12:00,18:00,24:00" }, |
505 | {1, S_O(rec_channels), 0, "rec channels", "stereo,mono" }, | 505 | {1, S_O(rec_channels), 0, "rec channels", "stereo,mono" }, |
506 | {4, S_O(rec_mic_gain), 4, "rec mic gain", NULL }, | 506 | {4, S_O(rec_mic_gain), 4, "rec mic gain", NULL }, |
507 | #ifdef HAVE_SPDIF_IN | ||
508 | {2, S_O(rec_source), 0 /* 0=mic */, "rec source", "mic,line,spdif" }, | ||
509 | #else | ||
507 | {1, S_O(rec_source), 0 /* 0=mic */, "rec source", "mic,line" }, | 510 | {1, S_O(rec_source), 0 /* 0=mic */, "rec source", "mic,line" }, |
511 | #endif | ||
508 | {3, S_O(rec_frequency), 0, /* 0=44.1kHz */ | 512 | {3, S_O(rec_frequency), 0, /* 0=44.1kHz */ |
509 | "rec frequency", "44,48,32,22,24,16" }, | 513 | "rec frequency", "44,48,32,22,24,16" }, |
510 | {4, S_O(rec_left_gain), 2, /* 0dB */ | 514 | {4, S_O(rec_left_gain), 2, /* 0dB */ |
diff --git a/apps/sound_menu.c b/apps/sound_menu.c index 1d389f30de..d3377a3efa 100644 --- a/apps/sound_menu.c +++ b/apps/sound_menu.c | |||
@@ -302,6 +302,8 @@ static bool recsource(void) | |||
302 | sizeof(names)/sizeof(struct opt_items), NULL ); | 302 | sizeof(names)/sizeof(struct opt_items), NULL ); |
303 | } | 303 | } |
304 | 304 | ||
305 | /* To be removed when we add support for sample rates and channel settings */ | ||
306 | #ifndef HAVE_UDA1380 | ||
305 | static bool recfrequency(void) | 307 | static bool recfrequency(void) |
306 | { | 308 | { |
307 | static const struct opt_items names[] = { | 309 | static const struct opt_items names[] = { |
@@ -327,12 +329,11 @@ static bool recchannels(void) | |||
327 | &global_settings.rec_channels, INT, | 329 | &global_settings.rec_channels, INT, |
328 | names, 2, NULL ); | 330 | names, 2, NULL ); |
329 | } | 331 | } |
332 | #endif | ||
330 | 333 | ||
334 | #if CONFIG_CODEC == MAS3587F | ||
331 | static bool recquality(void) | 335 | static bool recquality(void) |
332 | { | 336 | { |
333 | #ifdef HAVE_UDA1380 | ||
334 | (void)recquality(); | ||
335 | #endif | ||
336 | return set_int(str(LANG_RECORDING_QUALITY), "", UNIT_INT, | 337 | return set_int(str(LANG_RECORDING_QUALITY), "", UNIT_INT, |
337 | &global_settings.rec_quality, | 338 | &global_settings.rec_quality, |
338 | NULL, 1, 0, 7, NULL ); | 339 | NULL, 1, 0, 7, NULL ); |
@@ -343,7 +344,7 @@ static bool receditable(void) | |||
343 | return set_bool(str(LANG_RECORDING_EDITABLE), | 344 | return set_bool(str(LANG_RECORDING_EDITABLE), |
344 | &global_settings.rec_editable); | 345 | &global_settings.rec_editable); |
345 | } | 346 | } |
346 | 347 | #endif | |
347 | 348 | ||
348 | static bool rectimesplit(void) | 349 | static bool rectimesplit(void) |
349 | { | 350 | { |
@@ -901,20 +902,29 @@ bool recording_menu(bool no_source) | |||
901 | struct menu_item items[13]; | 902 | struct menu_item items[13]; |
902 | bool result; | 903 | bool result; |
903 | 904 | ||
904 | #ifndef HAVE_UDA1380 | 905 | #if CONFIG_CODEC == MAS3587F |
905 | items[i].desc = ID2P(LANG_RECORDING_QUALITY); | 906 | items[i].desc = ID2P(LANG_RECORDING_QUALITY); |
906 | items[i++].function = recquality; | 907 | items[i++].function = recquality; |
907 | #endif | 908 | #endif |
909 | /* We don't support frequency selection for UDA1380 yet. Let it just stay at | ||
910 | the default 44100 Hz. */ | ||
911 | #ifndef HAVE_UDA1380 | ||
908 | items[i].desc = ID2P(LANG_RECORDING_FREQUENCY); | 912 | items[i].desc = ID2P(LANG_RECORDING_FREQUENCY); |
909 | items[i++].function = recfrequency; | 913 | items[i++].function = recfrequency; |
914 | #endif | ||
910 | if(!no_source) { | 915 | if(!no_source) { |
911 | items[i].desc = ID2P(LANG_RECORDING_SOURCE); | 916 | items[i].desc = ID2P(LANG_RECORDING_SOURCE); |
912 | items[i++].function = recsource; | 917 | items[i++].function = recsource; |
913 | } | 918 | } |
919 | /* We don't support other configurations than stereo yet either */ | ||
920 | #ifndef HAVE_UDA1380 | ||
914 | items[i].desc = ID2P(LANG_RECORDING_CHANNELS); | 921 | items[i].desc = ID2P(LANG_RECORDING_CHANNELS); |
915 | items[i++].function = recchannels; | 922 | items[i++].function = recchannels; |
923 | #endif | ||
924 | #if CONFIG_CODEC == MAS3587F | ||
916 | items[i].desc = ID2P(LANG_RECORDING_EDITABLE); | 925 | items[i].desc = ID2P(LANG_RECORDING_EDITABLE); |
917 | items[i++].function = receditable; | 926 | items[i++].function = receditable; |
927 | #endif | ||
918 | items[i].desc = ID2P(LANG_RECORD_TIMESPLIT); | 928 | items[i].desc = ID2P(LANG_RECORD_TIMESPLIT); |
919 | items[i++].function = rectimesplit; | 929 | items[i++].function = rectimesplit; |
920 | items[i].desc = ID2P(LANG_RECORD_PRERECORD_TIME); | 930 | items[i].desc = ID2P(LANG_RECORD_PRERECORD_TIME); |