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

📄 run_time_menu.c

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

#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 <stdio.h>
#include "include\math-macro.h"

// Included UI-CORE API files
#include "Playcore\Coremain\coremain.h"
#include "Playcore\Coremain\coregdef.h"
#include "CoreAPI\CoreAPI.h"
#include "CoreAPI\DeviceManager.h"

// Included UI LOW LEVEL files
#ifdef D_GINGER_I86
#include "Decoder\OSDLayou.h"
#endif //D_GINGER_I86
#ifdef D_GINGER_I96
#include "OSDLayou.h"
#endif //D_GINGER_I96

// Included UI MENU SYSTEM files
#include "GUI\Menu_system\ms_menu.h"
#include "GUI\Menu_system\osd_rendering.h"
#include "GUI\Menu_system\ms_display.h"
#include "GUI\Menu_system\ms_screen.h"
#include "GUI\Menu_system\ms_component.h"
#include "GUI\Object_class\Hscroll\mso_hscroll_text.h"

#include "Menu\menu_operation_def.h"
#include "Menu_config\menu_config_common.h"

// Included CUSTOMER files
#include "Components\Bass_manager\o_bass_mgr.h"
#include "Components\Bookmark\o_bookmark.h"
#include "Components\Display\o_display.h"
#include "Components\Dynamic_range_control\o_drc.h"
#include "Components\Password\o_password_prompt.h"
#include "Components\Prologic\o_prologic2.h"
#include "Components\Search\o_search.h"
#include "Components\Search_display\o_search_display.h"
#include "Components\Karaoke\o_karaoke.h"
#include "Components\Firmware_upgrade\o_firmware_upgrade.h"
#include "Components\Message\o_message_handler.h"
#include "Components\Volume_control\o_volume_control.h"
#ifdef D_GUI_COMPONENT_TITLE_SELECT
#include "Components\VR_Title_Select\o_Title_Select.h"
#endif // D_GUI_COMPONENT_TITLE_SELECT
#include "Components\Device_switch\o_device_switch.h"
#include "Components\Playmode\o_playmode.h"
#include "Playcore\PlayMode\playmode.h"
#ifdef D_GUI_COMPONENT_PROGRAM
#include "Components\Program\o_program.h"
#endif
#ifdef TV_GUARDIAN_ENABLE
#include "Components\TV_guardian\o_tvguardian.h"
#include "Playcore\TVG\TVGAPI.h"
#endif // TV_GUARDIAN_ENABLE
#ifdef D_DISPLAY_ALL_VERSIONS
#include "Menu\Components\o_display_versions.h"
#endif//D_DISPLAY_ALL_VERSIONS
#ifdef D_GUI_COMPONENT_BRIGHTNESS_EDGE_CONTROLLER
#include "Components\Brightness_edge_controller\o_brightness_edge_controller.h"
#endif //D_GUI_COMPONENT_BRIGHTNESS_EDGE_CONTROLLER
#ifdef FTA_SUPPORT
#include "Customer\User_interface\GUI\Components\FTA_Selection\O_FTA_Selection.h"
#include "Customer\User_interface\GUI\Components\FTA_Channel_Tab\O_FTA_Channel_Tab.h"
#include "Customer\User_interface\GUI\Components\FTA_Channel_Display\O_FTA_Channel_Display.h"
#ifdef FTA_SATELLITE
#include "Customer\User_interface\GUI\Components\FTA_Transport_Tab\O_FTA_Transport_Tab.h"
#endif // FTA_SATELLITE
#endif

#if D_SUPPORT_SACD
#include "Components\Sacd\o_sacd.h"
#endif // D_SUPPORT_SACD

#ifdef D_GUI_COMPONENT_DVDVR
#include "Components\Dvdvr\o_dvdvr.h"
#endif // D_GUI_COMPONENT_DVDVR

#include "GUI\Resource\Bitmap\bitmap.h"
#ifndef DEBUG_UI_TRACE
#undef dbg_printf(sMsg)
#define dbg_printf(sMsg)
#undef	dbgm_printf(sMsg, mode)
#define dbgm_printf(sMsg, mode)
#endif

// Include the module header file
#include "Runtime\run_time_menu.h"
// Include configuration header file: named constants, macros and typedefs.
#include "Runtime\run_time_menu_config.h"
// Include custom header file: customer specific definitions, over-writing common ones.
#include "Custom\Runtime\run_time_menu_custom.h"

/***************************************************************************************
* 	Private Named constants
****************************************************************************************/
/***************************************************************************************
* 	Private Macros
****************************************************************************************/
/***************************************************************************************
* 	Private typdef definitions.
****************************************************************************************/
/***************************************************************************************
* 	Public global variables ARE FORBIDDEN
****************************************************************************************/
/***************************************************************************************
* 	Private static variable declaration ARE FORBIDDEN under normal circumstances.
****************************************************************************************/
/***************************************************************************************
* 	Private static functions declaration
****************************************************************************************/
BOOL LayoutRuntime(void);

/***************************************************************************************
* 	Private static functions declaration
****************************************************************************************/
static MS_OP _MenuOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _PopupContainerOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
#ifdef FTA_SUPPORT
static BOOL _FtaIsMsOpAllowed( UINT16 uiMsOP );
#endif //FTA_SUPPORT

// Include custom code file: customer specific code, over-writing common one.
#include "Custom\Runtime\run_time_menu_custom.c"
// Include configuration file: constants.
#include "Runtime\run_time_menu_config.c"

/***************************************************************************************
* 	Private static functions declaration
****************************************************************************************/

/***************************************************************************************
*	Function 	: 	LayoutRuntime
*
*	In		: 	None
*
*	Out		: 	TRUE if successful.
*
*	Desc 	:	Sets layout for the menu.
 ****************************************************************************************/
#ifndef D_CUSTOM_LayoutRuntime
 /***************************************************************************************/
BOOL LayoutRuntime (void)
{
#ifdef D_GINGER_I96
	go_CurrentLayout.m_bBigMemMap 	= OSD_LAYOUT_MEM_MAP_SMALL;
#endif
#ifdef D_CD_GRAPHIC_ENABLED
	go_CurrentLayout.m_bOSDBufferNum = OSD_BUFFER_0;
#endif//D_CD_GRAPHIC_ENABLED

	OSDAdaptPixResolutionToProgressive();

	OSDClearArea();
	OSDAddArea(&OsdMessageLayoutArea);
	OSDAddArea(&OsdLayoutAreaPopup);
	//OSDAddArea(&OsdDisplayLayoutArea);
	OSDSetLayout();
	OSDAdaptDisplayRangeToVideoStandard();	

	return(TRUE);
}
 /***************************************************************************************/
#endif //D_CUSTOM

/***************************************************************************************
*	Function 	: 	_LayoutFirmwareUpgrade
*
*	In		: 	None
*
*	Out		: 	TRUE if successful.
*
*	Desc 	:	Sets layout for the menu.
 ****************************************************************************************/
#ifdef D_GUI_SINGLE_LINE_COMPONENT
#ifndef D_CUSTOM__LayoutFirmwareUpgrade
static BOOL _LayoutFirmwareUpgrade(void)
{
#ifdef D_GINGER_I96
	go_CurrentLayout.m_bBigMemMap 	= OSD_LAYOUT_MEM_MAP_LARGE;
#endif
#ifdef D_CD_GRAPHIC_ENABLED
	go_CurrentLayout.m_bOSDBufferNum = OSD_BUFFER_0;
#endif//D_CD_GRAPHIC_ENABLED
	OSDAdaptPixResolutionToProgressive();
	OSDClearArea();
	OSDAddArea(&OsdFirmwareUpdLayoutArea);
	OSDSetLayout();
	OSDAdaptDisplayRangeToVideoStandard();	
	return(TRUE);
}
#endif //D_CUSTOM
#endif//#ifdef D_GUI_SINGLE_LINE_COMPONENT

/***************************************************************************************
*	Function 	: 	_LayoutProgram
*
*	In		: 	None
*
*	Out		: 	TRUE if successful.
*
*	Desc 	:	Sets layout for the program component.
 ****************************************************************************************/
#ifdef D_GUI_COMPONENT_PROGRAM
#ifdef D_GUI_SINGLE_LINE_COMPONENT
static BOOL _LayoutProgram(void)
{
#ifdef D_GINGER_I96
	go_CurrentLayout.m_bBigMemMap 	= OSD_LAYOUT_MEM_MAP_LARGE;
#endif
#ifdef D_CD_GRAPHIC_ENABLED
	go_CurrentLayout.m_bOSDBufferNum = OSD_BUFFER_0;
#endif//D_CD_GRAPHIC_ENABLED

	OSDAdaptPixResolutionToProgressive();
	OSDClearArea();
	OSDAddArea(&OsdProgramLayoutArea);
	OSDSetLayout();
	OSDAdaptDisplayRangeToVideoStandard();	
	return(TRUE);
}
#endif//#ifdef D_GUI_SINGLE_LINE_COMPONENT
#endif

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

/***************************************************************************************
*	Function	: 	_MenuOperation
*
*	In		: 	pThis	=	Pointer to the Clips Menu (MSO_CLIPS_MENU) object.
*
*				MsOp	=	Operation ID.
*
*				lParam	=	Parameter associated with an MS_OP if any.
*
*	Out		: 	None.
*
*	Return	:	ID of the operation that is to be propagated once processing is done, 
*				otherwise MS_OP_NONE.
*
*	Desc 	:	This function processes all operations/events  of the runtime Menu.
****************************************************************************************/
#ifndef D_CUSTOM__MenuOperation
 /***************************************************************************************/
static MS_OP _MenuOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{		
	// Pre-processing
	switch(MsOp)
	{
	case MS_OP_MENU_CLOSE_POPUP_COMPONENT:
		{		
			// This message is received by the runtime menu when another device is about to be loaded.
			// The Runtime menu must close all popups at this time.
			
			// Empty the Popup container.
			MSO_OBJECT __NEAR* pObject = MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pThis, (MS_DESCRIPTOR*)&oPopupContainerDescriptor);
			if(FALSE == MS_IsEmpty((MSO_CONTAINER __NEAR*)pObject))
				MS_SendOperation(pObject, MS_OP_EMPTY, 0);

			// Close DVD-VR, SACD components.
#if D_SUPPORT_SACD
			if(NULL != MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pThis, (MS_DESCRIPTOR*)&oSACDDescriptor))
				MS_ComponentClose((MS_DESCRIPTOR_COMPONENT*)&oSACDDescriptor, FALSE);
#endif // D_SUPPORT_SACD

#ifdef D_GUI_COMPONENT_DVDVR
			if(NULL != MS_FindObjectFromDescriptor((MSO_CONTAINER __NEAR*)pThis, (MS_DESCRIPTOR*)&oDVDVRDescriptor))
				MS_ComponentClose((MS_DESCRIPTOR_COMPONENT*)&oDVDVRDescriptor, FALSE);
#endif // D_GUI_COMPONENT_DVDVR			
		}
		return MS_OP_NONE;
		
	default:
		break;
	}
	
	MsOp = MS_MenuBasicOperation(pThis, MsOp, lParam);

	// Post-processing.
#ifdef FTA_SUPPORT
    if( _FtaIsMsOpAllowed(MsOp) == FALSE )
    {
        PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
        return MS_OP_NONE;
    }
#endif // FTA_SUPPORT

	switch(MsOp)
	{
#ifdef D_MULTI_CDDA_SHUFFLE_PLAY
	case MS_OP_MULTI_CDDA_SHUFFLE:
		// prohibit for non-CDDA disc 
		PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
		return MS_OP_NONE;
#endif // D_MULTI_CDDA_SHUFFLE_PLAY

#if D_SUPPORT_SACD
	case MS_OP_CORE_CACHE_FINISHED:
		{
			if(MEDIA_TYPE_SACD == DeviceManager_GetMediaType((UINT16)lParam))
			{				
				OSACD_OpenAtPos((MSO_CONTAINER __NEAR*)pThis, DEFAULT_POSITION, DEFAULT_POSITION);
			}			
		}
		break;
#endif // D_SUPPORT_SACD

#ifdef D_GUI_COMPONENT_DVDVR	
	case MS_OP_MENU: // Fall Through !!!
	case MS_OP_TITLE: // Fall Through !!!
		{
			if(CoreAPI_IsMenuAllowedDVDVR())
			{
				MSO_OBJECT __NEAR* pObject;

				// Do not open the DVD-VR component if any of the following condition is satisfied:
				// 1. MENU key was pressed but the User Defined Program chain is empty.
				// 2. TITLE key was pressed but the Original Program chain is empty.
				if((MS_OP_MENU == MsOp) && !CoreAPI_GetDVDVRMaxPlayListNum())
				{
					MS_SendOp(MS_OP_MSG_ERROR_EMPTY_PROGRAM_CHAIN, DVDVR_MSG_EMPTY_PLAY_LIST);
					return MS_OP_NONE;
				}
				else if((MS_OP_TITLE == MsOp) && !CoreAPI_GetDVDVRMaxProgramNum())
				{
					MS_SendOp(MS_OP_MSG_ERROR_EMPTY_PROGRAM_CHAIN, DVDVR_MSG_EMPTY_PROGRAM_LIST);
					return MS_OP_NONE;
				}
					
				// Close all pop-up windows before opening the DVD-VR component.
				pObject = MS_FindDescendant(pThis, &oPopupContainerDescriptor);
				if(FALSE == MS_IsEmpty((MSO_CONTAINER __NEAR*)pObject))
					MS_SendOperation(pObject, MS_OP_EMPTY, 0);

#ifdef D_GUI_COMPONENT_DISPLAY
				// The Display component should not be displayed at the same instant that the DVD-VR component is displayed.
				MS_ComponentClose((MS_DESCRIPTOR_COMPONENT*)&oComponentDisplay, FALSE);
#endif // D_GUI_COMPONENT_DISPLAY				
				
				ODVDVR_OpenAtPos((MSO_CONTAINER __NEAR*)pThis, DEFAULT_POSITION, DEFAULT_POSITION, (MS_OP_TITLE == MsOp));

				// Stop playback.
				if(PST_STOP != CoreAPI_GetPlayState())
					return MS_OP_STOP;
				else
					return MS_OP_NONE;
			}
		}
		break;
#endif // D_GUI_COMPONENT_DVDVR

⌨️ 快捷键说明

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