diff options
| author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-08-01 21:38:18 +0000 |
|---|---|---|
| committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2009-08-01 21:38:18 +0000 |
| commit | 3c7c79189e2912ac179deab21c92ffb3448b128b (patch) | |
| tree | dce0b4d5b3f49965172c896e72cd5e40264d1606 /apps | |
| parent | 1ace06a67d5ec4df3a0295a341124677782baf70 (diff) | |
| download | rockbox-3c7c79189e2912ac179deab21c92ffb3448b128b.zip rockbox-3c7c79189e2912ac179deab21c92ffb3448b128b.tar.gz rockbox-3c7c79189e2912ac179deab21c92ffb3448b128b.tar.bz2 rockbox-3c7c79189e2912ac179deab21c92ffb3448b128b.tar.xz | |
* 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
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/dsp.c | 14 | ||||
| -rw-r--r-- | apps/dsp.h | 8 |
2 files changed, 14 insertions, 8 deletions
@@ -890,6 +890,15 @@ static void set_gain(struct dsp_config *dsp) (long) (((int64_t) dsp->data.gain * eq_precut) >> 24); } +#ifdef HAVE_SW_VOLUME_CONTROL + if (global_settings.volume < SW_VOLUME_MAX || + global_settings.volume > SW_VOLUME_MIN) + { + int vol_gain = get_replaygain_int(global_settings.volume * 100); + dsp->data.gain = (long) (((int64_t) dsp->data.gain * vol_gain) >> 24); + } +#endif + if (dsp->data.gain == DEFAULT_GAIN) { dsp->data.gain = 0; @@ -1149,6 +1158,11 @@ int dsp_callback(int msg, intptr_t param) case DSP_CALLBACK_SET_TREBLE: treble = param; break; +#ifdef HAVE_SW_VOLUME_CONTROL + case DSP_CALLBACK_SET_SW_VOLUME: + set_gain(&AUDIO_DSP); + break; +#endif #endif case DSP_CALLBACK_SET_CHANNEL_CONFIG: dsp_set_channel_config(param); @@ -56,14 +56,6 @@ enum DSP_CROSSFEED }; -enum { - DSP_CALLBACK_SET_PRESCALE = 0, - DSP_CALLBACK_SET_BASS, - DSP_CALLBACK_SET_TREBLE, - DSP_CALLBACK_SET_CHANNEL_CONFIG, - DSP_CALLBACK_SET_STEREO_WIDTH -}; - struct dsp_config; int dsp_process(struct dsp_config *dsp, char *dest, |