diff options
author | Björn Stenberg <bjorn@haxx.se> | 2003-04-23 09:17:34 +0000 |
---|---|---|
committer | Björn Stenberg <bjorn@haxx.se> | 2003-04-23 09:17:34 +0000 |
commit | 86587527f52db8320f8d8ea48dfc76d3d93d79c8 (patch) | |
tree | c823b7c0d71d0f68ce087a1ab0fcf35c2b8560d6 /apps/wps-display.c | |
parent | b39dadf7f206695fa23ca7b6f305148a22b760c0 (diff) |
Added caption backlight: Turns on backlight briefly at the start and end of each track.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@3585 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/wps-display.c')
-rw-r--r-- | apps/wps-display.c | 16 |
1 files changed, 16 insertions, 0 deletions
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 @@ #include "lang.h" #include "powermgmt.h" #include "sprintf.h" +#include "backlight.h" #ifdef HAVE_LCD_BITMAP #include "icons.h" @@ -768,6 +769,21 @@ bool wps_refresh(struct mp3entry* id3, int ffwd_offset, unsigned char refresh_mo peak_meter_enabled = enable_pm; #endif +#ifndef SIMULATOR + if (global_settings.caption_backlight && id3) { + /* turn on backlight n seconds before track ends, and turn it off n + seconds into the new track. n == backlight_timeout, or 5s */ + int n = + backlight_timeout_value[global_settings.backlight_timeout] * 1000; + + if ( n < 1000 ) + n = 5000; /* use 5s if backlight is always on or off */ + + if ((id3->elapsed < 1000) || + ((id3->length - id3->elapsed) < (unsigned)n)) + backlight_on(); + } +#endif return true; } |