diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/SOURCES | 1 | ||||
-rw-r--r-- | apps/dsp.c | 58 | ||||
-rw-r--r-- | apps/dsp.h | 1 | ||||
-rw-r--r-- | apps/eq.c | 8 | ||||
-rw-r--r-- | apps/lang/english.lang | 54 | ||||
-rw-r--r-- | apps/settings.c | 22 | ||||
-rw-r--r-- | apps/settings.h | 34 | ||||
-rw-r--r-- | apps/sound_menu.c | 2 |
8 files changed, 6 insertions, 174 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 | |||
78 | #elif defined(CPU_ARM) && !defined(SIMULATOR) | 78 | #elif defined(CPU_ARM) && !defined(SIMULATOR) |
79 | eq_arm.S | 79 | eq_arm.S |
80 | #endif | 80 | #endif |
81 | eq_menu.c | ||
82 | #endif | 81 | #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 | |||
145 | bool dither_enabled; | 145 | bool dither_enabled; |
146 | bool new_gain; | 146 | bool new_gain; |
147 | bool crossfeed_enabled; | 147 | bool crossfeed_enabled; |
148 | bool eq_enabled; | ||
149 | }; | 148 | }; |
150 | 149 | ||
151 | struct resample_data | 150 | struct resample_data |
@@ -619,52 +618,6 @@ static void apply_crossfeed(long* src[], int count) | |||
619 | } | 618 | } |
620 | #endif | 619 | #endif |
621 | 620 | ||
622 | #define EQ_CUTOFF_USER2REAL(x) (0xffffffff / dsp->frequency * (x)) | ||
623 | #define EQ_Q_USER2REAL(x) (((x) << 16) / 10) | ||
624 | #define EQ_GAIN_USER2REAL(x) (((x) << 16) / 10) | ||
625 | |||
626 | /* Synchronize the EQ filters with the global settings */ | ||
627 | static void eq_update_data() | ||
628 | { | ||
629 | int i; | ||
630 | int *setting; | ||
631 | int gain, cutoff, q, maxgain; | ||
632 | |||
633 | /* Don't do anything if we're not playing */ | ||
634 | if (dsp->frequency == 0) | ||
635 | return; | ||
636 | |||
637 | setting = &global_settings.eq_band0_cutoff; | ||
638 | maxgain = 0; | ||
639 | |||
640 | /* Iterate over each band and update the appropriate filter */ | ||
641 | for(i = 0; i < 5; i++) { | ||
642 | cutoff = *setting++; | ||
643 | q = *setting++; | ||
644 | gain = *setting++; | ||
645 | |||
646 | /* Keep track of maxgain for the pre-amp */ | ||
647 | if (gain > maxgain) | ||
648 | maxgain = gain; | ||
649 | |||
650 | if (gain == 0) { | ||
651 | eq_data.enabled[i] = 0; | ||
652 | } else { | ||
653 | if (i == 0) | ||
654 | eq_ls_coefs(EQ_CUTOFF_USER2REAL(cutoff), EQ_Q_USER2REAL(q), | ||
655 | EQ_GAIN_USER2REAL(gain), eq_data.filters[0].coefs); | ||
656 | else if (i == 4) | ||
657 | eq_hs_coefs(EQ_CUTOFF_USER2REAL(cutoff), EQ_Q_USER2REAL(q), | ||
658 | EQ_GAIN_USER2REAL(gain), eq_data.filters[4].coefs); | ||
659 | else | ||
660 | eq_pk_coefs(EQ_CUTOFF_USER2REAL(cutoff), EQ_Q_USER2REAL(q), | ||
661 | EQ_GAIN_USER2REAL(gain), eq_data.filters[i].coefs); | ||
662 | |||
663 | eq_data.enabled[i] = 1; | ||
664 | } | ||
665 | } | ||
666 | } | ||
667 | |||
668 | /* Apply EQ filters to those bands that have got it switched on. */ | 621 | /* Apply EQ filters to those bands that have got it switched on. */ |
669 | static void eq_process(long **x, unsigned num) | 622 | static void eq_process(long **x, unsigned num) |
670 | { | 623 | { |
@@ -784,9 +737,6 @@ long dsp_process(char* dst, char* src[], long size) | |||
784 | size /= dsp->sample_bytes * factor; | 737 | size /= dsp->sample_bytes * factor; |
785 | dsp_set_replaygain(false); | 738 | dsp_set_replaygain(false); |
786 | 739 | ||
787 | if (dsp->eq_enabled) | ||
788 | eq_update_data(); | ||
789 | |||
790 | while (size > 0) | 740 | while (size > 0) |
791 | { | 741 | { |
792 | samples = convert_to_internal(src, size, tmp); | 742 | samples = convert_to_internal(src, size, tmp); |
@@ -795,7 +745,8 @@ long dsp_process(char* dst, char* src[], long size) | |||
795 | samples = resample(tmp, samples); | 745 | samples = resample(tmp, samples); |
796 | if (dsp->crossfeed_enabled && dsp->stereo_mode != STEREO_MONO) | 746 | if (dsp->crossfeed_enabled && dsp->stereo_mode != STEREO_MONO) |
797 | apply_crossfeed(tmp, samples); | 747 | apply_crossfeed(tmp, samples); |
798 | if (dsp->eq_enabled) | 748 | /* TODO: Might want to wrap this with a generic eq_enabled when the |
749 | settings are in place */ | ||
799 | eq_process(tmp, samples); | 750 | eq_process(tmp, samples); |
800 | write_samples((short*) dst, tmp, samples); | 751 | write_samples((short*) dst, tmp, samples); |
801 | written += samples; | 752 | written += samples; |
@@ -992,11 +943,6 @@ bool dsp_configure(int setting, void *value) | |||
992 | return 1; | 943 | return 1; |
993 | } | 944 | } |
994 | 945 | ||
995 | void dsp_set_eq(bool enable) | ||
996 | { | ||
997 | dsp->eq_enabled = enable; | ||
998 | } | ||
999 | |||
1000 | void dsp_set_crossfeed(bool enable) | 946 | void dsp_set_crossfeed(bool enable) |
1001 | { | 947 | { |
1002 | if (enable) | 948 | 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); | |||
54 | bool dsp_configure(int setting, void *value); | 54 | bool dsp_configure(int setting, void *value); |
55 | void dsp_set_replaygain(bool always); | 55 | void dsp_set_replaygain(bool always); |
56 | void dsp_set_crossfeed(bool enable); | 56 | void dsp_set_crossfeed(bool enable); |
57 | void dsp_set_eq(bool enable); | ||
58 | void sound_set_pitch(int r); | 57 | void sound_set_pitch(int r); |
59 | int sound_get_pitch(void); | 58 | int sound_get_pitch(void); |
60 | #endif | 59 | #endif |
@@ -32,11 +32,11 @@ | |||
32 | */ | 32 | */ |
33 | 33 | ||
34 | #define DIV64(x, y, z) (long)(((long long)(x) << (z))/(y)) | 34 | #define DIV64(x, y, z) (long)(((long long)(x) << (z))/(y)) |
35 | /* This macro requires the EMAC unit to be in fractional mode | 35 | /* TODO: This macro requires the EMAC unit to be in fractional mode |
36 | when the coef generator routines are called. If this can't be guaranteeed, | 36 | when the coef generator routines are called. If this can be guaranteeed, |
37 | then add "&& 0" below. This will use a slower coef calculation on Coldfire. | 37 | then remove the "&& 0" below for faster coef calculation on Coldfire. |
38 | */ | 38 | */ |
39 | #if defined(CPU_COLDFIRE) && !defined(SIMULATOR) | 39 | #if defined(CPU_COLDFIRE) && !defined(SIMULATOR) && 0 |
40 | #define FRACMUL(x, y) \ | 40 | #define FRACMUL(x, y) \ |
41 | ({ \ | 41 | ({ \ |
42 | long t; \ | 42 | 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" | |||
3599 | voice: "Backdrop failed" | 3599 | voice: "Backdrop failed" |
3600 | new: | 3600 | new: |
3601 | 3601 | ||
3602 | id: LANG_EQUALIZER | ||
3603 | desc: in the sound settings menu | ||
3604 | eng: "Equalizer" | ||
3605 | voice: "Equalizer" | ||
3606 | new: | ||
3607 | |||
3608 | id: LANG_EQUALIZER_SETTINGS | ||
3609 | desc: in the equalizer menu | ||
3610 | eng: "Browse EQ Presets" | ||
3611 | voice: "Browse EQ Presets" | ||
3612 | new: | ||
3613 | |||
3614 | id: LANG_EQUALIZER_GRAPHICAL | ||
3615 | desc: in the equalizer menu | ||
3616 | eng: "Graphical EQ" | ||
3617 | voice: "Graphical EQ" | ||
3618 | new: | ||
3619 | |||
3620 | id: LANG_EQUALIZER_GAIN | ||
3621 | desc: in the equalizer menu | ||
3622 | eng: "EQ Gain" | ||
3623 | voice: "EQ Gain" | ||
3624 | new: | ||
3625 | |||
3626 | id: LANG_EQUALIZER_GAIN_ITEM | ||
3627 | desc: in the equalizer menu | ||
3628 | eng: "%d Hz Band Gain" | ||
3629 | voice: "" | ||
3630 | new: | ||
3631 | |||
3632 | id: LANG_EQUALIZER_ADVANCED | ||
3633 | desc: in the equalizer menu | ||
3634 | eng: "EQ Advanced Settings" | ||
3635 | voice: "EQ Advanced Settings" | ||
3636 | new: | ||
3637 | |||
3638 | id: LANG_EQUALIZER_BAND_CUTOFF | ||
3639 | desc: in the equalizer menu | ||
3640 | eng: "Cutoff" | ||
3641 | voice: "Cutoff" | ||
3642 | new: | ||
3643 | |||
3644 | id: LANG_EQUALIZER_BAND_Q | ||
3645 | desc: in the equalizer menu | ||
3646 | eng: "Q" | ||
3647 | voice: "Q" | ||
3648 | new: | ||
3649 | |||
3650 | id: LANG_EQUALIZER_BAND_GAIN | ||
3651 | desc: in the equalizer menu | ||
3652 | eng: "Gain" | ||
3653 | voice: "Gain" | ||
3654 | new: | ||
3655 | |||
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[] = | |||
508 | #endif | 508 | #endif |
509 | #endif /* HAVE_LCD_BITMAP */ | 509 | #endif /* HAVE_LCD_BITMAP */ |
510 | 510 | ||
511 | #if CONFIG_CODEC == SWCODEC | ||
512 | {1, S_O(eq_enabled), false, "eq enabled", off_on }, | ||
513 | /* 0..32768 Hz */ | ||
514 | {15, S_O(eq_band0_cutoff), 60, "eq band 0 cutoff", NULL }, | ||
515 | {15, S_O(eq_band1_cutoff), 200, "eq band 1 cutoff", NULL }, | ||
516 | {15, S_O(eq_band2_cutoff), 800, "eq band 2 cutoff", NULL }, | ||
517 | {15, S_O(eq_band3_cutoff), 4000, "eq band 3 cutoff", NULL }, | ||
518 | {15, S_O(eq_band4_cutoff), 12000, "eq band 4 cutoff", NULL }, | ||
519 | /* 0..64 (or 0.0 to 6.4) */ | ||
520 | {6, S_O(eq_band0_q), 7, "eq band 0 q", NULL }, | ||
521 | {6, S_O(eq_band1_q), 10, "eq band 1 q", NULL }, | ||
522 | {6, S_O(eq_band2_q), 10, "eq band 2 q", NULL }, | ||
523 | {6, S_O(eq_band3_q), 10, "eq band 3 q", NULL }, | ||
524 | {6, S_O(eq_band4_q), 7, "eq band 4 q", NULL }, | ||
525 | /* -240..240 (or -24db to +24db) */ | ||
526 | {9|SIGNED, S_O(eq_band0_gain), 0, "eq band 0 gain", NULL }, | ||
527 | {9|SIGNED, S_O(eq_band1_gain), 0, "eq band 1 gain", NULL }, | ||
528 | {9|SIGNED, S_O(eq_band2_gain), 0, "eq band 2 gain", NULL }, | ||
529 | {9|SIGNED, S_O(eq_band3_gain), 0, "eq band 3 gain", NULL }, | ||
530 | {9|SIGNED, S_O(eq_band4_gain), 0, "eq band 4 gain", NULL }, | ||
531 | #endif | ||
532 | |||
533 | /* If values are just added to the end, no need to bump the version. */ | 511 | /* If values are just added to the end, no need to bump the version. */ |
534 | /* new stuff to be added at the end */ | 512 | /* new stuff to be added at the end */ |
535 | 513 | ||
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 @@ | |||
39 | #define PLUGIN_DIR ROCKBOX_DIR"/rocks" | 39 | #define PLUGIN_DIR ROCKBOX_DIR"/rocks" |
40 | #define BACKDROP_DIR ROCKBOX_DIR"/backdrops" | 40 | #define BACKDROP_DIR ROCKBOX_DIR"/backdrops" |
41 | #define REC_BASE_DIR "/recordings" | 41 | #define REC_BASE_DIR "/recordings" |
42 | #define EQS_DIR ROCKBOX_DIR "/eqs" | ||
43 | 42 | ||
44 | #define MAX_FILENAME 20 | 43 | #define MAX_FILENAME 20 |
45 | 44 | ||
@@ -409,39 +408,6 @@ struct user_settings | |||
409 | int brightness; /* iriver h300: backlight PWM value: 2..15 | 408 | int brightness; /* iriver h300: backlight PWM value: 2..15 |
410 | (0 and 1 are black) */ | 409 | (0 and 1 are black) */ |
411 | #endif | 410 | #endif |
412 | |||
413 | #if CONFIG_CODEC == SWCODEC | ||
414 | bool eq_enabled; /* Enable equalizer */ | ||
415 | |||
416 | /* Order is important here, must be cutoff, q, then gain for each band. | ||
417 | See dsp_eq_update_data in dsp.c for why. */ | ||
418 | |||
419 | /* Band 0 settings */ | ||
420 | int eq_band0_cutoff; /* Hz */ | ||
421 | int eq_band0_q; | ||
422 | int eq_band0_gain; /* +/- dB */ | ||
423 | |||
424 | /* Band 1 settings */ | ||
425 | int eq_band1_cutoff; /* Hz */ | ||
426 | int eq_band1_q; | ||
427 | int eq_band1_gain; /* +/- dB */ | ||
428 | |||
429 | /* Band 2 settings */ | ||
430 | int eq_band2_cutoff; /* Hz */ | ||
431 | int eq_band2_q; | ||
432 | int eq_band2_gain; /* +/- dB */ | ||
433 | |||
434 | /* Band 3 settings */ | ||
435 | int eq_band3_cutoff; /* Hz */ | ||
436 | int eq_band3_q; | ||
437 | int eq_band3_gain; /* +/- dB */ | ||
438 | |||
439 | /* Band 4 settings */ | ||
440 | int eq_band4_cutoff; /* Hz */ | ||
441 | int eq_band4_q; | ||
442 | int eq_band4_gain; /* +/- dB */ | ||
443 | #endif | ||
444 | |||
445 | #ifdef HAVE_LCD_COLOR | 411 | #ifdef HAVE_LCD_COLOR |
446 | unsigned char backdrop_file[MAX_FILENAME+1]; /* backdrop bitmap file */ | 412 | unsigned char backdrop_file[MAX_FILENAME+1]; /* backdrop bitmap file */ |
447 | #endif | 413 | #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 @@ | |||
45 | #include "splash.h" | 45 | #include "splash.h" |
46 | #if CONFIG_CODEC == SWCODEC | 46 | #if CONFIG_CODEC == SWCODEC |
47 | #include "dsp.h" | 47 | #include "dsp.h" |
48 | #include "eq_menu.h" | ||
49 | #endif | 48 | #endif |
50 | 49 | ||
51 | int selected_setting; /* Used by the callback */ | 50 | int selected_setting; /* Used by the callback */ |
@@ -380,7 +379,6 @@ bool sound_menu(void) | |||
380 | { ID2P(LANG_STEREO_WIDTH), stereo_width }, | 379 | { ID2P(LANG_STEREO_WIDTH), stereo_width }, |
381 | #if CONFIG_CODEC == SWCODEC | 380 | #if CONFIG_CODEC == SWCODEC |
382 | { ID2P(LANG_CROSSFEED), crossfeed }, | 381 | { ID2P(LANG_CROSSFEED), crossfeed }, |
383 | { ID2P(LANG_EQUALIZER), eq_menu }, | ||
384 | #endif | 382 | #endif |
385 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) | 383 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |
386 | { ID2P(LANG_LOUDNESS), loudness }, | 384 | { ID2P(LANG_LOUDNESS), loudness }, |