diff options
Diffstat (limited to 'apps/dsp.c')
-rw-r--r-- | apps/dsp.c | 14 |
1 files changed, 14 insertions, 0 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); |