diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/lang/english.lang | 5 | ||||
-rw-r--r-- | apps/settings.c | 8 | ||||
-rw-r--r-- | apps/settings.h | 1 | ||||
-rw-r--r-- | apps/settings_menu.c | 8 | ||||
-rw-r--r-- | apps/wps-display.c | 16 |
5 files changed, 36 insertions, 2 deletions
diff --git a/apps/lang/english.lang b/apps/lang/english.lang index 9b0ef36782..8bef2ce5db 100644 --- a/apps/lang/english.lang +++ b/apps/lang/english.lang | |||
@@ -1482,3 +1482,8 @@ id: LANG_SCROLL_BAR | |||
1482 | desc: display menu, F3 substitute | 1482 | desc: display menu, F3 substitute |
1483 | eng: "Scroll Bar" | 1483 | eng: "Scroll Bar" |
1484 | new: | 1484 | new: |
1485 | |||
1486 | id: LANG_CAPTION_BACKLIGHT | ||
1487 | desc: in settings_menu | ||
1488 | eng: "Caption backlight" | ||
1489 | new: | ||
diff --git a/apps/settings.c b/apps/settings.c index 8b74df852b..f4949416cd 100644 --- a/apps/settings.c +++ b/apps/settings.c | |||
@@ -125,6 +125,7 @@ modified unless the header & checksum test fails. | |||
125 | 125 | ||
126 | Rest of config block, only saved to disk: | 126 | Rest of config block, only saved to disk: |
127 | 0xAE fade on pause/unpause/stop setting (bit 0) | 127 | 0xAE fade on pause/unpause/stop setting (bit 0) |
128 | caption backlight (bit 1) | ||
128 | 0xB0 peak meter clip hold timeout (bit 0-4), peak meter performance (bit 7) | 129 | 0xB0 peak meter clip hold timeout (bit 0-4), peak meter performance (bit 7) |
129 | 0xB1 peak meter release step size, peak_meter_dbfs (bit 7) | 130 | 0xB1 peak meter release step size, peak_meter_dbfs (bit 7) |
130 | 0xB2 peak meter min either in -db or in percent | 131 | 0xB2 peak meter min either in -db or in percent |
@@ -376,7 +377,9 @@ int settings_save( void ) | |||
376 | config_block[0x29]=(unsigned char)(global_settings.topruntime >> 8); | 377 | config_block[0x29]=(unsigned char)(global_settings.topruntime >> 8); |
377 | } | 378 | } |
378 | 379 | ||
379 | config_block[0xae] = (unsigned char)global_settings.fade_on_stop; | 380 | config_block[0xae] = (unsigned char) |
381 | ((global_settings.fade_on_stop & 1) | | ||
382 | ((global_settings.caption_backlight & 1) << 1)); | ||
380 | config_block[0xb0] = (unsigned char)global_settings.peak_meter_clip_hold | | 383 | config_block[0xb0] = (unsigned char)global_settings.peak_meter_clip_hold | |
381 | (global_settings.peak_meter_performance ? 0x80 : 0); | 384 | (global_settings.peak_meter_performance ? 0x80 : 0); |
382 | config_block[0xb1] = global_settings.peak_meter_release | | 385 | config_block[0xb1] = global_settings.peak_meter_release | |
@@ -663,7 +666,8 @@ void settings_load(void) | |||
663 | global_settings.topruntime = | 666 | global_settings.topruntime = |
664 | config_block[0x28] | (config_block[0x29] << 8); | 667 | config_block[0x28] | (config_block[0x29] << 8); |
665 | 668 | ||
666 | global_settings.fade_on_stop=config_block[0xae]; | 669 | global_settings.fade_on_stop = config_block[0xae] & 1; |
670 | global_settings.caption_backlight = config_block[0xae] & 2; | ||
667 | 671 | ||
668 | global_settings.peak_meter_clip_hold = (config_block[0xb0]) & 0x1f; | 672 | global_settings.peak_meter_clip_hold = (config_block[0xb0]) & 0x1f; |
669 | global_settings.peak_meter_performance = | 673 | global_settings.peak_meter_performance = |
diff --git a/apps/settings.h b/apps/settings.h index 0ff7cb2102..1a29899c01 100644 --- a/apps/settings.h +++ b/apps/settings.h | |||
@@ -153,6 +153,7 @@ struct user_settings | |||
153 | int scroll_step; /* pixels to advance per update */ | 153 | int scroll_step; /* pixels to advance per update */ |
154 | 154 | ||
155 | bool fade_on_stop; /* fade on pause/unpause/stop */ | 155 | bool fade_on_stop; /* fade on pause/unpause/stop */ |
156 | bool caption_backlight; /* turn on backlight at end and start of track */ | ||
156 | }; | 157 | }; |
157 | 158 | ||
158 | /* prototypes */ | 159 | /* prototypes */ |
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index e336585866..c1b113ffe4 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c | |||
@@ -67,6 +67,13 @@ static bool invert_cursor(void) | |||
67 | return rc; | 67 | return rc; |
68 | } | 68 | } |
69 | 69 | ||
70 | static bool caption_backlight(void) | ||
71 | { | ||
72 | bool rc = set_bool( str(LANG_CAPTION_BACKLIGHT), | ||
73 | &global_settings.caption_backlight); | ||
74 | |||
75 | return rc; | ||
76 | } | ||
70 | /** | 77 | /** |
71 | * Menu to configure the battery display on status bar | 78 | * Menu to configure the battery display on status bar |
72 | */ | 79 | */ |
@@ -752,6 +759,7 @@ static bool display_settings_menu(void) | |||
752 | { str(LANG_PM_MENU), peak_meter_menu }, | 759 | { str(LANG_PM_MENU), peak_meter_menu }, |
753 | { str(LANG_VOLUME_DISPLAY), volume_type }, | 760 | { str(LANG_VOLUME_DISPLAY), volume_type }, |
754 | { str(LANG_BATTERY_DISPLAY), battery_type }, | 761 | { str(LANG_BATTERY_DISPLAY), battery_type }, |
762 | { str(LANG_CAPTION_BACKLIGHT), caption_backlight }, | ||
755 | #endif | 763 | #endif |
756 | }; | 764 | }; |
757 | 765 | ||
diff --git a/apps/wps-display.c b/apps/wps-display.c index 42c4759831..e6cf65a260 100644 --- a/apps/wps-display.c +++ b/apps/wps-display.c | |||
@@ -42,6 +42,7 @@ | |||
42 | #include "lang.h" | 42 | #include "lang.h" |
43 | #include "powermgmt.h" | 43 | #include "powermgmt.h" |
44 | #include "sprintf.h" | 44 | #include "sprintf.h" |
45 | #include "backlight.h" | ||
45 | 46 | ||
46 | #ifdef HAVE_LCD_BITMAP | 47 | #ifdef HAVE_LCD_BITMAP |
47 | #include "icons.h" | 48 | #include "icons.h" |
@@ -768,6 +769,21 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, unsigned char refresh_mo | |||
768 | peak_meter_enabled = enable_pm; | 769 | peak_meter_enabled = enable_pm; |
769 | #endif | 770 | #endif |
770 | 771 | ||
772 | #ifndef SIMULATOR | ||
773 | if (global_settings.caption_backlight && id3) { | ||
774 | /* turn on backlight n seconds before track ends, and turn it off n | ||
775 | seconds into the new track. n == backlight_timeout, or 5s */ | ||
776 | int n = | ||
777 | backlight_timeout_value[global_settings.backlight_timeout] * 1000; | ||
778 | |||
779 | if ( n < 1000 ) | ||
780 | n = 5000; /* use 5s if backlight is always on or off */ | ||
781 | |||
782 | if ((id3->elapsed < 1000) || | ||
783 | ((id3->length - id3->elapsed) < (unsigned)n)) | ||
784 | backlight_on(); | ||
785 | } | ||
786 | #endif | ||
771 | return true; | 787 | return true; |
772 | } | 788 | } |
773 | 789 | ||