📄 audioplayermainscreen.c
字号:
* title [IN]
* left_softkey [IN]
* right_softkey [IN]
* skin [IN]
* U8* history_buffer(?)
* RETURNS
* void
*****************************************************************************/
void mmi_audply_show_mainscreen(U16 title, U16 left_softkey, U16 right_softkey, S8 skin)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
MMI_title_string = (UI_string_type) GetString(title);
#ifdef __MMI_AUDIO_PLAYER_ON_SUBLCD__
if(g_audply.in_sub_screen)
{
SUBLCD_ExitCategoryFunction();
UI_set_sub_LCD_graphics_context();
}
#endif
#ifdef __GDI_MEMORY_PROFILE_2__
gdi_layer_multi_layer_enable();
/* get base layer as skin layer */
gdi_layer_get_base_handle(&audply_osd_layer);
gdi_layer_clear_background(GDI_COLOR_TRANSPARENT);
gdi_layer_set_source_key(TRUE, GDI_COLOR_TRANSPARENT);
#ifdef __MMI_AUDIO_PLAYER_ON_SUBLCD__
if(g_audply.in_sub_screen)
{
gdi_layer_create_using_outside_memory(0,0,UI_device_width,UI_device_height,&audply_skin_layer,(U8*)new_gdi_buffer,EXTRA_GDI_BUFFER_SIZE);
}
else
#endif
gdi_layer_create(0, 0, UI_device_width, UI_device_height, &audply_skin_layer);
gdi_layer_set_blt_layer(audply_skin_layer, audply_osd_layer, 0, 0);
#ifdef __MMI_AUDIO_SPECTRUM_DISPLAY__
g_aud_ply_spectrum.target_layer = audply_osd_layer;
#endif
#ifdef __MMI_AUDIO_PLAYER_LYRIC_DISPLAY__
audply_lyric_print.target_layer = audply_osd_layer;
#endif
#endif /* __GDI_MEMORY_PROFILE_2__ */
/* init images */
#ifdef __MMI_AUDIO_PLAYER_ON_SUBLCD__
if(g_audply.in_sub_screen)
{
mmi_sub_audply_init_main_screen_images(0);
audply_main_skin_index = -1;//be used to executed the initialization of images when show audio player main
} //screen on mainlcd after switching from audio player main screen on sublcd.
else
#endif
#ifndef __MMI_RESOURCE_ENFB_SUPPORT__
if (!init_images_done || audply_main_skin_index != skin)
#endif
{
mmi_audply_init_main_screen_images(skin);
audply_main_skin_index = skin;
init_images_done = TRUE;
init_title_scrolling_done = FALSE;
}
#ifdef __GDI_MEMORY_PROFILE_2__
is_audply_skin_layer_drawn = FALSE;
#endif
#ifdef __MMI_AUDIO_SPECTRUM_DISPLAY__
if (g_audply.spectrum_style != 0 )
{
g_aud_ply_spectrum.style = g_audply.spectrum_style;
switch (g_aud_ply_spectrum.style)
{
case STYLE_BLOCKS:
case STYLE_BARS:
g_aud_ply_spectrum.number_of_bars = 16;
break;
case STYLE_CIRCLES:
g_aud_ply_spectrum.number_of_bars = 8;
break;
default:
ASSERT(0);
}
}
#endif /* __MMI_AUDIO_SPECTRUM_DISPLAY__ */
#ifdef __MMI_AUDIO_PLAYER_ON_SUBLCD__
if(!g_audply.in_sub_screen)
{
#endif
clear_key_handlers();
clear_left_softkey();
clear_right_softkey();
audply_main_LSK_text = (UI_string_type) GetString(left_softkey);
audply_main_RSK_text = (UI_string_type) GetString(right_softkey);
SetKeyHandler(mmi_audply_redraw_LSK_down, KEY_LSK, KEY_EVENT_DOWN);
SetKeyHandler(mmi_audply_redraw_RSK_down, KEY_RSK, KEY_EVENT_DOWN);
#ifdef __MMI_AUDIO_PLAYER_ON_SUBLCD__
}
#endif
/* associate functions */
#ifdef __MMI_AUDIO_PLAYER_ON_SUBLCD__
if(g_audply.in_sub_screen)
{
SUBLCD_ExitCategoryFunction = MMI_dummy_function;
SUBLCD_RedrawCategoryFunction = MMI_dummy_function;
SUBLCD_GetCategoryHistory = dummy_get_history;
SUBLCD_GetCategoryHistorySize = dummy_get_history_size;
}
else
#endif
{
ExitCategoryFunction = MMI_dummy_function;
RedrawCategoryFunction = MMI_dummy_function;
GetCategoryHistory = dummy_get_history;
GetCategoryHistorySize = dummy_get_history_size;
}
/* draw screen */
mmi_audply_redraw_main_screen();
}
/*****************************************************************************
* FUNCTION
* mmi_audply_exit_mainscreen
* DESCRIPTION
* exit audio player main screen
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_audply_exit_mainscreen()
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
gui_scrolling_text_stop(&audply_main_scrolling_title);
#ifdef __MMI_AUDIO_PLAYER_LYRIC_DISPLAY__
mmi_audply_stop_scroll_lyric_and_clean_screen();
mmi_audply_lyric_check_backlight(0);
lyric_reEntry = TRUE;
#endif /* __MMI_AUDIO_PLAYER_LYRIC_DISPLAY__ */
#ifdef __MMI_AUDIO_SPECTRUM_DISPLAY__
mmi_audply_spectrum_display_stop();
#endif
#ifdef __MMI_AUDIO_PLAYER_ANIMATION__
/* stop animation */
if (audply_main_animation.img_handle != GDI_ERROR_HANDLE)
{
gdi_image_stop_animation(audply_main_animation.img_handle);
}
#endif /* __MMI_AUDIO_PLAYER_ANIMATION__ */
#ifdef __GDI_MEMORY_PROFILE_2__
gdi_layer_flatten_to_base(audply_skin_layer, audply_osd_layer, 0, 0);
gdi_layer_free(audply_skin_layer);
gdi_layer_multi_layer_disable();
/* restore blt layer as base layer only */
gdi_layer_set_blt_layer(audply_osd_layer, 0, 0, 0);
#endif /* __GDI_MEMORY_PROFILE_2__ */
#ifdef __MMI_TOUCH_SCREEN__
audply_main_volume_inc.down = FALSE;
audply_main_volume_dec.down = FALSE;
audply_main_setting.down = FALSE;
#ifdef __MMI_AUDIO_PLAYER_SKIN_SHOW_REPEAT_SHUFFLE__
audply_main_repeat.down = FALSE;
audply_main_shuffle.down = FALSE;
#endif
audply_pen_event_on_object = AUDPLY_PEN_NONE;
#endif /* __MMI_TOUCH_SCREEN__ */
}
/*****************************************************************************
* FUNCTION
* mmi_audply_redraw_LSK_down
* DESCRIPTION
* redraw shifted LSK for key press down event
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_audply_redraw_LSK_down(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 str_w, str_h;
S32 x1, y1, x2, y2;
color LSK_text_color = gui_color(255, 255, 255);
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#if(UI_DOUBLE_BUFFER_SUPPORT)
gui_lock_double_buffer();
#endif
gui_set_font(&MMI_medium_font);
gui_set_text_color(LSK_text_color);
gui_set_text_border_color(text_border_color);
/* show LSK */
gui_measure_string(audply_main_LSK_text, &str_w, &str_h);
x1 = AUDPLY_LSK_X_OFFSET;
y1 = UI_device_height - str_h - AUDPLY_LSK_Y_OFFSET;
x2 = str_w + AUDPLY_LSK_X_OFFSET;
y2 = UI_device_height - AUDPLY_LSK_Y_OFFSET;
gdi_layer_push_clip();
gdi_layer_set_clip(x1 - 2, y1 - 2, x2, y2);
#ifdef __GDI_MEMORY_PROFILE_2__
gdi_draw_solid_rect(x1 - 2, y1 - 2, x2, y2, GDI_COLOR_TRANSPARENT);
#else
gdi_image_draw(0, 0, audply_main_bg_img);
#endif
gdi_layer_pop_clip();
gui_push_text_clip();
gui_set_text_clip(x1, y1 - 1, x2, y2);
if (r2lMMIFlag)
{
gui_move_text_cursor(x2, y1);
}
else
{
gui_move_text_cursor(x1, y1);
}
gui_print_bordered_text(audply_main_LSK_text);
gui_pop_text_clip();
#if(UI_DOUBLE_BUFFER_SUPPORT)
gui_unlock_double_buffer();
gui_BLT_double_buffer(x1 - 2, y1 - 2, x2, y2);
#endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
}
/*****************************************************************************
* FUNCTION
* mmi_audply_redraw_RSK_down
* DESCRIPTION
* redraw shifted RSK for key press down event
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_audply_redraw_RSK_down(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 str_w, str_h;
S32 x1, y1, x2, y2;
color RSK_text_color = gui_color(255, 255, 255);
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#if(UI_DOUBLE_BUFFER_SUPPORT)
gui_lock_double_buffer();
#endif
gui_set_font(&MMI_medium_font);
gui_set_text_color(RSK_text_color);
gui_set_text_border_color(text_border_color);
/* show RSK */
gui_measure_string(audply_main_RSK_text, &str_w, &str_h);
x1 = UI_device_width - str_w - AUDPLY_RSK_X_OFFSET;
y1 = UI_device_height - str_h - AUDPLY_RSK_Y_OFFSET;
x2 = UI_device_width - AUDPLY_RSK_X_OFFSET;
y2 = UI_device_height - AUDPLY_RSK_Y_OFFSET;
gdi_layer_push_clip();
gdi_layer_set_clip(x1 - 2, y1 - 2, x2, y2);
#ifdef __GDI_MEMORY_PROFILE_2__
gdi_draw_solid_rect(x1 - 2, y1 - 2, x2, y2, GDI_COLOR_TRANSPARENT);
#else
gdi_image_draw(0, 0, audply_main_bg_img);
#endif
gdi_layer_pop_clip();
gui_push_text_clip();
gui_set_text_clip(x1, y1 - 1, x2, y2);
if (r2lMMIFlag)
{
gui_move_text_cursor(x2, y1);
}
else
{
gui_move_text_cursor(x1, y1);
}
gui_print_bordered_text(audply_main_RSK_text);
gui_pop_text_clip();
#if(UI_DOUBLE_BUFFER_SUPPORT)
gui_unlock_double_buffer();
gui_BLT_double_buffer(x1 - 2, y1 - 2, x2, y2);
#endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
}
/*****************************************************************************
* FUNCTION
* mmi_audply_redraw_LSK_up
* DESCRIPTION
* redraw shifted LSK for key press down event
* PARAMETERS
* void
* RETURNS
* void
*****************************************************************************/
void mmi_audply_redraw_LSK_up(void)
{
/*----------------------------------------------------------------*/
/* Local Variables */
/*----------------------------------------------------------------*/
S32 str_w, str_h;
S32 x1, y1, x2, y2;
color LSK_text_color = gui_color(255, 255, 255);
/*----------------------------------------------------------------*/
/* Code Body */
/*----------------------------------------------------------------*/
#if(UI_DOUBLE_BUFFER_SUPPORT)
gui_lock_double_buffer();
#endif
gui_set_font(&MMI_medium_font);
gui_set_text_color(LSK_text_color);
gui_set_text_border_color(text_border_color);
/* show LSK */
gui_measure_string(audply_main_LSK_text, &str_w, &str_h);
x1 = AUDPLY_LSK_X_OFFSET - 1;
y1 = UI_device_height - str_h - AUDPLY_LSK_Y_OFFSET - 1;
x2 = str_w + AUDPLY_LSK_X_OFFSET - 1;
y2 = UI_device_height - AUDPLY_LSK_Y_OFFSET - 1;
gdi_layer_push_clip();
gdi_layer_set_clip(x1 - 1, y1 - 1, x2 + 1, y2 + 1);
#ifdef __GDI_MEMORY_PROFILE_2__
gdi_draw_solid_rect(x1 - 1, y1 - 1, x2 + 1, y2 + 1, GDI_COLOR_TRANSPARENT);
#else
gdi_image_draw(0, 0, audply_main_bg_img);
#endif
gdi_layer_pop_clip();
gui_push_text_clip();
gui_set_text_clip(x1 - 1, y1 - 1, x2, y2);
if (r2lMMIFlag)
{
gui_move_text_cursor(x2, y1);
}
else
{
gui_move_text_cursor(x1, y1);
}
gui_print_bordered_text(audply_main_LSK_text);
gui_pop_text_clip();
#if(UI_DOUBLE_BUFFER_SUPPORT)
gui_unlock_double_buffer();
gui_BLT_double_buffer(x1 - 1, y1 - 1, x2 + 1, y2 + 1);
#endif /* (UI_DOUBLE_BUFFER_SUPPORT) */
}
/*****************************************************************************
* FUNCTION
* mmi_audply_redraw_RSK_up
* DESCRIPTION
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -