summaryrefslogtreecommitdiffstats
path: root/apps/plugins/mpegplayer/mpegplayer.c
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2008-05-28 10:17:16 +0000
committerMichael Sevakis <jethead71@rockbox.org>2008-05-28 10:17:16 +0000
commitadf2e4c9a012fda200431c92cb2c1707dbe2f0a3 (patch)
tree3a2755b05f9e2092d5bff458929b825c955c66f1 /apps/plugins/mpegplayer/mpegplayer.c
parentb57b779fbced4a3fc1ecd0799a7666c2f1645f17 (diff)
downloadrockbox-adf2e4c9a012fda200431c92cb2c1707dbe2f0a3.tar.gz
rockbox-adf2e4c9a012fda200431c92cb2c1707dbe2f0a3.zip
Targets with HAVE_LCD_ENABLE: Provide a means to receive notifications when the lcd is enabled and the image is refreshed so overlayed drawing can also be refreshed. Chiefly mpegplayer needs this so it can redraw the YUV data after the backlight is turned on while paused or when using 'Set Start Time'.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17640 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins/mpegplayer/mpegplayer.c')
-rw-r--r--apps/plugins/mpegplayer/mpegplayer.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c
index 5b92ccced1..42e0ddd5ad 100644
--- a/apps/plugins/mpegplayer/mpegplayer.c
+++ b/apps/plugins/mpegplayer/mpegplayer.c
@@ -587,13 +587,27 @@ static void draw_putsxy_oriented(int x, int y, const char *str)
}
#endif /* LCD_PORTRAIT */
+#ifdef HAVE_LCD_ENABLE
+/* So we can refresh the overlay */
+static void wvs_lcd_enable_hook(void)
+{
+ rb->queue_post(rb->button_queue, LCD_ENABLE_EVENT_1, 0);
+}
+#endif
+
static void wvs_backlight_on_video_mode(bool video_on)
{
if (video_on) {
/* Turn off backlight timeout */
/* backlight control in lib/helper.c */
backlight_force_on(rb);
+#ifdef HAVE_LCD_ENABLE
+ rb->lcd_set_enable_hook(NULL);
+#endif
} else {
+#ifdef HAVE_LCD_ENABLE
+ rb->lcd_set_enable_hook(wvs_lcd_enable_hook);
+#endif
/* Revert to user's backlight settings */
backlight_use_settings(rb);
}
@@ -1441,6 +1455,15 @@ static void button_loop(void)
continue;
} /* BUTTON_NONE: */
+#ifdef HAVE_LCD_ENABLE
+ case LCD_ENABLE_EVENT_1:
+ {
+ /* Draw the current frame if prepared already */
+ stream_draw_frame(true);
+ break;
+ } /* LCD_ENABLE_EVENT_1: */
+#endif
+
case MPEG_VOLUP:
case MPEG_VOLUP|BUTTON_REPEAT:
#ifdef MPEG_VOLUP2