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 ++++++++++++++--- apps/dsp.h | 1 + apps/misc.c | 16 ---------------- apps/misc.h | 8 -------- apps/pcmbuf.c | 3 +++ firmware/pcm.c | 3 +++ 6 files changed, 21 insertions(+), 27 deletions(-) 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; diff --git a/apps/dsp.h b/apps/dsp.h index ab42d73b24..f87037d368 100644 --- a/apps/dsp.h +++ b/apps/dsp.h @@ -65,6 +65,7 @@ int dsp_input_count(struct dsp_config *dsp, int count); int dsp_output_count(struct dsp_config *dsp, int count); intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value); +int get_replaygain_mode(bool have_track_gain, bool have_album_gain); void dsp_set_replaygain(void); void dsp_set_crossfeed(bool enable); void dsp_set_crossfeed_direct_gain(int gain); diff --git a/apps/misc.c b/apps/misc.c index 2766264de7..47ebf58080 100644 --- a/apps/misc.c +++ b/apps/misc.c @@ -682,22 +682,6 @@ int show_logo( void ) return 0; } -#if CONFIG_CODEC == SWCODEC -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; -} -#endif - #ifdef BOOTFILE #if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) /* diff --git a/apps/misc.h b/apps/misc.h index 35972301cc..a8ed6029a3 100644 --- a/apps/misc.h +++ b/apps/misc.h @@ -66,14 +66,6 @@ bool list_stop_handler(void); void car_adapter_mode_init(void); extern int show_logo(void); -#if CONFIG_CODEC == SWCODEC -/* Return current ReplayGain mode a file should have (REPLAYGAIN_TRACK or - * REPLAYGAIN_ALBUM) if ReplayGain processing is enabled, or -1 if no - * information present. - */ -int get_replaygain_mode(bool have_track_gain, bool have_album_gain); -#endif - int open_utf8(const char* pathname, int flags); #ifdef BOOTFILE diff --git a/apps/pcmbuf.c b/apps/pcmbuf.c index 319e3e8044..5b478362b5 100644 --- a/apps/pcmbuf.c +++ b/apps/pcmbuf.c @@ -25,6 +25,9 @@ #include #include "pcmbuf.h" #include "pcm.h" + +/* Define LOGF_ENABLE to enable logf output in this file */ +/*#define LOGF_ENABLE*/ #include "logf.h" #ifndef SIMULATOR #include "cpu.h" diff --git a/firmware/pcm.c b/firmware/pcm.c index bc7ec0282a..cddb2eaecd 100644 --- a/firmware/pcm.c +++ b/firmware/pcm.c @@ -21,6 +21,9 @@ #include #include "system.h" #include "kernel.h" + +/* Define LOGF_ENABLE to enable logf output in this file */ +/*#define LOGF_ENABLE*/ #include "logf.h" #include "audio.h" #include "sound.h" -- cgit v1.2.3