?? o_message_device.c
字號:
/****************************************************************************************************
* Copyright (c) 2005 ZORAN Corporation, All Rights Reserved
* THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF ZORAN CORPORATION
*
* File: o_message_device.c
*
* Description:
* =========
*
****************************************************************************************************/
/****************************************************************************************************
* INCLUDE FILES
****************************************************************************************************/
#include "Components\Message\o_message_device.h"
/***************************************************************************************
* Include customization file.
****************************************************************************************/
// Include custom code file: customer specific code, over-writing common one.
#include "Components\Custom\Message\o_message_device_custom.c"
/****************************************************************************************************
* DEFINITION: Private named constants
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Private macros
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Private typedefs
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Public (global) variables
****************************************************************************************************/
/****************************************************************************************************
* DEFINITION: Private (static) variables
****************************************************************************************************/
/****************************************************************************************************
* DECLARATION: Private (static) functions
****************************************************************************************************/
STATIC MSG_DEVICE_MEDIA_TYPE_PARAM _GetMediaTypeMsg(UINT16 wDeviceId);
static CONST UINT8 * _GetDeviceIcon(UINT16 wDeviceId);
/****************************************************************************************************
* DEFINITION: Public functions
****************************************************************************************************/
/****************************************************************************************************
* Function : Name
*
* Input : Parameter_1 - description
* Parameter_2 - description
*
* Output : Parameter_3 - description
* Parameter_4 - description
*
* Return : Describe_possible_returned_values_and_their_meaning
*
* Description : Describe_what_the_function_does_in_English
*
****************************************************************************************************/
MS_OP OMESSAGE_DEVICE_Operation(MSO_OBJECT __NEAR* pThis, MS_OP MsOp, UINT32 lParam)
{
FORMATED_UNICODE_STRING oFormUniStr;
MSO_MESSAGE_DEVICE __NEAR *pDeviceMessage = (MSO_MESSAGE_DEVICE __NEAR*)pThis;
OSD_MESSAGES eMsg = S_NULL;
MSO_MESSAGE __NEAR* pMessage = (MSO_MESSAGE __NEAR*)pThis;
MS_DESCRIPTOR_MESSAGE *pMessageDescriptor = (MS_DESCRIPTOR_MESSAGE*)(pThis->mpDescriptor);
BOOL bSaveAndUpdate = TRUE;
// Initialize oFormUniStr, if no font index, then OSDR_GetFormUniStr_OsdMessage will be wrong
oFormUniStr.mtFontIndex = FONT_MESSAGE;
oFormUniStr.mszUniStr[0] = 0;
switch(MsOp)
{
case MS_OP_TICK:
bSaveAndUpdate = FALSE;
if (pMessage->moParam.mwCoreTimer)
break;
switch(pMessage->moParam.mMsOpMsg)
{
case MS_OP_MSG_DEVICE_EJECTING:
if (DEVICE_TRAY_OPENING == DeviceManager_GetDeviceState(DEVICE_DISC))
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
else
pMessage->moParam.mwTimer = 1;
break;
case MS_OP_MSG_DEVICE_CLOSING:
if (DEVICE_TRAY_CLOSING == DeviceManager_GetDeviceState(DEVICE_DISC))
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
else
pMessage->moParam.mwTimer = 1;
break;
case MS_OP_MSG_DEVICE_LOADING:
if (INVALID_DEVICEID != DeviceManager_GetLoadingDevice())
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
else
pMessage->moParam.mwTimer = 1;
break;
case MS_OP_NONE:
if (!CoreAPI_IsMediaReady())
{
if ((MEDIA_TYPE_NOMEDIA == DeviceManager_GetMediaType(DEVICE_DISC))
&& (DEVICE_NO_DEVICE == DeviceManager_GetDeviceState(DEVICE_DISC)))
_DisplayMessageOnTick(pThis, MS_OP_MSG_DEVICE_MEDIA, MSG_DEVICE_MEDIA_NO_DISK);
if (MEDIA_TYPE_UNKNOWN == DeviceManager_GetMediaType(DEVICE_DISC))
_DisplayMessageOnTick(pThis, MS_OP_MSG_DEVICE_MEDIA, MSG_DEVICE_MEDIA_BAD_DISK);
}
if (DEVICE_TRAY_CLOSING == DeviceManager_GetDeviceState(DEVICE_DISC))
_DisplayMessageOnTick(pThis, MS_OP_MSG_DEVICE_CLOSING, 0);
if (INVALID_DEVICEID != DeviceManager_GetLoadingDevice())
{
_DisplayMessageOnTick(pThis, MS_OP_MSG_DEVICE_LOADING, DeviceManager_GetLoadingDevice());
}
break;
default:
break;
}
break;
case MS_OP_MSG_DEVICE_EJECTING: // The device/tray has been ejected/opened.
eMsg = S_EJECT;
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
pMessage->moParam.mpIcon = BMP_MESSAGE_DEVICE_DISC;
break;
case MS_OP_MSG_DEVICE_CLOSING: // The tray is closing.
eMsg = S_CLOSE;
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
pMessage->moParam.mpIcon = BMP_MESSAGE_DEVICE_DISC;
break;
case MS_OP_MSG_DEVICE_LOADING: // The device/tray has been loaded/closed.
eMsg = S_LOADING;
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
pMessage->moParam.mpIcon = _GetDeviceIcon((UINT16)lParam);
break;
case MS_OP_MSG_DEVICE_MEDIA_CURRENT:
// Get the current disc type and handle as MS_OP_MSG_DEVICE_MEDIA
lParam = _GetMediaTypeMsg((UINT16)lParam);
#ifdef D_MULTI_CDDA_SHUFFLE_PLAY
if (CoreAPI_IsMultiCDDAShufflePlay())
{
if (eClipType_CDDA != CoreAPI_GetCurrentClipType())
{
lParam = MSG_DEVICE_MEDIA_BAD_DISK;
}
}
#endif
MsOp = MS_OP_MSG_DEVICE_MEDIA;
case MS_OP_MSG_DEVICE_MEDIA: // The media type has changed.
//set message icon according device type
pMessage->moParam.mpIcon = _GetDeviceIcon(DeviceManager_GetCurrentDevice());
switch(lParam)
{
case MSG_DEVICE_MEDIA_DVDV:
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
#ifdef D_MINI_DVD
if(CoreAPI_IsDiscTypeMiniDVD())
eMsg = S_MINI_DVD;
else
#endif // D_MINI_DVD
eMsg = S_DVD;
break;
#ifdef DVD_AUDIO_SUPPORT
case MSG_DEVICE_MEDIA_DVDA:
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
eMsg = S_DVD_AUDIO;
break;
#endif // DVD_AUDIO_SUPPORT
#ifdef DVD_VR_SUPPORT
case MSG_DEVICE_MEDIA_DVDVR:
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
eMsg = S_DVD_VR;
break;
#endif // DVD_VR_SUPPORT
#if D_SUPPORT_SACD
case MSG_DEVICE_MEDIA_SACD:
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
eMsg = S_SACD;
break;
#endif // D_SUPPORT_SACD
// TODO: Rename this timeout into OMESSAGE_DEVICE_VCD_TIMEOUT
case MSG_DEVICE_MEDIA_SVCD:
#ifdef D_GUI_MESSAGE_TIMEOUT_DISTINGUISH_MEDIA_VCD
pMessage->moParam.mwTimer = D_GUI_MESSAGE_TIMEOUT_MEDIA_VCD_DISPLAY_TIME;
#else
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
#endif
eMsg = S_SVCD;
break;
case MSG_DEVICE_MEDIA_VCD:
#ifdef D_GUI_MESSAGE_TIMEOUT_DISTINGUISH_MEDIA_VCD
pMessage->moParam.mwTimer = D_GUI_MESSAGE_TIMEOUT_MEDIA_VCD_DISPLAY_TIME;
#else
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
#endif
eMsg = S_VCD;
break;
case MSG_DEVICE_MEDIA_VCD1P1:
#ifdef D_GUI_MESSAGE_TIMEOUT_DISTINGUISH_MEDIA_VCD
pMessage->moParam.mwTimer = D_GUI_MESSAGE_TIMEOUT_MEDIA_VCD_DISPLAY_TIME;
#else
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
#endif
eMsg = S_VCD1P1;
break;
case MSG_DEVICE_MEDIA_VCD2P0:
#ifdef D_GUI_MESSAGE_TIMEOUT_DISTINGUISH_MEDIA_VCD
pMessage->moParam.mwTimer = D_GUI_MESSAGE_TIMEOUT_MEDIA_VCD_DISPLAY_TIME;
#else
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
#endif
eMsg = S_VCD2P0;
break;
case MSG_DEVICE_MEDIA_NO_DISK:
eMsg = S_NO_DISK;
pMessage->moParam.mpIcon = BMP_MESSAGE_DEVICE_DISC;
pMessage->moParam.mwTimer = OMESSAGE_INFINITE_TIMEOUT;
break;
case MSG_DEVICE_MEDIA_BAD_DISK:
eMsg = S_BAD_DISK;
pMessage->moParam.mpIcon = BMP_MESSAGE_DEVICE_DISC;
pMessage->moParam.mwTimer = OMESSAGE_INFINITE_TIMEOUT;
break;
case MSG_DEVICE_MEDIA_CDDA:
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
eMsg = S_CDDA;
break;
case MSG_DEVICE_MEDIA_CDDTS:
pMessage->moParam.mwTimer = pMessageDescriptor->mwDefaultTimeout;
eMsg = S_CDDTS;
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -