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

📄 o_search_display.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 4 页
字号:
/* **************************************************************************************
*  Copyright (c) 2004 ZORAN Corporation, All Rights Reserved
*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
*  File: $Workfile: o_search_display.c $
*
* Description:
* ============
* Integrate the search and display component.
*
****************************************************************************************/
#include "Config.h"		// Global Configuration - do not remove!

#ifdef D_GUI_COMPONENT_SEARCH_DISPLAY

#ifdef DEBUG_UI_TRACE
#undef IFTRACE
#define IFTRACE if (gTraceUI)
#include "Debug\DbgMain.h"
#endif //DEBUG_UI_TRACE

#include "Include\SysDefs.h"

/***************************************************************************************
* Include files
****************************************************************************************/

#include "CoreAPI\CoreAPI.h"
#include "Library\String_generate.h"
#include "Library\Number.h"
#include "Strings/strings.h"
#include "UI_Manager\UIOP_Lib\uiop_lib.h"

#include "GUI\Menu_system\ms_object.h"
#include "GUI\Menu_system\osd_rendering.h"
#include "GUI\Menu_system\ms_display.h"
#include "GUI\Menu_system\ms_component.h"
#include "GUI\Menu_system\ms_container.h"
#include "GUI\Menu_system\ms_screen.h"
#include "GUI\Object_class\Button\mso_button.h"

#include "Bitmap\bitmap.h"
#include "menu_operation_def.h"
#include "Menu_config\menu_config_common.h"
#include "GUI\Object_class\Text\mso_text.h"

#include "Components\Search_display\o_search_display.h"
#include "Components\Search_display\o_search_display_config.h"
#include "Components\Custom\Search_display\o_search_display_custom.h"

#ifndef DEBUG_UI_TRACE
#undef dbg_printf(sMsg)
#define dbg_printf(sMsg)
#undef	dbgm_printf(sMsg, mode)
#define dbgm_printf(sMsg, mode)
#endif //DEBUG_UI_TRACE

/**************************************************************************
* 	Utility functions
***************************************************************************/
STATIC BOOL _IsTitleChapterValid(UINT16 wTitleNum, UINT16 wChapterNum);
STATIC BOOL _IsTitleTimeValid(UINT32 dwTime);
STATIC UINT16 _GetRepeatNum(void);
STATIC UINT16 _GetRepeatABNum(void);
STATIC BOOL _IsRepeatABAllowed(void);
STATIC BOOL _IsAngleAllowed(void);
STATIC BOOL _IsTimeComponentExist(void);
STATIC BOOL _IsAngleRepeatComponentExist(void);
STATIC BOOL _IsTrackComponentFocusable(void);
STATIC void _DoKeyAction(MS_OP wUIOP);

/**************************************************************************
* 	Operation functions
***************************************************************************/
STATIC MS_OP _SearchDisplayOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _SearchDisplayComponentOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _SearchDisplayTrackComponentOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _BasicTrackEditOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _TitleOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _TitleTextOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _ChapterOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _TrackOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _TrackTextOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _TimeTextOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _BasicTimeEditOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _TimeOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _BtnRepeatOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _BtnRepeatABOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC MS_OP _BtnAngleOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);

/***************************************************************************************
* 	Display functions
****************************************************************************************/
STATIC BOOL _SearchDisplayComponentFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);
STATIC BOOL _TrackFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);
STATIC BOOL _TimeFillOSDSeg(MSO_OBJECT __NEAR* pThis, MS_AREA __NEAR* pAbsArea);
STATIC BOOL _BtnRepeatFillOSDSeg(MSO_OBJECT __NEAR * pThis, MS_AREA __NEAR * pAbsArea);
STATIC BOOL _BtnRepeatABFillOSDSeg(MSO_OBJECT __NEAR * pThis, MS_AREA __NEAR * pAbsArea);
STATIC BOOL _BtnAngleFillOSDSeg(MSO_OBJECT __NEAR * pThis, MS_AREA __NEAR * pAbsArea);

/***************************************************************************************
* 	Utility functions
****************************************************************************************/
#include "Components\Custom\Search_display\o_search_display_custom.c"
#include "Components\Search_display\o_search_display_config.c"

/**********************************************************************************
 * Name			: _IsTitleChapterValid
 *
 * Purpose          	: Check whether the title num and the chapter num are in the range.
 *
 * Input			: wTitleNum		=	group/title number
 *				  wChapterNum	=	track/chapter number
 *
 * Return Value     	: TRUE: The title num and the chapter num are in the range.  FALSE: The title num and the chapter num are out of the range.
 *
 * Description		: refer to purpose
 *
 * Comments		: None.
 *
 **********************************************************************************/
STATIC BOOL _IsTitleChapterValid(UINT16 wTitleNum, UINT16 wChapterNum)
{
	if((wTitleNum < 1) ||(wTitleNum > CoreAPI_GetTotalTitleGroupNum()))
		return FALSE;
	else
	{	
		if ((wChapterNum > CoreAPI_GetTotalChapterTrackNum(wTitleNum)) || (wChapterNum < 1))
			return FALSE;
	}
	return TRUE;
}

/**********************************************************************************
 * Name			: _IsTitleTimeValid
 *
 * Purpose          	: Check whether the title time is in the range.
 *
 * Input			: dwTime - title time number
 *
 * Return Value     	: TRUE: The title time is in the range.  FALSE: The title time is  out of the range.
 *
 * Description		: refer to purpose
 *
 * Comments		: None.
 *
 **********************************************************************************/
STATIC BOOL _IsTitleTimeValid(UINT32 dwTime)
{
	if (dwTime > CoreAPI_GetTotalDiscTitleGroupTime())
		return FALSE;
	else
		return TRUE;
}

/***************************************************************************************
*	Function	: 	_GetRepeatNum
*
*	In		: 	None
*
*	Out		: 	None.
*
*	Return	:	return the current repeat status.
*
*	Desc 	:	This function return the current repeat status.
 **********************************************************************************/
STATIC UINT16 _GetRepeatNum(void)
{
	if (CoreAPI_IsRepeatOff())
		return S_OFF;
	else if (CoreAPI_IsRepeatSingle())
	{
		switch (CoreAPI_GetCurrentMediaType())
		{
			case MEDIA_TYPE_DVD_VIDEO:
				return S_CHAPTER;
				
			default:
				return S_SINGLE;
		}
	}
	else
	{
		switch (CoreAPI_GetCurrentMediaType())
		{
			case MEDIA_TYPE_DVD_VIDEO:
				return S_TITLE;
				
			default:
				return S_ALL;
		}
	}	
}

/***************************************************************************************
*	Function	: 	_GetRepeatABNum
*
*	In		: 	None
*
*	Out		: 	None.
*
*	Return	:	return the current repeatAB status.
*
*	Desc 	:	This function return the current repeatAB status.
 **********************************************************************************/
STATIC UINT16 _GetRepeatABNum(void)
{
	if(CoreAPI_IsRepeatABOff())
	{
		return S_REPEATAB_OFF;
	}
	else if (CoreAPI_IsRepeatABA())
	{
		return S_REPEATAB_A;
	}
	else
	{
		return S_REPEATAB_B;
	}	
}

/***************************************************************************************
*	Function	: 	_IsRepeatABAllowed
*
*	In		: 	None
*
*	Out		: 	None.
*
*	Return	:	if RepeatAB is allowed, return TRUE, else return FALSE.
*
*	Desc 	:	Decide whether the RepeatAB is allowed.
 **********************************************************************************/
STATIC BOOL _IsRepeatABAllowed(void)
{
	switch(CoreAPI_GetCurrentMediaType())
	{
		case MEDIA_TYPE_CLIPS:
			switch (CoreAPI_GetCurrentClipType())
			{
				case eClipType_JPEG:
				case eClipType_WMA:
#ifdef D_OGG_VORBIS
				case eClipType_OGG:
#endif
				case eClipType_None:
					return FALSE;

				default:
					return TRUE;
			}
			
		default:
			return TRUE;
	}
}

/***************************************************************************************
*	Function	: 	_IsAngleAllowed
*
*	In		: 	None
*
*	Out		: 	None.
*
*	Return	:	if angle exist, return TRUE, else return FALSE.
*
*	Desc 	:	Decide whether the angle exist.
 **********************************************************************************/
STATIC BOOL _IsAngleAllowed(void)
{
	switch(CoreAPI_GetCurrentMediaType())
	{
		case MEDIA_TYPE_DVD_VIDEO:
			return TRUE;
			
		default:
			return FALSE;
	}
}

/***************************************************************************************
*	Function	: 	_IsTimeComponentExist
*
*	In		: 	None
*
*	Out		: 	None.
*
*	Return	:	if the time component exist, return TRUE, else return FALSE.
*
*	Desc 	:	Decide whether the time component exist.
 **********************************************************************************/
STATIC BOOL _IsTimeComponentExist(void)
{
	switch(CoreAPI_GetCurrentMediaType())
	{
		case MEDIA_TYPE_DVD_VIDEO:
		case MEDIA_TYPE_VCD:
		case MEDIA_TYPE_SVCD:
			if (CoreAPI_IsFullStop())
				return FALSE;
			else
				return TRUE;
			
		default://Clips
			switch (CoreAPI_GetCurrentClipType())
			{
				case eClipType_MP3:
				case eClipType_CDDA:
				case eClipType_MPEG:
				case eClipType_AVI:
					return TRUE;

				default:
					return FALSE;
			}
	}
}

/***************************************************************************************
*	Function	: 	_IsAngleRepeatComponentExist
*
*	In		: 	None
*
*	Out		: 	None.
*
*	Return	:	if the anglerepeat component exist, return TRUE, else return FALSE.
*
*	Desc 	:	Decide whether the anglerepeat component exist.
 **********************************************************************************/
STATIC BOOL _IsAngleRepeatComponentExist(void)
{
	switch(CoreAPI_GetCurrentMediaType())
	{
		case MEDIA_TYPE_DVD_VIDEO:
		case MEDIA_TYPE_VCD:
		case MEDIA_TYPE_SVCD:
			if (CoreAPI_IsFullStop())
				return FALSE;
			else
				return TRUE;
			
		default://Clips
			switch (CoreAPI_GetCurrentClipType())
			{
				case eClipType_JPEG:
				case eClipType_MPEG:
				case eClipType_AVI:
					return TRUE;

				default:
					return FALSE;
			}
	}
}

/***************************************************************************************
*	Function	: 	_IsTrackComponentFocusable
*
*	In		: 	None
*
*	Out		: 	None.
*
*	Return	:	if the track component has focus, return TRUE, else return FALSE.
*
*	Desc 	:	Decide whether the track component have focus.
 **********************************************************************************/
STATIC BOOL _IsTrackComponentFocusable(void)
{
	switch(CoreAPI_GetCurrentMediaType())
	{
		case MEDIA_TYPE_DVD_VIDEO:
			return TRUE;
			
		case MEDIA_TYPE_VCD:
		case MEDIA_TYPE_SVCD:
			if (CoreAPI_IsSVCDPBCOn())
				return FALSE;
			else
				return TRUE;
			
		default://Clips
			switch (CoreAPI_GetCurrentClipType())
			{
				case eClipType_JPEG:
				case eClipType_MPEG:
				case eClipType_AVI:
					return FALSE;

				default:
					return TRUE;
			}
	}
}

/***************************************************************************************
*	Function	: 	_DoKeyAction
*
*	In		: 	wUIOP
*
*	Out		: 	None.
*
*	Return	:	None.
*
*	Desc 	:	Simulate the key action.
 **********************************************************************************/
STATIC void _DoKeyAction(MS_OP wUIOP)
{
	if ( MS_OP_NONE == MS_SEND_OP(wUIOP, 0) )
		return;
				
	if( NULL != oUIOPFunctionMapTbl[wUIOP & OPERATION_MASK])
		(*oUIOPFunctionMapTbl[wUIOP & OPERATION_MASK])();
}

/***************************************************************************************
* 	Operation functions
****************************************************************************************/

/***************************************************************************************
*	Function 	: 	_SearchDisplayContainerOperation
*
*	In		:
*
*	Out		:
*
*	Desc 	:	The outermost component user operation function.
****************************************************************************************/
STATIC MS_OP _SearchDisplayOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	switch(MsOp)
	{	
		case MS_OP_INIT:
			{
				MSO_SEARCH_DISPLAY_CONTAINER __NEAR* pSearchDisplayContainer = (MSO_SEARCH_DISPLAY_CONTAINER __NEAR*)pThis;

#ifdef D_CLOSE_SEARCH_DISPLAY_WHEN_NO_USER_INPUT
				pSearchDisplayContainer->moParam.mwCloseSearchDisplayTimeOut = CLOSE_SEARCH_DISPLAY_TIMEOUT_SECONDS * 10;
#endif
				switch (CoreAPI_GetCurrentMediaType())
				{
					case MEDIA_TYPE_DVD_VIDEO:
						MS_ComponentOpen(	(MS_DESCRIPTOR_COMPONENT*)&oSearchDisplayTitleChapterDescriptor, 
																				(MSO_CONTAINER __NEAR*)pThis);
						pSearchDisplayContainer->moParam.mwComponentType = eComponentTypeTitleChapterOrTrack;
						break;
							
					case MEDIA_TYPE_VCD:
					case MEDIA_TYPE_SVCD:
						MS_ComponentOpen(	(MS_DESCRIPTOR_COMPONENT*)&oSearchDisplayTrackDescriptor, 
																				(MSO_CONTAINER __NEAR*)pThis);

⌨️ 快捷键说明

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