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

📄 consoleoutlook.c

📁 M3355的源代码
💻 C
📖 第 1 页 / 共 3 页
字号:
	}

}
/*----------------------------------------------------------------------------
 * Function name: CheckIfActive
 * Arguments:	   BYTE curitemname
 * Return value:   bool
 * Remark:		check curitemname is highlighting and editible now.
 *----------------------------------------------------------------------------*/
BOOL CheckIfActive(BYTE curitemname)//curitemname is id of current menu item
{
//	static BOOL isactive=FALSE; //comment by chena
	BOOL isactive;

	if(DiscType==C_DVD||DiscType==C_DVD_VR)
	{
		isactive = (cnsl_cur_item_id== curitemname);
#if 0		
		if(cnsl_cur_item==curitemname)
			isactive=TRUE;
		else
			isactive=FALSE;
#endif
//		if(DiscType==C_DVD)
		{

			if (
				(!NVIsUOPPermit(UOP20)  &&  cnsl_cur_item_id== CNSL_BOX_AUDIO_DVD) ||
				(!NVIsUOPPermit(UOP21)  &&  cnsl_cur_item_id== CNSL_BOX_SUBTITLE_DVD) ||
				(!NVIsUOPPermit(UOP2) && cnsl_cur_item_id== CNSL_BOX_TITLE_DVD && g_UiCoreState != UI_CORE_STOP) ||
				((!NVIsUOPPermit(UOP1)|| !NVIsUOPPermit(UOP5) ||NVChkIsHighLight()) && cnsl_cur_item_id == CNSL_BOX_CHAPTER_DVD)

			)
				 isactive = FALSE;
#if 0
			if (NVIsUOPPermit(UOP20) != TRUE  &&  cnsl_cur_item == CNSL_BOX_AUDIO_DVD)
				 isactive = FALSE;
		 	if ((NVIsUOPPermit(UOP21) != TRUE)&&cnsl_cur_item == CNSL_BOX_SUBTITLE_DVD)
				 isactive = FALSE;
			if(NVIsUOPPermit(UOP2)!=TRUE && cnsl_cur_item == CNSL_BOX_TITLE_DVD&& g_UiCoreState != UI_CORE_STOP)
				isactive = FALSE;
			if((NVIsUOPPermit(UOP1)!=TRUE || (NVIsUOPPermit(UOP5)!=TRUE) ||NVChkIsHighLight()) && cnsl_cur_item == CNSL_BOX_CHAPTER_DVD)
				isactive = FALSE;
#endif			
		}

	}
	else//vcds
	{
//		if(cnsl_cur_item==curitemname-CNSL_BOX_TITLE_VCD)
		if(cnsl_cur_item_id== curitemname)
		{
#ifdef SOUND_SUPPORT
			if(
				curitemname==CNSL_BOX_SOUND_VCD&&
				(LeftMicStatus==C_LEFT_MIC_ON||RightMicStatus==C_RIGHT_MIC_ON)
			)
				isactive= FALSE;//bond modify for bug 2301 031030	
			else	
#endif
				isactive= TRUE;
		}
		else
			isactive= FALSE;
	}
	return isactive;
}
// item : ID of item
void ShowConsleItem(HDC hdc,BYTE item)
{
	BYTE str[30];
	PLAYPOINT CurPlayPoint;
	UINT languageid;
	SUBTTINFO SubttInfo;
	ANGLEINFO AngleInfo;
	BYTE totalasv, curasv, asvmode;
	BYTE bTT_type;
	BOOL chkflag;
	BYTE index = 250;
	BOOL chkifactive;

	chkifactive = CheckIfActive(item);
	NVGetCurInfo(&CurPlayPoint);


//	printf("ShowConsleItem(item=%d)\r\n",item);
	
	switch(item)
	{
	case CNSL_BOX_TITLE_DVD:
	case CNSL_BOX_TITLE_VCD:
		if((DiscType==C_DVD)||(DiscType==C_DVD_VR))
		{
//			NVGetCurInfo( &CurPlayPoint );
			GetModeStr(MODESTR_NUMSELECT,CurPlayPoint.wTTN,NVGetTTNsOrTrks(),str);
			if(NVGetTTNsOrTrks()>1)
			{
				if(g_UiCoreState==UI_CORE_STOP)
					chkflag = 1;
				else
//					chkflag = CheckIfActive(item);
					chkflag = chkifactive;
			}
			else
				chkflag = 0;
		}
		else if ((DiscType==C_VCD10||DiscType==C_VCD20||DiscType==C_SVCD))
		{
			if((OSD_Setup_Parameter.bPBC == C_OFF||DiscType==C_VCD10))
			{
//				NVGetCurInfo( &CurPlayPoint );
				GetModeStr(MODESTR_NUMSELECT,CurPlayPoint.wTTN,NVGetTTNsOrTrks(),str);

			 	 //modified by jane for lgsh bug 196
				if(g_UiCoreState==UI_CORE_STOP)//||g_UiCoreState==UI_CORE_PAUSE)
					chkflag = 1;
				else
				{
					if(NVGetTTNsOrTrks()>1)
//						chkflag = CheckIfActive(item);
						chkflag = chkifactive;
					else
						chkflag = 0;
				}
			}
			else
			{
				LoadText(RS_SETUP_ETC_PLAYBACK_CONTROL, str, 30);
				chkflag = 0;
			}
		}		
		index = 0;
//		ShowBoxWithMemdc(gui_hdc,&menus[0],str,chkflag);
		break;
	case CNSL_BOX_CHAPTER_DVD:
		if((DiscType==C_DVD)||(DiscType==C_DVD_VR))
		{
			if(NVChkIsMultiPGC())	//||NVIsUOPPermit(UOP1)!=TRUE||NVIsUOPPermit(UOP5)!=TRUE)	//modified by jane 
			{
				UNStringCopy(str, "\0-\0-\0\0");
			}
			else
			{
				GetModeStr(MODESTR_NUMSELECT,CurPlayPoint.wPTTN,NVGetTTPTTNs(CurPlayPoint.wTTN),str);
			}
			if(NVGetTTPTTNs(CurPlayPoint.wTTN)>1)
				chkflag = chkifactive;
			else
				chkflag = 0;

			index = 1;
		}
		break;

	case CNSL_BOX_TIME_DVD:
	case CNSL_BOX_TIME_VCD:
		if((DiscType==C_DVD)||(DiscType==C_DVD_VR))
		{
			if(cnsl_cur_item==CNSL_BOX_TIME_DVD)
				GetTimeStr(0,C_NO_TIME,timestr);
			else
				GetTimeStr(NVGetVideoTime(C_DISC_TM),C_DISC_TM,timestr);

			index = 2;
			chkflag = 0;
		}
           	else
		{
			if(cnsl_cur_item_id == CNSL_BOX_TIME_VCD)// - CNSL_BOX_TITLE_VCD)
				GetTimeStr(0,C_NO_TIME,timestr);
			else
				GetTimeStr(NVGetVideoTime(C_TRACK_TM),C_DISC_TM,timestr);

			index = 1;
			chkflag = 0;
		}
		memcpy(str,timestr,16);
		break;

	case CNSL_BOX_AUDIO_DVD:
	case CNSL_BOX_AUDIO_VCD:
		if((DiscType==C_DVD)||(DiscType==C_DVD_VR))
		{
			consoleAudioItem.lpbaseRect->rect.left = menus[3].baseRect.rect.left;//brc[3].rect.left;
			consoleAudioItem.lpbaseRect->rect.top = menus[3].baseRect.rect.top;//brc[3].rect.top;
			consoleAudioItem.lpbaseRect->bkColor = CNSL_BOX_BACKCOLOR_NORMAL;
			consoleAudioItem.lpbaseRect->strColor = CNSL_BOX_STRCOLOR_NORMAL;
			consoleAudioItem.curLine = chkifactive;//CheckIfActive(item);
			GetAudioInfo2Item(&consoleAudioItem);
			DrawMultiLineCSItem(gui_hdc,&consoleAudioItem);
			return;
		}
		else
		{
			{
				UINT uID;
				if(bVocalPressCnt==C_VOCAL_STEREO) uID = RS_GUI_STEREO;
				else if(bVocalPressCnt==C_VOCAL_LEFT) uID = RS_GUI_LEFT;
				else if(bVocalPressCnt==C_VOCAL_RIGHT) uID = RS_GUI_RIGHT;

				LoadText(uID, str, 30);
			}
#if 0		
			if(bVocalPressCnt==C_VOCAL_STEREO)
				LoadText(RS_GUI_STEREO, str,30);
			else if(bVocalPressCnt==C_VOCAL_LEFT)
				LoadText(RS_GUI_LEFT, str, 30);
			else if(bVocalPressCnt==C_VOCAL_RIGHT)
				LoadText(RS_GUI_RIGHT, str, 30);
#endif
			index = 2;
			chkflag = chkifactive;//CheckIfActive(item);
//			ShowBoxWithMemdc(gui_hdc,&menus[2],str,CheckIfActive(item));
		}
		break;

	case CNSL_BOX_SUBTITLE_DVD:
		if((DiscType==C_DVD)||(DiscType==C_DVD_VR))
		{
			NVGetSPInfo(&SubttInfo );
			if(!SubttInfo.SubTTTotalNo)
			{
				UNStringCopy( str,"\0N\0O\0N\0E\0\0");
				chkflag = 0;
			}
			else if(bNVSpSwOnOff ==C_OFF)
			{
				LoadText(RS_GUI_OFF, str,30);
				if(bZoomCount>0){
					chkflag = 0;
				}
				else{
					chkflag = chkifactive;//CheckIfActive(item);
				}
			}
			else
			{
				languageid=NVGetLanguageID(0,SubttInfo.SubTTNo);
				GetModeStr(MODESTR_NUMSTR, SubttInfo.SubTTNo,GUI_LANGUAGEID[languageid],str);
				chkflag = chkifactive;//CheckIfActive(item);
			}
			index = CNSL_BOX_SUBTITLE_DVD;
//			ShowBoxWithMemdc(gui_hdc,&menus[CNSL_BOX_SUBTITLE_DVD],str,chkflag);
		}
		break;

	case CNSL_BOX_ANGLE_DVD:
		if((DiscType==C_DVD)||(DiscType==C_DVD_VR))
		{
			NVGetAGLInfo(&AngleInfo);
			if(AngleInfo.AngleTotalNo<=1)
				GetModeStr(MODESTR_NUMSELECT,1,1,str);
			else
				GetModeStr(MODESTR_NUMSELECT,AngleInfo.AngleNo,AngleInfo.AngleTotalNo,str);
			if(AngleInfo.AngleTotalNo>1){
				chkflag = chkifactive;//CheckIfActive(item);
			}
			else{
				chkflag = 0;
			}
			index = 5;
		}
		break;
#ifdef SOUND_SUPPORT
	case CNSL_BOX_SOUND_DVD:
	case CNSL_BOX_SOUND_VCD:
		{
			UINT uID;
			//-->Alan, bug fix: 211, 212
			cursound = AP2PEOprParam.VirtualSurroundMode;
			//<--Alan, bug fix: 211, 212
			if(!cursound) uID = RS_GUI_NORMAL;
			else uID = RS_GUI_SRS3D;

			LoadText(uID, str, 30);
		}
#if 0
		if(!cursound)
			LoadText(RS_GUI_NORMAL, str,30);
		else
			LoadText(RS_GUI_SRS3D,str,30);
#endif

		//30911 gamble for sound mode in DTS state
		if((DiscType==C_DVD)||(DiscType==C_DVD_VR))
		{
			if(!PE_Permit_3DSurround() || LeftMicStatus == C_LEFT_MIC_ON || RightMicStatus == C_RIGHT_MIC_ON){
				chkflag = 0;
				index = 6;
			}
			 else{
			 	chkflag = chkifactive;//CheckIfActive(item);
				index = 6;
			 }
		}
		else{
			chkflag = chkifactive;//CheckIfActive(item);
			index = 3;
		}
//		ShowBoxWithMemdc(gui_hdc,&menus[index],str,chkflag);
		break;
#endif
	default:
		break;
	}

//	printf("ShowConsoleItem: index = %d, chkflag = %d\r\n",index, chkflag);
	
	if(index != 250)
		ShowBoxWithMemdc(gui_hdc, &(menus[index]), str, chkflag);

}

/*
	comment by chena:
		turn time to string format.

		Time : total senconds
		Timestr : char buffer for time
*/
void GetTimeStr(DWORD Time,BYTE bTimeMode,LPBYTE Timestr)
{
	DWORD min,sec,hour;

   // bVFDShowTimeMode = bOSDShowTimeMode = bTimeMode;

	if(bTimeMode==C_NO_TIME)
	{
		Timestr[1]=Timestr[5]=Timestr[7]=Timestr[11]=Timestr[13]='-';
	}
	else{
		if(Time!=0x3fffffff)
		{
			sec = Time % 60;
			Time /= 60;
			min = Time % 60;
			Time /= 60;
			hour = Time;

			Timestr[1]=hour%10 +'0'; 	//less than 10 hours
			Timestr[5]=min/10+'0';	
			Timestr[7]=min%10+'0';
			Timestr[11]=sec/10+'0';
			Timestr[13]=sec%10+'0';
		}
	}
}
#if 0
BYTE VcdGetHintIndex(BYTE vcditem)
{
	switch(vcditem)
	{
	case 0:
		return CNSL_BOX_TITLE_VCD;
	case 1:
		return CNSL_BOX_TIME_VCD;
	case 2:
		return CNSL_BOX_AUDIO_VCD;
	case 3:
		return CNSL_BOX_SOUND_VCD;
	}
}
#endif
void SetHintBoxInfo(BYTE bCurItem)
{
	WORD strID;
	BYTE i;
	int strlen;
	int totalangle,totalSp;
	ANGLEINFO AngleInfo;
	SUBTTINFO SubTTInfo;

	//get strID for hintbox according to bCurItem
	switch(bCurItem)
	{
	case CNSL_BOX_TITLE_DVD:
	case CNSL_BOX_CHAPTER_DVD:
	case CNSL_BOX_AUDIO_DVD:
	case CNSL_BOX_SUBTITLE_DVD:
	case CNSL_BOX_ANGLE_DVD:
		strID=bCurItem+1;
		break;
#ifdef SOUND_SUPPORT
	case CNSL_BOX_SOUND_DVD:
	case CNSL_BOX_SOUND_VCD:
		strID=RS_GUI_SOUND;
		break;
#endif
	case CNSL_BOX_TITLE_VCD://track
		strID=RS_GUI_TRACKS;
		break;
	case CNSL_BOX_TIME_VCD:
			strID=RS_GUI_TIME;
		break;
	case CNSL_BOX_AUDIO_VCD:
		strID=RS_GUI_AUDIO;
		break;
	}

	hintbox.upRct_str->strId=strID;


	//set str for hintbox
	hintbox.downRct_str[0]=&downHintStr[MOVE_ICON];
	hintbox.downRct_str[1]=&downHintStr[MOVESTR];
	switch(bCurItem)
	{
	case CNSL_BOX_TITLE_DVD:
	case CNSL_BOX_TITLE_VCD:
	case CNSL_BOX_CHAPTER_DVD:
	case CNSL_BOX_TIME_VCD:
	case CNSL_BOX_TIME_DVD:
		hintbox.downStrNums=6;
		hintbox.downRct_str[2]=&downHintStr[INPUT_ICON];
		hintbox.downRct_str[3]=&downHintStr[INPUTSTR];
		hintbox.downRct_str[4]=&downHintStr[ENTER_ICON];
		hintbox.downRct_str[5]=&downHintStr[ENTERSTR];
		break;
	case CNSL_BOX_ANGLE_DVD:
		//JANE ADDED FOR ONE ANGLE HINT	
		NVGetAGLInfo(&AngleInfo);
		totalangle=AngleInfo.AngleTotalNo;	
		if(totalangle <= 1)
		{
			hintbox.downStrNums=2;
		}
		else
		{
			hintbox.downStrNums=4;
			hintbox.downRct_str[2]=&downHintStr[SELECT_ICON];
			hintbox.downRct_str[3]=&downHintStr[SELECTSTR];
		}
		break;
	case CNSL_BOX_SUBTITLE_DVD:
		NVGetSPInfo(&SubTTInfo);	//bond add on 031013.
		totalSp=SubTTInfo.SubTTTotalNo;
		if(totalSp<= 1)
		{
			hintbox.downStrNums=2;
		}
		else
		{
			hintbox.downStrNums=4;
			hintbox.downRct_str[2]=&downHintStr[SELECT_ICON];
			hintbox.downRct_str[3]=&downHintStr[SELECTSTR];
		}
		break;
	default:
		hintbox.downStrNums=4;
		hintbox.downRct_str[2]=&downHintStr[SELECT_ICON];
		hintbox.downRct_str[3]=&downHintStr[SELECTSTR];
		break;
	}


	if(hintbox.downStrNums>4)
	{

⌨️ 快捷键说明

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