📄 mp3_osd.c
字号:
if(strcmp((char *)gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1], OSD_STR_STATIC(STR_VOLUME_ID)))
{
strcpy(temp1, OSD_STR_STATIC(STR_VOLUME_ID));
}
strcat(temp1, " ");
strcat(temp1, temp2);
if(OsdFontMode)
pucLocDispStr = temp1;
else
{
if((iCount==11)||(iCount==1)||(iCount==10)||(iCount==9))
pucLocDispStr = temp1;
else
Mp3_VolumeOSDChg ( temp1, ID_WND_EXP_RESERVED_TEMP1 );//maymeng 050926 for volume osd flickering problem
}
}
break;
default:
break;
}
if ( pucLocDispStr != NULL )
{
//strcpy(gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1],temp1);
strcpy(gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1],pucLocDispStr);
//strcpy((char *)gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1][MAX_SUPPORT_DYNAMIC_LENGTH-10],"\0");
gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1][MAX_SUPPORT_DYNAMIC_LENGTH-3] = 0;
gMp3_wnd[ID_WND_EXP_RESERVED_TEMP1].status = HS_NEED_DRAW;
ShowWindow(ID_WND_EXP_RESERVED_BG);
//Mp3_ShowReserved1Base ( pucLocDispStr );
}
if ( enType != MP3_OSDSTR_VOLUME )
gshowReserved1 = TRUE;
#if MP3_TIMER
SysResetTimer(&gMp3_Reserved_Timer, (SysTimerExpire_t)Mp3_ReservedTimerExpired, MP3_OSD_TIMER/*1600*/, 0, TIMER_ENABLE );
#endif
#endif /* _MP3_OSD_ENABLE */
}
/******************************************************************************
* Function name : Mp3_ShowChinese
* Arguments :
* IN
* OUT
* INOUT
* Return : void
* By : maymeng, 050711
* Description : show zhongwen notification
******************************************************************************
*/
void Mp3_ShowChinese(void)
{
if(MP3_PLAY == Mp3_GetMain() )
//Mp3_ShowPlay();//modify for when press C/E, the reserved filename area flickering.maymeng 050809
{
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_NOTICE_TXT], OSD_STR_STATIC(STR_PLAY_ID));
gMp3_wnd[ID_WND_EXP_NOTICE_TXT].status=HS_NEED_DRAW;
}
else if(MP3_PAUSE == Mp3_GetMain())
Mp3_ShowPause();
else if(MP3_TRICK_OFF != Mp3_GetTrick())
Mp3_ShowTrick();
#if MP3_TIMER
SysControlTimer(&gMp3_Reserved_Timer, TIMER_DISABLE );
#endif
#if _MP3_OSD_ENABLE
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1], OSD_STR_STATIC(STR_LANGUAGE_ID));
gMp3_wnd[ID_WND_EXP_RESERVED_TEMP1].status=HS_NEED_DRAW;
ShowWindow(ID_WND_EXP_BG);
#endif
gshowReserved1 = TRUE; //maymeng 051022
#if MP3_TIMER
SysResetTimer(&gMp3_Reserved_Timer, (SysTimerExpire_t)Mp3_ReservedTimerExpired, 2000, 0, TIMER_ENABLE );
#endif
}
/******************************************************************************
* Function name : Mp3_ShowNumberSel_TenPlus
* Arguments :
* IN
* OUT
* INOUT
* Return : void
* By : maymeng 050823
* Description : show when numbercontrol in the notice_txt wnd
******************************************************************************
*/
void Mp3_ShowNumberSel(BOOL bTenPlus_flag)
{
#if _MP3_OSD_ENABLE
//UCHAR tmp_str[5],temp[11];
UCHAR tmp_str[5];
UCHAR temp[11];
USHORT output_number;
//BY QQ 051118
#if 1
memset(temp,0,sizeof(temp));
memset(tmp_str,0,sizeof(tmp_str));
#else
CLEAR_STRING(temp);
CLEAR_STRING(tmp_str);
#endif
#if MP3_TIMER
SysControlTimer(&gMp3_Reserved_Timer, TIMER_DISABLE );
#endif
strcpy(temp, OSD_STR_STATIC(STR_SLECT_ID));
strcat(temp," ");
if(bTenPlus_flag)
{
#if MP3_over_250
sprintf(tmp_str, "%d", Select_250*250+Tenplus*10+Fiveplus*KeyPlus);
#else
sprintf(tmp_str, "%d", Tenplus*10+Fiveplus*KeyPlus);
#endif
//sprintf( tmp_str, " %d", gNumber[1]);
strcat(temp,tmp_str);
#if USE_CHINESE_ENGLISH_OSD
//BY MayMeng 051215
strcat(temp, /*"-"*/"\272");
#else
strcat(temp, /*"-"*/"\151");
#endif
}
else
{
//sprintf( tmp_str, " %02d", gNumber_output);//maymeng 051020
//output_number = gNumber_output[0]*100 +gNumber_output[1]*10+gNumber_output[2];
#if MP3_over_250
output_number=gNumber_output+Select_250*250;
#else
output_number=gNumber_output;
#endif
sprintf(tmp_str, "%d",output_number);
strcat(temp,tmp_str);
}
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1], temp);
gMp3_wnd[ID_WND_EXP_RESERVED_TEMP1].status = HS_NEED_DRAW;
OwSetCurrentWindowSet(gMp3_wnd);
ShowWindow(ID_WND_EXP_BG);
#if MP3_TIMER
SysResetTimer(&gMp3_Reserved_Timer, (SysTimerExpire_t)Mp3_ReservedTimerExpired, MP3_OSD_TIMER, 0, TIMER_ENABLE );
#endif
#endif
}
/******************************************************************************
* Function name : Mp3_ShowMute
* Arguments :
* IN
* OUT
* INOUT
* Return : void
* By : maymeng
* Description : show mute
******************************************************************************
*/
void Mp3_ShowMute(void)
{
#if _MP3_OSD_ENABLE
if(!gMute)
{
#if MP3_TIMER
SysControlTimer(&gMp3_Reserved_Timer, TIMER_DISABLE );
#endif
Mp3_ShowReserved1Base(OSD_STR_STATIC(STR_MUTE_OFF_ID));
#if MP3_TIMER
SysResetTimer(&gMp3_Reserved_Timer, (SysTimerExpire_t)Mp3_ReservedTimerExpired, 2000, 0, TIMER_ENABLE );
#endif
}
else
{//maymeng 051209 for mute problem:
if(SysInfo.Mute_Flag)
Mp3_ShowReserved1Base(OSD_STR_STATIC(STR_MUTE_ON_ID));
}
gshowReserved1 = TRUE;
#endif
}
/******************************************************************************
* Function name : Mp3_TimerExpiredReserved
* Arguments :
* IN
* OUT
* INOUT
* Return : void
* By : maymeng 050525
* Description : timer expire routine, for volume +/-
******************************************************************************
*/
void Mp3_ReservedTimerExpired(void)
{
#if MP3_TIMER
SysControlTimer(&gMp3_Reserved_Timer, TIMER_DISABLE );
#endif
/* avoid to use syssleep in timeout routine.. */
Mp3_SendOSDMsgToNAVI();
}
void Mp3_MovePointUpDown(BOOL is_up, BOOL is_folder)
{
USHORT index;
if( is_folder )
index = ID_WND_EXP_FOLD_NAME1 + gFolderPage->focus_index;
else
index = ID_WND_EXP_FILE_NAME1 + gPageinfo->focus_index;
gMp3_wnd[index].color= ID_COLOR_RED;
gMp3_wnd[index].status= HS_NEED_DRAW;
if(is_up)
index++;
else
index--;
gMp3_wnd[index].color= ID_COLOR_DARK_WHITE;
gMp3_wnd[index].status= HS_NEED_DRAW;
OwSetCurrentWindowSet(gMp3_wnd);//maymeng 050707
ShowWindow(ID_WND_EXP_BG);
}
/******************************************************************************
* Function name : Mp3_ShowOSDTimeUpdate
* Arguments :
* IN
* OUT
* INOUT
* Return : void
* By : Wanghu
* Description : show osd time update
******************************************************************************
*/
#if MP3_TIME_ENABLE
void Mp3_ShowOSDTimeUpdate(void)
{
char tmp_str[10];
int i, j, length;
Time_t gOsdtime;
ULONG32 cursec;
USHORT skip_width = 0;
USHORT pos;
#if 1
memset(tmp_str,0,sizeof(tmp_str));
#else
CLEAR_STRING(tmp_str);
#endif
if(bRemsec)
cursec = gMp3_time.RemSec;
else
cursec = gMp3_time.CurSec;
gOsdtime.hour = cursec/3600;
gOsdtime.min = (cursec%3600)/60;
gOsdtime.sec = cursec%60;
if(MP3_PAUSE != Mp3_GetMain()){
vfd_show_time(mp3_cur_track , cursec); //add vfd show
}
sprintf(tmp_str, "%d:%02d:%02d", gOsdtime.hour,
gOsdtime.min, gOsdtime.sec);
OwSetCurrentWindowSet(gMp3_wnd);
length = strlen(tmp_str);
for(i=0; i<length; i++)
{
if(tmp_str[i] != gOsd_str_dyn[ID_STR_EXP_NOTICE_TIME][i])
break;
}
for(j = 0; j < i; j++)
{
pos = tmp_str[j] - 48;
#if _SUPPORT_DOUBLING
skip_width += font_pos[pos].width - 1;
#else
skip_width += font_pos[pos].width + 2;
#endif/* _SUPPORT_DOUBLING */
}
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_NOTICE_TIME], (char *)(tmp_str + i));
#if _SUPPORT_DOUBLING
gMp3_wnd[ID_WND_EXP_NOTICE_TIME].winrect.width -= skip_width*2; //FONT_WIDTH*2*i;
#else
gMp3_wnd[ID_WND_EXP_NOTICE_TIME].winrect.width -= skip_width;
#endif/* _SUPPORT_DOUBLING */
gMp3_wnd[ID_WND_EXP_NOTICE_TIME].winrect.x_pos += skip_width; //FONT_WIDTH*i; //doubling: x_pos += width/2
gMp3_wnd[ID_WND_EXP_NOTICE_TIME].status = HS_NEED_DRAW;
OwSetCurrentWindowSet(gMp3_wnd);//maymeng 050707
ShowWindow(ID_WND_EXP_NOTICE_TIME);
#if _SUPPORT_DOUBLING
gMp3_wnd[ID_WND_EXP_NOTICE_TIME].winrect.width += skip_width*2; //FONT_WIDTH*2*i;
#else
gMp3_wnd[ID_WND_EXP_NOTICE_TIME].winrect.width += skip_width;
#endif/* _SUPPORT_DOUBLING */
gMp3_wnd[ID_WND_EXP_NOTICE_TIME].winrect.x_pos -= skip_width; //FONT_WIDTH*i;
strcpy((char*)gOsd_str_dyn[ID_STR_EXP_NOTICE_TIME],(char*)tmp_str);
}
void Mp3_ClearTimeInfo(void)
{
CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_NOTICE_TIME]);
gMp3_wnd[ ID_WND_EXP_NOTICE_TIME].status = HS_NEED_DRAW;
// ShowWindow(ID_WND_EXP_NOTICE_TIME);
}
#endif
void Mp3_ShowZeroTime(void)
{
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_NOTICE_TIME], (char *)"0:00:00");
gMp3_wnd[ ID_WND_EXP_NOTICE_TIME].status = HS_NEED_DRAW;
if( bLeftRight_arrow_flag )//maymeng 050905 for display time abnormal of folder<->file changing
ShowWindow(ID_WND_EXP_NOTICE_TIME);
}
/******************************************************************************
* Function name : Mp3_ShowLeftRight
* Arguments :
* IN
* OUT
* INOUT
* Return : void
* By : Wanghu
* Description : show left/right hightlight
******************************************************************************
*/
void Mp3_ShowLeftRight(BOOL Is_left)
{
if(Is_left)
{
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_ARROW_FOLD], PLAY_DOWN_ICON);
CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_ARROW_FILE]);
}
else
{
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_ARROW_FILE], PLAY_DOWN_ICON);
CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_ARROW_FOLD]);
}
gMp3_wnd[ID_WND_EXP_ARROW_FILE].status= HS_NEED_DRAW;
gMp3_wnd[ID_WND_EXP_ARROW_FOLD].status= HS_NEED_DRAW;
//OwSetCurrentWindowSet(gMp3_wnd);//maymeng 050707
ShowWindow(ID_WND_EXP_BG);
}
void Mp3_ShowInitWND(void)
{
UCHAR i;
if ( MP3_FILE == gMp3Control )
{
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_ARROW_FILE], PLAY_DOWN_ICON);
CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_ARROW_FOLD]);
}
else
{
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_ARROW_FOLD], PLAY_DOWN_ICON);
CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_ARROW_FILE]);
}
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_NOTICE_TXT], OSD_STR_STATIC(STR_READ_DISC_ID));
//gMp3_wnd[ID_WND_EXP_NOTICE_TXT].status=HS_NEED_DRAW;
//strcpy((char *)gOsd_str_dyn[ID_STR_EXP_NOTICE_TXT], "READING");
//strcpy((char *)gOsd_str_dyn[ID_STR_EXP_ARROW_FOLD], " ");
CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_NOTICE_TIME]);
CLEAR_STRING(gOsd_str_dyn[ ID_STR_EXP_RESERVED_FILENAME ]);
CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_NOTICE_FILENAME]);
gMp3_wnd[ ID_WND_EXP_ARROW_FILE].status = HS_NEED_DRAW;//maymeng 050705
gMp3_wnd[ ID_WND_EXP_ARROW_FOLD].status = HS_NEED_DRAW;
gMp3_wnd[ ID_WND_EXP_NOTICE_TXT].status = HS_NEED_DRAW;
//OwSetCurrentWindowSet(gMp3_wnd);
for( i = 0; i < 10; i++)
{
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_FOLD_NAME1 + i], "------");
CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_FOLD_NUM1 + i]);
CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_FOLD_ICON1 + i]);
strcpy((char *)gOsd_str_dyn[ID_STR_EXP_FILE_NAME1 + i], "------");
CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_FILE_NUM1 + i]);
gMp3_wnd[ID_WND_EXP_FOLD_NAME1 + i].color = ID_COLOR_DARK_WHITE;
gMp3_wnd[ID_WND_EXP_FILE_NAME1 + i].color = ID_COLOR_DARK_WHITE;
}
//maymeng 051010 added
CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1]);
if(gMute)
Mp3_ShowMute();
//051010 end
for( i = ID_WND_EXP_BG; i <= ID_WND_EXP_FILE_BLANK; i++)
{
gMp3_wnd[ i ].status = HS_NEED_DRAW;
}
OwSetCurrentWindowSet(gMp3_wnd);//maymeng 050707
ShowWindow(ID_WND_EXP_BG);
/* VFD Reading */
vfd_readtoc();
vfd_mp3();
vfd_display_mode();
vfd_audio_channel();
vfd_play();
vfd_show_time(mp3_cur_track, 0);
}
void Mp3_ShowTimeOutOSD(void)
{
if(gMute)//maymeng 050919 for "mute" disappearing after some op;
{
//maymeng 051209 for mute problem:
if(SysInfo.Mute_Flag)
Mp3_ShowReserved1Base(OSD_STR_STATIC(STR_MUTE_ON_ID));
gshowReserved1 = TRUE;
}
else
Mp3_ShowReserved1Base("\0");
}
//maymeng 050926 for mp3 volume osd flickering
void Mp3_VolumeOSDChg(UCHAR *string , SLONG wnd)
{
int i, j, length;
USHORT skip_width = 0;
USHORT pos;
NCHAR string_id;
string_id = gMp3_wnd[wnd].item_id;
length = strlen(string);
for(i=0; i<length; i++)
{
if(string[i] != gOsd_str_dyn[string_id][i])
break;
}
for(j = 0; j < i; j++)
{
if(string[j] == 45) //for " - " icon
pos = 16;
else if(string[j] == 46) // "."
pos = 49;
else if(string[j] == 32 ) // space
pos = 48;
else if(string[j] == 47) //"/"
pos = 44;
else
pos = string[j] - 48;
#if _SUPPORT_DOUBLING
skip_width += font_pos[pos].width - 1;
#else
skip_width += font_pos[pos].width + 2;
#endif
}
if(i >= length)
return;
strcpy((char *)gOsd_str_dyn[string_id], (char *)(string + i));
gMp3_wnd[wnd].winrect.width = font_pos[string[i] - 48].width ;//+10;
gMp3_wnd[wnd].winrect.x_pos += (BYTE2)skip_width;//doubling: x_pos += width/2
gMp3_wnd[wnd].status = HS_NEED_DRAW;
ShowWindow(wnd);
gMp3_wnd[wnd].winrect.width = 180;
gMp3_wnd[wnd].winrect.x_pos -= (BYTE2)skip_width;
strcpy((char*)gOsd_str_dyn[string_id],(char*)string);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -