Index: apps/gui/gwps-common.c =================================================================== --- apps/gui/gwps-common.c (revision 16239) +++ apps/gui/gwps-common.c (working copy) @@ -1872,6 +1872,7 @@ align.right = NULL; bool update_line, new_subline_refresh; + bool caption = false; #ifdef HAVE_LCD_BITMAP gui_wps_statusbar_draw(gwps, true); @@ -1915,6 +1916,61 @@ return false; } +#ifdef HAVE_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 = global_settings.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)) && + (state->paused == false)) + { + backlight_on(); + caption = true; + } + } +#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 = 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)) && + (state->paused == false)) + { + remote_backlight_on(); + caption = true; + } + } +#endif + + /* For some targets, the display is unreadable if the backlight is off. + * If so, only render the WPS if the backlight is (about to be) turned + * on. + */ +#if defined(HAVE_BACKLIGHT) && (defined(SANSA_E200)) + if (!(caption || is_backlight_on() +#if defined(HAVE_REMOTE_LCD) + || is_remote_backlight_on() +#endif + )) + { + return true; + } +#endif + state->ff_rewind_count = ffwd_offset; for (line = 0; line < data->num_lines; line++) @@ -2001,40 +2057,6 @@ display->update(); -#ifdef HAVE_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 = global_settings.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)) && - (state->paused == false)) - 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 = 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)) && - (state->paused == false)) - remote_backlight_on(); - } -#endif - return true; }