diff options
| author | Magnus Holmgren <magnushol@gmail.com> | 2005-09-24 15:22:48 +0000 |
|---|---|---|
| committer | Magnus Holmgren <magnushol@gmail.com> | 2005-09-24 15:22:48 +0000 |
| commit | 4b711c2f72608441f1ef44db584eccc9ca823ea1 (patch) | |
| tree | 34398d7fd8f1a200c36470659b278819553c676f /apps/dsp.c | |
| parent | 9a625ef7ac544976f45734d62294a52ef32cfe66 (diff) | |
| download | rockbox-4b711c2f72608441f1ef44db584eccc9ca823ea1.zip rockbox-4b711c2f72608441f1ef44db584eccc9ca823ea1.tar.gz rockbox-4b711c2f72608441f1ef44db584eccc9ca823ea1.tar.bz2 rockbox-4b711c2f72608441f1ef44db584eccc9ca823ea1.tar.xz | |
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
Diffstat (limited to 'apps/dsp.c')
| -rw-r--r-- | apps/dsp.c | 14 |
1 files changed, 8 insertions, 6 deletions
@@ -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. */ |