wgui_categories_multimedia.c
资源名称:mmi.rar [点击查看]
上传用户:lqx1163
上传日期:2014-08-13
资源大小:9183k
文件大小:176k
源码类别:
MTK
开发平台:
C/C++
- ********************************************************************************/
- /* video is successfully opened, create video playback layer */
- if (cat_vdoply_is_video_open)
- {
- /* we need play video on an extra layer, so will use multi-layer */
- gdi_layer_multi_layer_enable();
- gdi_layer_get_base_handle(&wgui_base_layer);
- if (wgui_is_touch_title_bar_buttons())
- {
- gBlack_buf = mmi_frm_scrmem_alloc(BLACK_BUFFER_SIZE);
- if (GDI_LAYER_SUCCEED != dm_create_layer_using_outside_memory(
- 0,
- 0,
- UI_device_width,
- UI_device_height,
- &gBlack_layer,
- gBlack_buf,
- BLACK_BUFFER_SIZE,
- DM_LAYER_BOTTOM))
- {
- MMI_ASSERT(0);
- }
- gdi_layer_push_and_set_active(*gBlack_layer);
- gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
- gdi_layer_clear(GDI_COLOR_BLACK);
- gdi_layer_pop_and_restore_active();
- }
- if ((wgui_video_info.width > content_width) || (wgui_video_info.height > content_height))
- {
- /* video larger than drawable region, need resize */
- /* calc draw size */
- gdi_util_fit_box(
- GDI_UTIL_MODE_LONG_SIDE_FIT,
- content_width,
- content_height,
- wgui_video_info.width,
- wgui_video_info.height,
- &resized_offset_x,
- &resized_offset_y,
- &resized_width,
- &resized_height);
- }
- else
- {
- /* video smaller than content region */
- if (!cat_vdoply_is_full_screen)
- {
- /* not full screen mode, play default size */
- resized_offset_x = (content_width - wgui_video_info.width) >> 1;
- resized_offset_y = (content_height - wgui_video_info.height) >> 1;
- resized_width = wgui_video_info.width;
- resized_height = wgui_video_info.height;
- }
- else
- {
- /* full screen mode, stretch (enlarge) it to fit content region */
- gdi_util_fit_box(
- GDI_UTIL_MODE_LONG_SIDE_FIT,
- content_width,
- content_height,
- wgui_video_info.width,
- wgui_video_info.height,
- &resized_offset_x,
- &resized_offset_y,
- &resized_width,
- &resized_height);
- }
- }
- /* shift to content position */
- resized_offset_x += content_offset_x;
- resized_offset_y += content_offset_y;
- if (wgui_is_touch_title_bar_buttons())
- {
- dm_create_layer(
- resized_offset_x,
- resized_offset_y,
- resized_width,
- resized_height,
- &cat_vdoply_video_layer,
- DM_LAYER_ACTIVE_TOP);
- }
- else
- {
- dm_create_layer(
- resized_offset_x,
- resized_offset_y,
- resized_width,
- resized_height,
- &cat_vdoply_video_layer,
- DM_LAYER_ACTIVE_BOTTOM);
- }
- /* clear this layer with black */
- gdi_layer_push_and_set_active(cat_vdoply_video_layer);
- gdi_layer_clear(GDI_COLOR_BLACK);
- gdi_layer_pop_and_restore_active();
- /* Get first frame and start to play */
- video_ret = mdi_video_ply_seek_and_get_frame(0, cat_vdoply_video_layer);
- if (video_ret < 0)
- {
- cat_vdoply_is_video_play = FALSE;
- }
- else
- {
- cat_vdoply_is_video_play = TRUE;
- }
- cat_vdoply_is_video_play_result = video_ret;
- }
- }
- /*****************************************************************************
- * [ShowCategoryVdoplyScreen]
- *
- * Generic video play screen.
- *
- * **********************
- * * *
- * * *
- * * *
- * * *
- * * *
- * * (Fullscreen Video) *
- * * *
- * * *
- * * *
- * * *
- * * *
- * **********************
- *
- * **********************
- * * Title *
- * **********************
- * * *
- * * *
- * * *
- * * (Video) *
- * * *
- * * *
- * * *
- * ******** ********
- * * LSK * * RSK *
- * **********************
- *
- *****************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * ShowCategoryVdoplyScreen
- * DESCRIPTION
- * Show Generic Play Video Category.
- * PARAMETERS
- * is_fullscreen [IN] Is full screen display, if false, will draw title and softkeys
- * title_str [IN] Title string id
- * title_icon [IN] Title icon id
- * lsk_str [IN] Lsk str id
- * lsk_icon [IN] Lsk icon id
- * rsk_str [IN] Lsk str id
- * rsk_icon [IN] Lsk icon id
- * video_id [IN] Video ID
- * video_filename [IN] Video filename
- * repeat_count [IN] Repeat count, 0 means infinite
- * is_visual_update [IN] Update visual to LCM or not
- * is_play_audio [IN] Play audio or not
- * is_lcd_no_sleep [IN] Will let lcd no sleep. This shall always TRUE unless u will handle lcd sleeping event
- * bg_color [IN] Backgroud color
- * play_finish_callback [IN] Play finish call back hdlr
- * gui_buffer [IN] Gui_buffer, use to detemin if it is newly enter
- * RETURNS
- * void
- *****************************************************************************/
- static void ShowCategoryVdoplyScreen(
- BOOL is_fullscreen,
- U16 title_str,
- U16 title_icon,
- U16 lsk_str,
- U16 lsk_icon,
- U16 rsk_str,
- U16 rsk_icon,
- U16 video_id,
- PS8 video_filename,
- U16 repeat_count,
- BOOL is_visual_update,
- BOOL is_play_audio,
- BOOL is_lcd_no_sleep,
- GDI_COLOR bg_color,
- void (*play_finish_callback) (MDI_RESULT),
- void *gui_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- U16 btn_prev_item_id, btn_next_item_id;
- S32 content_width, content_height;
- S32 content_offset_x, content_offset_y;
- MDI_RESULT video_ret = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* enter a sublcd screen with static image */
- /*
- * this is very important since we cant draw anything on sublcd while video is playing,
- * which will casue driver assert.
- *
- * caller of this category may ignore sublcd handling, it will be handled in this category
- */
- #ifdef __MMI_SUBLCD__
- if (!cat_vdoply_is_sublcd_display)
- {
- ForceSubLCDScreen(EnterCategoryVdoplySubScreen);
- }
- #endif /* __MMI_SUBLCD__ */
- /* arg check */
- MMI_ASSERT((video_id == 0 && video_filename != NULL) || (video_id != 0 && video_filename == NULL));
- /* clear keys */
- clear_category_screen_key_handlers();
- clear_key_handlers();
- clear_left_softkey();
- clear_right_softkey();
- /* init var */
- cat_vdoply_is_video_from_id = (video_id != 0) ? TRUE : FALSE;
- cat_vdoply_video_is_visual_update = is_visual_update;
- cat_vdoply_video_is_play_audio = is_play_audio;
- cat_vdoply_video_is_lcd_no_sleep = is_lcd_no_sleep;
- cat_vdoply_play_finish_callback = play_finish_callback;
- /* stop MMI sleep */
- if (cat_vdoply_video_is_lcd_no_sleep)
- {
- TurnOnBacklight(0);
- }
- /* set audio volumn */
- if (gui_buffer == NULL)
- {
- /* first time enter */
- cat_vdoply_audio_volumn = LEVEL5;
- }
- if (cat_vdoply_video_is_play_audio)
- {
- /* full screen play do not allows vol adjustment */
- if (!is_fullscreen)
- {
- SetKeyHandler(CatVdoplyVolUp, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(CatVdoplyVolDown, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- }
- /* suspend background audio */
- mdi_audio_suspend_background_play();
- /* init audio volumn */
- mdi_audio_set_volume(MDI_VOLUME_MEDIA, cat_vdoply_audio_volumn);
- }
- /*
- * user may request to repeat play many times, and wants a callback bewteen each play,
- * so we have to handle repeat play within this category by seeking to first frame
- * after play finished each time, instead of using driver's repeat play.
- */
- cat_vdoply_video_repeat_count = (repeat_count == 0) ? 0xffff : repeat_count; /* 0xff means infinte play */
- if (repeat_count != 0)
- {
- cat_vdoply_video_repeat_count--;
- }
- /********************************************************************************
- * Draw non-full screen UI
- ********************************************************************************/
- if (!is_fullscreen)
- {
- /* not fullscreen, draw title and softkey */
- /* init softkey */
- change_left_softkey(lsk_str, lsk_icon);
- change_right_softkey(rsk_str, rsk_icon);
- register_left_softkey_handler();
- register_right_softkey_handler();
- register_default_hide_softkeys();
- /* init title */
- MMI_title_string = (UI_string_type) get_string(title_str);
- MMI_title_icon = (PU8) get_image(title_icon);
- /* set content size */
- if (wgui_is_touch_title_bar_buttons())
- {
- content_width = UI_device_width;
- content_height = UI_device_height;
- content_offset_x = 0;
- content_offset_y = 0;
- cat_vdoply_is_full_screen = TRUE;
- title_bg_id = IMAGE_VIEW_TITLEBAR_BG;
- wgui_set_wallpaper_on_bottom(MMI_TRUE);
- }
- else
- {
- content_width = MMI_content_width;
- content_height = MMI_content_height;
- content_offset_x = MMI_content_x;
- content_offset_y = MMI_content_y;
- cat_vdoply_is_full_screen = FALSE;
- }
- /* clear shortcut num */
- MMI_menu_shortcut_number = -1;
- /* draw to buffer, but not blt to LCM by using lock */
- gdi_layer_lock_frame_buffer();
- gdi_layer_reset_clip();
- gdi_layer_reset_text_clip();
- /* clear content color */
- if (wgui_is_touch_title_bar_buttons())
- {
- gdi_draw_solid_rect(0, 0, UI_device_width - 1, UI_device_height - 1, GDI_COLOR_TRANSPARENT);
- }
- else
- {
- gdi_draw_solid_rect(
- MMI_content_x,
- MMI_content_y,
- MMI_content_x + MMI_content_width - 1,
- MMI_content_y + MMI_content_height - 1,
- GDI_COLOR_WHITE);
- clear_buttonbar();
- }
- /* 061506 double buffer Start */
- if (wgui_is_touch_title_bar_buttons())
- {
- #if defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
- gOnFullScreen = MMI_IN_NORMAL_SCREEN;//063006 title shift
- show_status_icon_bar(0);
- register_hide_status_icon_bar(0, hide_status_icons_bar0);
- #endif
- }
- //show_title_status_icon();
- /* 061506 double buffer End */
- draw_title();
- show_softkey_background();
- show_left_softkey();
- show_right_softkey();
- gdi_layer_unlock_frame_buffer();
- }
- else
- {
- /* entry full screen */
- entry_full_screen();
- /* clear full screen */
- gdi_layer_clear(bg_color);
- /* full screen */
- content_width = UI_device_width;
- content_height = UI_device_height;
- content_offset_x = 0;
- content_offset_y = 0;
- cat_vdoply_is_full_screen = TRUE;
- }
- /********************************************************************************
- * Open Video
- ********************************************************************************/
- if (video_id != 0)
- {
- /* source from id */
- /* always open with audio, if do not want audio, mute it by calling mdi function */
- video_ret = mdi_video_ply_open_clip_id(video_id, &wgui_video_info);
- cat_vdoply_is_video_open = (video_ret >= 0) ? TRUE : FALSE;
- }
- else if (video_filename != NULL)
- {
- /* source from file */
- /* always open with audio, if do not want audio, dsiable it in play function */
- video_ret = mdi_video_ply_open_clip_file(video_filename, &wgui_video_info);
- cat_vdoply_is_video_open = (video_ret >= 0) ? TRUE : FALSE;
- }
- else
- {
- /* no proper source */
- MMI_ASSERT(0);
- }
- /* check if the title bar buttons are enabled for the particular screen. */
- if (wgui_is_touch_title_bar_buttons())
- {
- btn_prev_item_id = dm_add_button(
- NULL,
- get_image(LEFT_RED_ARROW),
- get_image(LEFT_RED_ARROW),
- cat226_hide_button_full_screen);
- btn_next_item_id = dm_add_button(
- NULL,
- get_image(RIGHT_RED_ARROW),
- get_image(RIGHT_RED_ARROW),
- cat226_hide_button_full_screen);
- #if defined(__MMI_TOUCH_SCREEN__)
- /* register the handler for pen event down istead of pen event up. */
- dm_register_button_functions(btn_prev_item_id, KEY_EVENT_UP, gMMI_touch_title_button1_down_handler);
- dm_register_button_functions(btn_next_item_id, KEY_EVENT_UP, gMMI_touch_title_button2_down_handler);
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- }
- RedrawCategoryFunction = dm_redraw_category_screen;
- ExitCategoryFunction = ExitCategoryVdoplyScreen;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- if (wgui_is_touch_title_bar_buttons())
- {
- dm_data.s32CatId = MMI_CATEGORY_VDOPLY_BUTTON;
- }
- else
- {
- dm_data.s32CatId = MMI_CATEGORY_VDOPLY;
- }
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- if (is_fullscreen)
- {
- dm_data.s32flags = DM_NO_TITLE | DM_NO_STATUS_BAR | DM_NO_SOFTKEY | DM_BUTTON_DISABLE_BACKGROUND;
- }
- else
- {
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- }
- dm_setup_data(&dm_data);
- dm_register_category_controlled_callback(DrawCateVdoCategoryControlArea);
- dm_redraw_category_screen();
- /*
- * register exit category function befor calling the callback function,
- * since this call back may exit this category
- */
- video_ret = cat_vdoply_is_video_play_result;
- if (cat_vdoply_is_video_play == TRUE)
- {
- //gdi_layer_blt_previous(0, 0, UI_device_width - 1, UI_device_height - 1);//061506 double buffer
- if (wgui_is_touch_title_bar_buttons())
- {
- /* 061506 double buffer Start */
- #if defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
- //black-video-base-status
- video_ret = mdi_video_ply_play(
- cat_vdoply_video_layer,
- GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1 | GDI_LAYER_ENABLE_LAYER_2 | GDI_LAYER_ENABLE_LAYER_3,
- GDI_LAYER_ENABLE_LAYER_1,
- 1, /* repeat count */
- is_visual_update, /* update to LCM or not */
- is_play_audio, /* play aud or not */
- MDI_DEVICE_SPEAKER2, /* speaker & earphone */
- MDI_VIDEO_LCD_ROTATE_0, /* rotate */
- 100, /* 1x play speed */
- CatVdoplyPlayFinishCallback); /* hook callback */
- #else
- //black-video-base
- video_ret = mdi_video_ply_play(
- cat_vdoply_video_layer,
- GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1 | GDI_LAYER_ENABLE_LAYER_2,
- GDI_LAYER_ENABLE_LAYER_1,
- 1, /* repeat count */
- is_visual_update, /* update to LCM or not */
- is_play_audio, /* play aud or not */
- MDI_DEVICE_SPEAKER2, /* speaker & earphone */
- MDI_VIDEO_LCD_ROTATE_0, /* rotate */
- 100, /* 1x play speed */
- CatVdoplyPlayFinishCallback); /* hook callback */
- #endif
- }
- else
- {
- //base-video
- video_ret = mdi_video_ply_play(
- cat_vdoply_video_layer,
- GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1,
- GDI_LAYER_ENABLE_LAYER_1,
- 1, /* repeat count */
- is_visual_update, /* update to LCM or not */
- is_play_audio, /* play aud or not */
- MDI_DEVICE_SPEAKER2, /* speaker & earphone */
- MDI_VIDEO_LCD_ROTATE_0, /* rotate */
- 100, /* 1x play speed */
- CatVdoplyPlayFinishCallback); /* hook callback */
- }
- /* 061506 double buffer Start */
- cat_vdoply_is_video_play = (video_ret >= 0) ? TRUE : FALSE;
- cat_vdoply_is_video_force_stop = FALSE;
- }
- if (cat_vdoply_is_video_play == FALSE)
- {
- /* open file failed or play failed - reutrn error cause */
- if (cat_vdoply_play_finish_callback != NULL)
- {
- cat_vdoply_play_finish_callback(video_ret);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategoryVdoplyScreen
- * DESCRIPTION
- * Exit Category 224 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void ExitCategoryVdoplyScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cat_vdoply_is_video_open)
- {
- /* stop video playing */
- if (cat_vdoply_is_video_play)
- {
- mdi_video_ply_stop();
- cat_vdoply_is_video_play = FALSE;
- }
- /* close video source */
- if (cat_vdoply_is_video_from_id)
- {
- /* source from id */
- mdi_video_ply_close_clip_id();
- cat_vdoply_is_video_open = FALSE;
- }
- else
- {
- /* source from file */
- mdi_video_ply_close_clip_file();
- cat_vdoply_is_video_open = FALSE;
- }
- }
- /* let MMI can sleep */
- if (cat_vdoply_video_is_lcd_no_sleep)
- {
- TurnOffBacklight();
- }
- if (cat_vdoply_video_is_play_audio)
- {
- /* resume background audio */
- mdi_audio_resume_background_play();
- }
- if (wgui_is_touch_title_bar_buttons())
- {
- /* 061506 double buffer Start */
- /*******************************************************************************
- * Special status icon handle with double buffer
- *******************************************************************************/
- #if defined(__MMI_MAINLCD_176X220__) || defined(__MMI_MAINLCD_240X320__)
- U32 icon_flag;
- if (get_status_icon_bar_layer(0)!=GDI_ERROR_HANDLE && status_icon_buf!=NULL)
- {
- mmi_frm_scrmem_free(status_icon_buf);
- status_icon_buf = NULL;
- status_icon_layer = GDI_ERROR_HANDLE;
- set_status_icon_bar_layer(0, GDI_ERROR_HANDLE);
- }
- icon_flag = get_status_icon_bar_type(0);
- icon_flag &= ~ STATUS_ICON_BAR_ENABLE_DOUBLE_BUFFER;
- set_status_icon_bar_type(0, icon_flag);
- #endif
- /* 061506 double buffer End */
- title_bg_id = 0;
- if (gBlack_buf != NULL)
- {
- mmi_frm_scrmem_free(gBlack_buf);
- }
- gBlack_buf = NULL;
- gBlack_layer = NULL;
- entry_full_screen();
- }
- wgui_reset_touch_title_bar_buttons();
- ExitCategoryFunction = MMI_dummy_function;
- RedrawCategoryFunction = MMI_dummy_function;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- #ifdef __MMI_SUBLCD__
- /* exit sublcd */
- if (cat_vdoply_is_sublcd_display)
- {
- GoBackSubLCDHistory();
- cat_vdoply_is_sublcd_display = FALSE;
- }
- #endif /* __MMI_SUBLCD__ */
- }
- /*****************************************************************************
- * FUNCTION
- * EnterCategoryVdoplySubScreen
- * DESCRIPTION
- * Entery Category vdoply's sublcd screen, will draw an icon on sublcd
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SUBLCD__
- static void EnterCategoryVdoplySubScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- ExecSubLCDCurrExitHandler();
- cat_vdoply_is_sublcd_display = TRUE;
- ShowCategory332Screen(IMG_ID_VDOPLY_SUBLCD_ICON);
- /* force all animation on sulcd stop, this is prevent IMG_ID_VDOPLY_SUBLCD_ICON is an animation gif */
- gdi_lcd_set_active(GDI_LCD_SUB_LCD_HANDLE);
- gdi_image_stop_animation_all();
- gdi_lcd_set_active(GDI_LCD_MAIN_LCD_HANDLE);
- SetSubLCDExitHandler(ExitCategoryVdoplySubScreen);
- }
- #endif /* __MMI_SUBLCD__ */
- /*****************************************************************************
- * FUNCTION
- * ExitCategoryVdoplySubScreen
- * DESCRIPTION
- * Exit Category Vdoply's sublcd screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SUBLCD__
- static void ExitCategoryVdoplySubScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- SubLCDHistoryNode sub_history;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* someone may exit/draw sublcd first then exit mainlcd, this may cause driver assert */
- if (cat_vdoply_is_video_play)
- {
- mdi_video_ply_stop();
- cat_vdoply_is_video_play = FALSE;
- }
- cat_vdoply_is_sublcd_display = FALSE;
- sub_history.entryFuncPtr = EnterCategoryVdoplySubScreen;
- AddSubLCDHistory(&sub_history);
- }
- #endif /* __MMI_SUBLCD__ */
- /*****************************************************************************
- * FUNCTION
- * StopCategoryVdoplyVideo
- * DESCRIPTION
- * Stop Category Vdoply screen's video
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void StopCategoryVdoplyVideo(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cat_vdoply_is_video_force_stop = TRUE;
- if (cat_vdoply_is_video_open)
- {
- /* stop video playing */
- if (cat_vdoply_is_video_play)
- {
- mdi_video_ply_stop();
- cat_vdoply_is_video_play = FALSE;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * PauseCategoryVdoplyVideo
- * DESCRIPTION
- * Pause video play
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void PauseCategoryVdoplyVideo(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* stop video playing */
- if (cat_vdoply_is_video_open)
- {
- if (cat_vdoply_is_video_play)
- {
- mdi_video_ply_stop();
- cat_vdoply_is_video_play = FALSE;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ResumeCategoryVdoplyVideo
- * DESCRIPTION
- * Resume video play
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void ResumeCategoryVdoplyVideo(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MDI_RESULT video_ret;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* the callback function maybe already exit this category and close video file */
- /* check before play this video */
- if (cat_vdoply_is_video_open)
- {
- /* start play again */
- if (wgui_is_touch_title_bar_buttons())
- {
- video_ret = mdi_video_ply_play(
- cat_vdoply_video_layer,
- GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1 | GDI_LAYER_ENABLE_LAYER_2,
- GDI_LAYER_ENABLE_LAYER_1,
- 1, /* repeat count */
- cat_vdoply_video_is_visual_update, /* update to LCM or not */
- cat_vdoply_video_is_play_audio, /* play aud or not */
- MDI_DEVICE_SPEAKER2, /* speaker & earphone */
- MDI_VIDEO_LCD_ROTATE_0, /* rotate */
- 100, /* 1x play speed */
- CatVdoplyPlayFinishCallback); /* hook callback */
- }
- else
- {
- video_ret = mdi_video_ply_play(
- cat_vdoply_video_layer,
- GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1,
- GDI_LAYER_ENABLE_LAYER_1,
- 1, /* repeat count */
- cat_vdoply_video_is_visual_update, /* update to LCM or not */
- cat_vdoply_video_is_play_audio, /* play aud or not */
- MDI_DEVICE_SPEAKER2, /* speaker & earphone */
- MDI_VIDEO_LCD_ROTATE_0, /* rotate */
- 100, /* 1x play speed */
- CatVdoplyPlayFinishCallback); /* hook callback */
- }
- if (video_ret < 0)
- {
- cat_vdoply_play_finish_callback(video_ret);
- if (cat_vdoply_play_finish_callback != NULL)
- {
- cat_vdoply_play_finish_callback(video_ret);
- }
- }
- else
- {
- cat_vdoply_is_video_play = TRUE;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * CatVdoplyPlayFinishCallback
- * DESCRIPTION
- * Play finish callback function, will handle looping here
- * PARAMETERS
- * result [IN]
- * RETURNS
- * void
- *****************************************************************************/
- static void CatVdoplyPlayFinishCallback(MDI_RESULT result)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- MDI_RESULT video_ret;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (result >= 0)
- {
- /* success play finished */
- /* call callback function */
- if (cat_vdoply_play_finish_callback != NULL)
- {
- cat_vdoply_play_finish_callback(result);
- }
- /* teminate condition */
- if (cat_vdoply_video_repeat_count == 0)
- {
- return;
- }
- /* force stopped, will not loop again */
- if (cat_vdoply_is_video_force_stop == TRUE)
- {
- return;
- }
- /* calc remain count */
- if (cat_vdoply_video_repeat_count > 0) /* play again */
- {
- if (cat_vdoply_video_repeat_count != 0xffff)
- {
- /* not infite play */
- cat_vdoply_video_repeat_count--;
- }
- }
- /* the callback function maybe already exit this category and close video file */
- /* check before play this video */
- if (cat_vdoply_is_video_open)
- {
- /* seek to first frame */
- video_ret = mdi_video_ply_seek(0);
- if (video_ret < 0)
- {
- if (cat_vdoply_play_finish_callback != NULL)
- {
- cat_vdoply_play_finish_callback(video_ret);
- }
- return;
- }
- /* start play again */
- if (wgui_is_touch_title_bar_buttons())
- {
- video_ret = mdi_video_ply_play(
- cat_vdoply_video_layer,
- GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1 | GDI_LAYER_ENABLE_LAYER_2,
- GDI_LAYER_ENABLE_LAYER_1,
- 1, /* repeat count */
- cat_vdoply_video_is_visual_update, /* update to LCM or not */
- cat_vdoply_video_is_play_audio, /* play aud or not */
- MDI_DEVICE_SPEAKER2, /* speaker & earphone */
- MDI_VIDEO_LCD_ROTATE_0, /* rotate */
- 100, /* 1x play speed */
- CatVdoplyPlayFinishCallback); /* hook callback */
- }
- else
- {
- video_ret = mdi_video_ply_play(
- cat_vdoply_video_layer,
- GDI_LAYER_ENABLE_LAYER_0 | GDI_LAYER_ENABLE_LAYER_1,
- GDI_LAYER_ENABLE_LAYER_1,
- 1, /* repeat count */
- cat_vdoply_video_is_visual_update, /* update to LCM or not */
- cat_vdoply_video_is_play_audio, /* play aud or not */
- MDI_DEVICE_SPEAKER2, /* speaker & earphone */
- MDI_VIDEO_LCD_ROTATE_0, /* rotate */
- 100, /* 1x play speed */
- CatVdoplyPlayFinishCallback); /* hook callback */
- }
- if (video_ret < 0)
- {
- cat_vdoply_play_finish_callback(video_ret);
- if (cat_vdoply_play_finish_callback != NULL)
- {
- cat_vdoply_play_finish_callback(video_ret);
- }
- }
- }
- }
- else
- {
- /* something wrong */
- /* call callback function */
- if (cat_vdoply_play_finish_callback != NULL)
- {
- cat_vdoply_play_finish_callback(result);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * CatVdoplyVolUp
- * DESCRIPTION
- * volume down key press hdlr
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void CatVdoplyVolUp(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cat_vdoply_audio_volumn < LEVEL7)
- {
- cat_vdoply_audio_volumn++;
- mdi_audio_set_volume(MDI_VOLUME_MEDIA, cat_vdoply_audio_volumn);
- }
- }
- /*****************************************************************************
- * FUNCTION
- * CatVdoplyVolDown
- * DESCRIPTION
- * volume down key press hdlr
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- static void CatVdoplyVolDown(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cat_vdoply_audio_volumn > LEVEL1)
- {
- cat_vdoply_audio_volumn--;
- mdi_audio_set_volume(MDI_VOLUME_MEDIA, cat_vdoply_audio_volumn);
- }
- }
- #endif /* __MMI_VIDEO_PLAYER__ */
- extern void cat33_hide_lsk(void);
- extern void cat33_hide_rsk(void);
- PU8 cat226_bg_img = NULL;
- /*****************************************************************************
- * FUNCTION
- * cat226_hide_lsk
- * DESCRIPTION
- * hide category226 left softkey in normal mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void cat226_hide_lsk(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x, y, width, height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- wgui_softkey_get_dimension(MMI_LEFT_SOFTKEY, &width, &height);
- wgui_softkey_get_position(MMI_LEFT_SOFTKEY, &x, &y);
- gdi_layer_set_clip(x, y, x + width - 1, y + height - 1);
- gdi_image_draw(0, 0, (U8*) cat226_bg_img);
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * cat226_hide_rsk
- * DESCRIPTION
- * hide category226 right softkey in normal mode
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void cat226_hide_rsk(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 x, y, width, height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- wgui_softkey_get_dimension(MMI_RIGHT_SOFTKEY, &width, &height);
- wgui_softkey_get_position(MMI_RIGHT_SOFTKEY, &x, &y);
- gdi_layer_set_clip(x, y, x + width - 1, y + height - 1);
- gdi_image_draw(0, 0, (U8*) cat226_bg_img);
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * cat226_hide_button
- * DESCRIPTION
- *
- * PARAMETERS
- * button_object [?]
- * RETURNS
- * void
- *****************************************************************************/
- void cat226_hide_button(void *button_object)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- button *button_obj = (button*) button_object;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gdi_layer_set_clip(
- button_obj->x,
- button_obj->y,
- button_obj->x + button_obj->width + 1,
- button_obj->y + button_obj->height + 1);
- gdi_image_draw(0, 0, (U8*) cat226_bg_img);
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * cat226_hide_button_full_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * button_object [?]
- * RETURNS
- * void
- *****************************************************************************/
- void cat226_hide_button_full_screen(void *button_object)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- button *button_obj = (button*) button_object;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gdi_layer_set_clip(
- button_obj->x,
- button_obj->y,
- button_obj->x + button_obj->width + 1,
- button_obj->y + button_obj->height + 1);
- gdi_draw_solid_rect(
- button_obj->x,
- button_obj->y,
- button_obj->x + button_obj->width + 1,
- button_obj->y + button_obj->height + 1,
- GDI_COLOR_TRANSPARENT);
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * cat226_draw_scroll_text_cb
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void cat226_draw_scroll_text_cb(S32 x1, S32 y1, S32 x2, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gdi_layer_set_clip(x1, y1, x2, y2);
- gdi_image_draw(0, 0, (U8*) cat226_bg_img);
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * cat226_draw_scroll_text_cb_full_screen
- * DESCRIPTION
- *
- * PARAMETERS
- * x1 [IN]
- * y1 [IN]
- * x2 [IN]
- * y2 [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void cat226_draw_scroll_text_cb_full_screen(S32 x1, S32 y1, S32 x2, S32 y2)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- gdi_layer_push_clip();
- gdi_layer_set_clip(x1, y1, x2, y2);
- gdi_draw_solid_rect(x1, y1, x2, y2, GDI_COLOR_TRANSPARENT);
- gdi_layer_pop_clip();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory226Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategory226Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- enable_softkey_background();
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory226Screen
- * DESCRIPTION
- * Category screen for image viewer
- * one preview area, one image view area.
- * PARAMETERS
- * left_softkey [IN] Left softkey string id
- * left_softkey_icon [IN] Left softkey icon id
- * right_softkey [IN] Right softkey string id
- * right_softkey_icon [IN] Right softkey icon id
- * bg_image_id [IN] Background image id
- * str_1 [IN] String 1 for display ( filename )
- * str_2 [IN] String 2 for display ( file count )
- * left_arrow_up [IN] Up image id for left arrow
- * left_arrow_down [IN] Down image id for left arrow
- * event_callback1 [IN] Event handler for left arrow
- * right_arrow_up [IN] Up image id for right arrow
- * right_arrow_down [IN] Down image id for right arrow
- * event_callback2 [IN] Event handler for right arrow
- * icon1_up [IN] Up image id for icon1
- * icon1_down [IN]
- * event_callback3 [IN] Event handler for icon1
- * icon2_up [IN] Up image id for icon2
- * icon2_down [IN] Down image id for icon2
- * event_callback4 [IN] Event handler for icon2
- * icon3_up [IN] Up image id for icon3
- * icon3_down [IN] Down image id for icon3
- * event_callback5 [IN] Event handler for icon3
- * icon4_up [IN] Up image id for icon4
- * icon4_down [IN] Down image id for icon4
- * event_callback6 [IN] Event handler for icon4
- * area1_layer [IN/OUT] Layer handle for preview area
- * area1_call_back [IN] Draw function of preview area
- * area2_layer [IN/OUT] Layer handle for image content area
- * area2_call_back [IN] Draw function of image content area
- * layout [IN] Normal mode / full screen mode
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory226Screen(
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U16 bg_image_id,
- UI_string_type str_1,
- UI_string_type str_2,
- U16 left_arrow_up,
- U16 left_arrow_down,
- FuncPtr event_callback1,
- U16 right_arrow_up,
- U16 right_arrow_down,
- FuncPtr event_callback2,
- U16 icon1_up,
- U16 icon1_down,
- FuncPtr event_callback3,
- U16 icon2_up,
- U16 icon2_down,
- FuncPtr event_callback4,
- U16 icon3_up,
- U16 icon3_down,
- FuncPtr event_callback5,
- U16 icon4_up,
- U16 icon4_down,
- FuncPtr event_callback6,
- GDI_HANDLE *area1_layer,
- void (*area1_call_back) (dm_coordinates *coordinate),
- GDI_HANDLE *area2_layer,
- void (*area2_call_back) (dm_coordinates *coordinate),
- cat226_screen_layout_enum layout)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- U8 index = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- entry_full_screen();
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- disable_softkey_background();
- if (layout == VERTICAL_FULLSCREEN || layout == HORIZONTAL_FULLSCREEN)
- {
- register_hide_left_softkey(cat33_hide_lsk);
- register_hide_right_softkey(cat33_hide_rsk);
- }
- else
- {
- register_hide_left_softkey(cat226_hide_lsk);
- register_hide_right_softkey(cat226_hide_rsk);
- }
- cat226_bg_img = get_image(bg_image_id);
- dm_add_image(cat226_bg_img, NULL, NULL);
- /* dm_add_string(str_1, &MMI_default_font, UI_COLOR_WHITE, UI_COLOR_BLACK, NULL); */
- if (layout == VERTICAL_NORMAL || layout == HORIZONTAL_NORMAL)
- {
- dm_add_scroll_text(str_1, NULL, cat226_draw_scroll_text_cb, UI_COLOR_BLACK, UI_COLOR_WHITE);
- dm_add_button(NULL, get_image(left_arrow_up), get_image(left_arrow_down), cat226_hide_button);
- dm_add_button(NULL, get_image(right_arrow_up), get_image(right_arrow_down), cat226_hide_button);
- dm_add_button(NULL, get_image(icon1_up), get_image(icon1_down), cat226_hide_button);
- dm_add_button(NULL, get_image(icon2_up), get_image(icon2_down), cat226_hide_button);
- dm_add_button(NULL, get_image(icon3_up), get_image(icon3_down), cat226_hide_button);
- dm_add_button(NULL, get_image(icon4_up), get_image(icon4_down), cat226_hide_button);
- }
- else
- {
- dm_add_scroll_text(str_1, NULL, cat226_draw_scroll_text_cb_full_screen, UI_COLOR_BLACK, UI_COLOR_WHITE);
- dm_add_button(NULL, get_image(left_arrow_up), get_image(left_arrow_down), cat226_hide_button_full_screen);
- dm_add_button(NULL, get_image(right_arrow_up), get_image(right_arrow_down), cat226_hide_button_full_screen);
- dm_add_button(NULL, get_image(icon1_up), get_image(icon1_down), cat226_hide_button_full_screen);
- dm_add_button(NULL, get_image(icon2_up), get_image(icon2_down), cat226_hide_button_full_screen);
- dm_add_button(NULL, get_image(icon3_up), get_image(icon3_down), cat226_hide_button_full_screen);
- dm_add_button(NULL, get_image(icon4_up), get_image(icon4_down), cat226_hide_button_full_screen);
- }
- dm_add_string(str_2, &MMI_default_font, UI_COLOR_BLACK, UI_COLOR_WHITE, NULL);
- dm_register_button_functions(index, KEY_EVENT_UP, event_callback1);
- dm_register_button_functions(index++, KEY_EVENT_REPEAT, event_callback1);
- dm_register_button_functions(index, KEY_EVENT_UP, event_callback2);
- dm_register_button_functions(index++, KEY_EVENT_REPEAT, event_callback2);
- dm_register_button_functions(index++, KEY_EVENT_UP, event_callback3);
- dm_register_button_functions(index++, KEY_EVENT_UP, event_callback4);
- dm_register_button_functions(index, KEY_EVENT_UP, event_callback5);
- dm_register_button_functions(index++, KEY_EVENT_REPEAT, event_callback5);
- dm_register_button_functions(index, KEY_EVENT_UP, event_callback6);
- dm_register_button_functions(index++, KEY_EVENT_REPEAT, event_callback6);
- ExitCategoryFunction = ExitCategory226Screen;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- dm_data.s32CatId = MMI_CATEGORY226_ID1 + layout;
- dm_data.s32ScrId = GetActiveScreenId();
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND | DM_NO_BLT;
- dm_setup_data(&dm_data);
- dm_register_category_controlled_callback(area1_call_back);
- dm_register_category_controlled2_callback(area2_call_back);
- dm_redraw_category_screen();
- if (layout == VERTICAL_NORMAL || layout == HORIZONTAL_NORMAL)
- {
- *area1_layer = dm_get_layer_handle(0);
- *area2_layer = dm_get_layer_handle(1);
- }
- else
- {
- *area1_layer = GDI_ERROR_HANDLE;
- *area2_layer = dm_get_layer_handle(0);
- }
- }
- #ifdef __MMI_TOUCH_SCREEN__
- /*****************************************************************************
- * FUNCTION
- * Cat226RegisterPenHandlers
- * DESCRIPTION
- * Register pen event handlers for category control areas in category226
- * PARAMETERS
- * ctrl_area_idx [IN]
- * pen_hdlr [IN]
- * event_type [IN]
- * RETURNS
- * void
- *****************************************************************************/
- void Cat226RegisterPenHandlers(U16 ctrl_area_idx, mmi_pen_handler pen_hdlr, mmi_pen_event_type_enum event_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (ctrl_area_idx == 1)
- {
- wgui_register_category_screen_control_area_pen_handlers(pen_hdlr, event_type);
- }
- else if (ctrl_area_idx == 0)
- {
- wgui_register_category_screen_control_area2_pen_handlers(pen_hdlr, event_type);
- }
- else
- {
- MMI_ASSERT(ctrl_area_idx);
- }
- }
- #endif /* __MMI_TOUCH_SCREEN__ */
- /*****************************************************************************
- * FUNCTION
- * ShowCategory227Screen
- * DESCRIPTION
- * Category screen for image viewer
- * one preview area, one image view area.
- * PARAMETERS
- * title_string [IN] Title string
- * title_icon [IN] Title icon
- * left_softkey [IN] Left softkey string id
- * left_softkey_icon [IN] Left softkey icon id
- * right_softkey [IN] Right softkey string id
- * right_softkey_icon [IN] Right softkey icon id
- * display_call_back [IN] Event handler application customized area
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory227Screen(
- U8 *title_string,
- U16 title_icon,
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- void (*display_call_back) (dm_coordinates *coordinate))
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- MMI_title_string = (UI_string_type) title_string;
- MMI_title_icon = get_image(title_icon);
- change_left_softkey(left_softkey, left_softkey_icon);
- change_right_softkey(right_softkey, right_softkey_icon);
- SetupCategoryKeyHandlers();
- MMI_menu_shortcut_number = -1;
- ExitCategoryFunction = UI_dummy_function;
- GetCategoryHistorySize = dummy_get_history_size;
- GetCategoryHistory = dummy_get_history;
- RedrawCategoryFunction = dm_redraw_category_screen;
- dm_data.s32CatId = MMI_CATEGORY227_ID;
- dm_data.s32ScrId = GetActiveScreenId();
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_register_category_controlled_callback(display_call_back);
- dm_redraw_category_screen();
- }
- #ifdef __MMI_SWFLASH__
- /*****************************************************************************
- * FUNCTION
- * SetSWFlashPlayerLayer
- * DESCRIPTION
- * set swflash player layer
- * PARAMETERS
- * layer_handle [IN] layer handle
- * RETURNS
- * void
- *****************************************************************************/
- void SetSWFlashPlayerLayer(GDI_HANDLE layer_handle)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- cat_swflash_layer = layer_handle;
- }
- /*****************************************************************************
- * FUNCTION
- * CatSWFlashPlayEnd
- * DESCRIPTION
- *
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void CatSWFlashPlayEnd(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cat_swflash_is_open == MMI_FALSE || cat_swflash_is_play == MMI_FALSE)
- {
- /* open file failed or play failed - reutrn error cause */
- if (cat_swflash_play_finish_callback != NULL)
- {
- cat_swflash_play_finish_callback(-1);
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * DrawCateSWFlashCategoryControlArea
- * DESCRIPTION
- * draw vdo contro area
- * PARAMETERS
- * coordinate [IN/OUT] Coord
- * RETURNS
- * void
- *****************************************************************************/
- void DrawCateSWFlashCategoryControlArea(dm_coordinates *coordinate)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 content_width, content_height;
- S32 content_offset_x, content_offset_y;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (!cat_swflash_is_full_screen)
- {
- content_width = MMI_content_width;
- content_height = MMI_content_height;
- content_offset_x = MMI_content_x;
- content_offset_y = MMI_content_y;
- }
- else
- {
- content_width = UI_device_width;
- content_height = UI_device_height;
- content_offset_x = 0;
- content_offset_y = 0;
- }
- /********************************************************************************
- * Create Video Layer
- ********************************************************************************/
- /* video is successfully opened, create video playback layer */
- if (cat_swflash_is_open)
- {
- if (cat_swflash_layer == GDI_ERROR_HANDLE || cat_swflash_layer == GDI_LAYER_EMPTY_HANDLE)
- {/* the swflash layer maybe already set */
- if (wgui_is_touch_title_bar_buttons())
- {
- dm_create_layer(
- content_offset_x,
- content_offset_y,
- content_width,
- content_height,
- &cat_swflash_layer,
- DM_LAYER_ACTIVE_TOP);
- }
- else
- {
- dm_create_layer(
- content_offset_x,
- content_offset_y,
- content_width,
- content_height,
- &cat_swflash_layer,
- DM_LAYER_ACTIVE_BOTTOM);
- }
- }
- /* clear this layer with black */
- gdi_layer_push_and_set_active(cat_swflash_layer);
- gdi_layer_clear(GDI_COLOR_BLACK);
- gdi_layer_pop_and_restore_active();
- /* Get first frame and start to play */
- cat_swflash_play_ret = mdi_swflash_play(
- cat_swflash_layer,
- 1, /* repeat count */
- MDI_DEVICE_SPEAKER2, /* audio_path */
- cat_swflash_play_finish_callback); /* play_result_callback */
- cat_swflash_is_play = (cat_swflash_play_ret >= 0) ? MMI_TRUE : MMI_FALSE;
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory229Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * title_str [?]
- * title_icon [IN]
- * lsk_str [IN]
- * lsk_icon [IN]
- * rsk_str [IN]
- * rsk_icon [IN]
- * resource_id [IN]
- * resource_filename [IN]
- * repeat_count [IN]
- * is_play_audio [IN]
- * is_vibrate_on [IN]
- * is_interaction_on [IN]
- * is_lcd_no_sleep [IN]
- * is_full_screen [IN]
- * bg_color [IN]
- * play_finish_callback [IN]
- * gui_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory229Screen(
- U8 *title_str,
- U16 title_icon,
- U16 lsk_str,
- U16 lsk_icon,
- U16 rsk_str,
- U16 rsk_icon,
- U16 resource_id,
- PS8 resource_filename,
- U16 repeat_count,
- MMI_BOOL is_play_audio,
- MMI_BOOL is_vibrate_on,
- MMI_BOOL is_interaction_on,
- MMI_BOOL is_lcd_no_sleep,
- MMI_BOOL is_full_screen,
- GDI_COLOR bg_color,
- void (*play_finish_callback) (MDI_RESULT),
- void *gui_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- U16 btn_prev_item_id, btn_next_item_id;
- U32 playmode;
- MDI_RESULT mfh_ret;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- /* init var */
- cat_swflash_is_from_id = (resource_id != 0) ? MMI_TRUE : MMI_FALSE;
- cat_swflash_is_audio_on = is_play_audio;
- cat_swflash_is_vibrate_on = is_vibrate_on;
- cat_swflash_is_interaction_on = is_interaction_on;
- cat_swflash_is_lcd_no_sleep = is_lcd_no_sleep;
- cat_swflash_play_finish_callback = play_finish_callback;
- cat_swflash_is_full_screen = is_full_screen;
- /* setup keys */
- set_left_softkey_label(get_string(lsk_str));
- set_left_softkey_icon(get_image(lsk_icon));
- set_right_softkey_label(get_string(rsk_str));
- set_right_softkey_icon(get_image(rsk_icon));
- SetupCategoryKeyHandlers();
- /* setup title */
- MMI_title_string = (UI_string_type) title_str;
- MMI_title_icon = NULL;
- MMI_menu_shortcut_number = -1;
- /* setup top selection bar */
- if (wgui_is_touch_title_bar_buttons())
- {
- wgui_set_wallpaper_on_bottom(MMI_TRUE);
- btn_prev_item_id = dm_add_button(
- NULL,
- get_image(LEFT_RED_ARROW),
- get_image(LEFT_RED_ARROW),
- cat226_hide_button_full_screen);
- btn_next_item_id = dm_add_button(
- NULL,
- get_image(RIGHT_RED_ARROW),
- get_image(RIGHT_RED_ARROW),
- cat226_hide_button_full_screen);
- title_bg_id = IMAGE_VIEW_TITLEBAR_BG; /* for showing different title bar. */
- #if defined(__MMI_TOUCH_SCREEN__)
- /* register the handler for pen event down istead of pen event up. */
- dm_register_button_functions(btn_prev_item_id, KEY_EVENT_UP, gMMI_touch_title_button1_down_handler);
- dm_register_button_functions(btn_next_item_id, KEY_EVENT_UP, gMMI_touch_title_button2_down_handler);
- #endif /* defined(__MMI_TOUCH_SCREEN__) */
- }
- /* Start SWFlash handling */
- /* stop MMI sleep */
- if (cat_swflash_is_lcd_no_sleep)
- {
- TurnOnBacklight(0);
- }
- /* set audio volumn */
- if (gui_buffer == NULL)
- {
- /* first time enter */
- cat_swflash_audio_volumn = LEVEL5;
- }
- if (cat_swflash_is_audio_on)
- {
- /* init audio volumn */
- mdi_audio_set_volume(MDI_VOLUME_MEDIA, cat_swflash_audio_volumn);
- /* full screen play do not allows vol adjustment */
- if (!is_full_screen)
- {
- SetKeyHandler(CatVdoplyVolUp, KEY_VOL_UP, KEY_EVENT_DOWN);
- SetKeyHandler(CatVdoplyVolDown, KEY_VOL_DOWN, KEY_EVENT_DOWN);
- }
- /* suspend background audio */
- mdi_audio_suspend_background_play();
- }
- /*
- * user may request to repeat play many times, and wants a callback bewteen each play,
- * so we have to handle repeat play within this category by seeking to first frame
- * after play finished each time, instead of using driver's repeat play.
- */
- cat_swflash_repeat_count = (repeat_count == 0) ? 0xffff : repeat_count; /* 0xff means infinte play */
- if (repeat_count != 0)
- {
- cat_swflash_repeat_count--;
- }
- /********************************************************************************
- * Open SWFlash
- ********************************************************************************/
- #if 0
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- /* under construction !*/
- #endif
- if (is_play_audio)
- {
- playmode = CIM_PLAYERMODE;
- }
- else
- {
- playmode = CIM_DESKTOPMODE;
- }
- if (resource_id != 0)
- {
- /* source from id */
- /* always open with audio, if do not want audio, mute it by calling mdi function */
- mfh_ret = mdi_swflash_open_id(resource_id, playmode, &wgui_swflash_info);
- cat_swflash_is_open = (mfh_ret >= 0) ? MMI_TRUE : MMI_FALSE;
- }
- else if (resource_filename != NULL)
- {
- /* source from file */
- /* always open with audio, if do not want audio, dsiable it in play function */
- mfh_ret = mdi_swflash_open_file(resource_filename, playmode, &wgui_swflash_info);
- cat_swflash_is_open = (mfh_ret >= 0) ? MMI_TRUE : MMI_FALSE;
- }
- else
- {
- /* no proper source */
- MMI_ASSERT(0);
- }
- /* setup draw manager functions */
- ExitCategoryFunction = ExitCategorySWFlashScreen;
- dm_setup_category_functions(dm_redraw_category_screen, dummy_get_history, dummy_get_history_size);
- if (wgui_is_touch_title_bar_buttons())
- {
- dm_data.s32CatId = MMI_CATEGORY229_ID;
- }
- else
- {
- dm_data.s32CatId = MMI_CATEGORY_VDOPLY;
- }
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- if (is_full_screen)
- {
- if (wgui_is_touch_title_bar_buttons())
- {
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- }
- else
- {
- dm_data.s32flags = DM_NO_TITLE | DM_NO_STATUS_BAR | DM_NO_SOFTKEY;
- }
- }
- else
- {
- dm_data.s32flags = DM_CLEAR_SCREEN_BACKGROUND;
- }
- dm_setup_data(&dm_data);
- dm_register_category_controlled_callback(DrawCateSWFlashCategoryControlArea);
- dm_redraw_category_screen();
- CatSWFlashPlayEnd();
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategorySWFlashScreen
- * DESCRIPTION
- * Exit Category 224 screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ExitCategorySWFlashScreen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (cat_swflash_is_open)
- {
- /* stop video playing */
- if (cat_swflash_is_play)
- {
- mdi_swflash_stop();
- cat_swflash_is_play = MMI_FALSE;
- }
- /* close video source */
- if (cat_swflash_is_from_id)
- {
- /* source from id */
- mdi_swflash_close_id();
- cat_swflash_is_open = MMI_FALSE;
- }
- else
- {
- /* source from file */
- mdi_swflash_close_file();
- cat_swflash_is_open = MMI_FALSE;
- }
- }
- cat_swflash_is_open = MMI_FALSE;
- cat_swflash_is_play = MMI_FALSE;
- cat_swflash_is_from_id = MMI_FALSE;
- cat_swflash_layer = GDI_ERROR_HANDLE;
- cat_swflash_play_finish_callback = NULL;
- cat_swflash_play_ret = 0;
- /* let MMI can sleep */
- if (cat_swflash_is_lcd_no_sleep)
- {
- TurnOffBacklight();
- }
- if (cat_swflash_is_audio_on)
- {
- /* resume background audio */
- mdi_audio_resume_background_play();
- }
- if (wgui_is_touch_title_bar_buttons())
- {
- title_bg_id = 0;
- if (gBlack_buf != NULL)
- {
- mmi_frm_scrmem_free(gBlack_buf);
- }
- gBlack_buf = NULL;
- gBlack_layer = NULL;
- entry_full_screen();
- }
- wgui_reset_touch_title_bar_buttons();
- }
- /*****************************************************************************
- * FUNCTION
- * GetCat34MediaType
- * DESCRIPTION
- * Get category34 background media type
- * PARAMETERS
- * void
- * RETURNS
- * S32
- *****************************************************************************/
- S32 GetCat34MediaType(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return g_mmi_idle_bg_media_type;
- }
- /*****************************************************************************
- * FUNCTION
- * SetCat34MediaType
- * DESCRIPTION
- * Get category34 background media type
- * PARAMETERS
- * void
- * RETURNS
- * S32
- *****************************************************************************/
- void SetCat34MediaType(S32 media_type)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- g_mmi_idle_bg_media_type = media_type;
- }
- /*****************************************************************************
- * FUNCTION
- * SetupCat34Media
- * DESCRIPTION
- * Setup category34 background media type
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- mdi_result SetupCat34Media(U16 bg_media_id, S8 *bg_media_filename)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- mdi_result mfh_ret = 0;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (dispchar_iswp_swflash() == MMI_TRUE)
- {
- g_mmi_idle_bg_media_type = MMI_IDLE_BG_MEDIA_SWFLASH;
- }
- else
- {
- g_mmi_idle_bg_media_type = MMI_IDLE_BG_MEDIA_IMG;
- }
- if (g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_SWFLASH)
- {
- if(bg_media_id == 0xFFFF && bg_media_filename == NULL)
- {
- bg_media_id = PhnsetGetCurWallPaperIdx();
- bg_media_filename = idle_screen_wallpaper_name;
- }
- /********************************************************************************
- * SWFlash Setting
- ********************************************************************************/
- cat_swflash_is_full_screen = MMI_TRUE;
- cat_swflash_repeat_count = 1;
- cat_swflash_audio_volumn = LEVEL5;
- cat_swflash_is_audio_on = MMI_FALSE;
- cat_swflash_is_vibrate_on = MMI_FALSE;
- cat_swflash_is_interaction_on = MMI_FALSE;
- cat_swflash_is_lcd_no_sleep = MMI_FALSE;
- /********************************************************************************
- * Open SWFlash
- ********************************************************************************/
- if (bg_media_id != 0)
- {
- cat_swflash_is_from_id = MMI_TRUE;
- /* source from id */
- /* always open with audio, if do not want audio, mute it by calling mdi function */
- mfh_ret = mdi_swflash_open_id(bg_media_id, CIM_DESKTOPMODE, &wgui_swflash_info);
- cat_swflash_is_open = (mfh_ret >= 0) ? MMI_TRUE : MMI_FALSE;
- }
- else if (bg_media_filename!= NULL)
- {
- cat_swflash_is_from_id = MMI_FALSE;
- /* source from file */
- /* always open with audio, if do not want audio, dsiable it in play function */
- mfh_ret = mdi_swflash_open_file(bg_media_filename, CIM_DESKTOPMODE, &wgui_swflash_info);
- cat_swflash_is_open = (mfh_ret >= 0) ? MMI_TRUE : MMI_FALSE;
- }
- else
- {
- /* no proper source */
- MMI_ASSERT(0);
- }
- }
- else /* g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_SWFLASH */
- {
- return 0;
- }
- return mfh_ret;
- }
- /*****************************************************************************
- * FUNCTION
- * HandleCat34MediaPlay
- * DESCRIPTION
- * Handle media play error
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void HandleCat34MediaPlayFailed(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ( g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_SWFLASH)
- {
- if (cat_swflash_is_open == MMI_FALSE || cat_swflash_play_ret < 0)
- {
- PhnsetWallpaperBadFileCallBack(0);
- g_mmi_idle_bg_media_type = MMI_IDLE_BG_MEDIA_IMG;
- }
- }
- }
- /*****************************************************************************
- * FUNCTION
- * ShowCategory34Screen
- * DESCRIPTION
- *
- * PARAMETERS
- * left_softkey [IN]
- * left_softkey_icon [IN]
- * right_softkey [IN]
- * right_softkey_icon [IN]
- * bg_media_id [IN]
- * bg_media_filename [IN]
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory34Screen(
- U16 left_softkey,
- U16 left_softkey_icon,
- U16 right_softkey,
- U16 right_softkey_icon,
- U16 bg_media_id,
- S8 *bg_media_filename,
- U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- dm_data_struct dm_data;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if (dispchar_iswp_swflash() == MMI_TRUE)
- {
- g_mmi_idle_bg_media_type = MMI_IDLE_BG_MEDIA_SWFLASH;
- }
- else
- {
- g_mmi_idle_bg_media_type = MMI_IDLE_BG_MEDIA_IMG;
- }
- /********************************************************************************
- * IdleScreen
- ********************************************************************************/
- ShowCategory33Screen_ext(
- left_softkey,
- left_softkey_icon,
- right_softkey,
- right_softkey_icon,
- history_buffer);
- /********************************************************************************
- * SWFlash Setting
- ********************************************************************************/
- SetupCat34Media(bg_media_id, bg_media_filename);
- ExitCategoryFunction = ExitCategory34Screen;
- GetCategoryHistory = dummy_get_history;
- GetCategoryHistorySize = dummy_get_history_size;
- RedrawCategoryFunction = dm_redraw_category_screen;
- dm_data.s32ScrId = (S32) GetActiveScreenId();
- if ( g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_IMG )
- {
- dm_data.s32CatId = MMI_CATEGORY33_ID;
- dm_register_category_controlled_callback(NULL);
- }
- else if ( g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_SWFLASH )
- {
- dm_data.s32CatId = MMI_CATEGORY34_ID;
- dm_register_category_controlled_callback(DrawCateSWFlashCategoryControlArea);
- }
- dm_data.s32flags = 0;
- #ifdef __MMI_TOUCH_IDLESCREEN_SHORTCUTS__
- if (mmi_bootup_get_active_flight_mode() == 0)
- {
- dm_data.s32flags |= DM_NO_SOFTKEY;
- }
- #endif /* __MMI_TOUCH_IDLESCREEN_SHORTCUTS__ */
- dm_data.s32flags |= DM_CLEAR_SCREEN_BACKGROUND;
- dm_setup_data(&dm_data);
- dm_register_category_controlled2_callback(dm_category_33_controlled_area);
- dm_redraw_category_screen();
- HandleCat34MediaPlayFailed();
- }
- void ExitCategory34Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- if ( g_mmi_idle_bg_media_type == MMI_IDLE_BG_MEDIA_SWFLASH )
- {
- ExitCategorySWFlashScreen();
- }
- ExitCategory33Screen();
- }
- #endif /* __MMI_SWFLASH__ */
- /****************************************************************************
- *
- * MultiMedia Related [SubLCD] Categories
- *
- *****************************************************************************/
- /*****************************************************************************
- * [Category331] [SUB]
- *
- * This category is a empty SubLCD category.
- *
- * ****************
- * * *
- * * *
- * * *
- * * *
- * * *
- * ****************
- *
- *****************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * ShowCategory331Screen
- * DESCRIPTION
- * Enter Category 331 Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory331Screen(void)
- {
- #ifdef __MMI_SUBLCD__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GDI_LOCK;
- SUBLCD_ExitCategoryFunction();
- hide_status_icon_bar(2);
- SUBLCD_ExitCategoryFunction = ExitCategory331Screen;
- SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
- SUBLCD_GetCategoryHistory = dummy_get_history;
- SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
- GDI_UNLOCK;
- #endif /* __MMI_SUBLCD__ */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory331Screen
- * DESCRIPTION
- * Exit Category 331 Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SUBLCD__
- static void ExitCategory331Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SUBLCD_ExitCategoryFunction = MMI_dummy_function;
- SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
- SUBLCD_GetCategoryHistory = dummy_get_history;
- SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
- }
- #endif /* __MMI_SUBLCD__ */
- /*****************************************************************************
- * [Category332] [SUB]
- *
- * This category is to draw a image on sublcd
- *
- * ****************
- * * *
- * * *
- * * [ Image ] *
- * * *
- * * *
- * ****************
- *
- *****************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * ShowCategory332Screen
- * DESCRIPTION
- * Enter Category 332 Screen
- * PARAMETERS
- * image_id [IN] Image id
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory332Screen(MMI_ID_TYPE image_id)
- {
- #ifdef __MMI_SUBLCD__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- S32 image_width;
- S32 image_height;
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GDI_LOCK;
- SUBLCD_ExitCategoryFunction();
- UI_set_sub_LCD_graphics_context();
- hide_status_icon_bar(2);
- gdi_layer_reset_clip();
- gdi_layer_clear(GDI_COLOR_WHITE);
- if (image_id != 0)
- {
- gdi_image_get_dimension_id(image_id, &image_width, &image_height);
- gdi_image_draw_id((UI_device_width - image_width) >> 1, (UI_device_height - image_height) >> 1, image_id);
- }
- gdi_layer_blt_base_layer(0, 0, UI_device_width - 1, UI_device_height - 1);
- SUBLCD_ExitCategoryFunction = ExitCategory332Screen;
- SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
- SUBLCD_GetCategoryHistory = dummy_get_history;
- SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
- UI_set_main_LCD_graphics_context();
- GDI_UNLOCK;
- #endif /* __MMI_SUBLCD__ */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory332Screen
- * DESCRIPTION
- * Exit Category 332 Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SUBLCD__
- static void ExitCategory332Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- SUBLCD_ExitCategoryFunction = MMI_dummy_function;
- SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
- SUBLCD_GetCategoryHistory = dummy_get_history;
- SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
- }
- #endif /* __MMI_SUBLCD__ */
- /*****************************************************************************
- * [Category333] [SUB]
- *
- * This category is for audio player sub display.
- *
- * ****************
- * * *
- * * *
- * * XXXXXXXXX *
- * * *
- * * *
- * ****************
- *
- *****************************************************************************/
- /*****************************************************************************
- * FUNCTION
- * ShowCategory333Screen
- * DESCRIPTION
- * Enter Category 333 Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- void ShowCategory333Screen(void)
- {
- #ifdef __MMI_SUBLCD__
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- GDI_LOCK;
- SUBLCD_ExitCategoryFunction();
- UI_set_sub_LCD_graphics_context();
- gui_lock_double_buffer();
- register_hide_status_icon_bar(2, SUBLCD_screens_hide_status_icons);
- show_status_icon_bar(2);
- gui_unlock_double_buffer();
- SUBLCD_ExitCategoryFunction = ExitCategory333Screen;
- SUBLCD_RedrawCategoryFunction = RedrawCategory333Screen;
- SUBLCD_GetCategoryHistory = GetCategory333History;
- SUBLCD_GetCategoryHistorySize = GetCategory333HistorySize;
- RedrawCategory333Screen();
- UI_set_main_LCD_graphics_context();
- GDI_UNLOCK;
- #endif /* __MMI_SUBLCD__ */
- }
- /*****************************************************************************
- * FUNCTION
- * ExitCategory333Screen
- * DESCRIPTION
- * Exit Category 333 Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SUBLCD__
- static void ExitCategory333Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_set_sub_LCD_graphics_context();
- close_status_icons();
- #ifdef __MMI_AUDIO_PLAYER__
- mmi_audply_exit_subLCD();
- #endif
- #ifdef __MMI_FM_RADIO__
- mmi_fmrdo_exit_subLCD();
- #endif
- gui_hide_animations();
- SUBLCD_ExitCategoryFunction = MMI_dummy_function;
- SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
- SUBLCD_GetCategoryHistory = dummy_get_history;
- SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
- UI_set_main_LCD_graphics_context();
- }
- #endif /* __MMI_SUBLCD__ */
- /*****************************************************************************
- * FUNCTION
- * RedrawCategory333Screen
- * DESCRIPTION
- * Redraw Category 333 Screen
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SUBLCD__
- static void RedrawCategory333Screen(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- color c = gui_color(0, 0, 0);
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- UI_set_sub_LCD_graphics_context();
- gui_lock_double_buffer();
- #ifndef __MMI_SUB_WALLPAPER__
- show_sublcd_status_background(0, 0, (UI_device_width - 1), (UI_device_height - 1), MMI_FALSE);
- #endif
- SUBLCD_screens_show_status_icons();
- gui_draw_horizontal_line(0, UI_device_width - 1, 54, c);
- #ifdef __MMI_AUDIO_PLAYER__
- if (mmi_audply_is_playing())
- {
- mmi_audply_redraw_subLCD(TRUE);
- }
- #endif /* __MMI_AUDIO_PLAYER__ */
- #ifdef __MMI_FM_RADIO__
- if (mmi_fmrdo_is_power_on())
- {
- mmi_fmrdo_redraw_subLCD(TRUE);
- }
- #endif /* __MMI_FM_RADIO__ */
- gui_unlock_double_buffer();
- gui_BLT_double_buffer(0, 0, UI_device_width - 1, UI_device_height - 1);
- UI_set_main_LCD_graphics_context();
- }
- #endif /* __MMI_SUBLCD__ */
- /*****************************************************************************
- * FUNCTION
- * GetCategory333HistorySize
- * DESCRIPTION
- * Get Category 333 History Size
- * PARAMETERS
- * void
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SUBLCD__
- static S32 GetCategory333HistorySize(void)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (0);
- }
- #endif /* __MMI_SUBLCD__ */
- /*****************************************************************************
- * FUNCTION
- * GetCategory333History
- * DESCRIPTION
- * * Get Category 333 History
- * PARAMETERS
- * history_buffer [?]
- * RETURNS
- * void
- *****************************************************************************/
- #ifdef __MMI_SUBLCD__
- static U8 *GetCategory333History(U8 *history_buffer)
- {
- /*----------------------------------------------------------------*/
- /* Local Variables */
- /*----------------------------------------------------------------*/
- /*----------------------------------------------------------------*/
- /* Code Body */
- /*----------------------------------------------------------------*/
- return (history_buffer);
- }
- #endif /* __MMI_SUBLCD__ */