--- apps/dsp.c +++ apps/dsp.c @@ -126,8 +126,8 @@ */ struct eq_state { - char enabled[5]; /* 00h - Flags for active filters */ - struct eqfilter filters[5]; /* 08h - packing is 4? */ + char enabled[10]; /* 00h - Flags for active filters */ + struct eqfilter filters[10]; /* 08h - packing is 4? */ /* 10ch */ }; @@ -1025,7 +1025,7 @@ { if (band == 0) eq_ls_coefs(cutoff, q, gain, eq_data.filters[band].coefs); - else if (band == 4) + else if (band == 9) eq_hs_coefs(cutoff, q, gain, eq_data.filters[band].coefs); else eq_pk_coefs(cutoff, q, gain, eq_data.filters[band].coefs); @@ -1043,16 +1043,21 @@ EQ_PEAK_SHIFT, /* peaking */ EQ_PEAK_SHIFT, /* peaking */ EQ_PEAK_SHIFT, /* peaking */ + EQ_PEAK_SHIFT, /* peaking */ + EQ_PEAK_SHIFT, /* peaking */ + EQ_PEAK_SHIFT, /* peaking */ + EQ_PEAK_SHIFT, /* peaking */ + EQ_PEAK_SHIFT, /* peaking */ EQ_SHELF_SHIFT, /* high shelf */ }; unsigned int channels = AUDIO_DSP.data.num_channels; int i; - /* filter configuration currently is 1 low shelf filter, 3 band peaking + /* filter configuration currently is 1 low shelf filter, 8 band peaking filters and 1 high shelf filter, in that order. we need to know this so we can choose the correct shift factor. */ - for (i = 0; i < 5; i++) + for (i = 0; i < 10; i++) { if (!eq_data.enabled[i]) continue; --- apps/menus/eq_menu.c +++ apps/menus/eq_menu.c @@ -74,7 +74,7 @@ dsp_set_eq(global_settings.eq_enabled); dsp_set_eq_precut(global_settings.eq_precut); /* Update all bands */ - for(i = 0; i < 5; i++) { + for(i = 0; i < 10; i++) { dsp_set_eq_coefs(i); } } @@ -102,18 +102,33 @@ MENUITEM_SETTING(cutoff_2, &global_settings.eq_band2_cutoff, eq_setting_callback); MENUITEM_SETTING(cutoff_3, &global_settings.eq_band3_cutoff, eq_setting_callback); MENUITEM_SETTING(cutoff_4, &global_settings.eq_band4_cutoff, eq_setting_callback); +MENUITEM_SETTING(cutoff_5, &global_settings.eq_band5_cutoff, eq_setting_callback); +MENUITEM_SETTING(cutoff_6, &global_settings.eq_band6_cutoff, eq_setting_callback); +MENUITEM_SETTING(cutoff_7, &global_settings.eq_band7_cutoff, eq_setting_callback); +MENUITEM_SETTING(cutoff_8, &global_settings.eq_band8_cutoff, eq_setting_callback); +MENUITEM_SETTING(cutoff_9, &global_settings.eq_band9_cutoff, eq_setting_callback); MENUITEM_SETTING(q_0, &global_settings.eq_band0_q, eq_setting_callback); MENUITEM_SETTING(q_1, &global_settings.eq_band1_q, eq_setting_callback); MENUITEM_SETTING(q_2, &global_settings.eq_band2_q, eq_setting_callback); MENUITEM_SETTING(q_3, &global_settings.eq_band3_q, eq_setting_callback); MENUITEM_SETTING(q_4, &global_settings.eq_band4_q, eq_setting_callback); +MENUITEM_SETTING(q_5, &global_settings.eq_band5_q, eq_setting_callback); +MENUITEM_SETTING(q_6, &global_settings.eq_band6_q, eq_setting_callback); +MENUITEM_SETTING(q_7, &global_settings.eq_band7_q, eq_setting_callback); +MENUITEM_SETTING(q_8, &global_settings.eq_band8_q, eq_setting_callback); +MENUITEM_SETTING(q_9, &global_settings.eq_band9_q, eq_setting_callback); MENUITEM_SETTING(gain_0, &global_settings.eq_band0_gain, eq_setting_callback); MENUITEM_SETTING(gain_1, &global_settings.eq_band1_gain, eq_setting_callback); MENUITEM_SETTING(gain_2, &global_settings.eq_band2_gain, eq_setting_callback); MENUITEM_SETTING(gain_3, &global_settings.eq_band3_gain, eq_setting_callback); MENUITEM_SETTING(gain_4, &global_settings.eq_band4_gain, eq_setting_callback); +MENUITEM_SETTING(gain_5, &global_settings.eq_band5_gain, eq_setting_callback); +MENUITEM_SETTING(gain_6, &global_settings.eq_band6_gain, eq_setting_callback); +MENUITEM_SETTING(gain_7, &global_settings.eq_band7_gain, eq_setting_callback); +MENUITEM_SETTING(gain_8, &global_settings.eq_band8_gain, eq_setting_callback); +MENUITEM_SETTING(gain_9, &global_settings.eq_band9_gain, eq_setting_callback); static char* gainitem_get_name(int selected_item, void * data, char *buffer) { @@ -162,14 +177,41 @@ do_option, (void*)&gain_4, gainitem_get_name, gainitem_speak_item, &global_settings.eq_band4_cutoff, NULL, Icon_NOICON); +MENUITEM_FUNCTION_DYNTEXT(gain_item_5, MENU_FUNC_USEPARAM, + do_option, (void*)&gain_5, + gainitem_get_name, gainitem_speak_item, + &global_settings.eq_band5_cutoff, NULL, Icon_NOICON); +MENUITEM_FUNCTION_DYNTEXT(gain_item_6, MENU_FUNC_USEPARAM, + do_option, (void*)&gain_6, + gainitem_get_name, gainitem_speak_item, + &global_settings.eq_band6_cutoff, NULL, Icon_NOICON); +MENUITEM_FUNCTION_DYNTEXT(gain_item_7, MENU_FUNC_USEPARAM, + do_option, (void*)&gain_7, + gainitem_get_name, gainitem_speak_item, + &global_settings.eq_band7_cutoff, NULL, Icon_NOICON); +MENUITEM_FUNCTION_DYNTEXT(gain_item_8, MENU_FUNC_USEPARAM, + do_option, (void*)&gain_8, + gainitem_get_name, gainitem_speak_item, + &global_settings.eq_band8_cutoff, NULL, Icon_NOICON); +MENUITEM_FUNCTION_DYNTEXT(gain_item_9, MENU_FUNC_USEPARAM, + do_option, (void*)&gain_9, + gainitem_get_name, gainitem_speak_item, + &global_settings.eq_band9_cutoff, NULL, Icon_NOICON); -MAKE_MENU(gain_menu, ID2P(LANG_EQUALIZER_GAIN), NULL, Icon_NOICON, &gain_item_0, - &gain_item_1, &gain_item_2, &gain_item_3, &gain_item_4); +MAKE_MENU(gain_menu, ID2P(LANG_EQUALIZER_GAIN), NULL, Icon_NOICON, +&gain_item_0, + &gain_item_1, &gain_item_2, &gain_item_3, &gain_item_4, &gain_item_5, + &gain_item_6, &gain_item_7, &gain_item_8, &gain_item_9); -static const struct menu_item_ex *band_items[3][3] = { +static const struct menu_item_ex *band_items[8][3] = { { &cutoff_1, &q_1, &gain_1 }, { &cutoff_2, &q_2, &gain_2 }, - { &cutoff_3, &q_3, &gain_3 } + { &cutoff_3, &q_3, &gain_3 }, + { &cutoff_4, &q_4, &gain_4 }, + { &cutoff_5, &q_5, &gain_5 }, + { &cutoff_6, &q_6, &gain_6 }, + { &cutoff_7, &q_7, &gain_7 }, + { &cutoff_8, &q_8, &gain_8 } }; static char* centerband_get_name(int selected_item, void * data, char *buffer) @@ -221,11 +263,31 @@ do_center_band_menu, (void*)3, centerband_get_name, centerband_speak_item, (void*)3, NULL, Icon_EQ); -MAKE_MENU(band_4_menu, ID2P(LANG_EQUALIZER_BAND_HIGH_SHELF), NULL, - Icon_EQ, &cutoff_4, &q_4, &gain_4); +MENUITEM_FUNCTION_DYNTEXT(band_4_menu, MENU_FUNC_USEPARAM, + do_center_band_menu, (void*)4, + centerband_get_name, centerband_speak_item, + (void*)4, NULL, Icon_EQ); +MENUITEM_FUNCTION_DYNTEXT(band_5_menu, MENU_FUNC_USEPARAM, + do_center_band_menu, (void*)5, + centerband_get_name, centerband_speak_item, + (void*)5, NULL, Icon_EQ); +MENUITEM_FUNCTION_DYNTEXT(band_6_menu, MENU_FUNC_USEPARAM, + do_center_band_menu, (void*)6, + centerband_get_name, centerband_speak_item, + (void*)6, NULL, Icon_EQ); +MENUITEM_FUNCTION_DYNTEXT(band_7_menu, MENU_FUNC_USEPARAM, + do_center_band_menu, (void*)7, + centerband_get_name, centerband_speak_item, + (void*)7, NULL, Icon_EQ); +MENUITEM_FUNCTION_DYNTEXT(band_8_menu, MENU_FUNC_USEPARAM, + do_center_band_menu, (void*)8, + centerband_get_name, centerband_speak_item, + (void*)8, NULL, Icon_EQ); +MAKE_MENU(band_9_menu, ID2P(LANG_EQUALIZER_BAND_HIGH_SHELF), NULL, + Icon_EQ, &cutoff_9, &q_9, &gain_9); MAKE_MENU(advanced_eq_menu_, ID2P(LANG_EQUALIZER_ADVANCED), NULL, Icon_EQ, - &band_0_menu, &band_1_menu, &band_2_menu, &band_3_menu, &band_4_menu); + &band_0_menu, &band_1_menu, &band_2_menu, &band_3_menu, &band_4_menu, &band_5_menu, &band_6_menu, &band_7_menu, &band_8_menu, &band_9_menu); enum eq_slider_mode { @@ -281,7 +343,7 @@ if (band == 0) { screen->putsxy(x1, y1, "LS: "); screen->getstringsize("LS:", &w, &h); - } else if (band == 4) { + } else if (band == 9) { screen->putsxy(x1, y1, "HS: "); screen->getstringsize("HS:", &w, &h); } else { @@ -353,8 +415,8 @@ int height = y; int *setting = &global_settings.eq_band0_cutoff; - start_item = MIN(start_item, 5-nb_eq_sliders); - for (i=0; i<5; i++) { + start_item = MIN(start_item, 10-nb_eq_sliders); + for (i=0; i<10; i++) { cutoff = *setting++; q = *setting++; gain = *setting++; @@ -370,9 +432,9 @@ height++; } } - if (nb_eq_sliders != 5) + if (nb_eq_sliders != 10) gui_scrollbar_draw(screen, 0, y, SCROLLBAR_SIZE - 1, - screen->lcdheight - y, 5, + screen->lcdheight - y, 10, start_item, start_item + nb_eq_sliders, VERTICAL); return; @@ -411,8 +473,8 @@ if (height > screens[i].lcdheight) nb_eq_sliders[i]--; - if (nb_eq_sliders[i] > 5) - nb_eq_sliders[i] = 5; + if (nb_eq_sliders[i] > 10) + nb_eq_sliders[i] = 10; } y = h + 1; @@ -472,12 +534,12 @@ } /* Draw scrollbar if needed */ - if (nb_eq_sliders[i] != 5) + if (nb_eq_sliders[i] != 10) { if (current_band == 0) { start_item = 0; - } else if (current_band == 4) { - start_item = 5 - nb_eq_sliders[i]; + } else if (current_band == 9) { + start_item = 10 - nb_eq_sliders[i]; } else { start_item = current_band - 1; } @@ -530,13 +592,13 @@ case ACTION_STD_PREVREPEAT: current_band--; if (current_band < 0) - current_band = 4; /* wrap around */ + current_band = 9; /* wrap around */ break; case ACTION_STD_NEXT: case ACTION_STD_NEXTREPEAT: current_band++; - if (current_band > 4) + if (current_band > 9) current_band = 0; /* wrap around */ break; --- apps/settings.c +++ apps/settings.c @@ -991,7 +991,7 @@ /* Configure software equalizer, hardware eq is handled in audio_init() */ dsp_set_eq(global_settings.eq_enabled); dsp_set_eq_precut(global_settings.eq_precut); - for(i = 0; i < 5; i++) { + for(i = 0; i < 10; i++) { dsp_set_eq_coefs(i); } --- apps/settings.h +++ apps/settings.h @@ -368,6 +368,31 @@ int eq_band4_q; int eq_band4_gain; /* +/- dB */ + /* Band 5 settings */ + int eq_band5_cutoff; /* Hz */ + int eq_band5_q; + int eq_band5_gain; /* +/- dB */ + + /* Band 6 settings */ + int eq_band6_cutoff; /* Hz */ + int eq_band6_q; + int eq_band6_gain; /* +/- dB */ + + /* Band 7 settings */ + int eq_band7_cutoff; /* Hz */ + int eq_band7_q; + int eq_band7_gain; /* +/- dB */ + + /* Band 8 settings */ + int eq_band8_cutoff; /* Hz */ + int eq_band8_q; + int eq_band8_gain; /* +/- dB */ + + /* Band 9 settings */ + int eq_band9_cutoff; /* Hz */ + int eq_band9_q; + int eq_band9_gain; /* +/- dB */ + /* Misc. swcodec */ int beep; /* system beep volume when changing tracks etc. */ int keyclick; /* keyclick volume */ --- apps/settings_list.c +++ apps/settings_list.c @@ -1421,19 +1421,34 @@ get_precut_talkid, dsp_set_eq_precut), /* 0..32768 Hz */ INT_SETTING_NOWRAP(F_EQSETTING, eq_band0_cutoff, LANG_EQUALIZER_BAND_CUTOFF, - 60, "eq band 0 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, + 30, "eq band 0 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL), INT_SETTING_NOWRAP(F_EQSETTING, eq_band1_cutoff, LANG_EQUALIZER_BAND_CENTER, - 200, "eq band 1 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, + 60, "eq band 1 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL), INT_SETTING_NOWRAP(F_EQSETTING, eq_band2_cutoff, LANG_EQUALIZER_BAND_CENTER, - 800, "eq band 2 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, + 120, "eq band 2 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL), INT_SETTING_NOWRAP(F_EQSETTING, eq_band3_cutoff, LANG_EQUALIZER_BAND_CENTER, - 4000, "eq band 3 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, + 250, "eq band 3 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL), - INT_SETTING_NOWRAP(F_EQSETTING, eq_band4_cutoff, LANG_EQUALIZER_BAND_CUTOFF, - 12000, "eq band 4 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, + INT_SETTING_NOWRAP(F_EQSETTING, eq_band4_cutoff, LANG_EQUALIZER_BAND_CENTER, + 500, "eq band 4 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, + EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band5_cutoff, LANG_EQUALIZER_BAND_CENTER, + 1000, "eq band 5 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, + EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band6_cutoff, LANG_EQUALIZER_BAND_CENTER, + 2000, "eq band 6 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, + EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band7_cutoff, LANG_EQUALIZER_BAND_CENTER, + 4000, "eq band 7 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, + EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band8_cutoff, LANG_EQUALIZER_BAND_CENTER, + 8000, "eq band 8 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, + EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band9_cutoff, LANG_EQUALIZER_BAND_CUTOFF, + 16000, "eq band 9 cutoff", UNIT_HERTZ, EQ_CUTOFF_MIN, EQ_CUTOFF_MAX, EQ_CUTOFF_STEP, NULL, NULL, NULL), /* 0..64 (or 0.0 to 6.4) */ INT_SETTING_NOWRAP(F_EQSETTING, eq_band0_q, LANG_EQUALIZER_BAND_Q, 7, @@ -1448,9 +1463,24 @@ INT_SETTING_NOWRAP(F_EQSETTING, eq_band3_q, LANG_EQUALIZER_BAND_Q, 10, "eq band 3 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP, eq_q_format, get_dec_talkid, NULL), - INT_SETTING_NOWRAP(F_EQSETTING, eq_band4_q, LANG_EQUALIZER_BAND_Q, 7, + INT_SETTING_NOWRAP(F_EQSETTING, eq_band4_q, LANG_EQUALIZER_BAND_Q, 10, "eq band 4 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP, eq_q_format, get_dec_talkid, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band5_q, LANG_EQUALIZER_BAND_Q, 10, + "eq band 5 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP, + eq_q_format, get_dec_talkid, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band6_q, LANG_EQUALIZER_BAND_Q, 10, + "eq band 6 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP, + eq_q_format, get_dec_talkid, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band7_q, LANG_EQUALIZER_BAND_Q, 10, + "eq band 7 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP, + eq_q_format, get_dec_talkid, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band8_q, LANG_EQUALIZER_BAND_Q, 10, + "eq band 8 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP, + eq_q_format, get_dec_talkid, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band9_q, LANG_EQUALIZER_BAND_Q, 7, + "eq band 9 q", UNIT_INT, EQ_Q_MIN, EQ_Q_MAX, EQ_Q_STEP, + eq_q_format, get_dec_talkid, NULL), /* -240..240 (or -24db to +24db) */ INT_SETTING_NOWRAP(F_EQSETTING, eq_band0_gain, LANG_GAIN, 0, "eq band 0 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, @@ -1467,6 +1497,22 @@ INT_SETTING_NOWRAP(F_EQSETTING, eq_band4_gain, LANG_GAIN, 0, "eq band 4 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, EQ_GAIN_STEP, db_format, get_dec_talkid, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band5_gain, LANG_GAIN, 0, + "eq band 5 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, + EQ_GAIN_STEP, db_format, get_dec_talkid, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band6_gain, LANG_GAIN, 0, + "eq band 6 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, + EQ_GAIN_STEP, db_format, get_dec_talkid, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band7_gain, LANG_GAIN, 0, + "eq band 7 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, + EQ_GAIN_STEP, db_format, get_dec_talkid, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band8_gain, LANG_GAIN, 0, + "eq band 8 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, + EQ_GAIN_STEP, db_format, get_dec_talkid, NULL), + INT_SETTING_NOWRAP(F_EQSETTING, eq_band9_gain, LANG_GAIN, 0, + "eq band 9 gain", UNIT_DB, EQ_GAIN_MIN, EQ_GAIN_MAX, + EQ_GAIN_STEP, db_format, get_dec_talkid, NULL), + /* dithering */ OFFON_SETTING(F_SOUNDSETTING, dithering_enabled, LANG_DITHERING, false,