From dd8cb8a2c12a538e935d508e77794753f5f11276 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Sat, 4 Feb 2006 23:16:31 +0000 Subject: Committed a little too much git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8569 a1c6a512-1295-4272-9138-f99709370657 --- apps/SOURCES | 1 - apps/dsp.c | 58 ++------------------------------------------------ apps/dsp.h | 1 - apps/eq.c | 8 +++---- apps/lang/english.lang | 54 ---------------------------------------------- apps/settings.c | 22 ------------------- apps/settings.h | 34 ----------------------------- apps/sound_menu.c | 2 -- tools/buildzip.pl | 1 - 9 files changed, 6 insertions(+), 175 deletions(-) diff --git a/apps/SOURCES b/apps/SOURCES index ef65789588..35f78c455e 100644 --- a/apps/SOURCES +++ b/apps/SOURCES @@ -78,5 +78,4 @@ eq_cf.S #elif defined(CPU_ARM) && !defined(SIMULATOR) eq_arm.S #endif -eq_menu.c #endif diff --git a/apps/dsp.c b/apps/dsp.c index f403674ba2..789cf72b20 100644 --- a/apps/dsp.c +++ b/apps/dsp.c @@ -145,7 +145,6 @@ struct dsp_config bool dither_enabled; bool new_gain; bool crossfeed_enabled; - bool eq_enabled; }; struct resample_data @@ -619,52 +618,6 @@ static void apply_crossfeed(long* src[], int count) } #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. */ 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; dsp_set_replaygain(false); - if (dsp->eq_enabled) - eq_update_data(); - while (size > 0) { samples = convert_to_internal(src, size, tmp); @@ -795,7 +745,8 @@ long dsp_process(char* dst, char* src[], long size) samples = resample(tmp, samples); if (dsp->crossfeed_enabled && dsp->stereo_mode != STEREO_MONO) 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); write_samples((short*) dst, tmp, samples); written += samples; @@ -992,11 +943,6 @@ bool dsp_configure(int setting, void *value) return 1; } -void dsp_set_eq(bool enable) -{ - dsp->eq_enabled = enable; -} - void dsp_set_crossfeed(bool enable) { if (enable) diff --git a/apps/dsp.h b/apps/dsp.h index 11b20b1866..f86a4d9989 100644 --- a/apps/dsp.h +++ b/apps/dsp.h @@ -54,7 +54,6 @@ int dsp_stereo_mode(void); bool dsp_configure(int setting, void *value); void dsp_set_replaygain(bool always); void dsp_set_crossfeed(bool enable); -void dsp_set_eq(bool enable); void sound_set_pitch(int r); int sound_get_pitch(void); #endif diff --git a/apps/eq.c b/apps/eq.c index 7921028403..17165be541 100644 --- a/apps/eq.c +++ b/apps/eq.c @@ -32,11 +32,11 @@ */ #define DIV64(x, y, z) (long)(((long long)(x) << (z))/(y)) -/* This macro requires the EMAC unit to be in fractional mode - when the coef generator routines are called. If this can't be guaranteeed, - then add "&& 0" below. This will use a slower coef calculation on Coldfire. +/* TODO: This macro requires the EMAC unit to be in fractional mode + when the coef generator routines are called. If this can be guaranteeed, + 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) \ ({ \ long t; \ diff --git a/apps/lang/english.lang b/apps/lang/english.lang index f024d645fe..a2803ad432 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang @@ -3599,57 +3599,3 @@ eng: "Backdrop failed" voice: "Backdrop failed" 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: - diff --git a/apps/settings.c b/apps/settings.c index fd1b530890..07db21ef66 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -508,28 +508,6 @@ static const struct bit_entry hd_bits[] = #endif #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. */ /* new stuff to be added at the end */ diff --git a/apps/settings.h b/apps/settings.h index bb401b674e..bb58336202 100644 --- a/apps/settings.h +++ b/apps/settings.h @@ -39,7 +39,6 @@ #define PLUGIN_DIR ROCKBOX_DIR"/rocks" #define BACKDROP_DIR ROCKBOX_DIR"/backdrops" #define REC_BASE_DIR "/recordings" -#define EQS_DIR ROCKBOX_DIR "/eqs" #define MAX_FILENAME 20 @@ -409,39 +408,6 @@ struct user_settings int brightness; /* iriver h300: backlight PWM value: 2..15 (0 and 1 are black) */ #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 unsigned char backdrop_file[MAX_FILENAME+1]; /* backdrop bitmap file */ #endif diff --git a/apps/sound_menu.c b/apps/sound_menu.c index 2bd0ff6e59..e44aa68231 100644 --- a/apps/sound_menu.c +++ b/apps/sound_menu.c @@ -45,7 +45,6 @@ #include "splash.h" #if CONFIG_CODEC == SWCODEC #include "dsp.h" -#include "eq_menu.h" #endif int selected_setting; /* Used by the callback */ @@ -380,7 +379,6 @@ bool sound_menu(void) { ID2P(LANG_STEREO_WIDTH), stereo_width }, #if CONFIG_CODEC == SWCODEC { ID2P(LANG_CROSSFEED), crossfeed }, - { ID2P(LANG_EQUALIZER), eq_menu }, #endif #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) { ID2P(LANG_LOUDNESS), loudness }, diff --git a/tools/buildzip.pl b/tools/buildzip.pl index fad73624ed..a9af7619db 100755 --- a/tools/buildzip.pl +++ b/tools/buildzip.pl @@ -91,7 +91,6 @@ sub buildzip { mkdir ".rockbox/wps", 0777; mkdir ".rockbox/themes", 0777; mkdir ".rockbox/backdrops", 0777; - mkdir ".rockbox/eqs", 0777; my $c = 'find apps -name "*.codec" ! -empty -exec cp {} .rockbox/codecs/ \;'; print `$c`; -- cgit v1.2.3