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

📄 console.c

📁 M3355的源代码
💻 C
📖 第 1 页 / 共 5 页
字号:
#endif

		break;

	case V_KEY_ENTER:
		/*PROCESS*/
		bitcount=0;
		NVGetCurInfo(&OSD_Console_Parameter.PlayPoint); 	   
		if ((NVIsUOPPermit(UOP1)!=TRUE || NVIsUOPPermit(UOP5)!=TRUE))
			//||((g_UiCoreState==UI_CORE_PAUSE)&&(OSD_Console_Parameter.PlayPoint.wPTTN==temppttn)))		//lily for lg bug 1610
		{
			ShowDiscInfo(MSG_INVALID,MSG_NULL);
			curpgnum = OSD_Console_Parameter.PlayPoint.wPTTN;
			temppttn=curpgnum;
		}
		else	{
			//modified by jane for la bug 2312
			if ((OSD_Console_Parameter.PlayPoint.wPTTN==temppttn)&&(g_UiCoreState!=UI_CORE_STOP))	//bond add for la bug 2210	 031027
				;
			else
			{			
				if((temppttn==0)||(temppttn>totalpg))	//modified by jane
				{
					temppttn=curpgnum=OSD_Console_Parameter.PlayPoint.wPTTN;
				}
				else
				{
					 if (g_UiCoreState != UI_CORE_PLAY)
					{
						ClearRectArea(gui_hdc,GUITYPE_PLAYMODEGUI);	//added by jane
						bActionCtl = 0; 	   // change for hanyang 1121
						g_UiCoreState = UI_CORE_PLAY;
						if(NVPlayModeChg(C_NV_Play,0))
							ShowPlayModeGui(RS_FUN_OSD_PLAY, MSG_NULL );
					}
					 
					// if (OSD_Console_Parameter.PlayPoint.wPTTN!=temppttn)	//added by jane
					{
						OSD_Console_Parameter.PlayPoint.wPTTN=temppttn;//curpgnum;JANE
						OSD_Console_Parameter.PlayPoint.dwLBAAddr=0;
						if((DiscType==C_DVD)||(DiscType ==	C_DVD_VR))
							 OSD_Console_Parameter.PlayPoint.bDomain= 3; /* 3 for TT_DOM */
						
						if(!NVPTTPlay(&OSD_Console_Parameter.PlayPoint, C_STOP_SKIPPG,KEY_PTT))
						{
							NVGetCurInfo(&OSD_Console_Parameter.PlayPoint);
							curpgnum = OSD_Console_Parameter.PlayPoint.wPTTN;
							temppttn=curpgnum;
						}
						else
						{
							 if (g_UiPlaybackRepeatRange!=UI_PLAYBACKRANGE_REPEATALL&&RepeatAB_Counter!=REPEAT_AB_A)	//added by jane
								UiClearPlaybckMd();
							 ClearRectArea(gui_hdc,GUITYPE_MODEGUI);
						}
					}
				}
			}
		}
		SetConsolePTTTimer(INFINITETIME);	  
		ItemState=DISPLAY_STATE;
		break;

	default:
		return UI_NOUSE_FUNC_MSG;
	}

	if ((DiscType==C_DVD)||(DiscType ==  C_DVD_VR))
	{
		/*if(NVIsUOPPermit(UOP1)!=TRUE || (NVIsUOPPermit(UOP5)!=TRUE) )
		{
			UNStringCopy(str, "\0-\0-\0\0");
			//return UI_IS_FUNC_MSG;
		}
		else*/
		{
			GetModeStr(MODESTR_NUMSELECT,temppttn,totalpg,str);	//MODIFIED BY JANE
		}

		{
			BOOL chkflag;
			if (totalpg>1)	
				chkflag = CheckIfActive(CNSL_BOX_CHAPTER_DVD);
			else
				chkflag = 0;
			ShowBoxWithMemdc(gui_hdc,&menus[1],str,chkflag);
		}

	}
	return UI_IS_FUNC_MSG;
}



WORD CnslItemTime(WORD msgtype)
{
	int time, hour, minute, second;
	int totaltime, temp, i;
	BOOL bRes;
	static BYTE ch[5]="00000";
	PLAYPOINT PlayPoint;
	DWORD dwItemID;

	totaltime=NVGetTotalTime();

	switch(msgtype)
	{
	case V_KEY_ENTER:
		if(bitcount!=0)
		{
			bitcount=0;
			//modified by jane
			hour=((ch[0]>'0')?(ch[0]-'0'):0);
			minute=((ch[1]>'0')?((ch[1]-'0')*10):0)+((ch[2]>'0')?(ch[2]-'0'):0);
			second=((ch[3]>'0')?((ch[3]-'0')*10):0)+((ch[4]>'0')?(ch[4]-'0'):0);
			time=hour*3600+minute*60+second;
			
// Start for LG#1286	// In case SVCD, Time-search can't work for VBR disc
			if (VirDiscType==C_VCD20)
				totaltime = NVGetVCDTotalTimePBCON();

			if((VirDiscType==C_SVCD) || \
				(VirDiscType==C_VCD20 && (IsVCDSVCDStillPicture() || time>=totaltime)))
			{
				ShowDiscInfo(MSG_INVALID, MSG_NULL);
				if(ItemState==EDIT_STATE)
					for(i=0;i<5;i++)
						ch[i]='-';
				timestr[1]=ch[0];/*hour*/
				timestr[5]=ch[1];
				timestr[7]=ch[2];/*minute*/
				timestr[11]=ch[3];
				timestr[13]=ch[4];/*second*/
				ShowBoxWithMemdc(gui_hdc,&menus[1],timestr,0);
//				ShowBoxWithMemdc(gui_hdc,&(vcdbrc[1]),&(vcdbmpbox[1]),timestr,0);
				return UI_IS_FUNC_MSG;
			}
// End for LG#1286
#if ( _CDG_MODE==_CDG_Enable )	 //30214-06sd
			if ( (time<=totaltime)&&(totaltime!=0)&&(NVIsUOPPermit(UOP5)==TRUE)&&(((DiscType == C_CDG)&&(CDG_Decode_Flag==1))||(DiscType != C_CDG)))//cliff 30410-02cf for can not time search in console
#else

			if ( (time<=totaltime)&&(totaltime!=0)&&(NVIsUOPPermit(UOP5)==TRUE) )//TPE Angus and sean modify for Mustek Dual layer disc, time search to totaltime fail 20021212
#endif

			{
				/*if(hour>60||minute>60||second>60)
					bRes=FALSE;
				else*/
				{
// Start for LG#1286

					if ( (time != 0) || (DiscType == C_DVD)
						 || (VirDiscType == C_VCD20) || (VirDiscType == C_VCD10) ) //030527-01ba//dvd audio sh
// End for LG#1286					  
					{
						if (g_UiCoreState != UI_CORE_PLAY)
						{
							//ClearRectArea(gui_hdc,GUITYPE_DISPLAYGUI);  //marked by jane
							bActionCtl = 0;
							g_UiCoreState = UI_CORE_PLAY;
							SendVFDPart1Show();
							NVPlayModeChg(C_NV_Play, 0);
						}

#if 1
						bRes = NVTimeSearch(time,(DiscType==C_DVD||DiscType==C_DVD_VR)?0:1);
#else
						//<<bond modify for la bug 1841 031015.
						if(DiscType==C_VCD10||DiscType==C_VCD20||DiscType==C_SVCD)
							  bRes = NVTimeSearch(time, 1/* current track search */);
						else
							  bRes = NVTimeSearch(time, 0/* total disc search */);
						//>>
#endif
					}
					else
					{
						PlayPoint.wTTN = 1;
						PlayPoint.wPTTN=0;
						PlayPoint.dwLBAAddr=0;
						OSD_Console_Parameter.PlayPoint.dwLBAAddr=0;
						if (g_UiCoreState != UI_CORE_PLAY)
						{
							//ClearRectArea(gui_hdc,GUITYPE_DISPLAYGUI);	//marked by jane
							bActionCtl = 0;
							g_UiCoreState = UI_CORE_PLAY;
							SendVFDPart1Show();
							NVPlayModeChg(C_NV_Play, 0);
						}
						bRes = NVPTTPlay(&PlayPoint, C_STOP_SKIPPG,KEY_TIMER);
					}
				}
			}
			else
				bRes = FALSE;

			if (bRes)// time search action work
			{
				if((g_UiCoreState == UI_CORE_PAUSE)||(g_UiCoreState == UI_CORE_STEP))
				{
					g_UiCoreState = UI_CORE_PLAY;
					SendVFDPart1Show();
					NVPlayModeChg(C_NV_Play,0);
				}
				
				 //modified by jane for lg bug 2958
				//if(g_UiPlaybackList != UI_PLAYBACKLIST_NORMAL)
				if((g_UiPlaybackRepeatRange==UI_PLAYBACKRANGE_REPEATAB &&NVIsInsideAB(time))
					||(g_UiPlaybackRepeatRange==UI_PLAYBACKRANGE_REPEATONE&&NVIsInsideChapter(time))
					||(g_UiPlaybackRepeatRange==UI_PLAYBACKRANGE_REPEATALL))
					;
				else
				{
					UiClearPlaybckMd();
					SendVFDPart1Show();	//addey by brook
				}

				ConsoleTimeMode=C_TT_TM;
				CloseConsole();
				ShowPlayModeGui(RS_FUN_OSD_PLAY, MSG_NULL );
				return UI_IS_FUNC_MSG;
			}
			else// time search action not work
			{
				ShowDiscInfo(MSG_INVALID,MSG_NULL);
				/*time=NVGetVideoTime(ConsoleTimeMode);
				hour=time/3600;
				minute=(time-hour*3600)/60;
				second=time%60;
				ch[0]=(hour/10)+'0';
				ch[1]=(hour%10)+'0';
				ch[2]=(minute/10)+'0';
				ch[3]=(minute%10)+'0';
				ch[4]=(second/10)+'0';
				ch[5]=(second%10)+'0';*/
				
				ch[0]='-';
				ch[1]='-';
				ch[2]='-';
				ch[3]='-';
				ch[4]='-';
			  
				ItemState=DISPLAY_STATE;
				GetTimeStr(0,C_NO_TIME,timestr);
				break;
			}
		}

		ItemState=DISPLAY_STATE;
		return UI_IS_FUNC_MSG;

	case V_KEY_0:
	case V_KEY_1:
	case V_KEY_2:
	case V_KEY_3:
	case V_KEY_4:
	case V_KEY_5:
	case V_KEY_6:
	case V_KEY_7:
	case V_KEY_8:
	case V_KEY_9:
		if(bitcount==0)
		{
			for(i=0;i<5;i++)
				ch[i]='0';
		}
		temp=msgtype-V_KEY_0;
		bitcount++;
		for(i=0;i<4;i++)//left move
			ch[i]=ch[i+1];
		ch[4] = temp+'0';
		ItemState=EDIT_STATE;
#if (_CONSOLE_AUTO_CLOSE_TIME >= 1)

		SetConsoleTimer(_CONSOLE_AUTO_CLOSE_TIME*1000);
#endif

		break;

	case V_KEY_CLEAR:
		if(ItemState==EDIT_STATE)
		{
			for (i = 0;i < 5;i++)
				ch[i]='-';
		bitcount=0;
		}
		else
			return UI_IS_FUNC_MSG;
		break;

	default:
		return UI_NOUSE_FUNC_MSG;
	}

	timestr[1]=ch[0];/*hour*/
	timestr[5]=ch[1];
	timestr[7]=ch[2];/*minute*/
	timestr[11]=ch[3];
	timestr[13]=ch[4];/*second*/

	{
		BYTE index;
		if ((DiscType==C_DVD)||(DiscType == C_DVD_VR)) index = 2;
		else index = 1;

		ShowBoxWithMemdc(gui_hdc,&menus[index],timestr,0);
	}

	return UI_IS_FUNC_MSG;
}

WORD CnslItemSubtitle(WORD msgtype)
{
	int totalSP, curSP, num,i;
	BYTE mediatype=0;//mikehan
	WORD LANGUAGEID;//mikehan
	SUBTTINFO SubttInfo;
	BYTE str[30];

	if(g_UiCoreState == UI_CORE_PAUSE || g_UiCoreState == UI_CORE_STEP)
	{
		return UI_NOUSE_FUNC_MSG;
	}
	NVGetSPInfo(&SubttInfo);
	curSP = SubttInfo.SubTTNo;
	totalSP=SubttInfo.SubTTTotalNo;
	if((!totalSP)||(NVIsUOPPermit(UOP21) != TRUE))
		if ((msgtype==V_KEY_LEFT)||(msgtype==V_KEY_RIGHT)||(msgtype==V_KEY_SUBP)
			||((msgtype>=V_KEY_0)&&(msgtype<=V_KEY_9))||(msgtype==V_KEY_SUBP_ONOFF)
			||(msgtype==V_KEY_ENTER))
			{//bond add for la bug 031217 
			 ShowDiscInfo(MSG_INVALID, MSG_NULL);
			return UI_IS_FUNC_MSG;	
			}
		else 
			return UI_NOUSE_FUNC_MSG;
	 if(totalSP<=1)
		curSP=totalSP;

	switch(msgtype)
	{
	case V_KEY_LEFT: /*sub-pic id sub 1*/
		if( bZoomCount >0)
			return UI_IS_FUNC_MSG;
			
		if(!SubttInfo.SubTTOnOff)
		{
			if(!NVSetSpSW(C_ON))
				return UI_IS_FUNC_MSG;
			curSP=totalSP;
		}
		else if(curSP==1)
		{
			if(!NVSetSpSW(C_OFF))
				return UI_IS_FUNC_MSG;
			curSP=0;
		}
		else
			curSP--;
		ItemState=DISPLAY_STATE;
#if (_CONSOLE_AUTO_CLOSE_TIME >= 1)

		SetConsoleTimer(_CONSOLE_AUTO_CLOSE_TIME*1000);
#endif

		break;

	case V_KEY_RIGHT:/*sub-pic id add 1*/
	case V_KEY_SUBP:
		if( bZoomCount >0)
			return UI_IS_FUNC_MSG;
		
		if(!SubttInfo.SubTTOnOff)
		{
			if(!NVSetSpSW(C_ON))
				return UI_IS_FUNC_MSG;
			if(totalSP>1)
				curSP=1;
		}
		else if(curSP==totalSP)
		{
			curSP=0;
			if(!NVSetSpSW(C_OFF))
				return UI_IS_FUNC_MSG;
		}
		else
			curSP++;
		ItemState=DISPLAY_STATE;
#if (_CONSOLE_AUTO_CLOSE_TIME >= 1)

		SetConsoleTimer(_CONSOLE_AUTO_CLOSE_TIME*1000);
#endif

		break;

	case V_KEY_0:
	case V_KEY_1:
	case V_KEY_2:
	case V_KEY_3:
	case V_KEY_4:
	case V_KEY_5:
	case V_KEY_6:
	case V_KEY_7:
	case V_KEY_8:
	case V_KEY_9:
		break;

	case V_KEY_SUBP_ONOFF:
#if 1

		NVSetSpSW(!SubttInfo.SubTTOnOff);
		if(SubttInfo.SubTTOnOff)	curSP = 0;
#else
		if(SubttInfo.SubTTOnOff)
		{
			NVSetSpSW(C_OFF);
			curSP=0;
		}
		else
			NVSetSpSW(C_ON);
#endif
#if (_CONSOLE_AUTO_CLOSE_TIME >= 1)

		SetConsoleTimer(_CONSOLE_AUTO_CLOSE_TIME*1000);
#endif

		break;

	case V_KEY_ENTER:
		curSP =	curpgnum;
		curpgnum = 0;
		ItemState=DISPLAY_STATE;
		return UI_IS_FUNC_MSG;

	default:
		return UI_NOUSE_FUNC_MSG;
	}

	if (!NVSPIdSet(curSP, 1)) /* 1 for RnTmSetID */
		curSP =0;
	if (ItemState == DISPLAY_STATE)
	{
		if(!curSP)
		{
			LoadText(RS_GUI_OFF, str,30);
		}
		else
		{
			LANGUAGEID=NVGetLanguageID(mediatype, (BYTE)curSP);
			GetModeStr(MODESTR_NUMSTR, curSP,GUI_LANGUAGEID[LANGUAGEID],str);
		}
		ShowBoxWithMemdc(gui_hdc,&menus[CNSL_BOX_SUBTITLE_DVD],str,CheckIfActive(CNSL_BOX_SUBTITLE_DVD));
	}
	return UI_IS_FUNC_MSG;
}

WORD CnslItemAudio(WORD msgtype)
{
	if( g_UiCoreState == UI_CORE_STEP)
		return UI_NOUSE_FUNC_MSG;
		
	if( (g_UiCoreState == UI_CORE_PAUSE)||(g_UiCoreState == UI_CORE_SLOW)||(g_UiCoreState == UI_CORE_REVSLOW))
	{
		if ((msgtype==V_KEY_LEFT)||(msgtype==V_KEY_RIGHT))
		{
			ShowDiscInfo(MSG_INVALID, MSG_NULL);
			return UI_IS_FUNC_MSG;
		}
		else
			return UI_NOUSE_FUNC_MSG;
	}

	if ((DiscType == C_DVD || DiscType==C_DVD_VR))
		return DVDCnslItemAudio(msgtype);
	else
		return VCDCnslItemAudio(msgtype);
}
WORD CnslItemAngle(WORD msgtype)
{
	int totalangle, curangle, num;
	ANGLEINFO AngleInfo;
	BYTE str[30];
	WORD tangle;

	if(g_UiCoreState == UI_CORE_PAUSE || g_UiCoreState == UI_CORE_STEP)
		return UI_NOUSE_FUNC_MSG;
	
	NVGetAGLInfo(&AngleInfo);
	curangle = AngleInfo.AngleNo;
	totalangle=AngleInfo.AngleTotalNo;


	switch(msgtype)
	{
	case V_KEY_1:
	case V_KEY_2:
	case V_KEY_3:
	case V_KEY_4:
	case V_KEY_5:
	case V_KEY_6:
	case V_KEY_7:
	case V_KEY_8:
	case V_KEY_9:
	if(totalangle <= 1)
		return UI_IS_FUNC_MSG;
		tangle=msgtype-V_KEY_0;
		if(tangle>totalangle)
			return UI_IS_FUNC_MSG;
		curangle=tangle;
#if (_CONSOLE_AUTO_CLOSE_TIME >= 1)

		SetConsoleTimer(_CONSOLE_AUTO_CLOSE_TIME*1000);
#endif

		break;
	case V_KEY_LEFT: /*angle id sub 1*/
	

⌨️ 快捷键说明

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