From 4b711c2f72608441f1ef44db584eccc9ca823ea1 Mon Sep 17 00:00:00 2001 From: Magnus Holmgren Date: Sat, 24 Sep 2005 15:22:48 +0000 Subject: Iriver: Added new ReplayGain type: track gain if shuffle mode is active, album gain otherwise. Properly apply ReplayGain settings on config file load. Bumped config version, so save your settings. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@7558 a1c6a512-1295-4272-9138-f99709370657 --- apps/dsp.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'apps/dsp.c') diff --git a/apps/dsp.c b/apps/dsp.c index 23b7ea548d..8ec36c3f33 100644 --- a/apps/dsp.c +++ b/apps/dsp.c @@ -708,11 +708,16 @@ void dsp_set_replaygain(bool always) if (global_settings.replaygain || global_settings.replaygain_noclip) { - long peak; + bool track_mode + = ((global_settings.replaygain_type == REPLAYGAIN_TRACK) + || ((global_settings.replaygain_type == REPLAYGAIN_SHUFFLE) + && global_settings.playlist_shuffle)); + long peak = (track_mode || !dsp->album_peak) + ? dsp->track_peak : dsp->album_peak; if (global_settings.replaygain) { - gain = (global_settings.replaygain_track || !dsp->album_gain) + gain = (track_mode || !dsp->album_gain) ? dsp->track_gain : dsp->album_gain; if (global_settings.replaygain_preamp) @@ -720,13 +725,10 @@ void dsp_set_replaygain(bool always) long preamp = get_replaygain_int( global_settings.replaygain_preamp * 10); - gain = (long) ((((int64_t) gain * preamp)) >> 24); + gain = (long) (((int64_t) gain * preamp) >> 24); } } - peak = (global_settings.replaygain_track || !dsp->album_peak) - ? dsp->track_peak : dsp->album_peak; - if (gain == 0) { /* So that noclip can work even with no gain information. */ -- cgit v1.2.3