diff options
author | Hristo Kovachev <bger@rockbox.org> | 2006-02-08 13:08:55 +0000 |
---|---|---|
committer | Hristo Kovachev <bger@rockbox.org> | 2006-02-08 13:08:55 +0000 |
commit | db734b41d5004fabd7a0cb110040d7a05bd0adb4 (patch) | |
tree | 4da56be9128183f1d33a130435b1e1600f5eab42 /firmware | |
parent | dcc9a8a3d8171d1f7df22a405764f7b9c194c88f (diff) |
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
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/drivers/uda1380.c | 10 | ||||
-rw-r--r-- | firmware/export/audio.h | 6 | ||||
-rw-r--r-- | firmware/export/sound.h | 4 | ||||
-rw-r--r-- | firmware/sound.c | 8 |
4 files changed, 14 insertions, 14 deletions
diff --git a/firmware/drivers/uda1380.c b/firmware/drivers/uda1380.c index eb2b57e7f3..3281391c72 100644 --- a/firmware/drivers/uda1380.c +++ b/firmware/drivers/uda1380.c @@ -255,10 +255,10 @@ void uda1380_disable_recording(void) /** * Set recording gain and volume * - * type: params: ranges: - * AUDIO_GAIN_MIC left 0 .. 15 -> 0 .. 30 dB gain - * AUDIO_GAIN_LINEIN left & right 0 .. 8 -> 0 .. 24 dB gain - * AUDIO_GAIN_ADC left & right -128 .. 48 -> -64 .. 24 dB gain + * type: params: ranges: + * AUDIO_GAIN_MIC left 0 .. 15 -> 0 .. 30 dB gain + * AUDIO_GAIN_LINEIN left & right 0 .. 8 -> 0 .. 24 dB gain + * AUDIO_GAIN_DECIMATOR left & right -128 .. 48 -> -64 .. 24 dB gain * * Note: For all types the value 0 gives 0 dB gain. */ @@ -274,7 +274,7 @@ void uda1380_set_recvol(int left, int right, int type) uda1380_write_reg(REG_PGA, (uda1380_regs[REG_PGA] & ~PGA_GAIN_MASK) | PGA_GAINL(left) | PGA_GAINR(right)); break; - case AUDIO_GAIN_ADC: + case AUDIO_GAIN_DECIMATOR: uda1380_write_reg(REG_DEC_VOL, DEC_VOLL(left) | DEC_VOLR(right)); break; } diff --git a/firmware/export/audio.h b/firmware/export/audio.h index 214f298a75..6867f3a268 100644 --- a/firmware/export/audio.h +++ b/firmware/export/audio.h @@ -33,9 +33,9 @@ #define AUDIOERR_DISK_FULL 1 -#define AUDIO_GAIN_LINEIN 0 -#define AUDIO_GAIN_MIC 1 -#define AUDIO_GAIN_ADC 2 /* for UDA1380 */ +#define AUDIO_GAIN_LINEIN 0 +#define AUDIO_GAIN_MIC 1 +#define AUDIO_GAIN_DECIMATOR 2 /* for UDA1380 */ struct audio_debug diff --git a/firmware/export/sound.h b/firmware/export/sound.h index 2c002063db..dae124d8f7 100644 --- a/firmware/export/sound.h +++ b/firmware/export/sound.h @@ -42,8 +42,8 @@ enum { SOUND_MIC_GAIN, #endif #if defined(HAVE_UDA1380) - SOUND_ADC_LEFT_GAIN, - SOUND_ADC_RIGHT_GAIN, + SOUND_DECIMATOR_LEFT_GAIN, + SOUND_DECIMATOR_RIGHT_GAIN, #endif }; diff --git a/firmware/sound.c b/firmware/sound.c index cee8c06294..110c2c91b8 100644 --- a/firmware/sound.c +++ b/firmware/sound.c @@ -97,8 +97,8 @@ static const struct sound_settings_info sound_settings_table[] = { [SOUND_LEFT_GAIN] = {"dB", 1, 1, 0, 8, 8, NULL}, [SOUND_RIGHT_GAIN] = {"dB", 1, 1, 0, 8, 8, NULL}, [SOUND_MIC_GAIN] = {"dB", 1, 1, 0, 15, 2, NULL}, - [SOUND_ADC_LEFT_GAIN] = {"dB", 1, 1,-128, 48, 0, NULL}, - [SOUND_ADC_RIGHT_GAIN]= {"dB", 1, 1,-128, 48, 0, NULL}, + [SOUND_DECIMATOR_LEFT_GAIN] = {"dB", 1, 1,-128, 48, 0, NULL}, + [SOUND_DECIMATOR_RIGHT_GAIN]= {"dB", 1, 1,-128, 48, 0, NULL}, #endif }; @@ -762,8 +762,8 @@ int sound_val2phys(int setting, int value) result = value * 20; /* (30/15) *10 */ break; - case SOUND_ADC_LEFT_GAIN: - case SOUND_ADC_RIGHT_GAIN: + case SOUND_DECIMATOR_LEFT_GAIN: + case SOUND_DECIMATOR_RIGHT_GAIN: result = value * 5; /* (1/2) *10 */ break; |