summaryrefslogtreecommitdiff
path: root/apps/gui
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-11-21 23:55:39 +0000
committerJens Arnold <amiconn@rockbox.org>2005-11-21 23:55:39 +0000
commitb51f7dfc9b507ab9db12fe90b2ddad708f435e06 (patch)
treeefcef3411689401da21795d700a0741f8ab1072b /apps/gui
parente68680ac310adb8373c9f3a5194466766d64cf37 (diff)
downloadrockbox-b51f7dfc9b507ab9db12fe90b2ddad708f435e06.tar.gz
rockbox-b51f7dfc9b507ab9db12fe90b2ddad708f435e06.zip
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.c22
1 files changed, 19 insertions, 3 deletions
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,
1612 data->peak_meter_enabled = enable_pm; 1612 data->peak_meter_enabled = enable_pm;
1613#endif 1613#endif
1614 1614
1615#if defined(CONFIG_BACKLIGHT) && !defined(SIMULATOR) 1615#ifdef CONFIG_BACKLIGHT
1616 if (global_settings.caption_backlight && state->id3) { 1616 if (global_settings.caption_backlight && state->id3) {
1617 /* turn on backlight n seconds before track ends, and turn it off n 1617 /* turn on backlight n seconds before track ends, and turn it off n
1618 seconds into the new track. n == backlight_timeout, or 5s */ 1618 seconds into the new track. n == backlight_timeout, or 5s */
1619 int n = 1619 int n = backlight_timeout_value[global_settings.backlight_timeout]
1620 backlight_timeout_value[global_settings.backlight_timeout] * 1000; 1620 * 1000;
1621 1621
1622 if ( n < 1000 ) 1622 if ( n < 1000 )
1623 n = 5000; /* use 5s if backlight is always on or off */ 1623 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,
1627 backlight_on(); 1627 backlight_on();
1628 } 1628 }
1629#endif 1629#endif
1630#ifdef HAVE_REMOTE_LCD
1631 if (global_settings.remote_caption_backlight && state->id3) {
1632 /* turn on remote backlight n seconds before track ends, and turn it
1633 off n seconds into the new track. n == remote_backlight_timeout,
1634 or 5s */
1635 int n = backlight_timeout_value[global_settings.remote_backlight_timeout]
1636 * 1000;
1637
1638 if ( n < 1000 )
1639 n = 5000; /* use 5s if backlight is always on or off */
1640
1641 if ((state->id3->elapsed < 1000) ||
1642 ((state->id3->length - state->id3->elapsed) < (unsigned)n))
1643 remote_backlight_on();
1644 }
1645#endif
1630 return true; 1646 return true;
1631} 1647}
1632 1648