📄 osd_draw_explore.c
字号:
/******************************************************************************
* Filename : OSD_draw_mmp_BASIC.c
* Start : 2003. 8. 25
* By : Hongsik Park
* Contact : hongsik7.park@samsung.com
* Description :
* For another scheme of OSD resource manageent.
*
******************************************************************************
*/
#ifndef _OSD_DRAW_MMP_BASIC_C_
#define _OSD_DRAW_MMP_BASIC_C_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "Basic_typedefs.h"
#include "CUSTOM/Custom_option.h"
#include "OS/OS_abstract.h"
#include "API/SH_types.h"
#include "API/SH_api.h"
#include "COMMON/Common.h"
#include "MAIN/Global_state.h"
#include "DRIVER/FS/Fs_api.h"
#include "CUSTOM/Osd_types.h"
#include "CUSTOM/Key_handler_setup.h"
#include "MAIN/Appl_types.h"
#include "MAIN/DVD/Dvd_predef.h"
#include "MAIN/DVD/Dvd_common.h"
#include "MAIN/Uop_msg.h"
#include "MAIN/SVCD/Svcd_types.h"
#include "MAIN/SVCD/Svcd_ext.h"
#include "MAIN/SVCD/Svcd_show.h"
#include "CUSTOM/Firm_update.h"
#include "MAIN/MMP/Mmp_common.h"
#include "MAIN/MMP/Mmp_predef.h"
#include "MAIN/MMP/Mmp_global.h"
#include "DRIVER/FS/Fs_api.h"
#include "Osd_util.h"
#include "Osd_draw.h"
#include "Osd_data.h"
#include "Osd_timer.h"
#include "CUSTOM/Strings_ext.h"
#include "Osd_draw_explore.h"
extern VOID MmpGetCurTimeStr(CHAR *cur_str, CHAR *remain_str);
extern INLINE OSD_MainType_et GetDisplayMainState( VOID );
extern SH_Gfx_base_st gGfx_base;
/******************************************************************************
* Function name : GetNoticeIconIndex
* Arguments :
* IN VOID
*
* OUT
* I/O
* Return :
* UCHAR
* By : Kim Do Yeon
* Description : Get the Notice Icon
* Revision :
******************************************************************************
*/
UCHAR GetNoticeIcon(MmpNoticeType_et notice_type)
{
UCHAR notice_icon;
switch (notice_type)
{
case MMP_NOTICE_PLAY:
notice_icon = '\033';
break;
case MMP_NOTICE_PAUSE:
notice_icon = '\034';
break;
case MMP_NOTICE_STOP:
case MMP_NOTICE_RESUME_STOP:/* full stop */
notice_icon = '\035';
break;
case MMP_NOTICE_SKIP_F:
notice_icon = '\076';
break;
case MMP_NOTICE_SKIP_R:
notice_icon = '\074';
break;
case MMP_NOTICE_FF:
notice_icon = '\375';
break;
case MMP_NOTICE_FR:
notice_icon = '\376';
break;
case MMP_NOTICE_KARA:
notice_icon = '\035';
break;
case MMP_NOTICE_READ:
case MMP_NOTICE_REPEAT_A:
case MMP_NOTICE_REPEAT_AB:
case MMP_NOTICE_3D:
case MMP_NOTICE_NUM:
case MMP_NOTICE_DEFAULT:
notice_icon = '\040';
break;
}
return notice_icon;
}
/******************************************************************************
* Function name : OwUpdateExploreNotice
* Arguments :
* IN MmpNoticeType_et notice_type
*
* OUT
* I/O
* Return :
* VOID
* By : Kim Do Yeon
* Description :
* Revision : Qian liping 060531
******************************************************************************
*/
VOID OwUpdateExploreNotice(MmpNoticeType_et notice_type)
{
CHAR notice_string[20];
GetMmpNoticeString( notice_string);
#if _APP_CAP_OSD_MMP_MUTE_IN_FRONT
SH_GfxDrawRec(SH_CANV1, 8, 50, 200-8+67, 40, COLOR_TRANS_BLUE);
#else
SH_GfxDrawRec(SH_CANV1, 8, 50, 200-8, 40, COLOR_TRANS_BLUE);
#endif
SH_GfxDrawStr(SH_CANV1, notice_string, 8, 56, NULL );
//Re-check the MUTE state.
OwMmpDrawMute();
#if _APP_CAP_OSD_EXPLORE_NOTICE_TIMEOUT
/* Set notice string tiemr to make a string disapper */
switch(notice_type)
{
case MMP_NOTICE_SKIP_F:
case MMP_NOTICE_SKIP_R:
case MMP_NOTICE_READ:
case MMP_NOTICE_DECODE:
case MMP_NOTICE_3D:
case MMP_NOTICE_DUALMONO:
case MMP_NOTICE_PLAY:
case MMP_NOTICE_STOP:
case MMP_NOTICE_KARA:
case MMP_NOTICE_REVERBRATION:
#if _APP_CAP_OSD_MMP_MUTE_IN_FRONT
case MMP_NOTICE_MUTE:
case MMP_NOTICE_MUTEOFF:
#endif
OsdMmpNoticeTimerSet( OSD_TIME_FOR_MMP_NOTICE, TIMER_ENABLE );
break;
case MMP_NOTICE_REPEAT_AB:
if( GetMmpRepeatMode(TRUE) == REPEAT_SUB_NONE )
OsdMmpNoticeTimerSet( OSD_TIME_FOR_MMP_NOTICE, TIMER_ENABLE );
else
OsdMmpNoticeTimerSet( OSD_TIME_FOR_MMP_NOTICE, TIMER_DISABLE );
break;
case MMP_NOTICE_NP:
case MMP_NOTICE_VIDEOMODE:
case MMP_NOTICE_VIDEOSCAN:
OsdMmpNoticeTimerSet( OSD_TIME_FOR_NP, TIMER_ENABLE );
break;
default:
OsdMmpNoticeTimerSet( OSD_TIME_FOR_MMP_NOTICE, TIMER_DISABLE );
break;
}
#endif/*_APP_CAP_OSD_EXPLORE_NOTICE_TIMEOUT*/
}
/******************************************************************************
* Function name : OwUpdateImageNotice
* Arguments :
* IN MmpNoticeType_et notice_type
*
* OUT
* I/O
* Return :
* VOID
* By : Kim Do Yeon
* Description :
* Revision :
******************************************************************************
*/
VOID OwUpdateImageNotice(MmpNoticeType_et notice_type)
{
CHAR notice_string[10], dis_str[MAX_SUPPORT_DYNAMIC_LENGTH];
UCHAR notice_icon;
notice_icon = GetNoticeIcon(notice_type);
GetMmpNoticeString( notice_string);
#if 0 // Qian liping 060706: wrong canvas for cursor message.
SH_GfxDrawRec(SH_CANV1, 57, 44, 500, 30, COLOR_TRANS_BLUE);
if ((notice_type == MMP_NOTICE_SKIP_F) ||(notice_type == MMP_NOTICE_SKIP_R))
{
sprintf((char *)dis_str, "%c %s", notice_icon, notice_string);
SH_GfxDrawStr(SH_CANV1, dis_str, 57, 44, NULL);
}
#else
GfxShowNoticeBoxBg();
if ((notice_type == MMP_NOTICE_SKIP_F) ||(notice_type == MMP_NOTICE_SKIP_R))
{
sprintf((char *)dis_str, "%c %s", notice_icon, notice_string);
SH_GfxDrawRec(SH_CANV2, 0, 5, 240, 30, OSD_COLOR_TRANS );
SH_GfxDrawStr(SH_CANV2, dis_str, 0, 5, NULL);
}
#endif
}
/******************************************************************************
* Function name : OwUpdateMmpNotice
* Arguments :
* IN VOID
*
* OUT
* I/O
* Return :
* BOOL
* By : Kim Do Yeon
* Description :
* Revision :
******************************************************************************
*/
VOID OwUpdateMmpNotice(VOID)
{
MmpNoticeType_et notice_type;
notice_type = GetMmpNoticeType();
switch (GetDisplayMainState())
{
case DISPLAY_EXPLORER:
OwUpdateExploreNotice(notice_type);
break;
case DISPLAY_IMAGE_INFO:
case DISPLAY_OFF:
OwUpdateImageNotice(notice_type);
break;
default:
break;
}
}
/******************************************************************************
* Function name : OwMmpExpInfo1RemainTime
* Arguments :
* IN VOID
*
* OUT
* I/O
* Return : STATIC VOID
*
* By : Kim Do Yeon
* Description : Draw the remain time banner
* Revision : 1.0
******************************************************************************
*/
STATIC VOID OwMmpExpInfo1RemainTime(VOID)
{
CHAR time_info_str[20], time_remain_str[20];
CHAR dis_str[MAX_SUPPORT_DYNAMIC_LENGTH];
MmpGetCurTimeStr(time_info_str, time_remain_str);
SH_GfxDrawRec(SH_CANV1, 2, 2, 616, 40, COLOR_TRANS_BLUE);
sprintf(dis_str, "%s", (char *)gpSingletime[MENU_LANG]);
SH_GfxDrawStr(SH_CANV1, dis_str, 10, 8, NULL);
SH_GfxDrawImage(SH_CANV1, IMG_INFO_TIME, 217, 8);
SH_GfxDrawStr(SH_CANV1, time_info_str, 217+35, 8, NULL);
SH_GfxDrawImage(SH_CANV1, IMG_INFO_TIME, 407, 8);
SH_GfxDrawStr(SH_CANV1, time_remain_str, 407+35, 8, NULL);
}
/******************************************************************************
* Function name : OwMmpExpInfo1Norm
* Arguments :
* IN VOID
*
* OUT
* I/O
* Return : STATIC VOID
*
* By : Kim Do Yeon
* Description :
* Revision :
******************************************************************************
*/
STATIC VOID OwMmpExpInfo1Norm(VOID)
{
CHAR time_info_str[20];
BYTE2 cur_file_index, cur_folder_index, total_folder, total_file;
if(IsBgPlay())
{
cur_file_index = GetMmpBgPlay();
cur_folder_index = GetMmpFolderPlay();
total_folder = GetMmpTotalFolders(); //video situation also needed azureming@060406
total_file = GetMmpTotalPlayListNum();
}
else
{
if(GetMmpFileType() == MMP_IMAGE_FILE) // gaoping 20060415
cur_file_index = GetMmpFileCursor();
else
cur_file_index = MMP_NO_SELECTION; //(weilf)20060413:under full stop state,file index should be 0
cur_folder_index = GetMmpFolderOpen();
total_folder = GetMmpTotalFolders();
total_file = GetMmpTotalFiles();
}
/* Draw Explore Info1 bar */
SH_GfxDrawRec(SH_CANV1, 0, 0, 620, 44, COLOR_DARK_BLUE);
SH_GfxDrawRec(SH_CANV1, 2, 2, 616, 40, COLOR_TRANS_BLUE);
SH_GfxDrawImage(SH_CANV1, IMG_MMN_INFO, 8, 5);
SH_GfxDrawImage(SH_CANV1, IMG_EXT_DISC, 8, 21);
/* File/Folder info */
SH_GfxDrawImage(SH_CANV1, IMG_EXP_FOLDER, 57, 12);
SH_GfxDrawImage(SH_CANV1, IMG_EXP_FILE, 217, 12);
OwUpdateExpFolderInfo(cur_folder_index + 1, total_folder);
OwUpdateExpFileInfo(cur_file_index + 1, total_file);
/* Time Info */
MmpGetCurTimeStr(time_info_str, NULL);
SH_GfxDrawImage(SH_CANV1, IMG_INFO_TIME, 407, 8);
SH_GfxDrawStr(SH_CANV1, time_info_str, 407+35, 8, NULL);
/* Mode Info */
OwMmpSetRepeatIcon();
OwMmpSetModeIcon();
}
/******************************************************************************
* Function name : OwMmpDrawInfo1
* Arguments :
* IN
* MmpInfo1State_et state
* OUT
* I/O
* Return :
* VOID
* By : Liu renliang
* Description :
* Revision :
******************************************************************************
*/
VOID OwMmpDrawInfo1(OSD_ExpInfo1State_et state)
{
switch(state)
{
case EXPLORER_MODE_INFO1HIDE:
SH_GfxDrawRec(SH_CANV1, 0, 0, 620, 47, COLOR_TRANS);
break;
#if (_APP_CAP_FUNC_REMAIN_TIME && !_APP_CAP_KEY_TIME_KEY) //Lu Shuai 050714
case EXPLORER_MODE_INFO1REMAIN:
OwMmpExpInfo1RemainTime();
break;
#endif/*_APP_CAP_FUNC_REMAIN_TIME && !_APP_CAP_KEY_TIME_KEY*/
#if _APP_CAP_KEY_TIME_KEY
case EXPLORER_MODE_INFO1NORMAL:
OwMmpExpInfo1Norm();
break;
#endif /*_APP_CAP_KEY_TIME_KEY*/
default:
#if _APP_CAP_KEY_TIME_KEY //Lu Shuai 050714
//Empty here
#else
OwMmpExpInfo1Norm();
#endif
break;
}
}
#if _APP_CAP_KEY_TIME_KEY //Lu Shuai 050714
/******************************************************************************
* Function name : OwMmpDrawTimeInfo1
* Arguments :
* IN OSD_ExpInfo1State_et state
*
* OUT
* I/O
* Return : VOID
*
* By : Kim Do Yeon
* Description : Display the remain time banner
* Revision : 1.0
******************************************************************************
*/
VOID OwMmpDrawTimeInfo1(OSD_ExpInfo1State_et state)
{
BYTE1 index;
CHAR time_info_str[20];
switch(state)
{
case EXPLORER_MODE_INFO1HIDE:
SH_GfxDrawRec(SH_CANV1, 0, 0, 620, 44, COLOR_TRANS);
break;
case EXPLORER_MODE_INFO1NORMAL:
MmpGetCurTimeStr(time_info_str, NULL);
SH_GfxDrawStr(SH_CANV1, time_info_str, 407+35, 8, NULL);
break;
default:
break;
}
}
#endif /*_APP_CAP_KEY_TIME_KEY*/
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -