rockbox/apps
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
..
bitmaps bitmaps: Use *x16.bmp also for upcoming 24bit targets (they are actually 24bit BMPs). 2014-06-21 00:13:58 +02:00
gui Selective Backlight/Advanced Softlock - Selective actions based on context 2017-01-17 23:06:17 +01:00
hosted/android Fix reds. 2014-03-14 23:43:45 +01:00
iap iAP: fix USB storage mount after using an iAP accessory 2016-08-26 00:16:16 +02:00
keymaps zenxfi3: fix recording keymap and simulator keymap 2016-09-21 00:29:42 +01:00
lang Selective Backlight/Advanced Softlock - Selective actions based on context 2017-01-17 23:06:17 +01:00
menus Implement speaker enable/disable on jack (un)plug 2017-02-04 17:22:08 +01:00
player
plugins Fix for Chessbox bug FS#10363 2017-02-01 01:33:48 +01:00
radio Replace SAMSUNG_YH920_PAD with YH92X 2016-01-25 09:23:09 +01:00
recorder Implement speaker enable/disable on jack (un)plug 2017-02-04 17:22:08 +01:00
abrepeat.c ab_repeat: Move GUI bits to the skin engine. This allows ab_repeat to be compiled headless. 2014-03-10 22:55:26 +01:00
abrepeat.h ab_repeat: Move GUI bits to the skin engine. This allows ab_repeat to be compiled headless. 2014-03-10 22:55:26 +01:00
action.c action.c must desist in calling set_cpu_frequency from a tick 2017-01-21 12:03:23 -05:00
action.h Selective Backlight/Advanced Softlock - Selective actions based on context 2017-01-17 23:06:17 +01:00
alarm_menu.c
alarm_menu.h
appevents.h Get rid of some superfluous single-purpose functions in playback. 2013-07-13 00:08:51 -04:00
applimits.h
apps.make
audio_path.c Implement speaker enable/disable on jack (un)plug 2017-02-04 17:22:08 +01:00
audio_thread.c talk: Remove superflous call to talk_init(). 2014-02-02 19:40:38 +01:00
audio_thread.h Update software recording engine to latest codec interface. 2013-06-30 00:40:27 +02:00
beep.c Enable setting of global output samplerate on certain targets. 2013-07-06 04:22:04 +02:00
bookmark.c Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
bookmark.h
buffering.c Cleanup unused function 2016-04-04 11:06:29 +02:00
buffering.h Remove I/O priority. It is harmful when used with the new file code. 2014-08-30 14:01:21 -04:00
codec_thread.c Remove I/O priority. It is harmful when used with the new file code. 2014-08-30 14:01:21 -04:00
codec_thread.h Update software recording engine to latest codec interface. 2013-06-30 00:40:27 +02:00
codecs.c Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
core_asmdefs.c
cuesheet.c Implements starting playback from a cuesheet. 2014-03-10 04:13:53 +01:00
cuesheet.h Implements starting playback from a cuesheet. 2014-03-10 04:13:53 +01:00
debug_menu.c AMS: Return ascodec to interrupt-based I2C2 driver 2017-01-25 00:05:13 +01:00
debug_menu.h
enc_config.c
enc_config.h
features.txt Get rid of USE_ROCKBOX_USB 2015-01-08 16:07:12 +01:00
filetree.c Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
filetree.h
filetypes.c Fix color of files with no extension. 2013-06-05 18:35:09 -04:00
filetypes.h
fracmul.h
keyboard.h
language.c
language.h
logfdisp.c Don't add new message to logf when we dump it to file 2016-04-04 11:07:44 +02:00
logfdisp.h
main.c iBasso DX50/DX90: Major code cleanup and reorganization. 2015-02-02 21:57:55 +01:00
menu.c menus: Stop scrolling before entering the USB screen or remnants of the previous list could appear on it. 2014-01-16 00:25:40 +01:00
menu.h
misc.c Implement speaker enable/disable on jack (un)plug 2017-02-04 17:22:08 +01:00
misc.h usb screen: Push the usb screen onto the activity stack. This enables %cs tag support for it. 2014-01-16 00:26:45 +01:00
mpeg.c Implement time-based resume and playback start. 2014-03-10 04:12:30 +01:00
mpeg.h
onplay.c Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
onplay.h
pcmbuf.c Fix previous errors for targets with no crossfade. 2017-01-05 03:22:47 -05:00
pcmbuf.h Playback: Fix problems with crossfade on short tracks. 2017-01-05 02:37:14 -05:00
playback.c Fix broken logf 2016-03-30 20:48:17 +00:00
playback.h playback,talk: Share audiobuffer via core_alloc_maximum(). 2013-12-23 12:17:38 +01:00
playlist.c Reenable database ramcache and playlist dircache 2017-01-17 15:27:47 -05:00
playlist.h Reenable database ramcache and playlist dircache 2017-01-17 15:27:47 -05:00
playlist_catalog.c Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
playlist_catalog.h
playlist_menu.h
playlist_viewer.c Don't shorten the playlist on shuffle. Fixes FS#13040 2015-04-19 12:31:45 +02:00
playlist_viewer.h
plugin.c Fix broken logf 2016-03-30 20:48:17 +00:00
plugin.h Implement speaker enable/disable on jack (un)plug 2017-02-04 17:22:08 +01:00
rbcodec_helpers.c
rbcodecconfig.h kernel: Break out kernel primitives into separate files and move to separate dir. 2014-03-03 18:11:57 +01:00
rbcodecplatform.h
README
root_menu.c iBasso DX50/DX90: Major code cleanup and reorganization. 2015-02-02 21:57:55 +01:00
root_menu.h root_menu: Remove previous_music_is_wps() and change previous_music via event callback. 2014-04-15 23:54:28 +02:00
screen_access.c Fix put_line via multiscreen API on remotes. Stupid me. 2014-01-08 10:45:00 +01:00
screen_access.h put_line/scrolling: Make the scroll engine inform custom scrollers about start/stop of scrolling. 2014-01-12 01:34:06 +01:00
screens.c Fix more reds. 2013-12-15 00:47:21 +01:00
screens.h
scrobbler.c iBasso DX50/DX90: Major code cleanup and reorganization. 2015-02-02 21:57:55 +01:00
scrobbler.h Get rid of some superfluous single-purpose functions in playback. 2013-07-13 00:08:51 -04:00
settings.c Implement speaker enable/disable on jack (un)plug 2017-02-04 17:22:08 +01:00
settings.h Implement speaker enable/disable on jack (un)plug 2017-02-04 17:22:08 +01:00
settings_list.c Implement speaker enable/disable on jack (un)plug 2017-02-04 17:22:08 +01:00
settings_list.h Selective Backlight/Advanced Softlock - Selective actions based on context 2017-01-17 23:06:17 +01:00
shortcuts.c Shortcuts: Add move callback for buflib allocations 2015-01-02 01:11:54 +01:00
shortcuts.h
sound_menu.h
SOURCES Selective Backlight/Advanced Softlock - Selective actions based on context 2017-01-17 23:06:17 +01:00
status.c
status.h
tagcache.c Reenable database ramcache and playlist dircache 2017-01-17 15:27:47 -05:00
tagcache.h Implement time-based resume and playback start. 2014-03-10 04:12:30 +01:00
tagnavi.config
tagtree.c events: Rework event subsystem (add_event, send_event) to be more versatile. 2014-03-14 23:36:30 +01:00
tagtree.h
talk.c talk: On hwcodec disabling DMA interrupt is required during buflib move 2014-02-03 12:43:05 +01:00
talk.h talk: Add debug menu entry to view statistics about talk engine. 2014-02-02 19:40:39 +01:00
tree.c Rewrite filesystem code (WIP) 2014-08-30 03:48:23 +02:00
tree.h Implement time-based resume and playback start. 2014-03-10 04:12:30 +01:00
usb_keymaps.c
usb_keymaps.h
voice_thread.c Fix warnings. 2014-02-03 12:33:33 +01:00
voice_thread.h

For general information see: docs/README
For API information see: docs/API