diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-09-25 02:44:50 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-09-25 02:44:50 +0000 |
commit | 4196e7c59c16b3fea4b85f9b9c5373a624094f91 (patch) | |
tree | 0d5e3d21ba61aa67f6fc5faa2dd2426223139774 | |
parent | 968ba0a277d2437f109b8b1dde66dacfc5ee2126 (diff) | |
download | rockbox-4196e7c59c16b3fea4b85f9b9c5373a624094f91.tar.gz rockbox-4196e7c59c16b3fea4b85f9b9c5373a624094f91.zip |
Fix the eq menu so changes are applied after using the "simple eq settings" menu
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14849 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/menus/eq_menu.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/apps/menus/eq_menu.c b/apps/menus/eq_menu.c index 883c55d830..36f925a036 100644 --- a/apps/menus/eq_menu.c +++ b/apps/menus/eq_menu.c | |||
@@ -46,6 +46,7 @@ | |||
46 | #include "keyboard.h" | 46 | #include "keyboard.h" |
47 | #include "gui/scrollbar.h" | 47 | #include "gui/scrollbar.h" |
48 | #include "eq_menu.h" | 48 | #include "eq_menu.h" |
49 | #include "pcmbuf.h" | ||
49 | #ifdef HAVE_WM8758 | 50 | #ifdef HAVE_WM8758 |
50 | #include "wm8758.h" | 51 | #include "wm8758.h" |
51 | #endif | 52 | #endif |
@@ -78,23 +79,25 @@ void eq_precut_format(char* buffer, size_t buffer_size, int value, const char* u | |||
78 | /* | 79 | /* |
79 | * Settings functions | 80 | * Settings functions |
80 | */ | 81 | */ |
81 | int enable_callback(int action, const struct menu_item_ex *this_item) | 82 | void eq_apply(void) |
82 | { | 83 | { |
83 | int i; | 84 | int i; |
85 | dsp_set_eq(global_settings.eq_enabled); | ||
86 | dsp_set_eq_precut(global_settings.eq_precut); | ||
87 | /* Update all bands */ | ||
88 | for(i = 0; i < 5; i++) { | ||
89 | dsp_set_eq_coefs(i); | ||
90 | } | ||
91 | } | ||
92 | int enable_callback(int action, const struct menu_item_ex *this_item) | ||
93 | { | ||
84 | (void)this_item; | 94 | (void)this_item; |
85 | if (action == ACTION_EXIT_MENUITEM) | 95 | if (action == ACTION_EXIT_MENUITEM) |
86 | { | 96 | eq_apply(); |
87 | dsp_set_eq(global_settings.eq_enabled); | ||
88 | dsp_set_eq_precut(global_settings.eq_precut); | ||
89 | /* Update all bands */ | ||
90 | for(i = 0; i < 5; i++) { | ||
91 | dsp_set_eq_coefs(i); | ||
92 | } | ||
93 | } | ||
94 | return action; | 97 | return action; |
95 | } | 98 | } |
96 | MENUITEM_SETTING(eq_enable, &global_settings.eq_enabled, enable_callback); | 99 | MENUITEM_SETTING(eq_enable, &global_settings.eq_enabled, enable_callback); |
97 | MENUITEM_SETTING(eq_precut, &global_settings.eq_precut, NULL); | 100 | MENUITEM_SETTING(eq_precut, &global_settings.eq_precut, enable_callback); |
98 | 101 | ||
99 | int dsp_set_coefs_callback(int action, const struct menu_item_ex *this_item) | 102 | int dsp_set_coefs_callback(int action, const struct menu_item_ex *this_item) |
100 | { | 103 | { |
@@ -121,6 +124,7 @@ int do_option(void* param) | |||
121 | { | 124 | { |
122 | const struct menu_item_ex *setting = (const struct menu_item_ex*)param; | 125 | const struct menu_item_ex *setting = (const struct menu_item_ex*)param; |
123 | do_setting_from_menu(setting); | 126 | do_setting_from_menu(setting); |
127 | eq_apply(); | ||
124 | return 0; | 128 | return 0; |
125 | } | 129 | } |
126 | 130 | ||
@@ -636,7 +640,7 @@ MENUITEM_FUNCTION(eq_browse, 0, ID2P(LANG_EQUALIZER_BROWSE), | |||
636 | (int(*)(void))eq_browse_presets, NULL, NULL, Icon_NOICON); | 640 | (int(*)(void))eq_browse_presets, NULL, NULL, Icon_NOICON); |
637 | 641 | ||
638 | int soundmenu_callback(int action,const struct menu_item_ex *this_item); | 642 | int soundmenu_callback(int action,const struct menu_item_ex *this_item); |
639 | MAKE_MENU(equalizer_menu, ID2P(LANG_EQUALIZER), soundmenu_callback, Icon_EQ, | 643 | MAKE_MENU(equalizer_menu, ID2P(LANG_EQUALIZER), NULL, Icon_EQ, |
640 | &eq_enable, &eq_graphical, &eq_precut, &gain_menu, | 644 | &eq_enable, &eq_graphical, &eq_precut, &gain_menu, |
641 | &advanced_eq_menu_, &eq_save, &eq_browse); | 645 | &advanced_eq_menu_, &eq_save, &eq_browse); |
642 | 646 | ||