summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeffrey Goode <jeffg7@gmail.com>2009-10-22 00:59:42 +0000
committerJeffrey Goode <jeffg7@gmail.com>2009-10-22 00:59:42 +0000
commitfaa47bf1b77c3155d52514bc1b294f82b72cd5db (patch)
treecefdec2f486b0c9f5928587b3bbdb5def9cf36fa
parent6afe802a8335a1334babcdb33a15ee61652bb6f3 (diff)
downloadrockbox-faa47bf1b77c3155d52514bc1b294f82b72cd5db.tar.gz
rockbox-faa47bf1b77c3155d52514bc1b294f82b72cd5db.zip
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
-rw-r--r--apps/dsp.c17
-rw-r--r--apps/dsp.h1
-rw-r--r--apps/misc.c16
-rw-r--r--apps/misc.h8
-rw-r--r--apps/pcmbuf.c3
-rw-r--r--firmware/pcm.c3
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 @@
26#include "dsp.h" 26#include "dsp.h"
27#include "eq.h" 27#include "eq.h"
28#include "kernel.h" 28#include "kernel.h"
29#include "playback.h"
30#include "system.h" 29#include "system.h"
31#include "settings.h" 30#include "settings.h"
32#include "replaygain.h" 31#include "replaygain.h"
33#include "misc.h"
34#include "tdspeed.h" 32#include "tdspeed.h"
35#include "buffer.h" 33#include "buffer.h"
36#include "fixedpoint.h" 34#include "fixedpoint.h"
37#include "fracmul.h" 35#include "fracmul.h"
38#include "pcmbuf.h"
39 36
40/* Define LOGF_ENABLE to enable logf output in this file */ 37/* Define LOGF_ENABLE to enable logf output in this file */
41/*#define LOGF_ENABLE*/ 38/*#define LOGF_ENABLE*/
@@ -1479,6 +1476,20 @@ intptr_t dsp_configure(struct dsp_config *dsp, int setting, intptr_t value)
1479 return 1; 1476 return 1;
1480} 1477}
1481 1478
1479int get_replaygain_mode(bool have_track_gain, bool have_album_gain)
1480{
1481 int type;
1482
1483 bool track = ((global_settings.replaygain_type == REPLAYGAIN_TRACK)
1484 || ((global_settings.replaygain_type == REPLAYGAIN_SHUFFLE)
1485 && global_settings.playlist_shuffle));
1486
1487 type = (!track && have_album_gain) ? REPLAYGAIN_ALBUM
1488 : have_track_gain ? REPLAYGAIN_TRACK : -1;
1489
1490 return type;
1491}
1492
1482void dsp_set_replaygain(void) 1493void dsp_set_replaygain(void)
1483{ 1494{
1484 long gain = 0; 1495 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);
65int dsp_output_count(struct dsp_config *dsp, int count); 65int dsp_output_count(struct dsp_config *dsp, int count);
66intptr_t dsp_configure(struct dsp_config *dsp, int setting, 66intptr_t dsp_configure(struct dsp_config *dsp, int setting,
67 intptr_t value); 67 intptr_t value);
68int get_replaygain_mode(bool have_track_gain, bool have_album_gain);
68void dsp_set_replaygain(void); 69void dsp_set_replaygain(void);
69void dsp_set_crossfeed(bool enable); 70void dsp_set_crossfeed(bool enable);
70void dsp_set_crossfeed_direct_gain(int gain); 71void 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 )
682 return 0; 682 return 0;
683} 683}
684 684
685#if CONFIG_CODEC == SWCODEC
686int get_replaygain_mode(bool have_track_gain, bool have_album_gain)
687{
688 int type;
689
690 bool track = ((global_settings.replaygain_type == REPLAYGAIN_TRACK)
691 || ((global_settings.replaygain_type == REPLAYGAIN_SHUFFLE)
692 && global_settings.playlist_shuffle));
693
694 type = (!track && have_album_gain) ? REPLAYGAIN_ALBUM
695 : have_track_gain ? REPLAYGAIN_TRACK : -1;
696
697 return type;
698}
699#endif
700
701#ifdef BOOTFILE 685#ifdef BOOTFILE
702#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF) 686#if !defined(USB_NONE) && !defined(USB_HANDLED_BY_OF)
703/* 687/*
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);
66void car_adapter_mode_init(void); 66void car_adapter_mode_init(void);
67extern int show_logo(void); 67extern int show_logo(void);
68 68
69#if CONFIG_CODEC == SWCODEC
70/* Return current ReplayGain mode a file should have (REPLAYGAIN_TRACK or
71 * REPLAYGAIN_ALBUM) if ReplayGain processing is enabled, or -1 if no
72 * information present.
73 */
74int get_replaygain_mode(bool have_track_gain, bool have_album_gain);
75#endif
76
77int open_utf8(const char* pathname, int flags); 69int open_utf8(const char* pathname, int flags);
78 70
79#ifdef BOOTFILE 71#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 @@
25#include <kernel.h> 25#include <kernel.h>
26#include "pcmbuf.h" 26#include "pcmbuf.h"
27#include "pcm.h" 27#include "pcm.h"
28
29/* Define LOGF_ENABLE to enable logf output in this file */
30/*#define LOGF_ENABLE*/
28#include "logf.h" 31#include "logf.h"
29#ifndef SIMULATOR 32#ifndef SIMULATOR
30#include "cpu.h" 33#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 @@
21#include <stdlib.h> 21#include <stdlib.h>
22#include "system.h" 22#include "system.h"
23#include "kernel.h" 23#include "kernel.h"
24
25/* Define LOGF_ENABLE to enable logf output in this file */
26/*#define LOGF_ENABLE*/
24#include "logf.h" 27#include "logf.h"
25#include "audio.h" 28#include "audio.h"
26#include "sound.h" 29#include "sound.h"