📄 osd.c
字号:
//#include "ctkav.h"#include "winav.h"#include "infofilter.h"#include "srcfilter.h"#include "osd.h"#include "gdi.h"#include "osddsply.h"#include "osdnd.h"#include "cc.h"#include "setup.h"#include "hal.h"#include "thumb.h"#include "osdmm.h"#include "osddlg.h"#include "utl.h"#include "osdsrch.h"#include "osdprgm.h"#include "media.h"#include "osdbmark.h"#include "mmanager.h"#include "osddg.h"#include "osdss.h"#include "digest.h"#include "char_subpict.h"#include "osd3.h"#if defined(SUPPORT_STB) || defined(IMAGE_FRAME_SETUP) //CoCo2.38#include "mainmenu.h"#endif //#ifdef SUPPORT_POWERON_MENU //CoCo2.38#include "poweronmenu.h"#endif //#ifdef SUPPORT_POWERON_MENU#ifdef SUPPORT_RADIO_TUNER#include "radio.h"#endif //SUPPORT_RADIO_TUNER//The depth for each corner's message stack#define OSD_MAX_DEPTH_OF_MSG_STACK 4//The depth for UI's stack //Currently, we have 5 layers in CT909 UI. But layer 0 (normal display) and layer 4 (screen saver) will not be push to the stack.//Therefore, the maximum depth for UI stack is 3. (for layer 1 to layer 3)#define OSD_MAX_DEPTH_OF_UI 6BYTE aMsgChk[MAX_MSGNO_FOR_CHECK] ={#include "msgcheck.txt" //CoCo, should check it for CT909 new message refinement};/////////////////////////////////////////////////////////////////////// ***** Global Variable Area *****STATUS gcShowStatus;BYTE _bOSDLang; // keep current osd languageBYTE __bMsgString[MAXNO_OF_MSG_STRING+1]; // CoCo, should remove it in CT909OSDMESSAGE _OSDNUCurMsg;OSDMESSAGE _OSDNBCurMsg;OSDMESSAGE _OSDNUStack[OSD_MAX_DEPTH_OF_MSG_STACK];OSDMESSAGE _OSDNBStack[OSD_MAX_DEPTH_OF_MSG_STACK];BYTE _bOSDNUIndex;BYTE _bOSDNBIndex;BYTE _bOSDCurrentUI; //Keep the current UI.BYTE _OSDUIStack[OSD_MAX_DEPTH_OF_UI]; //The UI's stack for recovery's usage.BYTE _bOSDUIStackIndex; //The index to record the stack.DWORD _dwOSDNUStartTickCount; // the reference start ticks for down countWORD _wOSDNUDisplayTickCount; // OSD display ticks, down count in OSD_TriggerDWORD _dwOSDNBStartTickCount; // the reference start ticks for down countWORD _wOSDNBDisplayTickCount; // OSD display ticks, down count in OSD_Trigger//Alan2.21, OSD Buffer mode infoOSDBUF_INFO _OSDBuffer_Info;// record the Scan or slow factorBYTE _bSpeedFactor; // only support 0 ~ 255BYTE _bWaitingCnt; //CoCo, this variable is for "waiting..." usage. Need to move it to OSDND?PARM_RECT _OSDRect;BYTE _bOSDTemp, _bOSDTemp1;BYTE __bOSDClearNDURegion;BYTE __bOSDClearNDBRegion;BYTE __bOSDForceToClearNBRegion;//CoCo1.10, support OSD dynamic region//The following variables are for OSD dynamic region.BYTE __bOSDDynamicRegion;pDynamicRegionRecoverFunc DynamicRegionRecoverFunction;BYTE _bOSDSetRegion = FALSE;BYTE _bOSDCurrentRegion;GDI_REGION_INFO _bOSDCurrentRegionInfo;extern BYTE __bKeyMessage;extern BYTE _bGDIInit;extern void OSDPROMPT_Trigger(void);extern void SETUP_Trigger(void);
extern void SETUP_ConfigOSDRegion(void);//***************************************************************************// Function : OSD_PANEL_Output// Abstract : This function will process the message output for OSD and Panel.// Arguments : bMessage : the input message// wParam : the parameter for this message// bSec : the display tome for this message// =0x0 : clear the pre-display message// =0xFF : means forever display// =other value: unit is second.// Return : none.// Side Effect : none.// Notes : //***************************************************************************void OSD_PANEL_Output(BYTE bMessage, WORD wParam, BYTE bSec){ OSD_Output(bMessage, wParam, bSec); PANEL_Output(bMessage, wParam);}//***************************************************************************// Function : OSD_Output// Abstract : This function will process the message output for normal // : display and display mode. // Arguments : bMessage : the input message// wParam : the parameter for this message// bSec : the display tome for this message// =0x0 : clear the pre-display message// =0xFF : means forever display// =other value: unit is second.// Return : none.// Side Effect : none.// Notes : //***************************************************************************void OSD_Output(BYTE bMessage, WORD wParam, BYTE bSec){ if ((bMessage == MSG_NULL) || (_bGDIInit == FALSE)) return; //1. Update gcShowStatus _OSD_UpdateStatus(bMessage, wParam); //2. Remove specific messages when receiving bMessage. _OSD_UpdateMessage(bMessage); if (bMessage == MSG_DISPLAY) { if (bSec == 0xFF) { OSDDSPLY_Update(MSG_INITIAL_PALETTE, 0); OSDDSPLY_Update(MSG_DISPLAY, OSD_CHANGE_UI); } return; } if (_bOSDCurrentUI == OSD_UI_DISPLAY) { _OSD_ClearMsg(MSG_TVMODE); if ((bMessage >= MSG_PLAYING) && (bMessage <= MSG_FREEZE)) { //Update status. Send MSG_STATUS to Display mode to update the playing status. OSDDSPLY_Update(MSG_STATUS, wParam); } //Judge if this is Display mode message. if (OSDDSPLY_Update(bMessage, wParam)) //This is a Display mode message. { if ((bSec == 0) && (OSDND_GetMessagePos(bMessage) == OSD_ND_BOTTOM_REGION)) { if (_OSD_SearchMsg(bMessage)) { _OSD_ClearMsg(bMessage); //Clear the forever message from the stack even Display mode has processed it. } } if (bMessage != MSG_ANGLE_CTL) //CoCo1.05, Let normal display process "MSG_ANGLE_CTL" even the virtual panel has processed it. return; } }#ifdef SUPPORT_NAVIGATOR //++CoCo2.37p //CoCo1.11, when title/chapter if (_bOSDCurrentUI == OSD_UI_NAVIGATOR) { OSDDSPLY_NAVIGATOR_ClearMenuForNVChange(bMessage); } #endif //#ifdef SUPPORT_NAVIGATOR //++CoCo2.37p if (bSec == 0) //Our F/W forces to clear the message { if ((bMessage != _OSDNUCurMsg.bMessage) && (bMessage != _OSDNBCurMsg.bMessage)) { //The message maybe a forever message and has been put to the stack before. //Therefore, need to clear it if is is in the stack. if (_OSD_SearchMsg(bMessage)) { _OSD_ClearMsg(bMessage); } //CoCo0.72, MSG_NUMBER needs to clear MSG_KEY10 if ((bMessage == MSG_NUMBER) && (_OSDNUCurMsg.bMessage == MSG_KEY10)) { //Let MSG_NUMBER to clear MSG_KEY10 } else if (bMessage == MSG_PLAYING) //CoCo2.17, fix the bug about KEY_REPEAT_AB==>KEY_REPEAT_AB==>KEY_PAUSE==>KEY_PLAY can't recover MSG_REPEATAB. { if (_bOSDNUIndex > 0) //The stack has forever message to be recovered. { _OSD_RecoverNURegion(); } return; } else return; } _bOSDTemp = OSDND_GetMessagePos(bMessage); //Notify the OSDND to clear the message. _OSD_ClearNUNBRegion(_bOSDTemp); if (_bOSDTemp == OSD_ND_UPPER_RIGHT_REGION) { //Set message to MSG_NULL first. If there is any forever message to be recovered, it will be set later. _OSDNUCurMsg.bMessage = MSG_NULL; //Recover the normal upper region. _OSD_RecoverNURegion(); } else if (_bOSDTemp == OSD_ND_BOTTOM_REGION) { //Set message to MSG_NULL first. If there is any forever message to be recovered, it will be set later. _OSDNBCurMsg.bMessage = MSG_NULL; //Recover the normal bottom region. _OSD_RecoverNBRegion(); } } else //bSec != 0=>F/W send the message to show it. { if (OSDND_GetMessagePos(bMessage) == OSD_ND_UNKNOWN_REGION) return; //CoCo, need to check the following flow for __bKeyMessage if(__bKeyMessage!=MSG_ALL && bSec!=0xFF) { // Must check the message in aMsgChk[] array if(aMsgChk[bMessage]==1) { // The message is sent by correspond key: // only clear __bKeyMessage, other flow is same as original case if(bMessage==__bKeyMessage) { __bKeyMessage=MSG_NULL; } else { // filter special slide show case KEY_NEXT/PREV and then "MSG_PLAYING" // in this case we hope retrun, not to clear the OSD "NEXT" or "PREV" if ((_OSDNUCurMsg.bMessage == MSG_NEXT || _OSDNUCurMsg.bMessage == MSG_PREV) && bMessage == MSG_PLAYING) { return; } //clear the message. if ((_OSD_MessageGroup(_OSDNUCurMsg.bMessage) != _OSD_MessageGroup(bMessage))) { // it is just a call to set some MSG to NULL return; } else { _OSD_ClearDisplayRegion(bMessage); //CoCo0.63, add the code to clear the curernt message. _bOSDTemp = OSDND_GetMessagePos(bMessage); if (_bOSDTemp == OSD_ND_UPPER_RIGHT_REGION) { _OSDNUCurMsg.bMessage = MSG_NULL; } else if (_bOSDTemp == OSD_ND_UPPER_RIGHT_REGION) { _OSDNBCurMsg.bMessage = MSG_NULL; } return; } } } } //If the normal upper or normal bottom message is a forever message, we will push it to the stack. if (OSDND_GetMessagePos(bMessage) == OSD_ND_UPPER_RIGHT_REGION) { if (_OSDNUCurMsg.bMessage != MSG_NULL) { if (_OSD_MessageGroup(_OSDNUCurMsg.bMessage) != _OSD_MessageGroup(bMessage)) _OSD_PushForeverMsg(_OSDNUCurMsg.bMessage); //judge if the message should be cleared in normal upper region or normal bottom region. if (OSDND_GetMessagePos(_OSDNUCurMsg.bMessage) == OSDND_GetMessagePos(bMessage)) { _OSD_ClearDisplayRegion(bMessage); } } else { //Always clear the region to prevent some UI has info. in that region. ex. Thumbnail UI. if (_bOSDCurrentUI != OSD_UI_NONE) { _OSD_ClearNUNBRegion(OSD_ND_UPPER_RIGHT_REGION); } } } else if (OSDND_GetMessagePos(bMessage) == OSD_ND_BOTTOM_REGION) { if (_OSDNBCurMsg.bMessage != MSG_NULL) { if (_OSD_MessageGroup(_OSDNBCurMsg.bMessage) != _OSD_MessageGroup(bMessage)) { if (OSDND_GetMessagePos(_OSDNBCurMsg.bMessage) == OSDND_GetMessagePos(bMessage)) _OSD_PushForeverMsg(_OSDNBCurMsg.bMessage); } //judge if the message should be cleared in normal upper region or normal bottom region. if (OSDND_GetMessagePos(_OSDNBCurMsg.bMessage) == OSDND_GetMessagePos(bMessage)) { _OSD_ClearDisplayRegion(bMessage); //Just clear the position of the input message because the current message's position is the same as input message. } } else { //Always clear the region to prevent some UI has info. in that region. ex. Thumbnail UI. if (_bOSDCurrentUI != OSD_UI_NONE) { _OSD_ClearNUNBRegion(OSD_ND_BOTTOM_REGION); } } } //Set the input message to current message. if (bSec != 0) { _OSD_SetCurrentMsg(bMessage, wParam, bSec); //Call normal display entry to show the message. OSDND_Update(bMessage, wParam); } }}// *********************************************************************// Function : _OSD_MessageGroup// Abstract : // Arguments : // Return : none.// Side Effect : none.// Notes : // *********************************************************************BYTE _OSD_MessageGroup(BYTE bMessage){ if(((bMessage>=MSG_PLAYING) && (bMessage<=MSG_FREEZE)) || ((bMessage>=MSG_NEXT) && (bMessage<=MSG_PREV)) ) return MSG_PLAYING; else return bMessage;}// *********************************************************************// Function : _OSD_UpdateStatus// Abstract : To update the gcShowStatus information.// Arguments : bMessage: the input message// wParam : parameter for this message// bSec : the message display time// Return : none.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -