From faa47bf1b77c3155d52514bc1b294f82b72cd5db Mon Sep 17 00:00:00 2001 From: Jeffrey Goode Date: Thu, 22 Oct 2009 00:59:42 +0000 Subject: Code cleanup in dsp.c and misc.c, some comments git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23314 a1c6a512-1295-4272-9138-f99709370657 --- apps/dsp.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'apps/dsp.c') diff --git a/apps/dsp.c b/apps/dsp.c index e0cea6d41b..ada16b0d89 100644 --- a/apps/dsp.c +++ b/apps/dsp.c @@ -26,16 +26,13 @@ #include "dsp.h" #include "eq.h" #include "kernel.h" -#include "playback.h" #include "system.h" #include "settings.h" #include "replaygain.h" -#include "misc.h" #include "tdspeed.h" #include "buffer.h" #include "fixedpoint.h" #include "fracmul.h" -#include "pcmbuf.h" /* Define LOGF_ENABLE to enable logf output in this file */ /*#define LOGF_ENABLE*/ @@ -1479,6 +1476,20 @@ intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value) return 1; } +int get_replaygain_mode(bool have_track_gain, bool have_album_gain) +{ + int type; + + bool track = ((global_settings.replaygain_type == REPLAYGAIN_TRACK) + || ((global_settings.replaygain_type == REPLAYGAIN_SHUFFLE) + && global_settings.playlist_shuffle)); + + type = (!track && have_album_gain) ? REPLAYGAIN_ALBUM + : have_track_gain ? REPLAYGAIN_TRACK : -1; + + return type; +} + void dsp_set_replaygain(void) { long gain = 0; -- cgit v1.2.3