summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2009-08-01 21:38:18 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2009-08-01 21:38:18 +0000
commit3c7c79189e2912ac179deab21c92ffb3448b128b (patch)
treedce0b4d5b3f49965172c896e72cd5e40264d1606 /apps
parent1ace06a67d5ec4df3a0295a341124677782baf70 (diff)
downloadrockbox-3c7c79189e2912ac179deab21c92ffb3448b128b.tar.gz
rockbox-3c7c79189e2912ac179deab21c92ffb3448b128b.zip
* 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.c14
-rw-r--r--apps/dsp.h8
2 files changed, 14 insertions, 8 deletions
diff --git a/apps/dsp.c b/apps/dsp.c
index ec59417621..f9b94e8228 100644
--- a/apps/dsp.c
+++ b/apps/dsp.c
@@ -890,6 +890,15 @@ static void set_gain(struct dsp_config *dsp)
890 (long) (((int64_t) dsp->data.gain * eq_precut) >> 24); 890 (long) (((int64_t) dsp->data.gain * eq_precut) >> 24);
891 } 891 }
892 892
893#ifdef HAVE_SW_VOLUME_CONTROL
894 if (global_settings.volume < SW_VOLUME_MAX ||
895 global_settings.volume > SW_VOLUME_MIN)
896 {
897 int vol_gain = get_replaygain_int(global_settings.volume * 100);
898 dsp->data.gain = (long) (((int64_t) dsp->data.gain * vol_gain) >> 24);
899 }
900#endif
901
893 if (dsp->data.gain == DEFAULT_GAIN) 902 if (dsp->data.gain == DEFAULT_GAIN)
894 { 903 {
895 dsp->data.gain = 0; 904 dsp->data.gain = 0;
@@ -1149,6 +1158,11 @@ int dsp_callback(int msg, intptr_t param)
1149 case DSP_CALLBACK_SET_TREBLE: 1158 case DSP_CALLBACK_SET_TREBLE:
1150 treble = param; 1159 treble = param;
1151 break; 1160 break;
1161#ifdef HAVE_SW_VOLUME_CONTROL
1162 case DSP_CALLBACK_SET_SW_VOLUME:
1163 set_gain(&AUDIO_DSP);
1164 break;
1165#endif
1152#endif 1166#endif
1153 case DSP_CALLBACK_SET_CHANNEL_CONFIG: 1167 case DSP_CALLBACK_SET_CHANNEL_CONFIG:
1154 dsp_set_channel_config(param); 1168 dsp_set_channel_config(param);
diff --git a/apps/dsp.h b/apps/dsp.h
index 7d1e2b3ddc..58a5edb5e2 100644
--- a/apps/dsp.h
+++ b/apps/dsp.h
@@ -56,14 +56,6 @@ enum
56 DSP_CROSSFEED 56 DSP_CROSSFEED
57}; 57};
58 58
59enum {
60 DSP_CALLBACK_SET_PRESCALE = 0,
61 DSP_CALLBACK_SET_BASS,
62 DSP_CALLBACK_SET_TREBLE,
63 DSP_CALLBACK_SET_CHANNEL_CONFIG,
64 DSP_CALLBACK_SET_STEREO_WIDTH
65};
66
67struct dsp_config; 59struct dsp_config;
68 60
69int dsp_process(struct dsp_config *dsp, char *dest, 61int dsp_process(struct dsp_config *dsp, char *dest,