diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugin.c | 4 | ||||
-rw-r--r-- | apps/plugin.h | 6 | ||||
-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 |
5 files changed, 57 insertions, 1 deletions
diff --git a/apps/plugin.c b/apps/plugin.c index e7b66a1cb2..9a435b24bc 100644 --- a/apps/plugin.c +++ b/apps/plugin.c | |||
@@ -601,6 +601,10 @@ static const struct plugin_api rockbox_api = { | |||
601 | simplelist_info_init, | 601 | simplelist_info_init, |
602 | simplelist_show_list, | 602 | simplelist_show_list, |
603 | 603 | ||
604 | #ifdef HAVE_LCD_ENABLE | ||
605 | lcd_set_enable_hook, | ||
606 | &button_queue, | ||
607 | #endif | ||
604 | }; | 608 | }; |
605 | 609 | ||
606 | int plugin_load(const char* plugin, const void* parameter) | 610 | int plugin_load(const char* plugin, const void* parameter) |
diff --git a/apps/plugin.h b/apps/plugin.h index c23e6457cf..edd54989da 100644 --- a/apps/plugin.h +++ b/apps/plugin.h | |||
@@ -124,7 +124,7 @@ void* plugin_get_buffer(size_t *buffer_size); | |||
124 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ | 124 | #define PLUGIN_MAGIC 0x526F634B /* RocK */ |
125 | 125 | ||
126 | /* increase this every time the api struct changes */ | 126 | /* increase this every time the api struct changes */ |
127 | #define PLUGIN_API_VERSION 115 | 127 | #define PLUGIN_API_VERSION 116 |
128 | 128 | ||
129 | /* update this to latest version if a change to the api struct breaks | 129 | /* update this to latest version if a change to the api struct breaks |
130 | backwards compatibility (and please take the opportunity to sort in any | 130 | backwards compatibility (and please take the opportunity to sort in any |
@@ -752,6 +752,10 @@ struct plugin_api { | |||
752 | int count, void* data); | 752 | int count, void* data); |
753 | bool (*simplelist_show_list)(struct simplelist_info *info); | 753 | bool (*simplelist_show_list)(struct simplelist_info *info); |
754 | 754 | ||
755 | #ifdef HAVE_LCD_ENABLE | ||
756 | void (*lcd_set_enable_hook)(void (*enable_hook)(void)); | ||
757 | struct event_queue *button_queue; | ||
758 | #endif | ||
755 | }; | 759 | }; |
756 | 760 | ||
757 | /* plugin header */ | 761 | /* plugin header */ |
diff --git a/apps/plugins/mpegplayer/mpeg_settings.c b/apps/plugins/mpegplayer/mpeg_settings.c index 70b41a00e2..17a1cbbb69 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) | |||
543 | return val; | 543 | return val; |
544 | } | 544 | } |
545 | 545 | ||
546 | #ifdef HAVE_LCD_ENABLE | ||
547 | static void get_start_time_lcd_enable_hook(void) | ||
548 | { | ||
549 | rb->queue_post(rb->button_queue, LCD_ENABLE_EVENT_0, 0); | ||
550 | } | ||
551 | #endif /* HAVE_LCD_ENABLE */ | ||
552 | |||
546 | static int get_start_time(uint32_t duration) | 553 | static int get_start_time(uint32_t duration) |
547 | { | 554 | { |
548 | int button = 0; | 555 | int button = 0; |
@@ -556,6 +563,10 @@ static int get_start_time(uint32_t duration) | |||
556 | lcd_(clear_display)(); | 563 | lcd_(clear_display)(); |
557 | lcd_(update)(); | 564 | lcd_(update)(); |
558 | 565 | ||
566 | #ifdef HAVE_LCD_ENABLE | ||
567 | rb->lcd_set_enable_hook(get_start_time_lcd_enable_hook); | ||
568 | #endif | ||
569 | |||
559 | draw_slider(0, 100, &rc_bound); | 570 | draw_slider(0, 100, &rc_bound); |
560 | rc_bound.b = rc_bound.t - SLIDER_TMARGIN; | 571 | rc_bound.b = rc_bound.t - SLIDER_TMARGIN; |
561 | rc_bound.t = SCREEN_MARGIN; | 572 | rc_bound.t = SCREEN_MARGIN; |
@@ -707,6 +718,13 @@ static int get_start_time(uint32_t duration) | |||
707 | slider_state = state9; | 718 | slider_state = state9; |
708 | break; | 719 | break; |
709 | 720 | ||
721 | #ifdef HAVE_LCD_ENABLE | ||
722 | case LCD_ENABLE_EVENT_0: | ||
723 | if (slider_state == state2) | ||
724 | display_thumb_image(&rc_vid); | ||
725 | continue; | ||
726 | #endif | ||
727 | |||
710 | default: | 728 | default: |
711 | rb->default_event_handler(button); | 729 | rb->default_event_handler(button); |
712 | rb->yield(); | 730 | rb->yield(); |
@@ -736,6 +754,10 @@ static int get_start_time(uint32_t duration) | |||
736 | rb->yield(); | 754 | rb->yield(); |
737 | } | 755 | } |
738 | 756 | ||
757 | #ifdef HAVE_LCD_ENABLE | ||
758 | rb->lcd_set_enable_hook(NULL); | ||
759 | #endif | ||
760 | |||
739 | #ifndef HAVE_LCD_COLOR | 761 | #ifndef HAVE_LCD_COLOR |
740 | stream_gray_show(false); | 762 | stream_gray_show(false); |
741 | grey_clear_display(); | 763 | grey_clear_display(); |
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) | |||
587 | } | 587 | } |
588 | #endif /* LCD_PORTRAIT */ | 588 | #endif /* LCD_PORTRAIT */ |
589 | 589 | ||
590 | #ifdef HAVE_LCD_ENABLE | ||
591 | /* So we can refresh the overlay */ | ||
592 | static void wvs_lcd_enable_hook(void) | ||
593 | { | ||
594 | rb->queue_post(rb->button_queue, LCD_ENABLE_EVENT_1, 0); | ||
595 | } | ||
596 | #endif | ||
597 | |||
590 | static void wvs_backlight_on_video_mode(bool video_on) | 598 | static void wvs_backlight_on_video_mode(bool video_on) |
591 | { | 599 | { |
592 | if (video_on) { | 600 | if (video_on) { |
593 | /* Turn off backlight timeout */ | 601 | /* Turn off backlight timeout */ |
594 | /* backlight control in lib/helper.c */ | 602 | /* backlight control in lib/helper.c */ |
595 | backlight_force_on(rb); | 603 | backlight_force_on(rb); |
604 | #ifdef HAVE_LCD_ENABLE | ||
605 | rb->lcd_set_enable_hook(NULL); | ||
606 | #endif | ||
596 | } else { | 607 | } else { |
608 | #ifdef HAVE_LCD_ENABLE | ||
609 | rb->lcd_set_enable_hook(wvs_lcd_enable_hook); | ||
610 | #endif | ||
597 | /* Revert to user's backlight settings */ | 611 | /* Revert to user's backlight settings */ |
598 | backlight_use_settings(rb); | 612 | backlight_use_settings(rb); |
599 | } | 613 | } |
@@ -1441,6 +1455,15 @@ static void button_loop(void) | |||
1441 | continue; | 1455 | continue; |
1442 | } /* BUTTON_NONE: */ | 1456 | } /* BUTTON_NONE: */ |
1443 | 1457 | ||
1458 | #ifdef HAVE_LCD_ENABLE | ||
1459 | case LCD_ENABLE_EVENT_1: | ||
1460 | { | ||
1461 | /* Draw the current frame if prepared already */ | ||
1462 | stream_draw_frame(true); | ||
1463 | break; | ||
1464 | } /* LCD_ENABLE_EVENT_1: */ | ||
1465 | #endif | ||
1466 | |||
1444 | case MPEG_VOLUP: | 1467 | case MPEG_VOLUP: |
1445 | case MPEG_VOLUP|BUTTON_REPEAT: | 1468 | case MPEG_VOLUP|BUTTON_REPEAT: |
1446 | #ifdef MPEG_VOLUP2 | 1469 | #ifdef MPEG_VOLUP2 |
diff --git a/apps/plugins/mpegplayer/mpegplayer.h b/apps/plugins/mpegplayer/mpegplayer.h index fa13a1e378..571c28883d 100644 --- a/apps/plugins/mpegplayer/mpegplayer.h +++ b/apps/plugins/mpegplayer/mpegplayer.h | |||
@@ -104,4 +104,7 @@ enum mpeg_malloc_reason_t | |||
104 | #include "disk_buf.h" | 104 | #include "disk_buf.h" |
105 | #include "stream_mgr.h" | 105 | #include "stream_mgr.h" |
106 | 106 | ||
107 | #define LCD_ENABLE_EVENT_0 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 0) | ||
108 | #define LCD_ENABLE_EVENT_1 MAKE_SYS_EVENT(SYS_EVENT_CLS_PRIVATE, 1) | ||
109 | |||
107 | #endif /* MPEGPLAYER_H */ | 110 | #endif /* MPEGPLAYER_H */ |