rockbox/apps/menus
Amaury Pouly 1245c5fe61 Implement speaker enable/disable on jack (un)plug
The implementation is not very complicated but there are a few things worth
noting. There was a previous "speaker enable" setting but it was a boolean.
I decided to replace it with a choice setting that has 2 options (on, off)
if headphones cannot be detect on this target, or 3 options (on, off, auto)
if we can detect headphones. This will break the old setting on target that
cannot detect jack but it makes the code more uniform and avoid maintaining
two settings with more #ifdef. The third option (auto) uses the LANG_AUTO
text, which I think is clear enough (disable speaker on jack plug).
In order to avoid code duplication (both in apps and firmware), I decided to
keep the audiohw_enable_speaker function as-is: it takes a boolean and doesn't
care about the speaker policy. I introduced a new audio_enable_speaker that
takes directly the mode (which follows the setting encoding): 0=off, 1=on
and 2=auto. This way one calls audio_enable_speaker and it changes the speaker
once to reflect the request mode. The apps code then uses this function in the
places where it makes sense: on setting load, setting change and jack (un)plug
event.

Change-Id: I027873f698eb4bc365d7c02b515297806355d9e2
2017-02-04 17:22:08 +01:00
..
audiohw_eq_menu.c
display_menu.c Selective Backlight/Advanced Softlock - Selective actions based on context 2017-01-17 23:06:17 +01:00
eq_menu.c Fix incorrect language string reference in eq_menu.c 2014-01-26 16:26:00 +01:00
eq_menu.h EQ: - Fine grained EQ configuration 2013-03-05 03:19:34 +01:00
exported_menus.h playlist_viewer: Resurrect playlist viewer settings submenu in the playlist viewer context menu. 2014-01-11 10:46:37 +01:00
main_menu.c Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
menu_common.c
menu_common.h
playback_menu.c Get rid of some superfluous single-purpose functions in playback. 2013-07-13 00:08:51 -04:00
playlist_menu.c playlist: Get rid of plugin buffer use in playlist_save(). 2014-04-15 23:54:28 +02:00
plugin_menu.c
radio_menu.c Fix FS#12158 - Make the "Mode: " line in the radio menu voice. 2011-06-16 13:28:15 +00:00
recording_menu.c Reuse frequency string from recording for playback frequency. 2013-07-06 17:14:02 -04:00
settings_menu.c Selective Backlight/Advanced Softlock - Selective actions based on context 2017-01-17 23:06:17 +01:00
sound_menu.c Implement speaker enable/disable on jack (un)plug 2017-02-04 17:22:08 +01:00
theme_menu.c Touchscreen: Show a line separator in lists. 2014-03-03 15:14:16 +01:00
time_menu.c lcd-common: Remove support for custom line heights from viewport. 2014-01-07 14:13:48 +01:00