📄 osd_draw_explore.c
字号:
/******************************************************************************
* Function name : OwMmpDrawModeInfo
* Arguments :
* IN
* VOID
* OUT
* I/O
* Return :
* VOID
* By : Liu renliang
* Description : draw mode info in explore info2 window
* Revision :
******************************************************************************
*/
VOID OwMmpDrawModeInfo(VOID)
{
BYTE1 mode;
mode = GetMmpPlayMode();
gOSD_state.ecPlaymode_pos = mode;
SH_GfxDrawRec(SH_CANV1, 2, 50, 616, 40, COLOR_TRANS_BLUE);
SH_GfxDrawImage(SH_CANV1, IMG_BOOKMARK, 8, 56);
SH_GfxDrawImage(SH_CANV1, IMG_MODE_NRM, 303, 56);
SH_GfxDrawImage(SH_CANV1, IMG_MODE_RAN, 303 + 50, 56);
SH_GfxDrawImage(SH_CANV1, IMG_MODE_PGM, 303 + 50*2, 56);
OwMmpModeInfoSel(mode);
}
#endif /* _APP_CAP_FUNC_RANDOM_PLAY */
/******************************************************************************
* Function name : OwMmpDrawMute
* Arguments :
* IN
*
* OUT
* I/O
* Return :
* VOID
* By : QQ
* Description : make the mute string disp position fixable
* Revision : 050802
******************************************************************************
*/
VOID OwMmpDrawMute(VOID)
{
#if !_APP_CAP_OSD_MMP_MUTE_IN_FRONT
if(gMuteOn)
{
SH_GfxDrawRec(SH_CANV1, 200, 50, 67, 40, COLOR_TRANS_BLUE );
SH_GfxDrawStr(SH_CANV1, (char *)gpMute[MENU_LANG], 200, 56, NULL);
gOSD_state.etExp_state.ebMute_draw = TRUE;
}
else
{
SH_GfxDrawRec(SH_CANV1, 200, 50, 67, 40, COLOR_TRANS_BLUE );
gOSD_state.etExp_state.ebMute_draw = FALSE;
}
#endif
}
/******************************************************************************
* Function name : OwMmpDrawPlayInfo
* Arguments :
* IN
* VOID
* OUT
* I/O
* Return :
* VOID
* By : Liu renliang
* Description : draw the play info in explore info2 window
* Revision :
******************************************************************************
*/
VOID OwMmpDrawPlayInfo(VOID)
{
BYTE2 folder, file;
//OwUpdateMmpNotice();
OwDisplayPathInfo(MMP_NO_SELECTION, MMP_NO_SELECTION);/* Clear up */
switch (gOSD_state.etExp_state.etCtrl_focus)
{
case EXPLORER_SUB_FOLDER:
folder = GetMmpFolderCursor();
OwDisplayPathInfo(folder, MMP_NO_SELECTION);
break;
case EXPLORER_SUB_FILE:
folder = GetMmpFolderOpen();
file = GetMmpFileCursor();
OwDisplayPathInfo(folder, file);
break;
default:
break;
}
}
/******************************************************************************
* Function name : OwGetIconImage
* Arguments :
* IN MmpFileType_et file_type
*
* OUT
* I/O
* Return : Gfx_imge_et
*
* By : Kim Do Yeon
* Description : Get the icon id
* Revision : 1.0
******************************************************************************
*/
Gfx_imge_et OwGetIconImage(MmpFileType_et file_type)
{
BYTE1 file_icon;
/* Set the file icon */
switch(file_type)
{
case MMP_IMAGE_FILE:
file_icon = IMG_IMG;
break;
case MMP_AUDIO_FILE:
file_icon = IMG_AUDIO;
break;
#if _APP_CAP_NAV_MMP_PLAY_VIDEO_FILE
case MMP_VIDEO_FILE:
file_icon = IMG_INFO_MV;
break;
#endif
case MMP_FOLDER:
default:
file_icon = IMG_EXP_FOLDER;
}/* switch */
return file_icon;
}
/******************************************************************************
* Function name : OwUpdateFolderCursor
* Arguments :
* IN BYTE2 old_cursor, BYTE2 new_cursor
*
* OUT
* I/O
* Return : VOID
*
* By : Kim Do Yeon
* Description : Update the folder cursor
* Revision : 1.0
******************************************************************************
*/
VOID OwUpdateFolderCursor(BYTE2 old_cursor, BYTE2 new_cursor)
{
BYTE2 folder_play, folder_total, folder_pg, play_folder_pg;
folder_play = GetMmpFolderOpen();
folder_total = GetMmpTotalFolders();
folder_pg = GetMmpFolderPage();
play_folder_pg = folder_play / MMP_CTRL_PAGE_UNIT_SIZE;
/* Unhighlihgt */
if(old_cursor != MMP_NO_SELECTION)
SH_GfxChgAreaColor(SH_CANV1, 43, 98, 136, 287, OSD_MMP_COLOR_EXP_SELECTED, OSD_COLOR_FONT_DEFAULT);
SH_GfxChgAreaColor(SH_CANV1, 43, 98, 136, 287, OSD_COLOR_FONT_HIGHLIGHT, OSD_COLOR_FONT_DEFAULT);
if(new_cursor == MMP_NO_SELECTION)
{
if((folder_play != MMP_NO_SELECTION) && (folder_pg == play_folder_pg))
SH_GfxChgAreaColor(SH_CANV1,8+35, 105+34*(folder_play % MMP_CTRL_PAGE_UNIT_SIZE), 138, 30,
OSD_COLOR_FONT_DEFAULT, OSD_MMP_COLOR_EXP_SELECTED);
}
else
{
if((folder_play != MMP_NO_SELECTION) && (folder_play != new_cursor ) \
&& (folder_play/MMP_CTRL_PAGE_UNIT_SIZE == new_cursor/MMP_CTRL_PAGE_UNIT_SIZE))
{
if(folder_pg == play_folder_pg)
SH_GfxChgAreaColor(SH_CANV1,8+35, 105+34*(folder_play % MMP_CTRL_PAGE_UNIT_SIZE), 138, 30,
OSD_COLOR_FONT_DEFAULT, OSD_MMP_COLOR_EXP_SELECTED);
}
if(new_cursor < folder_total)
{
SH_GfxChgAreaColor(SH_CANV1,8+35, 105+34*(new_cursor % MMP_CTRL_PAGE_UNIT_SIZE), 138, 30,
OSD_COLOR_FONT_DEFAULT, OSD_COLOR_FONT_HIGHLIGHT);
SH_GfxChgAreaColor(SH_CANV1,8+35, 105+34*(new_cursor % MMP_CTRL_PAGE_UNIT_SIZE), 138, 30,
OSD_MMP_COLOR_EXP_SELECTED, OSD_COLOR_FONT_HIGHLIGHT);
}
}
}
/******************************************************************************
* Function name : OwDrawAlbum
* Arguments :
* IN BYTE2 select_index, BYTE1 draw_history
*
* OUT
* I/O
* Return : VOID
*
* By : Kim Do Yeon
* Description : Draw the album osd
* Revision : 1.0
******************************************************************************
*/
VOID OwDrawAlbum(BYTE2 select_index, BYTE1 draw_history)
{
BYTE1 index;
BYTE2 end_index, album_page_num, x, y, bg_x;
CHAR str_tmp[20];
end_index = GetMmpFileEndIndex(select_index, MMP_ALBUM_PAGE_UNIT_SIZE);
album_page_num = select_index/MMP_ALBUM_PAGE_UNIT_SIZE;
if(draw_history == MMP_ALBUM_DRAWN_BEFORE)
{
SH_GfxDrawRec(SH_CANV1, 0, 0, 580, 377, COLOR_TRANS);
}
else
{
bg_x = MMP_ALBUM_BG_X;
y = MMP_ALBUM_BG_Y;
OwGetOsdCenterPosition( &x,&y, 580, 377 );
SH_GfxSetCanvas(SH_CANV1, bg_x, y, 580, 377);
}
/* Album top info osd */
SH_GfxDrawRec(SH_CANV1, 0, 0, 580, 42, COLOR_DARK_BLUE);
SH_GfxDrawRec(SH_CANV1, 3, 4, 580-6, 42-8, COLOR_TRANS_BLUE);
/* Album top info contents */
SH_GfxDrawImage(SH_CANV1, IMG_JPG_INFO, 14, 7);
#ifdef _MTK_STYLE
/* Draw "Album" string. */
SH_GfxDrawRec(SH_CANV1, 14 + 35, 4, 165, 34, COLOR_TRANS_BLUE);
SH_GfxDrawStr(SH_CANV1, (char *)gpAlbum[MENU_LANG], 14 + 35, 7, NULL);
#else
SH_GfxDrawImage(SH_CANV1, IMG_EXP_FILE, 215, 10);
#endif
/* thumb image info bar */
for(index = 0; index <= end_index; index ++)
{
x = 20 + 190*(index%3);
//y = 182 + 165*(index/3);
y = 174 + 165*(index/3); // cydrain 20061017
SH_GfxDrawRec(SH_CANV1, x, y, 160, 30, COLOR_DARK_BLUE);
SH_GfxDrawRec(SH_CANV1, x+4, y+2, 160-8, 30-4, COLOR_TRANS_BLUE);
sprintf(str_tmp," %d ", album_page_num*MMP_ALBUM_PAGE_UNIT_SIZE +(index +1));
SH_GfxDrawStr(SH_CANV1, str_tmp, x+4, y, NULL);
}
OwUpdateAlbumSelectInfo(select_index);
SH_GfxShowCanvas(SH_CANV1, TRUE);
}
/******************************************************************************
* Function name : OwUpdateAlbumSelect
* Arguments :
* IN
* BYTE2 old_select, BYTE2 new_select
* OUT
* I/O
* Return : VOID
*
* By : Kim Do Yeon
* Description : Update the album selection
* Revision : 1.0
******************************************************************************
*/
VOID OwUpdateAlbumSelect(BYTE2 old_select, BYTE2 new_select)
{
BYTE2 index, x, y;
OwUpdateAlbumSelectInfo(new_select);
/* Unhighlight the previous selection, fill color change */
index = old_select%MMP_ALBUM_PAGE_UNIT_SIZE; /* calculate the index in album osd */
x = 20 + 190*(index%3);
y = 182 + 165*(index/3);
SH_GfxChgAreaColor(SH_CANV1,x+4, y+2, 160-8, 30-4,OSD_COLOR_HIGHLIGHT, COLOR_DARK_BLUE);
/* Highlight the selection, fill color change */
index = new_select%MMP_ALBUM_PAGE_UNIT_SIZE; /* calculate the index in album osd */
x = 20 + 190*(index%3);
y = 182 + 165*(index/3);
SH_GfxChgAreaColor(SH_CANV1,x+4, y+2, 160-8, 30-4, COLOR_DARK_BLUE, OSD_COLOR_HIGHLIGHT);
}
/******************************************************************************
* Function name : OwMmpSetPlayOSD
* Arguments :
* IN BOOL on_off
*
* OUT
* I/O
* Return : VOID
*
* By : Kim Do Yeon
* Description :
* Revision : Set the file/folder icon color
******************************************************************************
*/
VOID OwMmpSetPlayOSD(BOOL on_off)
{
#if (_CUSTOM_ID_ != _CUSTOM_ID_FUNAI_)
if(on_off)
{
SH_GfxChgAreaColor(SH_CANV1,57, 12, 30, 30, COLOR_DARK_YELLOW, COLOR_DARK_GREEN);
SH_GfxChgAreaColor(SH_CANV1,217, 12, 30, 30, COLOR_DARK_YELLOW, COLOR_DARK_GREEN);
}
else
{
SH_GfxChgAreaColor(SH_CANV1,57, 12, 30, 30, COLOR_DARK_GREEN, COLOR_DARK_YELLOW);
SH_GfxChgAreaColor(SH_CANV1,217, 12, 30, 30, COLOR_DARK_GREEN, COLOR_DARK_YELLOW);
}
#endif /* (_CUSTOM_ID_ != _CUSTOM_ID_FUNAI_) */
}
/******************************************************************************
* Function name : OwMmpSetRepeatAbOsd
* Arguments :
* IN
* BOOL on_off
* OUT
* I/O
* Return : VOID
*
* By : Kim Do Yeon
* Description : Set the repeat ab icon color
* Revision : 1.0
******************************************************************************
*/
VOID OwMmpSetRepeatAbOsd(BOOL on_off)
{
if(on_off)
{
SH_GfxChgAreaColor(SH_CANV1,545, 8, 30, 30, COLOR_DARK_BLUE, OSD_MMP_REPEAT_A_BLINK);
}
else
{
SH_GfxChgAreaColor(SH_CANV1,545, 8, 30, 30, OSD_MMP_REPEAT_A_BLINK, COLOR_DARK_BLUE);
}
}
#if _APP_CAP_OSD_SHOW_CURRENT_ITEM_NUM
/******************************************************************************
* Function name : GetValueDigit
* Arguments :
* IN UINT num
*
* OUT
* I/O
* Return : UCHAR
*
* By : QQ
* Description :
* Revision : 1.0
******************************************************************************
*/
UCHAR GetValueDigit(UINT num)
{
UCHAR i = 1;
while(num>0){
num = num/(10*i);
i++;
}
return i;
}
/******************************************************************************
* Function name : OwUpdateNumDisp
* Arguments :
* IN
*
* OUT
* I/O
* Return : VOID
*
* By
* Description : Qian liping 060412
* Revision : 1.0
******************************************************************************
*/
VOID OwUpdateNumDisp(UINT cur_num,UINT total_num)
{
char dis_str[MAX_SUPPORT_DYNAMIC_LENGTH];
UINT temp;
char str[15],str1[15];
BYTE2 str_width, str_x;
if(cur_num > MMP_MAX_INPUT_NUM) // cydrain 20060919
return;
temp = total_num;
if ( temp > FS_MAX_NUM_OF_FILE)
temp = FS_MAX_NUM_OF_FILE;
sprintf((char *)str, "");
strcat((char *)str, "%");
sprintf((char *)str1, "%01d",GetValueDigit(cur_num));
strcat(str,str1);
strcat((char *)str, "d/");
strcat((char *)str, "%");
sprintf((char *)str1, "%01d",GetValueDigit(temp));
strcat(str,str1);
strcat((char *)str, "d");
sprintf((char *)dis_str , str, cur_num , temp );
SH_GfxGetStrSize((char *)dis_str , &str_width, NULL);
str_x = gGfx_base.canvas[SH_CANV1 ].width - str_width;
#ifndef _MTK_STYLE
SH_GfxDrawRec(SH_CANV1, 540-210, INFO_OSD_H, 210, 30, COLOR_TRANS);
SH_GfxDrawStr(SH_CANV1, dis_str, str_x, INFO_OSD_H, NULL);
#else
SH_GfxDrawRec(SH_CANV1, 540-210, 5, 200, 30, COLOR_TRANS_BLUE);
SH_GfxDrawStr(SH_CANV1, dis_str, str_x-10, 5, NULL);
#endif
}
#endif /*_APP_CAP_OSD_SHOW_CURRENT_ITEM_NUM*/
/******************************************************************************
* Function name : OwUpdateMmpInfo1
* Arguments :
* IN VOID
*
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -