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

📄 screenprocessing.c

📁 Zoran V966 DVD 解码 Soc芯片的源程序
💻 C
📖 第 1 页 / 共 2 页
字号:
/* **************************************************************************************
*  Copyright (c) 2004 ZORAN Corporation, All Rights Reserved
*  THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
*  File: $Workfile$
*
* 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"

// Included CORE files
#include "Playcore\Coremain\coredefs.h"
#include "playcore\scpad\scmgr.h"
#include "Playcore\Coremain\BrowseHandler.h"
#include "Playcore\ps\ps.h"
//#include "Playcore\Coremain\CoreGDef.h"

// Included CORE API files
#include "CoreAPI\CoreAPI.h"
#include "CoreAPI\DeviceManager.h"

// Included UI MENU SYSTEM files
#include "GUI\Menu_system\ms_menu.h"
#include "GUI\Menu_system\ms_screen.h"
#include "Menu_config\menu_config_common.h"

// Included CUSTOMER files
#include "Runtime\run_time_menu.h"
#include "Clips\clips_menu.h"
#include "Setup\setup_menu.h"
#include "Components\Message\o_message_handler.h"
#include "Components\Screen_saver\o_ssaver.h"
#include "Components\Firmware_upgrade\o_firmware_upgrade.h"
#include "Menu\menu_operation_def.h"
#include "Strings\Strings.h"
#include "Screen\ScreenProcessing.h"
#include "Screen\menu_manager.h"
#include "UI_Manager\UIOP_Lib\uiop_lib.h"
#include "gui\Components\Playmode\o_playmode.h"
#ifdef D_GUI_COMPONENT_PROGRAM
#include "Components\Program\o_program.h"
#endif

#ifdef D_GINGER_I86
#include "Decoder\OSDLayou.h"
#include "Decoder\decoder.h"
#endif //D_GINGER_I86
#ifdef D_GINGER_I96
#include "OSDLayou.h"
#endif //D_GINGER_I96

#ifdef TV_GUARDIAN_ENABLE
#include "Kernel\EventDef.h"
#include "Playcore\TVG\TVGAPI.h"
#endif // TV_GUARDIAN_ENABLE
// <<< ITA_YO_0001G : Customizing of loader spinning. Sync saver to spin down.
#ifdef D_SYNC_SPINDOWN_TO_OSDSAVER
#include "Kernel\eventdef.h"
#endif
// >>> ITA_YO_0001G : Customizing of loader spinning. Sync saver to spin down.


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

// Include configuration header file: named constants, macros and typedefs.
#include "Screen\ScreenProcessing_config.h"
// Include custom header file: customer specific definitions, over-writing common ones.
#include "Screen\Custom\ScreenProcessing_custom.h"

/**************************************************************************
*	Static macro declaration
***************************************************************************/
#define MS_IsScreenPal		MS_IsGeneralPurpose1
#define MS_SetScreenPal		MS_SetGeneralPurpose1
#define MS_ClearScreenPal	MS_ClearGeneralPurpose1

#define MS_IsEnableUserOp	MS_IsGeneralPurpose2
#define MS_EnableUserOp		MS_SetGeneralPurpose2
#define MS_DisableUserOp	MS_ClearGeneralPurpose2

/****************************************************************************************************
*	DEFINITION: Public (global) variables
****************************************************************************************************/
UINT16 __NEAR wDeviceIdCurrent;
UINT16 __NEAR wDeviceIdRequested;


/**************************************************************************
*	Static functions declaration
***************************************************************************/
static MS_OP _ScreenOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _ScreenMsOpTranslator(MSO_OBJECT __NEAR* pThis, MS_OP  MsOp, UINT32 lParam);
static MS_OP _ScreenPostUserOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
static MS_OP _ScreenSSaverOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam);
STATIC void _ScreenSaverStartTimer(void);
STATIC void _ScreenRestartPlayback(void);

// Include custom code file: customer specific code, over-writing common one.
#include "Screen\Custom\ScreenProcessing_custom.c"
// Include configuration file: constants.
#include "Screen\ScreenProcessing_config.c"

/**************************************************************************
*	Screen descriptor for the whole project
***************************************************************************/
static CONST MS_DESCRIPTOR_SCREEN oScreenDescriptor =
{
	{
		sizeof(MSO_SCREEN),
		MS_NAV_NULL,
		MS_ATTR_CONTAINER | MS_ATTR_FOCUSABLE | MS_ATTR_FOCUS, // Attributes
		{
			0, 0, 720, 560,
		},
		SCREENPROC_ScreenOperation,
		mpfFillOsdSegNull,
		mpParamNull 
	},
	maContentsNull,
	mwNbrContentsNull
};
	
/**************************************************************************
*	Public functions definition
***************************************************************************/

/**************************************************************************
*	Function	:	SCREENPROC_OpenScreen
*	In		:	
*	Out		:	
*	Desc	:	
 ***************************************************************************/
void SCREENPROC_OpenScreen(void)
{
	dbg_printf(( "\nSCREENPROC_OpenScreen" ));
	// Initialise the screen descriptor
	((MSO_OBJECT __NEAR*)gpScreen)->mpDescriptor = (MS_DESCRIPTOR*)(&oScreenDescriptor);
	// Open the screen (allocation of memory for OSD areas to refresh, other MS variables...	
	MS_SendOp(MS_OP_SCREEN_OPEN, 0);
#ifdef OSD_ALLOW_ONLY_BIG_OSD_BUFF_MENUS
    OSDSetWriteToBuffProhibited(TRUE );
#endif
	MS_SendOp(MS_OP_OPEN, MENU_ID_RUNTIME);
}
/**************************************************************************
*	Function	:	SCREENPROC_OpenScreen
*	In		:	
*	Out		:	
*	Desc	:
 ***************************************************************************/
void SCREENPROC_CloseScreen(void)
{
	dbg_printf(( "\nSCREENPROC_CloseScreen" ));
	// Close the screen (allocation of memory for OSD areas to refresh, other MS variables...	
	MS_SendOp(MS_OP_SCREEN_CLOSE, 0);
}
/**************************************************************************
*	Function	:	SCREENPROC_OpenScreen
*	In		:	
*	Out		:	
*	Desc	:	
 ***************************************************************************/
BOOL SCREENPROC_MessageIsDisplayed (MS_OP MsOpMsg)
{
	MS_OP MsOpMsgSearch= MsOpMsg;

	MS_SendOp(MS_OP_IS_MSG_DISPLAYED, (UINT32)(&MsOpMsgSearch));

	if (MsOpMsg == MsOpMsgSearch)
		return 0;
	return 1;
}
/**************************************************************************
*	Function	:	SCREENPROC_ScreenOperation
*	In		:	
*	Out		:	
*	Desc	:	
 ***************************************************************************/
#pragma argsused
MS_OP SCREENPROC_ScreenOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{		
	// Transmit MS_OP of class message to the message handler only to save the stack
	if (MS_IS_MSG_OP(MsOp))
	{
		MSO_OBJECT __NEAR* pObjectMessageHandler;

		pObjectMessageHandler = MS_FindDescendant(pThis, &oDescriptorMessageHandler);
		if (NULL != pObjectMessageHandler)
		{
			MS_SendOperation(pObjectMessageHandler, MsOp, lParam);
		}
		return MS_OP_NONE;
	}

	MsOp = _ScreenSSaverOperation(pThis, MsOp, lParam);
	MsOp = _ScreenMsOpTranslator(pThis, MsOp, lParam);
	MsOp = _ScreenOperation(pThis, MsOp, lParam);

	// Post-processing project screen operation override
	// User operations require handling here only if not handled elsewhere.
	MsOp = _ScreenPostUserOperation(pThis, MsOp, lParam);

	MsOp = MENU_MANAGER_Operation(pThis, MsOp, lParam);
	return(MsOp);
}

/**************************************************************************
*	Function	:	_ScreenCoreOperation
*	In		:	
*	Out		:	
*	Desc	:	
 ***************************************************************************/
#ifndef D_CUSTOM__ScreenOperation
#pragma argsused
static MS_OP _ScreenOperation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
	if(!MS_IsEnableUserOp(pThis) && MS_IS_USER_OP(MsOp))
	{
		switch(MsOp)
		{
		case MS_OP_EJECT: // Fall Through !!!
		case MS_OP_POWER:
			break;
			
		default:
			PROHIBIT(MSG_PROHIBIT_NOT_ALLOWED_NOW);
			return MS_OP_NONE;			
		}
	}

	// Pre-processing
	switch(MsOp)
	{
	case MS_OP_OPEN:
		MS_EnableUserOp(pThis);
		break;

	case MS_OP_MENU_ENABLE_USE_OP:
		if (lParam)
			MS_EnableUserOp(pThis);
		else
			MS_DisableUserOp(pThis);
		return MS_OP_NONE;

	case MS_OP_MENU_SET_REQUESTED_DEVICE:
		wDeviceIdRequested = (UINT16)lParam;
		return MS_OP_NONE;
		
	/*case MS_OP_DEVICE_SWITCH:
		// Ask the active menu to stop the current playback
		// Need to do from the screen to be able to switch runtime to browser in clips
		// No condition, always do stop for filesystem
		MS_SendOp(MS_OP_MENU_STOP, 0);
		break;*/
		
	case MS_OP_CORE_REFRESH_DEVICE_LIST:
		{
			UINT16 wDeviceId = (UINT16)lParam;
		
			if (DEVICE_DISC == wDeviceId)
			{				
				switch (DeviceManager_GetDeviceState(wDeviceId))
				{
				case DEVICE_TRAY_OPENING:
					CoreAPI_Stop();
					MS_SendOp(MS_OP_OPEN_MENU, MENU_ID_RUNTIME);
					if (wDeviceId == wDeviceIdCurrent)
					{
						wDeviceIdCurrent = 0xFFFF;
					}
					break;

				case DEVICE_IDENTIFIED:
					if (DeviceManager_IsAllowedContructDevice(wDeviceId))
					{
						MS_DisableUserOp(pThis);
						DeviceManager_ContructDevice(wDeviceId);
					}
					break;
					
				// In case no media or unknown media, we don't cache, so need to display the message here (only for disc)
				case DEVICE_NO_DEVICE:
					if (MEDIA_TYPE_NOMEDIA == DeviceManager_GetMediaType(wDeviceId))
					{
#ifdef TV_GUARDIAN_ENABLE
						if((!CoreAPI_TVGIsActivated())&&(0 !=CoreAPI_GetTVGRemindCounter())&&!CoreAPI_TVGAdvertisementHasBeenDisplayed())
							{
							MS_SEND_OP(MS_OP_MENU_TVG_ADVERTISEMENT,NULL);
							CoreAPI_TVGAdvertisementSetHasBeenDisplayed(TRUE);
						}
#endif // TV_GUARDIAN_ENABLE
						MS_SendOp(MS_OP_MSG_DEVICE_MEDIA, MSG_DEVICE_MEDIA_NO_DISK);
					}
					break;
					
					// In case no media or unknown media, we don't cache, so need to display the message here (only for disc)
				case DEVICE_UNKNOWN:
					if (MEDIA_TYPE_UNKNOWN == DeviceManager_GetMediaType(wDeviceId))
						MS_SendOp(MS_OP_MSG_DEVICE_MEDIA, MSG_DEVICE_MEDIA_BAD_DISK);
					break;

				default:
					break;
				}

			}
#ifdef FTA_SUPPORT
			else if (DEVICE_FTA == wDeviceId)
			{
				if (DeviceManager_IsAllowedContructDevice(wDeviceId))
				{
					MS_DisableUserOp(pThis);
					DeviceManager_ContructDevice(wDeviceId);
                
				}
				break;
			}
#endif // FTA_SUPPORT

			// Other device than DISC
#ifdef SUPPORT_FLASH_CARD
			else
			{
				if (DEVICE_REMOVED == DeviceManager_GetDeviceState(wDeviceId))
				{
					switch(DeviceManager_GetDeviceType(wDeviceId))
					{
					case DEVICE_TYPE_SD:
					case DEVICE_TYPE_MMC: 
					case DEVICE_TYPE_MS:
					case DEVICE_TYPE_MSPRO:
					case DEVICE_TYPE_CF:
					case DEVICE_TYPE_SM:
					case DEVICE_TYPE_XD:
						MS_SendOp(MS_OP_MSG_DEVICE_MEDIA, MSG_DEVICE_MEDIA_CARD_REMOVED);
						break;
					case DEVICE_TYPE_USB:
						MS_SendOp(MS_OP_MSG_DEVICE_MEDIA, MSG_DEVICE_MEDIA_USB_REMOVED);
						break;	
					default:
						break;
					}
					
					if (DeviceManager_IsAllowedDestructUSBCard(wDeviceId))
					{
						// !!! API SEQUENCE: Close the menu (destruct the directory) before destructing the device
						// TODO: when multipage, maybe another device is playing in the clips
						if (wDeviceId == wDeviceIdCurrent)
						{
							MS_MenuClose((MS_DESCRIPTOR_MENU *)MENU_ID_CLIPS);
							MS_SendOp(MS_OP_OPEN_MENU, MENU_ID_RUNTIME);
							wDeviceIdCurrent = 0xFFFF;
						}
					   	DeviceManager_DestructUSBCard(wDeviceId);
					
						/*if (wDeviceId == wDeviceIdCurrent)
						{
							wDeviceIdCurrent = 0xFFFF;
							// If the disc is present switch ot it and the only device, else go to Runtime menu
							if (		(DEVICE_IDENTIFIED == DeviceManager_GetDeviceState(DEVICE_DISC))
								&& 	(1 == DeviceManager_GetNumberDevices())) 
							{
								if (DeviceManager_WaitBHIdle())
								{
									MS_DisableUserOp(pThis);
									DeviceManager_ContructDevice(DEVICE_DISC);
								}
							}
						}*/
					}
					else
					{
						BREAK_POINT();
					}					
								
				}
				else if (DEVICE_UNKNOWN == DeviceManager_GetDeviceState(wDeviceId))
				{
					switch (DeviceManager_GetDeviceType(wDeviceId))
					{
					case DEVICE_TYPE_USB:
						MS_SendOp(MS_OP_MSG_DEVICE_MEDIA, MSG_DEVICE_MEDIA_BAD_USB);
						//MS_SendOp(MS_OP_MSG_ERROR_UNSUPPORTED_USB, 0);
						break;
						
					case DEVICE_TYPE_SD:
					case DEVICE_TYPE_MMC:
					case DEVICE_TYPE_MS:
					case DEVICE_TYPE_MSPRO:
					case DEVICE_TYPE_CF:
					case DEVICE_TYPE_SM:
					case DEVICE_TYPE_XD:
						MS_SendOp(MS_OP_MSG_DEVICE_MEDIA, MSG_DEVICE_MEDIA_BAD_CARD);
						break;

					default:
						break;
					}
					

⌨️ 快捷键说明

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