From b51f7dfc9b507ab9db12fe90b2ddad708f435e06 Mon Sep 17 00:00:00 2001 From: Jens Arnold Date: Mon, 21 Nov 2005 23:55:39 +0000 Subject: Backlight handling: * Added 'Caption Backlight' and 'Backlight On When Charging' for the iriver remote LCD. * Enabled the backlight code for the simulator, and prepared backlight simulation. It's only a stub atm, writing messages to the console window. * Added tick task handling to the simulators for this to work. * Code cleanup in backlight.c, less dead code. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8034 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/gwps-common.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) (limited to 'apps/gui') diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index c2a4dff3b6..16f3a6f2cc 100644 --- a/apps/gui/gwps-common.c +++ b/apps/gui/gwps-common.c @@ -1612,12 +1612,12 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, data->peak_meter_enabled = enable_pm; #endif -#if defined(CONFIG_BACKLIGHT) && !defined(SIMULATOR) +#ifdef CONFIG_BACKLIGHT if (global_settings.caption_backlight && state->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; + int n = backlight_timeout_value[global_settings.backlight_timeout] + * 1000; if ( n < 1000 ) n = 5000; /* use 5s if backlight is always on or off */ @@ -1626,6 +1626,22 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, ((state->id3->length - state->id3->elapsed) < (unsigned)n)) backlight_on(); } +#endif +#ifdef HAVE_REMOTE_LCD + if (global_settings.remote_caption_backlight && state->id3) { + /* turn on remote backlight n seconds before track ends, and turn it + off n seconds into the new track. n == remote_backlight_timeout, + or 5s */ + int n = backlight_timeout_value[global_settings.remote_backlight_timeout] + * 1000; + + if ( n < 1000 ) + n = 5000; /* use 5s if backlight is always on or off */ + + if ((state->id3->elapsed < 1000) || + ((state->id3->length - state->id3->elapsed) < (unsigned)n)) + remote_backlight_on(); + } #endif return true; } -- cgit v1.2.3