summaryrefslogtreecommitdiff
path: root/apps/gui/gwps.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/gwps.c')
-rw-r--r--apps/gui/gwps.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/apps/gui/gwps.c b/apps/gui/gwps.c
index 6285f7793f..0c8a3aa2b1 100644
--- a/apps/gui/gwps.c
+++ b/apps/gui/gwps.c
@@ -81,6 +81,50 @@ static void wps_state_init(void);
81static void track_changed_callback(void *param); 81static void track_changed_callback(void *param);
82static void nextid3available_callback(void* param); 82static void nextid3available_callback(void* param);
83 83
84
85#if defined(HAVE_BACKLIGHT) || defined(HAVE_REMOTE_LCD)
86static void gwps_caption_backlight(struct wps_state *state)
87{
88 if (state && state->id3)
89 {
90#ifdef HAVE_BACKLIGHT
91 if (global_settings.caption_backlight)
92 {
93 /* turn on backlight n seconds before track ends, and turn it off n
94 seconds into the new track. n == backlight_timeout, or 5s */
95 int n = global_settings.backlight_timeout * 1000;
96
97 if ( n < 1000 )
98 n = 5000; /* use 5s if backlight is always on or off */
99
100 if (((state->id3->elapsed < 1000) ||
101 ((state->id3->length - state->id3->elapsed) < (unsigned)n)) &&
102 (state->paused == false))
103 backlight_on();
104 }
105#endif
106#ifdef HAVE_REMOTE_LCD
107 if (global_settings.remote_caption_backlight)
108 {
109 /* turn on remote backlight n seconds before track ends, and turn it
110 off n seconds into the new track. n == remote_backlight_timeout,
111 or 5s */
112 int n = global_settings.remote_backlight_timeout * 1000;
113
114 if ( n < 1000 )
115 n = 5000; /* use 5s if backlight is always on or off */
116
117 if (((state->id3->elapsed < 1000) ||
118 ((state->id3->length - state->id3->elapsed) < (unsigned)n)) &&
119 (state->paused == false))
120 remote_backlight_on();
121 }
122#endif
123 }
124}
125#endif
126
127
84static void change_dir(int direction) 128static void change_dir(int direction)
85{ 129{
86 if (global_settings.prevent_skip) 130 if (global_settings.prevent_skip)
@@ -680,6 +724,9 @@ long gui_wps_show(void)
680 724
681 if (wps_state.do_full_update || update) 725 if (wps_state.do_full_update || update)
682 { 726 {
727#if defined(HAVE_BACKLIGHT) || defined(HAVE_REMOTE_LCD)
728 gwps_caption_backlight(&wps_state);
729#endif
683 FOR_NB_SCREENS(i) 730 FOR_NB_SCREENS(i)
684 { 731 {
685#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) 732#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)