1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
10 * Copyright (C) 2007 Jonathan Gordon
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
31 #include "sound_menu.h"
33 #include "exported_menus.h"
34 #include "menu_common.h"
39 /***********************************/
41 MENUITEM_SETTING(volume
, &global_settings
.volume
, NULL
);
42 #ifdef AUDIOHW_HAVE_BASS
43 MENUITEM_SETTING(bass
, &global_settings
.bass
,
44 #ifdef HAVE_SW_TONE_CONTROLS
51 #ifdef AUDIOHW_HAVE_BASS_CUTOFF
52 MENUITEM_SETTING(bass_cutoff
, &global_settings
.bass_cutoff
, NULL
);
54 #endif /* AUDIOHW_HAVE_BASS */
57 #ifdef AUDIOHW_HAVE_TREBLE
58 MENUITEM_SETTING(treble
, &global_settings
.treble
,
59 #ifdef HAVE_SW_TONE_CONTROLS
66 #ifdef AUDIOHW_HAVE_TREBLE_CUTOFF
67 MENUITEM_SETTING(treble_cutoff
, &global_settings
.treble_cutoff
, NULL
);
69 #endif /* AUDIOHW_HAVE_TREBLE */
72 MENUITEM_SETTING(balance
, &global_settings
.balance
, NULL
);
73 MENUITEM_SETTING(channel_config
, &global_settings
.channel_config
,
74 #if CONFIG_CODEC == SWCODEC
80 MENUITEM_SETTING(stereo_width
, &global_settings
.stereo_width
,
81 #if CONFIG_CODEC == SWCODEC
88 #ifdef AUDIOHW_HAVE_DEPTH_3D
89 MENUITEM_SETTING(depth_3d
, &global_settings
.depth_3d
, NULL
);
92 #if CONFIG_CODEC == SWCODEC
93 /* Crossfeed Submenu */
94 MENUITEM_SETTING(crossfeed
, &global_settings
.crossfeed
, lowlatency_callback
);
95 MENUITEM_SETTING(crossfeed_direct_gain
,
96 &global_settings
.crossfeed_direct_gain
, lowlatency_callback
);
97 MENUITEM_SETTING(crossfeed_cross_gain
,
98 &global_settings
.crossfeed_cross_gain
, lowlatency_callback
);
99 MENUITEM_SETTING(crossfeed_hf_attenuation
,
100 &global_settings
.crossfeed_hf_attenuation
, lowlatency_callback
);
101 MENUITEM_SETTING(crossfeed_hf_cutoff
,
102 &global_settings
.crossfeed_hf_cutoff
, lowlatency_callback
);
103 MAKE_MENU(crossfeed_menu
,ID2P(LANG_CROSSFEED
), NULL
, Icon_NOICON
,
104 &crossfeed
, &crossfeed_direct_gain
, &crossfeed_cross_gain
,
105 &crossfeed_hf_attenuation
, &crossfeed_hf_cutoff
);
107 static int timestretch_callback(int action
,const struct menu_item_ex
*this_item
)
111 case ACTION_EXIT_MENUITEM
: /* on exit */
112 if (global_settings
.timestretch_enabled
&& !dsp_timestretch_available())
113 splash(HZ
*2, ID2P(LANG_PLEASE_REBOOT
));
116 lowlatency_callback(action
, this_item
);
119 MENUITEM_SETTING(timestretch_enabled
,
120 &global_settings
.timestretch_enabled
, timestretch_callback
);
121 MENUITEM_SETTING(dithering_enabled
,
122 &global_settings
.dithering_enabled
, lowlatency_callback
);
124 /* compressor submenu */
125 MENUITEM_SETTING(compressor_threshold
,
126 &global_settings
.compressor_threshold
, lowlatency_callback
);
127 MENUITEM_SETTING(compressor_gain
,
128 &global_settings
.compressor_makeup_gain
, lowlatency_callback
);
129 MENUITEM_SETTING(compressor_ratio
,
130 &global_settings
.compressor_ratio
, lowlatency_callback
);
131 MENUITEM_SETTING(compressor_knee
,
132 &global_settings
.compressor_knee
, lowlatency_callback
);
133 MENUITEM_SETTING(compressor_release
,
134 &global_settings
.compressor_release_time
, lowlatency_callback
);
135 MAKE_MENU(compressor_menu
,ID2P(LANG_COMPRESSOR
), NULL
, Icon_NOICON
,
136 &compressor_threshold
, &compressor_gain
, &compressor_ratio
,
137 &compressor_knee
, &compressor_release
);
140 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
141 MENUITEM_SETTING(loudness
, &global_settings
.loudness
, NULL
);
142 MENUITEM_SETTING(avc
, &global_settings
.avc
, NULL
);
143 MENUITEM_SETTING(superbass
, &global_settings
.superbass
, NULL
);
144 MENUITEM_SETTING(mdb_enable
, &global_settings
.mdb_enable
, NULL
);
145 MENUITEM_SETTING(mdb_strength
, &global_settings
.mdb_strength
, NULL
);
146 MENUITEM_SETTING(mdb_harmonics
, &global_settings
.mdb_harmonics
, NULL
);
147 MENUITEM_SETTING(mdb_center
, &global_settings
.mdb_center
, NULL
);
148 MENUITEM_SETTING(mdb_shape
, &global_settings
.mdb_shape
, NULL
);
152 MENUITEM_SETTING(speaker_enabled
, &global_settings
.speaker_enabled
, NULL
);
155 #ifdef AUDIOHW_HAVE_EQ
156 #endif /* AUDIOHW_HAVE_EQ */
158 MAKE_MENU(sound_settings
, ID2P(LANG_SOUND_SETTINGS
), NULL
, Icon_Audio
,
160 #ifdef AUDIOHW_HAVE_BASS
163 #ifdef AUDIOHW_HAVE_BASS_CUTOFF
166 #ifdef AUDIOHW_HAVE_TREBLE
169 #ifdef AUDIOHW_HAVE_TREBLE_CUTOFF
172 #ifdef AUDIOHW_HAVE_EQ
173 ,&audiohw_eq_tone_controls
175 ,&balance
,&channel_config
,&stereo_width
176 #ifdef AUDIOHW_HAVE_DEPTH_3D
179 #if CONFIG_CODEC == SWCODEC
180 ,&crossfeed_menu
, &equalizer_menu
, &dithering_enabled
181 ,×tretch_enabled
184 #if (CONFIG_CODEC == MAS3587F) || (CONFIG_CODEC == MAS3539F)
185 ,&loudness
,&avc
,&superbass
,&mdb_enable
,&mdb_strength
186 ,&mdb_harmonics
,&mdb_center
,&mdb_shape