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

📄 o_dvdvr.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 3 页
字号:
	default:
		break;
	}
	
	MsOp = OTEXT_Operation(pThis, MsOp, lParam);
	
	// Post-processing
	switch(MsOp)
	{
	case MS_OP_INIT:			// Fall THrough !!!
	case MS_OP_ON_DEFROST:
		{
			MSO_PLAYTITLE __NEAR* pPlayTitle = (MSO_PLAYTITLE __NEAR*)pThis;
			pPlayTitle->moParam.mwTitleCurrent 	= INVALID_TRACK;
			pPlayTitle->moParam.mwTitlesTotal	= INVALID_TRACK;
		}
		break;

	default:
		break;
	}	
	return MsOp;
}

/***************************************************************************************
*	Function 	: 	_ListItemOperation
*
*	In		:
*
*	Out		:
*
*	Desc 	:	The MSO_LIST_TEM user operation function.
****************************************************************************************/
#pragma argsused
STATIC MS_OP _ListItemOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	switch(MsOp)
	{
	case MS_OP_TICK:
		{
			MSO_DVDVR_LISTITEM __NEAR* pItem = (MSO_DVDVR_LISTITEM __NEAR*)pThis;
			
			if(pItem->moParam.mwAbsTitleIndex == CoreAPI_GetCurrentTitleGroupNum())
			{
				if(FALSE == pItem->moParam.mbIsPlaying)
				{
					pItem->moParam.mbIsPlaying = TRUE;
					MS_DisplayAddObject(pThis);
				}
			}
			else
			{
				if(TRUE == pItem->moParam.mbIsPlaying)
				{
					pItem->moParam.mbIsPlaying = FALSE;
					MS_DisplayAddObject(pThis);
				}
			}
		}
		break;

	case MS_OP_INIT: // Fall Through !!!
		{
			((MSO_DVDVR_LISTITEM __NEAR*)pThis)->moParam.mwAbsTitleIndex 	= _GetIndexFromParam(lParam);
			((MSO_DVDVR_LISTITEM __NEAR*)pThis)->moParam.mbIsPlaying 		= _GetIsPlayingStatusFromParam(lParam);
		} // Fall Through !!!
	case MS_OP_ON_DEFROST:	
		{
			FORMATED_UNICODE_STRING oFormUniStr;
			MSO_DVDVR_LISTITEM __NEAR* pItem = (MSO_DVDVR_LISTITEM __NEAR*)pThis;
			MS_DESCRIPTOR_DVDVR_LISTITEM* pDescriptor = (MS_DESCRIPTOR_DVDVR_LISTITEM*)pThis->mpDescriptor;			
			
			// Allocate scratchpad memory to hold a unicode formatted string.
			pItem->moParam.mwScTitleName = OSDR_MallocScFormUniStr();			
			pItem->moParam.mwScCreationTime = OSDR_MallocScFormUniStr();

			// Title Name
			CoreAPI_GetTitleName(pItem->moParam.mwAbsTitleIndex, oFormUniStr.mszUniStr,  UNISTR_LENGTH_MAX);
			
			oFormUniStr.mtFontIndex = pDescriptor->mtFontIndex;
			OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR *)&oFormUniStr);
			OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwScTitleName);

			// Creation Time
			oFormUniStr.mszUniStr[0] = 0;
			CoreAPI_GetRecordTime(pItem->moParam.mwAbsTitleIndex, oFormUniStr.mszUniStr);

			oFormUniStr.mtFontIndex = pDescriptor->mtFontIndex;
			OSDR_FormatUniString((FORMATED_UNICODE_STRING __NEAR *)&oFormUniStr);
			OSDR_SetScFormUniStr((FORMATED_UNICODE_STRING __NEAR*)&oFormUniStr, pItem->moParam.mwScCreationTime);

			// No need to ask for display during initialization because the parent (MSO_VLIST) asks for the display.
			if(MS_OP_INIT != MsOp)
				MS_DisplayAddObject(pThis);
		}
		break;

	case MS_OP_ENTER: // Fall Through !!!
	case MS_OP_PLAY:
		{
			MSO_DVDVR_LISTITEM __NEAR* pItem = (MSO_DVDVR_LISTITEM __NEAR*)pThis;

			// Starting playback of the focused title while the play mode is set to Program 
			// does not seem logical. Hence, set the play mode to normal before starting playback.
			if(CoreAPI_IsProgramPlayback())
			{
				CoreAPI_SetPlaybackMode(PM_PLAYBACK_NORMAL);
			}
			MS_SendOp(MS_OP_MSG_PLAYSTATE_PLAY, 0);
			
			// Resume playback if the PLAY key was pressed, and the focused item is the active item.
			if((MS_OP_PLAY == MsOp) && (pItem->moParam.mwAbsTitleIndex == CoreAPI_GetCurrentTitleGroupNum()))
			{				
				CoreAPI_Play();
				return MS_OP_CLOSE_PARENT;
			}
			else
			{
				if(CoreAPI_GotoEntry(pItem->moParam.mwAbsTitleIndex, 1))
					return MS_OP_CLOSE_PARENT;
				else
					PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
			}
		}
		return MS_OP_NONE;

	case MS_OP_REFRESH:
	case MS_OP_FOCUS_CHANGE:
		// Ask for re-display when we gain or loose focus.
		MS_DisplayAddObject(pThis);
		break;	

	case MS_OP_PREPARE_FOR_FREEZE: // Fall Through !!!
	case MS_OP_EMPTY:
		{
			MSO_DVDVR_LISTITEM __NEAR* pItem = (MSO_DVDVR_LISTITEM __NEAR*)pThis;			
			
			// Release the Scratch pad memory
			OSDR_FreeScFormUniStr(pItem->moParam.mwScTitleName);
			pItem->moParam.mwScTitleName = NULL_HANDLE;

			OSDR_FreeScFormUniStr(pItem->moParam.mwScCreationTime);
			pItem->moParam.mwScCreationTime = NULL_HANDLE;
		}
		break;
			
	default:
		break;
	}	
	return MsOp;
}

/***************************************************************************************
*	Function 	: 	_BrowserScrollListOperation
*
*	In		:
*
*	Out		:
*
*	Desc 	:	Operation function of the SACD track browser scroll list.
****************************************************************************************/
STATIC MS_OP _BrowserScrollListOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	MsOp = VScrollListOperation(pThis, MsOp, lParam);

	// Post processing
	switch(MsOp)
	{		
	case MS_OP_INIT: 		// Fall Through !!!
	case MS_OP_REFRESH:	// Fall Through !!!
		{
			MS_DESCRIPTOR_VSCROLL_LIST* pScrollListDescriptor = (MS_DESCRIPTOR_VSCROLL_LIST*)MS_GetDescriptorPtr(pThis);			
			MSO_VLIST __NEAR* pList 		= (MSO_VLIST __NEAR*)MS_FindDescendant(pThis, pScrollListDescriptor->mpDescriptorVList);
			PGC_TYPE tProgramChain 		= _GetProgramChainType();
			UINT16 wAbsCurrentTitle 		= CoreAPI_GetCurrentTitleGroupNum();				
			UINT16 wCount 				= 0;
			UINT16 wAbsItemIndex			= NULL_INDEX;
 			MSO_OBJECT __NEAR* 	pItem 	= NULL;
			BOOL bDisplayActiveTitle 		= _DisplayActiveTitle();	
			UINT8 cNumItemsToDisplay 		= 0;			

			// Remove all existing items in the browser list.
			MS_SendOperation((MSO_OBJECT __NEAR*)pList, MS_OP_EMPTY, 0);

			if(TRUE == bDisplayActiveTitle)
			{			
				// Display the active item if the following two conditions are statisfied:
				// 1. The current play state is not full stop.
				// 2. The Browser list is displaying titles from the program chain to which the active title belongs. 
				if(!CoreAPI_IsFullStop()
					&& ((CoreAPI_DVDVRIsPGPlaying() && (PGC_TYPE_ORIGINAL == tProgramChain))
							||(!CoreAPI_DVDVRIsPGPlaying() && (PGC_TYPE_USERDEFINED == tProgramChain))))
				{
					UINT16 wCurrentTitle = (PGC_TYPE_ORIGINAL == tProgramChain) ? 
											CoreAPI_GetDVDVRCurrtProgramNum() : CoreAPI_GetDVDVRCurrentPlayListNum();

					pList->moParam.mwFirstDisplayItem = wCurrentTitle - (wCurrentTitle % pList->moParam.mcNumVisibleItems);
				}
				else
					pList->moParam.mwFirstDisplayItem = 0;
			}			

			// Set list parameters.
			pList->moParam.mwTotalItems = (PGC_TYPE_ORIGINAL == tProgramChain) ? 
											CoreAPI_GetDVDVRMaxProgramNum() : CoreAPI_GetDVDVRMaxPlayListNum();

			cNumItemsToDisplay = MIN((pList->moParam.mwTotalItems - pList->moParam.mwFirstDisplayItem), pList->moParam.mcNumVisibleItems);

			wAbsItemIndex = pList->moParam.mwFirstDisplayItem;

			if(PGC_TYPE_USERDEFINED == tProgramChain)
				wAbsItemIndex += CoreAPI_GetDVDVRMaxProgramNum();

			for(wCount = 1; wCount <= cNumItemsToDisplay; wCount++)
			{				
				pItem = OVLIST_CreateAndAppendItem(pList, &oListItemDescriptor);

				++wAbsItemIndex;
				MS_SendOperation(pItem, MS_OP_INIT, _MakeListItemParam(wAbsItemIndex, (wAbsItemIndex == wAbsCurrentTitle)));
			}

			MS_DisplayAddObject(pThis);
			
			// Set focus to the appropriate list item.
			if(MS_IsFocused(pList))
			{
				pItem = MS_GetObjectListPtr(pList);
				
				if(TRUE == bDisplayActiveTitle)
				{
					// Set focus to the active title.
					while(NULL != pItem->mpNext)
					{
						if(wAbsCurrentTitle == ((MSO_DVDVR_LISTITEM __NEAR*)pItem)->moParam.mwAbsTitleIndex) 
							break;
						else
							pItem = pItem->mpNext;	
					}

					// Incase we reached end of the list but didnt find an active item.
					if(wAbsCurrentTitle != ((MSO_DVDVR_LISTITEM __NEAR*)pItem)->moParam.mwAbsTitleIndex)
						pItem = MS_GetObjectListPtr(pList);
					
					_ResetActiveTitleFlag();
				}
				else
				{					
					if(MS_IS_FOCUS_ON_LASTITEM(pList))
					{
						while(NULL != pItem->mpNext)
							pItem = pItem->mpNext;					
					}
				}
				MS_ScreenSetFocusObject(pItem);
			}				
		}
		return MsOp;
		
	default:
		break;
	}
	return MsOp;
}

/***************************************************************************************
*	Function 	: 	_HelpTextOperation
*
*	In		:
*
*	Out		:
*
*	Desc 	:	Operation function of the SACD help text.
****************************************************************************************/
STATIC MS_OP _HelpTextOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	// Pre-processing
	switch(MsOp)
	{
	case MS_OP_TICK:
		{
			MSO_DVDVR_HELPTEXT __NEAR* pHelpText = (MSO_DVDVR_HELPTEXT __NEAR*)pThis;
			PGC_TYPE tProgramChain = _GetProgramChainType();

			if(tProgramChain != pHelpText->moParam.mtProgramChain)
			{
				pHelpText->moParam.mtProgramChain = tProgramChain;
				MS_SendOperation(pThis, MS_OP_BUILD_TEXT_TABLE, 0);
			}
		}
		break;

	case MS_OP_POPULATE_TEXT_TABLE:
		{
			FORMATED_UNICODE_STRING oFormUniStr;
			MSO_DVDVR_HELPTEXT __NEAR* pHelpText = (MSO_DVDVR_HELPTEXT __NEAR*)pThis;			
			OSD_MESSAGES osdMenuKeyHelp = (PGC_TYPE_ORIGINAL == pHelpText->moParam.mtProgramChain) ? S_DISPLAY_PLAY_LIST : S_CLOSE_DVDVR_WINDOW;
			OSD_MESSAGES osdTitleKeyHelp = (PGC_TYPE_ORIGINAL == pHelpText->moParam.mtProgramChain) ? S_CLOSE_DVDVR_WINDOW : S_DISPLAY_PROGRAM_LIST;
			UINT8 cWordsWritten = 0;
			
			((MULTILINE_TEXT_TABLE*)lParam)->mcTableEntryCount = 0;

			// MENU key help.
			cWordsWritten = STR_GenerateOSDMESSAGEString(S_MENU, oFormUniStr.mszUniStr, 0, UNISTR_LENGTH_MAX);
			
            		// Tag a colon, and a space on the end.
			oFormUniStr.mszUniStr[cWordsWritten++] = L':';
			oFormUniStr.mszUniStr[cWordsWritten++] = UNICODE_SPACE;

			STR_GenerateOSDMESSAGEString(osdMenuKeyHelp, oFormUniStr.mszUniStr, cWordsWritten, UNISTR_LENGTH_MAX);

			// Remove any extra spacing on the end.
			STR_AppendPaddingSpace(oFormUniStr.mszUniStr, MIN(wcslen(oFormUniStr.mszUniStr),UNISTR_LENGTH_MAX), UNISTR_LENGTH_MAX, DVDVR_INFO_PADDING_SPACES);
			
			oFormUniStr.mtFontIndex = (((MS_DESCRIPTOR_TEXT *)((MS_DESCRIPTOR_MULTILINE_TEXT *)pThis->mpDescriptor))->mtFontIndex);

⌨️ 快捷键说明

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