From db734b41d5004fabd7a0cb110040d7a05bd0adb4 Mon Sep 17 00:00:00 2001 From: Hristo Kovachev Date: Wed, 8 Feb 2006 13:08:55 +0000 Subject: Patch #1403437 by Peter D'Hoye & Martin Scarratt: Recording gain. Changes: ***1. all platforms: 1.1 corrects gain display bug; 1.2 allows combined setting of stereo gain without an extra line on the display; 2. iRiver H1xx and H3xx specific: 2.1 correctly named the decimator variables, they were called 'gain'; 2.2 splitted decimator gain settings for mic and line-in so that they are saved separately; 2.3 added combined analog and decimator gain setting giving a smooth gain range with the best analog/decimator gain combination git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8627 a1c6a512-1295-4272-9138-f99709370657 --- apps/sound_menu.c | 37 +++++++++++++------------------------ 1 file changed, 13 insertions(+), 24 deletions(-) (limited to 'apps/sound_menu.c') diff --git a/apps/sound_menu.c b/apps/sound_menu.c index 9c8d398029..e4820b3379 100644 --- a/apps/sound_menu.c +++ b/apps/sound_menu.c @@ -18,6 +18,7 @@ ****************************************************************************/ #include "config.h" #include +#include #include #include "system.h" #include "kernel.h" @@ -53,9 +54,15 @@ int selected_setting; /* Used by the callback */ void dec_sound_formatter(char *buffer, int buffer_size, int val, const char * unit) { val = sound_val2phys(selected_setting, val); + char sign = ' '; + if(val < 0) + { + sign = '-'; + val = abs(val); + } int integer = val / 10; int dec = val % 10; - snprintf(buffer, buffer_size, "%d.%d %s", integer, dec, unit); + snprintf(buffer, buffer_size, "%c%d.%d %s", sign, integer, dec, unit); } bool set_sound(const unsigned char * string, @@ -237,6 +244,9 @@ static bool recchannels(void) static bool recquality(void) { +#ifdef HAVE_UDA1380 + (void)recquality(); +#endif return set_int(str(LANG_RECORDING_QUALITY), "", UNIT_INT, &global_settings.rec_quality, NULL, 1, 0, 7, NULL ); @@ -248,21 +258,6 @@ static bool receditable(void) &global_settings.rec_editable); } -#ifdef HAVE_UDA1380 -static bool recadcleft(void) -{ - return set_sound(str(LANG_RECORDING_ADC_LEFT), - &global_settings.rec_adc_left_gain, - SOUND_ADC_LEFT_GAIN); -} - -static bool recadcright(void) -{ - return set_sound(str(LANG_RECORDING_ADC_RIGHT), - &global_settings.rec_adc_right_gain, - SOUND_ADC_RIGHT_GAIN); -} -#endif static bool rectimesplit(void) { @@ -791,8 +786,10 @@ bool recording_menu(bool no_source) struct menu_item items[13]; bool result; +#ifndef HAVE_UDA1380 items[i].desc = ID2P(LANG_RECORDING_QUALITY); items[i++].function = recquality; +#endif items[i].desc = ID2P(LANG_RECORDING_FREQUENCY); items[i++].function = recfrequency; if(!no_source) { @@ -801,14 +798,6 @@ bool recording_menu(bool no_source) } items[i].desc = ID2P(LANG_RECORDING_CHANNELS); items[i++].function = recchannels; - -#ifdef HAVE_UDA1380 - items[i].desc = ID2P(LANG_RECORDING_ADC_LEFT); - items[i++].function = recadcleft; - items[i].desc = ID2P(LANG_RECORDING_ADC_RIGHT); - items[i++].function = recadcright; -#endif - items[i].desc = ID2P(LANG_RECORDING_EDITABLE); items[i++].function = receditable; items[i].desc = ID2P(LANG_RECORD_TIMESPLIT); -- cgit v1.2.3