1
0
Fork 0
forked from len0rd/rockbox

Committed a little too much

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8569 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Linus Nielsen Feltzing 2006-02-04 23:16:31 +00:00
parent 621bcc2294
commit dd8cb8a2c1
9 changed files with 6 additions and 175 deletions

View file

@ -78,5 +78,4 @@ eq_cf.S
#elif defined(CPU_ARM) && !defined(SIMULATOR) #elif defined(CPU_ARM) && !defined(SIMULATOR)
eq_arm.S eq_arm.S
#endif #endif
eq_menu.c
#endif #endif

View file

@ -145,7 +145,6 @@ struct dsp_config
bool dither_enabled; bool dither_enabled;
bool new_gain; bool new_gain;
bool crossfeed_enabled; bool crossfeed_enabled;
bool eq_enabled;
}; };
struct resample_data struct resample_data
@ -619,52 +618,6 @@ static void apply_crossfeed(long* src[], int count)
} }
#endif #endif
#define EQ_CUTOFF_USER2REAL(x) (0xffffffff / dsp->frequency * (x))
#define EQ_Q_USER2REAL(x) (((x) << 16) / 10)
#define EQ_GAIN_USER2REAL(x) (((x) << 16) / 10)
/* Synchronize the EQ filters with the global settings */
static void eq_update_data()
{
int i;
int *setting;
int gain, cutoff, q, maxgain;
/* Don't do anything if we're not playing */
if (dsp->frequency == 0)
return;
setting = &global_settings.eq_band0_cutoff;
maxgain = 0;
/* Iterate over each band and update the appropriate filter */
for(i = 0; i < 5; i++) {
cutoff = *setting++;
q = *setting++;
gain = *setting++;
/* Keep track of maxgain for the pre-amp */
if (gain > maxgain)
maxgain = gain;
if (gain == 0) {
eq_data.enabled[i] = 0;
} else {
if (i == 0)
eq_ls_coefs(EQ_CUTOFF_USER2REAL(cutoff), EQ_Q_USER2REAL(q),
EQ_GAIN_USER2REAL(gain), eq_data.filters[0].coefs);
else if (i == 4)
eq_hs_coefs(EQ_CUTOFF_USER2REAL(cutoff), EQ_Q_USER2REAL(q),
EQ_GAIN_USER2REAL(gain), eq_data.filters[4].coefs);
else
eq_pk_coefs(EQ_CUTOFF_USER2REAL(cutoff), EQ_Q_USER2REAL(q),
EQ_GAIN_USER2REAL(gain), eq_data.filters[i].coefs);
eq_data.enabled[i] = 1;
}
}
}
/* Apply EQ filters to those bands that have got it switched on. */ /* Apply EQ filters to those bands that have got it switched on. */
static void eq_process(long **x, unsigned num) static void eq_process(long **x, unsigned num)
{ {
@ -784,9 +737,6 @@ long dsp_process(char* dst, char* src[], long size)
size /= dsp->sample_bytes * factor; size /= dsp->sample_bytes * factor;
dsp_set_replaygain(false); dsp_set_replaygain(false);
if (dsp->eq_enabled)
eq_update_data();
while (size > 0) while (size > 0)
{ {
samples = convert_to_internal(src, size, tmp); samples = convert_to_internal(src, size, tmp);
@ -795,7 +745,8 @@ long dsp_process(char* dst, char* src[], long size)
samples = resample(tmp, samples); samples = resample(tmp, samples);
if (dsp->crossfeed_enabled && dsp->stereo_mode != STEREO_MONO) if (dsp->crossfeed_enabled && dsp->stereo_mode != STEREO_MONO)
apply_crossfeed(tmp, samples); apply_crossfeed(tmp, samples);
if (dsp->eq_enabled) /* TODO: Might want to wrap this with a generic eq_enabled when the
settings are in place */
eq_process(tmp, samples); eq_process(tmp, samples);
write_samples((short*) dst, tmp, samples); write_samples((short*) dst, tmp, samples);
written += samples; written += samples;
@ -992,11 +943,6 @@ bool dsp_configure(int setting, void *value)
return 1; return 1;
} }
void dsp_set_eq(bool enable)
{
dsp->eq_enabled = enable;
}
void dsp_set_crossfeed(bool enable) void dsp_set_crossfeed(bool enable)
{ {
if (enable) if (enable)

View file

@ -54,7 +54,6 @@ int dsp_stereo_mode(void);
bool dsp_configure(int setting, void *value); bool dsp_configure(int setting, void *value);
void dsp_set_replaygain(bool always); void dsp_set_replaygain(bool always);
void dsp_set_crossfeed(bool enable); void dsp_set_crossfeed(bool enable);
void dsp_set_eq(bool enable);
void sound_set_pitch(int r); void sound_set_pitch(int r);
int sound_get_pitch(void); int sound_get_pitch(void);
#endif #endif

View file

@ -32,11 +32,11 @@
*/ */
#define DIV64(x, y, z) (long)(((long long)(x) << (z))/(y)) #define DIV64(x, y, z) (long)(((long long)(x) << (z))/(y))
/* This macro requires the EMAC unit to be in fractional mode /* TODO: This macro requires the EMAC unit to be in fractional mode
when the coef generator routines are called. If this can't be guaranteeed, when the coef generator routines are called. If this can be guaranteeed,
then add "&& 0" below. This will use a slower coef calculation on Coldfire. then remove the "&& 0" below for faster coef calculation on Coldfire.
*/ */
#if defined(CPU_COLDFIRE) && !defined(SIMULATOR) #if defined(CPU_COLDFIRE) && !defined(SIMULATOR) && 0
#define FRACMUL(x, y) \ #define FRACMUL(x, y) \
({ \ ({ \
long t; \ long t; \

View file

@ -3599,57 +3599,3 @@ eng: "Backdrop failed"
voice: "Backdrop failed" voice: "Backdrop failed"
new: new:
id: LANG_EQUALIZER
desc: in the sound settings menu
eng: "Equalizer"
voice: "Equalizer"
new:
id: LANG_EQUALIZER_SETTINGS
desc: in the equalizer menu
eng: "Browse EQ Presets"
voice: "Browse EQ Presets"
new:
id: LANG_EQUALIZER_GRAPHICAL
desc: in the equalizer menu
eng: "Graphical EQ"
voice: "Graphical EQ"
new:
id: LANG_EQUALIZER_GAIN
desc: in the equalizer menu
eng: "EQ Gain"
voice: "EQ Gain"
new:
id: LANG_EQUALIZER_GAIN_ITEM
desc: in the equalizer menu
eng: "%d Hz Band Gain"
voice: ""
new:
id: LANG_EQUALIZER_ADVANCED
desc: in the equalizer menu
eng: "EQ Advanced Settings"
voice: "EQ Advanced Settings"
new:
id: LANG_EQUALIZER_BAND_CUTOFF
desc: in the equalizer menu
eng: "Cutoff"
voice: "Cutoff"
new:
id: LANG_EQUALIZER_BAND_Q
desc: in the equalizer menu
eng: "Q"
voice: "Q"
new:
id: LANG_EQUALIZER_BAND_GAIN
desc: in the equalizer menu
eng: "Gain"
voice: "Gain"
new:

View file

@ -508,28 +508,6 @@ static const struct bit_entry hd_bits[] =
#endif #endif
#endif /* HAVE_LCD_BITMAP */ #endif /* HAVE_LCD_BITMAP */
#if CONFIG_CODEC == SWCODEC
{1, S_O(eq_enabled), false, "eq enabled", off_on },
/* 0..32768 Hz */
{15, S_O(eq_band0_cutoff), 60, "eq band 0 cutoff", NULL },
{15, S_O(eq_band1_cutoff), 200, "eq band 1 cutoff", NULL },
{15, S_O(eq_band2_cutoff), 800, "eq band 2 cutoff", NULL },
{15, S_O(eq_band3_cutoff), 4000, "eq band 3 cutoff", NULL },
{15, S_O(eq_band4_cutoff), 12000, "eq band 4 cutoff", NULL },
/* 0..64 (or 0.0 to 6.4) */
{6, S_O(eq_band0_q), 7, "eq band 0 q", NULL },
{6, S_O(eq_band1_q), 10, "eq band 1 q", NULL },
{6, S_O(eq_band2_q), 10, "eq band 2 q", NULL },
{6, S_O(eq_band3_q), 10, "eq band 3 q", NULL },
{6, S_O(eq_band4_q), 7, "eq band 4 q", NULL },
/* -240..240 (or -24db to +24db) */
{9|SIGNED, S_O(eq_band0_gain), 0, "eq band 0 gain", NULL },
{9|SIGNED, S_O(eq_band1_gain), 0, "eq band 1 gain", NULL },
{9|SIGNED, S_O(eq_band2_gain), 0, "eq band 2 gain", NULL },
{9|SIGNED, S_O(eq_band3_gain), 0, "eq band 3 gain", NULL },
{9|SIGNED, S_O(eq_band4_gain), 0, "eq band 4 gain", NULL },
#endif
/* If values are just added to the end, no need to bump the version. */ /* If values are just added to the end, no need to bump the version. */
/* new stuff to be added at the end */ /* new stuff to be added at the end */

View file

@ -39,7 +39,6 @@
#define PLUGIN_DIR ROCKBOX_DIR"/rocks" #define PLUGIN_DIR ROCKBOX_DIR"/rocks"
#define BACKDROP_DIR ROCKBOX_DIR"/backdrops" #define BACKDROP_DIR ROCKBOX_DIR"/backdrops"
#define REC_BASE_DIR "/recordings" #define REC_BASE_DIR "/recordings"
#define EQS_DIR ROCKBOX_DIR "/eqs"
#define MAX_FILENAME 20 #define MAX_FILENAME 20
@ -409,39 +408,6 @@ struct user_settings
int brightness; /* iriver h300: backlight PWM value: 2..15 int brightness; /* iriver h300: backlight PWM value: 2..15
(0 and 1 are black) */ (0 and 1 are black) */
#endif #endif
#if CONFIG_CODEC == SWCODEC
bool eq_enabled; /* Enable equalizer */
/* Order is important here, must be cutoff, q, then gain for each band.
See dsp_eq_update_data in dsp.c for why. */
/* Band 0 settings */
int eq_band0_cutoff; /* Hz */
int eq_band0_q;
int eq_band0_gain; /* +/- dB */
/* Band 1 settings */
int eq_band1_cutoff; /* Hz */
int eq_band1_q;
int eq_band1_gain; /* +/- dB */
/* Band 2 settings */
int eq_band2_cutoff; /* Hz */
int eq_band2_q;
int eq_band2_gain; /* +/- dB */
/* Band 3 settings */
int eq_band3_cutoff; /* Hz */
int eq_band3_q;
int eq_band3_gain; /* +/- dB */
/* Band 4 settings */
int eq_band4_cutoff; /* Hz */
int eq_band4_q;
int eq_band4_gain; /* +/- dB */
#endif
#ifdef HAVE_LCD_COLOR #ifdef HAVE_LCD_COLOR
unsigned char backdrop_file[MAX_FILENAME+1]; /* backdrop bitmap file */ unsigned char backdrop_file[MAX_FILENAME+1]; /* backdrop bitmap file */
#endif #endif

View file

@ -45,7 +45,6 @@
#include "splash.h" #include "splash.h"
#if CONFIG_CODEC == SWCODEC #if CONFIG_CODEC == SWCODEC
#include "dsp.h" #include "dsp.h"
#include "eq_menu.h"
#endif #endif
int selected_setting; /* Used by the callback */ int selected_setting; /* Used by the callback */
@ -380,7 +379,6 @@ bool sound_menu(void)
{ ID2P(LANG_STEREO_WIDTH), stereo_width }, { ID2P(LANG_STEREO_WIDTH), stereo_width },
#if CONFIG_CODEC == SWCODEC #if CONFIG_CODEC == SWCODEC
{ ID2P(LANG_CROSSFEED), crossfeed }, { ID2P(LANG_CROSSFEED), crossfeed },
{ ID2P(LANG_EQUALIZER), eq_menu },
#endif #endif
#if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
{ ID2P(LANG_LOUDNESS), loudness }, { ID2P(LANG_LOUDNESS), loudness },

View file

@ -91,7 +91,6 @@ sub buildzip {
mkdir ".rockbox/wps", 0777; mkdir ".rockbox/wps", 0777;
mkdir ".rockbox/themes", 0777; mkdir ".rockbox/themes", 0777;
mkdir ".rockbox/backdrops", 0777; mkdir ".rockbox/backdrops", 0777;
mkdir ".rockbox/eqs", 0777;
my $c = 'find apps -name "*.codec" ! -empty -exec cp {} .rockbox/codecs/ \;'; my $c = 'find apps -name "*.codec" ! -empty -exec cp {} .rockbox/codecs/ \;';
print `$c`; print `$c`;