diff options
Diffstat (limited to 'apps/plugins/mpegplayer')
| -rw-r--r-- | apps/plugins/mpegplayer/mpeg_settings.c | 22 | ||||
| -rw-r--r-- | apps/plugins/mpegplayer/mpegplayer.c | 23 | ||||
| -rw-r--r-- | apps/plugins/mpegplayer/mpegplayer.h | 3 |
3 files changed, 48 insertions, 0 deletions
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c index 70b41a0..17a1cbb 100644 --- a/apps/plugins/mpegplayer/mpeg_settings.c +++ b/apps/plugins/mpegplayer/mpeg_settings.c @@ -543,6 +543,13 @@ static uint32_t increment_time(uint32_t val, int32_t amount, uint32_t range) return val; } +#ifdef HAVE_LCD_ENABLE +static void get_start_time_lcd_enable_hook(void) +{ + rb->queue_post(rb->button_queue, LCD_ENABLE_EVENT_0, 0); +} +#endif /* HAVE_LCD_ENABLE */ + static int get_start_time(uint32_t duration) { int button = 0; @@ -556,6 +563,10 @@ static int get_start_time(uint32_t duration) lcd_(clear_display)(); lcd_(update)(); +#ifdef HAVE_LCD_ENABLE + rb->lcd_set_enable_hook(get_start_time_lcd_enable_hook); +#endif + draw_slider(0, 100, &rc_bound); rc_bound.b = rc_bound.t - SLIDER_TMARGIN; rc_bound.t = SCREEN_MARGIN; @@ -707,6 +718,13 @@ static int get_start_time(uint32_t duration) slider_state = state9; break; +#ifdef HAVE_LCD_ENABLE + case LCD_ENABLE_EVENT_0: + if (slider_state == state2) + display_thumb_image(&rc_vid); + continue; +#endif + default: rb->default_event_handler(button); rb->yield(); @@ -736,6 +754,10 @@ static int get_start_time(uint32_t duration) rb->yield(); } +#ifdef HAVE_LCD_ENABLE + rb->lcd_set_enable_hook(NULL); +#endif + #ifndef HAVE_LCD_COLOR stream_gray_show(false); grey_clear_display(); diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 5b92ccc..42e0ddd 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 diff --git a/apps/plugins/mpegplayer/mpegplayer.h b/apps/plugins/mpegplayer/mpegplayer.h index fa13a1e..571c288 100644 --- a/apps/plugins/mpegplayer/mpegplayer.h +++ b/apps/plugins/mpegplayer/mpegplayer.h @@ -104,4 +104,7 @@ enum mpeg_malloc_reason_t #include "disk_buf.h" #include "stream_mgr.h" +#define LCD_ENABLE_EVENT_0 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 0) +#define LCD_ENABLE_EVENT_1 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 1) + #endif /* MPEGPLAYER_H */ |