1
0
Fork 0
forked from len0rd/rockbox

* Move DSP_CALLBACK_* enum to sound.h

* Add software based volume control for a certain range (SW_VOLUME_MIN -> SW_VOLUME_MAX)
 * Make Onda VX747 use it
 * Don't change volume or frequency in Ingenic Jz4740 codec driver when they're already set


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22106 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Maurus Cuelenaere 2009-08-01 21:38:18 +00:00
parent 1ace06a67d
commit 3c7c79189e
6 changed files with 52 additions and 32 deletions

View file

@ -158,16 +158,6 @@ sound_set_type* sound_get_fn(int setting)
}
#if CONFIG_CODEC == SWCODEC
/* Copied from dsp.h, nasty nasty, but we don't want to include dsp.h */
enum {
DSP_CALLBACK_SET_PRESCALE = 0,
DSP_CALLBACK_SET_BASS,
DSP_CALLBACK_SET_TREBLE,
DSP_CALLBACK_SET_CHANNEL_CONFIG,
DSP_CALLBACK_SET_STEREO_WIDTH
};
static int (*dsp_callback)(int, intptr_t) = NULL;
void sound_set_dsp_callback(int (*func)(int, intptr_t))
@ -251,6 +241,10 @@ static void set_prescaled_volume(void)
r += ((r - (VOLUME_MIN - ONE_DB)) * current_balance) / VOLUME_RANGE;
}
#ifdef HAVE_SW_VOLUME_CONTROL
dsp_callback(DSP_CALLBACK_SET_SW_VOLUME, 0);
#endif
#if CONFIG_CODEC == MAS3507D
dac_volume(tenthdb2reg(l), tenthdb2reg(r), false);
#elif defined(HAVE_UDA1380) || defined(HAVE_WM8975) || defined(HAVE_WM8758) \