⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mp3_osd.c

📁 三星ic 9980的源代码. 718版.
💻 C
📖 第 1 页 / 共 3 页
字号:
	else
	{
		Mp3_ShowTrkNumber();
		Mp3_ShowFilePath();
	}
	gMp3_wnd[ID_WND_EXP_NOTICE_FILENAME].status = HS_NEED_DRAW;
	gMp3_wnd[ID_WND_EXP_RESERVED_FILENAME].status = HS_NEED_DRAW;
	ShowWindow(ID_WND_EXP_BG);
#endif
  }

/******************************************************************************
 *  Function name : 	Mp3_ShowReserved1Base
 *  Arguments  : 
 *       IN         
 *       OUT
 *       INOUT
 *  Return        	: 	void
 *  By            	:   		maymeng 05823
 *  Description	:		base of osd display: for reserved temp1 wnd
 ******************************************************************************
 */
void  Mp3_ShowReserved1Base( UCHAR *str )
{
	strcpy((char *)gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1], str);
	//OwSetCurrentWindowSet(gMp3_wnd);
	gMp3_wnd[ID_WND_EXP_RESERVED_TEMP1].status = HS_NEED_DRAW;
	ShowWindow(ID_WND_EXP_RESERVED_BG);
}

/******************************************************************************
 *  Function name : 	Mp3_ShowTrkNumber
 *  Arguments  : 
 *       IN         
 *       OUT
 *       INOUT
 *  Return        	: 	void
 *  By            	: 		maymeng 050713
 *  Description	:		show the current trk no/ the total trk no  on the notice filename wnd
 ******************************************************************************
 */
 void Mp3_ShowTrkNumber(void)
{
	#if _MP3_OSD_ENABLE

	char        tmp_str[10] ;	
	USHORT  CurrTrack_no, Total_track_cnt, index;
	USHORT	 pre_index = 0; 
#if 1
	memset(tmp_str,0,sizeof(tmp_str));
#else
	CLEAR_STRING(tmp_str);
#endif
	
	OwSetCurrentWindowSet(gMp3_wnd);//By QQ 051112
	
#if _MP3_300_
	for(index = 0; index < (gFolderPage->focus_index + gFolderPage->page_index*MAX_CONTENT_IN_PAGE); index++)
		pre_index += gFileNumInFolder[index];
	pre_index += gPageinfo->page_index*MAX_CONTENT_IN_PAGE; 
	#if 1
	CurrTrack_no = gFileInfo[gPageinfo->focus_index + pre_index].file_no + 1;
	Total_track_cnt = gMp3TotalFile;
	#else
	CurrTrack_no = gPageinfo->focus_index + 1 +  gPageinfo->page_index*MAX_CONTENT_IN_PAGE ;
	Total_track_cnt = gPageinfo->total_num;
	#endif
	
	sprintf(tmp_str,"%03d/%03d",CurrTrack_no,Total_track_cnt);
	strcpy((char *)gOsd_str_dyn[ID_STR_EXP_NOTICE_FILENAME], (char *)tmp_str );
		gMp3_wnd[ ID_WND_EXP_NOTICE_FILENAME].status = HS_NEED_DRAW;
	#endif

	mp3_cur_track = CurrTrack_no;
	
	//vfd_show_time(mp3_cur_track, 0);
	
#endif
}

 /******************************************************************************
 *  Function name : 	Mp3_ShowNoticeTXTBase
 *  Arguments  : 
 *       IN         
 *       OUT
 *       INOUT
 *  Return        	: 	void
 *  By            	: 		maymeng 050823
 *  Description	:		base for show notice txt content
 ******************************************************************************
 */
void Mp3_ShowNoticeTXTBase(UCHAR *str )
{
	strcpy((char *)gOsd_str_dyn[ID_STR_EXP_NOTICE_TXT], str);
	gMp3_wnd[ID_WND_EXP_NOTICE_TXT].status=HS_NEED_DRAW;
	OwSetCurrentWindowSet(gMp3_wnd);
	ShowWindow(ID_WND_EXP_BG);
}  

/******************************************************************************
 *  Function name : 	Mp3_ShowPlay
 *  Arguments  : 
 *       IN         
 *       OUT
 *       INOUT
 *  Return        	: 	void
 *  By            	: 		may
 *  Description	:		show play
 ******************************************************************************
 */
 void Mp3_ShowPlay(void)
{
#if _MP3_OSD_ENABLE
 	extern BOOL gMute;

	/* realhu: to clear number key display */
	if(gReturnFlag)
	{
		//do not clear the reserved temp1 wnd to avoid the return osd display lag
		gReturnFlag= FALSE;
	}
	else
	{
		if(!gMute)
		{
			CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1]);		
			gMp3_wnd[ID_WND_EXP_RESERVED_TEMP1].status=HS_NEED_DRAW;
		}
	}
	
   	if(bInfoKey)
	{
		Mp3_ShowFilePath();
		Mp3_ShowTrkNumber();
    	}

	Mp3_ShowNoticeTXTBase (OSD_STR_STATIC(STR_PLAY_ID) );
	vfd_play();
#endif
}

/******************************************************************************
 *  Function name : 	Mp3_ShowPause
 *  Arguments  : 
 *       IN         
 *       OUT
 *       INOUT
 *  Return        	: 	void
 *  By            	: 		maymeng 
 *  Description	:		show pause
 ******************************************************************************
 */

void Mp3_ShowPause(void)
{
#if _MP3_OSD_ENABLE
	Mp3_ShowNoticeTXTBase(OSD_STR_STATIC(STR_PAUSE_ID));
	
	vfd_pause();                                       //add vfd show
	VfdDiscTurnF = 0;
#endif
}

/******************************************************************************
 *  Function name : 	Mp3_ShowStop
 *  Arguments  : 
 *       IN         
 *       OUT
 *       INOUT
 *  Return        	: 	void
 *  By            	: 		maymeng 
 *  Description	:		show stop
 ******************************************************************************
 */

void Mp3_ShowStop(void)
{
#if _MP3_OSD_ENABLE
	Mp3_ShowNoticeTXTBase(OSD_STR_STATIC(STR_STOP_ID));

	gFolderPage->page_index = 0;
	gFolderPage->focus_index = 0;
	gFolderPage->content_num = (gFolderPage->page_index == (gFolderPage->total_page - 1)) ? (gFolderPage->total_num - gFolderPage->page_index*MAX_CONTENT_IN_PAGE)\
		:(MAX_CONTENT_IN_PAGE);
	Mp3_ShowFoldOSD(gFolderPage->focus_index);


	gPageinfo->total_num = gFileNumInFolder[0];
	gPageinfo->total_page = (gPageinfo->total_num%MAX_CONTENT_IN_PAGE == 0) ? (gPageinfo->total_num/MAX_CONTENT_IN_PAGE) \
		: (gPageinfo->total_num/MAX_CONTENT_IN_PAGE + 1);
	gPageinfo->page_index = 0;
	gPageinfo->focus_index = 0;
	gPageinfo->content_num = (gPageinfo->page_index == (gPageinfo->total_page - 1)) ? (gPageinfo->total_num - gPageinfo->page_index*MAX_CONTENT_IN_PAGE)\
		:(MAX_CONTENT_IN_PAGE);
	if(bInfoKey)
	{
		Mp3_ShowFilePath();
		Mp3_ShowTrkNumber();
	}

	Mp3_ShowFileOSD(gPageinfo->focus_index);

	vfd_mp3_stop();
#endif
}

 /******************************************************************************
 *  Function name : 	Mp3_ShowSkipNextPrev
 *  Arguments  : 
 *       IN         
 *       OUT
 *       INOUT
 *  Return        	: 	void
 *  By            	: 		wanghu
 *  Description	:		show next/previous osd
 ******************************************************************************
 */
 void Mp3_ShowSkipNextPrev(BOOL	Is_next)
{
#if _MP3_OSD_ENABLE
	if(Is_next)
		Mp3_ShowNoticeTXTBase(OSD_STR_STATIC(STR_NEXT_ID));
	else
		Mp3_ShowNoticeTXTBase(OSD_STR_STATIC(STR_PREV_ID));

#endif	
}

/******************************************************************************
 *  Function name : 	Mp3_ShowTrick
 *  Arguments  : 
 *       IN         
 *       OUT
 *       INOUT
 *  Return        	: 	void
 *  By            	: 		Wanghu 
 *  Description	:		show FF/Fr 
 ******************************************************************************
 */
void Mp3_ShowTrick(void)
{
#if _MP3_OSD_ENABLE
 	UCHAR 	temp[15],
 			temp_speed[6];

	//BY QQ 051118
#if 1	
	memset(temp,0,sizeof(temp));
	memset(temp_speed,0,sizeof(temp_speed));
#else
	CLEAR_STRING(temp);
	CLEAR_STRING(temp_speed);
#endif
	
	if(Mp3_GetTrick() > MP3_TRICK_OFF)
		strcpy(temp, FF_ICON);
	else if(Mp3_GetTrick() < MP3_TRICK_OFF)
		strcpy(temp, FR_ICON);
	if( (MP3_FF_2 == Mp3_GetTrick()) || (MP3_FR_2 == Mp3_GetTrick()))
		strcpy(temp_speed, "X2");
	else if( (MP3_FF_4 == Mp3_GetTrick()) || (MP3_FR_4 == Mp3_GetTrick()))
		strcpy(temp_speed, "X4");
	else if( (MP3_FF_8 == Mp3_GetTrick()) || (MP3_FR_8 == Mp3_GetTrick()))
		strcpy(temp_speed, "X8");
	else if( (MP3_FF_16 == Mp3_GetTrick()) || (MP3_FR_16 == Mp3_GetTrick()))
		strcpy(temp_speed, "X16");
	else

	strcpy(temp_speed, OSD_STR_STATIC(STR_PLAY_ID));

	strcat(temp,temp_speed);
	Mp3_ShowNoticeTXTBase(temp);
#endif
}

 /******************************************************************************
 *  Function name : 	Mp3_ShowReading
 *  Arguments  : 
 *       IN         
 *       OUT
 *       INOUT
 *  Return        	: 	void
 *  By            	: 		Wanghu
 *  Description	:		show current page osd
 ******************************************************************************
 */
void Mp3_ShowReading(BOOL	enable)
{
#if _MP3_OSD_ENABLE
	if(TRUE == enable)
		Mp3_ShowNoticeTXTBase(OSD_STR_STATIC(STR_READ_DISC_ID));	
	else
		Mp3_ShowNoticeTXTBase(" ");
#endif	/*	_MP3_OSD_ENABLE	*/
}

VOID MP3_ShowOsdTimeoutString ( Mp3TimeoutOsdType enType, UCHAR uiParam )
{
#if _MP3_OSD_ENABLE
	UCHAR 	*pucLocDispStr = NULL;
	UCHAR 	temp2[10],
			temp1[18];
	UCHAR 	iCount;
#if 1
	memset(temp1,0,sizeof(temp1));//BY QQ 051118
	memset(temp2,0,sizeof(temp2));
#else
	CLEAR_STRING(temp1);//BY QQ 051118
	CLEAR_STRING(temp2);
#endif
	
#if MP3_TIMER
	SysControlTimer(&gMp3_Reserved_Timer, TIMER_DISABLE );
#endif

	switch ( enType )
	{
		case MP3_OSDSTR_RETURN:
			pucLocDispStr = OSD_STR_STATIC(STR_RETURN_ID);
			break;

		case MP3_OSDSTR_INVALID:
			pucLocDispStr = OSD_STR_STATIC(STR_PROHIBITION_ID);
			break;

		case MP3_OSDSTR_PAL_NTSC:
		{
			 CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1]);
			
			if ( gOutput_tv_system == DISPLAY_NTSC_M )
				strcpy(temp1, (char *)"NTSC");
			else
				strcpy(temp1, (char *)"PAL");

			pucLocDispStr = temp1;	
		}
			break;

		case MP3_OSDSTR_REPEAT:
		{
			if ( MP3_REPEAT_ONE == Mp3_GetRepeat() ){
				strcpy(temp2, OSD_STR_STATIC(STR_REPEAT_TRK_ID));	
				vfd_repeatOne();
			}else if( MP3_REPEAT_ALL == Mp3_GetRepeat()){
				strcpy(temp2, OSD_STR_STATIC(STR_REPEAT_ALL_ID));
				vfd_repeatAll();
			}
			else if( MP3_REPEAT_OFF== Mp3_GetRepeat()) {
				strcpy(temp2, OSD_STR_STATIC(STR_OFF_ID));
				vfd_repeatOff();
			}
#if MP3_APP_DEBUG			
			else
				SysPrintf("\Repeat Err");
#endif				
			strcpy(temp1, OSD_STR_STATIC(STR_REPEAT_ID));
			strcat(temp1," ");
			strcat(temp1,temp2);

			pucLocDispStr = temp1;	
		}
			break;

		case MP3_OSDSTR_RESUME:
			pucLocDispStr = OSD_STR_STATIC(STR_RESUME_ID);
			break;

		case MP3_OSDSTR_3D:
			//CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1]);
#if 1			
			//pucLocDispStr = OSD_STR_STATIC(uiParam-MP3_OSDSTR_3D+STR_3D_NORMAL_ID);
			strcpy(temp1,OSD_STR_STATIC(uiParam+STR_3D_NORMAL_ID));
			pucLocDispStr = temp1;
#else
			switch(uiParam)
			{
				case 1:
					pucLocDispStr = OSD_STR_STATIC(STR_3D_JAZZ_ID);
					break;
				case 2:
					pucLocDispStr = OSD_STR_STATIC(STR_3D_ROCK_ID);
					break;
				case 3:
					pucLocDispStr = OSD_STR_STATIC(STR_3D_POP_ID);
					break;
				case 4:
					pucLocDispStr = OSD_STR_STATIC(STR_3D_CLASSIC_ID);
					break;
				case 0:
					pucLocDispStr = OSD_STR_STATIC(STR_3D_NORMAL_ID);
					break;
		 	}
#endif			
			break;

		case MP3_OSDSTR_AUDIO:
		{
			//CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1]);
#if 1
			strcpy(temp1,OSD_STR_STATIC(uiParam+STR_STERO_ID));
			pucLocDispStr = temp1;
#else
			switch(uiParam)
			{
				case 0:
					pucLocDispStr = OSD_STR_STATIC(STR_STERO_ID);
					break;
				case 1:
					pucLocDispStr = OSD_STR_STATIC(STR_LEFT_CH_ID);
					break;
				case 2:
					pucLocDispStr = OSD_STR_STATIC(STR_RIGHT_CH_ID);
					break;
				case 3:
					pucLocDispStr = OSD_STR_STATIC(STR_AUTO_L);
					break;
				case 4:
					pucLocDispStr = OSD_STR_STATIC(STR_AUTO_R);
					break;		
			}			
#endif			
		}
			break;

		case MP3_OSDSTR_TONE:
		{
#if 1			
			BYTE1 i = 0;
			char	*line[] = {TONE_REDUCE_LINE,TONE_NONE_LINE,TONE_ADD_LINE,TONE_VALUE_LINE,HALF_HIGH_LINE};
			memset(temp1,0,sizeof(temp1));
			
			for (i = 0; i < 13; i++){
				if( i == ToneValue)
					temp1[i] = *line[3];
				else
				{
					if( i%6 == 0)
						temp1[i] = *line[i/6];
					else
						temp1[i] = *line[4];
				}
			}
			//strcpy(gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1],temp1);
			pucLocDispStr = temp1;
#else					
			for (iCount = 0; iCount < 13; iCount++)
			{
				if(iCount == 0){
					if( iCount == ToneValue)
						strcpy(temp1,TONE_VALUE_LINE);
					else
						strcpy(temp1,TONE_REDUCE_LINE);
				}else if(iCount == 6){
					if( iCount == ToneValue)
						strcat(temp1,TONE_VALUE_LINE);
					else
						strcat(temp1,TONE_NONE_LINE);
				}else if(iCount == 12){
					if( iCount == ToneValue)
						strcat(temp1,TONE_VALUE_LINE);
					else
						strcat(temp1,TONE_ADD_LINE);
				}else{
					if( iCount == ToneValue)
						strcat(temp1,TONE_VALUE_LINE);
					else
						strcat(temp1,HALF_HIGH_LINE);
				}
			}
#endif							
		}
			break;

		case MP3_OSDSTR_VOLUME:
		{
			UCHAR	vol_l;
#if !_SW_VOLUME_
			UCHAR	vol_tbl[16] = {85, 47, 41, 38, 36, 34, 33, 32, 31, 30, 29, 28, 27, 26, 25, 24};
#endif
			extern BOOL gMute;
			
			if(gshowReserved1 )
			{
				CLEAR_STRING(gOsd_str_dyn[ID_STR_EXP_RESERVED_TEMP1]);
				gMp3_wnd[ID_WND_EXP_RESERVED_TEMP1].status=HS_NEED_DRAW;
				ShowWindow(ID_WND_EXP_RESERVED_TEMP1);
				gshowReserved1 = FALSE; //maymeng 051021
			}
			
#if _SW_VOLUME_
			iCount = VolumeShowVal;
			sprintf(temp2,"%2d",iCount);
#else
			vol_l =(IO_RData32_EX((unsigned char*)&rPWM_CONTROL1_H)&0x7F);	
			for(iCount = 0; iCount < 16; iCount++){
				if(vol_l == vol_tbl[iCount])
					break;
			}
			sprintf(temp2,"%2d",iCount);
#endif	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -