diff options
Diffstat (limited to 'apps/menus/sound_menu.c')
-rw-r--r-- | apps/menus/sound_menu.c | 70 |
1 files changed, 37 insertions, 33 deletions
diff --git a/apps/menus/sound_menu.c b/apps/menus/sound_menu.c index 127b01d342..315fef81b3 100644 --- a/apps/menus/sound_menu.c +++ b/apps/menus/sound_menu.c | |||
@@ -32,60 +32,64 @@ | |||
32 | #include "pcmbuf.h" | 32 | #include "pcmbuf.h" |
33 | #endif | 33 | #endif |
34 | #include "exported_menus.h" | 34 | #include "exported_menus.h" |
35 | #include "menu_common.h" | ||
35 | 36 | ||
36 | /***********************************/ | 37 | /***********************************/ |
37 | /* SOUND MENU */ | 38 | /* SOUND MENU */ |
38 | #if CONFIG_CODEC == SWCODEC | 39 | MENUITEM_SETTING(volume, &global_settings.volume, NULL); |
39 | /* This callback is also used in the eq menu to toggle low latency mode. | 40 | MENUITEM_SETTING(bass, &global_settings.bass, |
40 | So, remember this if the callback is used for anything other than the togging */ | 41 | #ifdef HAVE_SW_TONE_CONTROLS |
41 | int soundmenu_callback(int action, const struct menu_item_ex *this_item) | 42 | lowlatency_callback |
42 | { | ||
43 | (void)this_item; | ||
44 | switch (action) | ||
45 | { | ||
46 | case ACTION_ENTER_MENUITEM: /* on entering an item */ | ||
47 | pcmbuf_set_low_latency(true); | ||
48 | break; | ||
49 | case ACTION_EXIT_MENUITEM: /* on exit */ | ||
50 | pcmbuf_set_low_latency(false); | ||
51 | break; | ||
52 | } | ||
53 | return action; | ||
54 | } | ||
55 | #else | 43 | #else |
56 | #define soundmenu_callback NULL | 44 | NULL |
57 | #endif | 45 | #endif |
58 | 46 | ); | |
59 | MENUITEM_SETTING(volume, &global_settings.volume, soundmenu_callback); | ||
60 | MENUITEM_SETTING(bass, &global_settings.bass, soundmenu_callback); | ||
61 | #ifdef HAVE_WM8758 | 47 | #ifdef HAVE_WM8758 |
62 | MENUITEM_SETTING(bass_cutoff, &global_settings.bass_cutoff, soundmenu_callback); | 48 | MENUITEM_SETTING(bass_cutoff, &global_settings.bass_cutoff, NULL); |
63 | #endif | 49 | #endif |
64 | MENUITEM_SETTING(treble, &global_settings.treble, soundmenu_callback); | 50 | MENUITEM_SETTING(treble, &global_settings.treble, |
51 | #ifdef HAVE_SW_TONE_CONTROLS | ||
52 | lowlatency_callback | ||
53 | #else | ||
54 | NULL | ||
55 | #endif | ||
56 | ); | ||
65 | #ifdef HAVE_WM8758 | 57 | #ifdef HAVE_WM8758 |
66 | MENUITEM_SETTING(treble_cutoff, &global_settings.treble_cutoff, soundmenu_callback); | 58 | MENUITEM_SETTING(treble_cutoff, &global_settings.treble_cutoff, NULL); |
59 | #endif | ||
60 | MENUITEM_SETTING(balance, &global_settings.balance, NULL); | ||
61 | MENUITEM_SETTING(channel_config, &global_settings.channel_config, | ||
62 | #if CONFIG_CODEC == SWCODEC | ||
63 | lowlatency_callback | ||
64 | #else | ||
65 | NULL | ||
66 | #endif | ||
67 | ); | ||
68 | MENUITEM_SETTING(stereo_width, &global_settings.stereo_width, | ||
69 | #if CONFIG_CODEC == SWCODEC | ||
70 | lowlatency_callback | ||
71 | #else | ||
72 | NULL | ||
67 | #endif | 73 | #endif |
68 | MENUITEM_SETTING(balance, &global_settings.balance, soundmenu_callback); | 74 | ); |
69 | MENUITEM_SETTING(channel_config, &global_settings.channel_config, soundmenu_callback); | ||
70 | MENUITEM_SETTING(stereo_width, &global_settings.stereo_width, soundmenu_callback); | ||
71 | 75 | ||
72 | #if CONFIG_CODEC == SWCODEC | 76 | #if CONFIG_CODEC == SWCODEC |
73 | /* Crossfeed Submenu */ | 77 | /* Crossfeed Submenu */ |
74 | MENUITEM_SETTING(crossfeed, &global_settings.crossfeed, soundmenu_callback); | 78 | MENUITEM_SETTING(crossfeed, &global_settings.crossfeed, lowlatency_callback); |
75 | MENUITEM_SETTING(crossfeed_direct_gain, | 79 | MENUITEM_SETTING(crossfeed_direct_gain, |
76 | &global_settings.crossfeed_direct_gain, soundmenu_callback); | 80 | &global_settings.crossfeed_direct_gain, lowlatency_callback); |
77 | MENUITEM_SETTING(crossfeed_cross_gain, | 81 | MENUITEM_SETTING(crossfeed_cross_gain, |
78 | &global_settings.crossfeed_cross_gain, soundmenu_callback); | 82 | &global_settings.crossfeed_cross_gain, lowlatency_callback); |
79 | MENUITEM_SETTING(crossfeed_hf_attenuation, | 83 | MENUITEM_SETTING(crossfeed_hf_attenuation, |
80 | &global_settings.crossfeed_hf_attenuation, soundmenu_callback); | 84 | &global_settings.crossfeed_hf_attenuation, lowlatency_callback); |
81 | MENUITEM_SETTING(crossfeed_hf_cutoff, | 85 | MENUITEM_SETTING(crossfeed_hf_cutoff, |
82 | &global_settings.crossfeed_hf_cutoff, soundmenu_callback); | 86 | &global_settings.crossfeed_hf_cutoff, lowlatency_callback); |
83 | MAKE_MENU(crossfeed_menu,ID2P(LANG_CROSSFEED), NULL, Icon_NOICON, | 87 | MAKE_MENU(crossfeed_menu,ID2P(LANG_CROSSFEED), NULL, Icon_NOICON, |
84 | &crossfeed, &crossfeed_direct_gain, &crossfeed_cross_gain, | 88 | &crossfeed, &crossfeed_direct_gain, &crossfeed_cross_gain, |
85 | &crossfeed_hf_attenuation, &crossfeed_hf_cutoff); | 89 | &crossfeed_hf_attenuation, &crossfeed_hf_cutoff); |
86 | 90 | ||
87 | MENUITEM_SETTING(dithering_enabled, | 91 | MENUITEM_SETTING(dithering_enabled, |
88 | &global_settings.dithering_enabled, soundmenu_callback); | 92 | &global_settings.dithering_enabled, lowlatency_callback); |
89 | #endif | 93 | #endif |
90 | 94 | ||
91 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) | 95 | #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F) |