The install window doesn't need to be wider than the other ones.
[Rockbox.git] / apps / menus / sound_menu.c
blob704ceeb7f6c1a217b3fa27b0394ebe7e639871c8
2 /***************************************************************************
3 * __________ __ ___.
4 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
5 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
6 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
7 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 * \/ \/ \/ \/ \/
9 * $Id$
11 * Copyright (C) 2007 Jonathan Gordon
13 * All files in this archive are subject to the GNU General Public License.
14 * See the file COPYING in the source tree root for full license agreement.
16 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
17 * KIND, either express or implied.
19 ****************************************************************************/
21 #include <stdbool.h>
22 #include <stddef.h>
23 #include <limits.h>
24 #include "config.h"
25 #include "lang.h"
26 #include "action.h"
27 #include "settings.h"
28 #include "menu.h"
29 #include "sound_menu.h"
30 #include "eq_menu.h"
31 #if CONFIG_CODEC == SWCODEC
32 #include "pcmbuf.h"
33 #endif
34 #include "exported_menus.h"
36 /***********************************/
37 /* SOUND MENU */
38 #if CONFIG_CODEC == SWCODEC
39 int soundmenu_callback(int action,const struct menu_item_ex *this_item)
41 (void)this_item;
42 switch (action)
44 case ACTION_ENTER_MENUITEM: /* on entering an item */
45 pcmbuf_set_low_latency(true);
46 break;
47 case ACTION_EXIT_MENUITEM: /* on exit */
48 pcmbuf_set_low_latency(false);
49 break;
51 return action;
53 #else
54 #define soundmenu_callback NULL
55 #endif
57 MENUITEM_SETTING(volume, &global_settings.volume, soundmenu_callback);
58 MENUITEM_SETTING(bass, &global_settings.bass, soundmenu_callback);
59 MENUITEM_SETTING(treble, &global_settings.treble, soundmenu_callback);
60 MENUITEM_SETTING(balance, &global_settings.balance, soundmenu_callback);
61 MENUITEM_SETTING(channel_config, &global_settings.channel_config, soundmenu_callback);
62 MENUITEM_SETTING(stereo_width, &global_settings.stereo_width, soundmenu_callback);
64 #if CONFIG_CODEC == SWCODEC
65 /* Crossfeed Submenu */
66 MENUITEM_SETTING(crossfeed, &global_settings.crossfeed, soundmenu_callback);
67 MENUITEM_SETTING(crossfeed_direct_gain,
68 &global_settings.crossfeed_direct_gain, soundmenu_callback);
69 MENUITEM_SETTING(crossfeed_cross_gain,
70 &global_settings.crossfeed_cross_gain, soundmenu_callback);
71 MENUITEM_SETTING(crossfeed_hf_attenuation,
72 &global_settings.crossfeed_hf_attenuation, soundmenu_callback);
73 MENUITEM_SETTING(crossfeed_hf_cutoff,
74 &global_settings.crossfeed_hf_cutoff, soundmenu_callback);
75 MAKE_MENU(crossfeed_menu,ID2P(LANG_CROSSFEED), NULL, Icon_NOICON,
76 &crossfeed, &crossfeed_direct_gain, &crossfeed_cross_gain,
77 &crossfeed_hf_attenuation, &crossfeed_hf_cutoff);
79 MENUITEM_SETTING(dithering_enabled,
80 &global_settings.dithering_enabled, soundmenu_callback);
81 #endif
83 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
84 MENUITEM_SETTING(loudness, &global_settings.loudness, NULL);
85 MENUITEM_SETTING(avc, &global_settings.avc, NULL);
86 MENUITEM_SETTING(superbass, &global_settings.superbass, NULL);
87 MENUITEM_SETTING(mdb_enable, &global_settings.mdb_enable, NULL);
88 MENUITEM_SETTING(mdb_strength, &global_settings.mdb_strength, NULL);
89 MENUITEM_SETTING(mdb_harmonics, &global_settings.mdb_harmonics, NULL);
90 MENUITEM_SETTING(mdb_center, &global_settings.mdb_center, NULL);
91 MENUITEM_SETTING(mdb_shape, &global_settings.mdb_shape, NULL);
92 #endif
96 MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, Icon_Audio,
97 &volume,
98 &bass,&treble,
99 &balance,&channel_config,&stereo_width
100 #if CONFIG_CODEC == SWCODEC
101 ,&crossfeed_menu, &equalizer_menu, &dithering_enabled
102 #endif
103 #ifdef HAVE_WM8758
104 ,&hw_eq_menu
105 #endif
106 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
107 ,&loudness,&avc,&superbass,&mdb_enable,&mdb_strength
108 ,&mdb_harmonics,&mdb_center,&mdb_shape
109 #endif