diff options
| author | Jens Arnold <amiconn@rockbox.org> | 2005-11-21 23:55:39 +0000 |
|---|---|---|
| committer | Jens Arnold <amiconn@rockbox.org> | 2005-11-21 23:55:39 +0000 |
| commit | b51f7dfc9b507ab9db12fe90b2ddad708f435e06 (patch) | |
| tree | efcef3411689401da21795d700a0741f8ab1072b /apps/gui | |
| parent | e68680ac310adb8373c9f3a5194466766d64cf37 (diff) | |
| download | rockbox-b51f7dfc9b507ab9db12fe90b2ddad708f435e06.zip rockbox-b51f7dfc9b507ab9db12fe90b2ddad708f435e06.tar.gz rockbox-b51f7dfc9b507ab9db12fe90b2ddad708f435e06.tar.bz2 rockbox-b51f7dfc9b507ab9db12fe90b2ddad708f435e06.tar.xz | |
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
Diffstat (limited to 'apps/gui')
| -rw-r--r-- | apps/gui/gwps-common.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/apps/gui/gwps-common.c b/apps/gui/gwps-common.c index c2a4dff..16f3a6f 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 */ @@ -1627,6 +1627,22 @@ bool gui_wps_refresh(struct gui_wps *gwps, int ffwd_offset, 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; } |