From d85c3ec41020a6c56b0d5d95a9ed790f57d73c6e Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Tue, 20 Oct 2009 21:54:59 +0000 Subject: Convert lcd_activation callbacks to use the event system to allow for multiple parallel callbacks (for custom statusbar). Increase maximum event count as we need more (I actually had a report about it during custom statusbar testing). Removed corresponding functions from the core and plugin api. Bump min version and sort. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23302 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/mpegplayer/mpegplayer.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'apps/plugins/mpegplayer/mpegplayer.c') diff --git a/apps/plugins/mpegplayer/mpegplayer.c b/apps/plugins/mpegplayer/mpegplayer.c index 0cb5f94d19..7c52a47260 100644 --- a/apps/plugins/mpegplayer/mpegplayer.c +++ b/apps/plugins/mpegplayer/mpegplayer.c @@ -652,8 +652,9 @@ static void draw_putsxy_oriented(int x, int y, const char *str) #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) /* So we can refresh the overlay */ -static void wvs_lcd_enable_hook(void) +static void wvs_lcd_enable_hook(void* param) { + (void)param; rb->queue_post(rb->button_queue, LCD_ENABLE_EVENT_1, 0); } #endif @@ -665,11 +666,11 @@ static void wvs_backlight_on_video_mode(bool video_on) /* backlight control in lib/helper.c */ backlight_force_on(); #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) - rb->lcd_activation_set_hook(NULL); + rb->remove_event(LCD_EVENT_ACTIVATION, wvs_lcd_enable_hook); #endif } else { #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) - rb->lcd_activation_set_hook(wvs_lcd_enable_hook); + rb->add_event(LCD_EVENT_ACTIVATION, false, wvs_lcd_enable_hook); #endif /* Revert to user's backlight settings */ backlight_use_settings(); @@ -1671,7 +1672,7 @@ static void button_loop(void) #if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP) /* Be sure hook is removed before exiting since the stop will put it * back because of the backlight restore. */ - rb->lcd_activation_set_hook(NULL); + rb->remove_event(LCD_EVENT_ACTIVATION, wvs_lcd_enable_hook); #endif rb->lcd_setfont(FONT_UI); -- cgit v1.2.3