📄 osd.c
字号:
#endif
_RecoverNUNBMessage();
}
}
break;
//LJY1.20, support 4M flash, remove digest
#ifndef NO_DIGEST
// Brian1.00, handle Digest OSD
case MSG_DIGEST:
if (bSec==0xff)
{
OSDLD_Update(MSG_CLEAR_ALL, NULL);
OSDDG_Update(MSG_DIGEST, wParam);
_bCurrentUI = OSD_UI_DIGEST;
}
else
{
OSDDG_Update(MSG_CLEAR, 0);
switch (__bDisplay)
{
case 0:
_bCurrentUI = OSD_UI_NONE;
break;
case 1:
case 2: // in fact, in VCD digest, there should be no Display mode 2
#ifdef SHOW_6_DISPLAY_MODE//ch00.105
case 3://wendy.105
case 4:
case 5:
case 6:
#endif //#ifdef SHOW_6_DISPLAY_MODE//ch00.105
default:
_OSD_DisplayLD(); //++CoCo1.21
break;
}
}
break;
#endif // #ifndef NO_DIGEST
#ifdef SHOW_POWERON_BAR //Xuli1.05 show power-on bar on/off
case MSG_PWRON_BAR:
OSD_ShowPoweronBar(wParam);
break;
#endif
default:
return FALSE; //CoCo1.21
}
return TRUE; //CoCo1.21
}
void _OSD_UpdateMessage(BYTE bMessage)
{
switch(bMessage)
{
case MSG_WAITING:
// LLY.050, must clear MSG_OPEN, because MSG_WAITING and MSG_OPEN are excursive
_OSD_OutputProcess(MSG_OPEN, 0, 0);
break;
case MSG_STOPWAIT:
// this message will clear the MSG_WAITING
_OSD_OutputProcess(MSG_WAITING, 0, 0);
break;
case MSG_PBC:
//for safe, message consistent with main
_OSD_OutputProcess(MSG_PLAYING, 0, 0);
_OSD_OutputProcess(MSG_SETPROGRAM, 0, 0);
_OSD_OutputProcess(MSG_PROGRAM, 0, 0);
_OSD_OutputProcess(MSG_SELECTIONLIST, 0, 0);
//_OSD_OutputProcess(MSG_ERR_PICTURE, 0, 0); //CoCo2.31, No one send this message.
break;
case MSG_STOP:
_OSD_OutputProcess(MSG_ANGLE_CTL, 0, 0);
break;
case MSG_OPEN:
case MSG_POWER:
// for safe, message consistent with main
// auto remove the forever display message
_OSD_OutputProcess(MSG_WAITING, 0, 0);
_OSD_OutputProcess(MSG_PLAYING, 0, 0);
_OSD_OutputProcess(MSG_DISCTYPE, 0, 0);
_OSD_OutputProcess(MSG_SETPROGRAM, 0, 0);
_OSD_OutputProcess(MSG_PROGRAM, 0, 0);
_OSD_OutputProcess(MSG_SELECTIONLIST, 0, 0);
//_OSD_OutputProcess(MSG_ERR_PICTURE, 0, 0); //CoCo2.31, No one send this message.
_OSD_OutputProcess(MSG_ANGLE_CTL, 0, 0); // DVD.040-1
// LLY.170a, fix "Region code error" forever message can't turn-off
// while open/close ane put into non-DVD title
_OSD_OutputProcess(MSG_ABNORMAL_DISC, 0, 0);
break;
case MSG_PLAYLIST:
_OSD_OutputProcess(MSG_SELECTIONLIST, 0, 0);
//_OSD_OutputProcess(MSG_ERR_PICTURE, 0, 0); //CoCo2.31, No one send this message.
break;
#ifdef SHOW_6_DISPLAY_MODE
case MSG_CLEARPROGRAM: //xuli1.07 Update program info of display mode
_OSD_OutputProcess(MSG_PROGRAM,0,0);
break;
#endif
}
}
// *******************************************************************
// Function : _OSD_CheckMessage
// Description : Check whether the message needs process or not
// Arguments : bMessage: the message to check
// Return : TRUE: the message needs further process
// FALSE: the message needs no process
// Side Effect :
// *******************************************************************
BYTE _OSD_CheckMessage(BYTE bMessage, BYTE bSec)
{
// _OSD_CheckMessage check the following things:
// [1] If this is a displayable/clearable message. If not, no need to do further process. Return FALSE
// [2] If the bMessage is not the current message but in the stack, then call
// _OSD_ClearStackMessage(bMessage) to clear the message from stack. Return FALSE.
// call OSDND_GetMessagePos to determine which region it belongs to
_bOSDTemp = OSDND_GetMessagePos(bMessage);
if (_bOSDTemp == OSDND_UNKNOWN_REGION)
{
// it is not ND message
return FALSE;
}
if (bMessage != _pOSDCurMsg->bMessage)
{
// It is not the current message, then check if it is in the stack,
// If it is in stack then it must be a "clear" action, i.e. bSec should be 0.
// But I don't pass bSec to this function, I just assume there should be no mistake.
switch (_bOSDTemp)
{
case OSDND_UPPER_RIGHT_REGION:
for (_bOSDTemp=0; _bOSDTemp< _bOSDNUIndex; _bOSDTemp++)
{
if (_OSDNUStack[_bOSDTemp].bMessage == bMessage)
{
// if flow comes here, but bSec is not 0, means error
//#if defined( SUPPORT_PRINTF) || defined(SERIAL_DEBUG)
// if (bSec != 0)
// _printf("_OSD_CheckMessage Error\n");
//#endif
_OSDNUStack[_bOSDTemp].bMessage = MSG_NULL;
if (_bOSDTemp == _bOSDNUIndex-1)
{
// we just clear the topest msg from the stack
// so decrease index by 1
_bOSDNUIndex--;
}
if (bSec == 0)
return FALSE;
}
}
case OSDND_BOTTOM_REGION:
for (_bOSDTemp=0; _bOSDTemp< _bOSDNBIndex; _bOSDTemp++)
{
if (_OSDNBStack[_bOSDTemp].bMessage == bMessage)
{
_OSDNBStack[_bOSDTemp].bMessage = MSG_NULL;
if (_bOSDTemp == _bOSDNBIndex-1)
{
// we just clear the topest msg from the stack
// so decrease index by 1
_bOSDNBIndex--;
}
if (bSec == 0)
return FALSE;
}
}
}
}
// It is a new displayable/clearable OSD MSG, OSD_Output will process it.
return TRUE;
}
void _ClearAngleMsgFromStack(void)
{
for (_bOSDTemp=0; _bOSDTemp< _bOSDNBIndex; _bOSDTemp++)
{
if (_OSDNBStack[_bOSDTemp].bMessage == MSG_ANGLE_CTL)
{
_OSDNBStack[_bOSDTemp].bMessage = MSG_NULL;
if (_bOSDTemp == _bOSDNBIndex-1)
{
// we just clear the topest msg from the stack
// so decrease index by 1
_bOSDNBIndex--;
}
}
}
}
void _ClearNUGroupMsgFromStack(BYTE bMessage)
{
for (_bOSDTemp=0; _bOSDTemp< _bOSDNUIndex; _bOSDTemp++)
{
if (_OSDNUStack[_bOSDTemp].bMessage != MSG_NULL &&
_OSD_MessageGroup(_OSDNUStack[_bOSDTemp].bMessage) == _OSD_MessageGroup(bMessage))
{
_OSDNBStack[_bOSDTemp].bMessage = MSG_NULL;
if (_bOSDTemp == _bOSDNUIndex-1)
{
// we just clear the topest msg from the stack
// so decrease index by 1
_bOSDNUIndex--;
}
}
}
}
BYTE _OSD_FilterDisplayInfor(BYTE bMessage)
{
//#ifndef NO_OSD
_bOSDTemp=FALSE;
switch(bMessage)
{
case MSG_SHOWDISPLAY: //CoCo1.26, add new message for Display mode.
#ifdef SHOW_6_DISPLAY_MODE //ch00.105
//wendy1.07, because CDDA OSD will updated the disc type info @ runtime,
//so when display on and only show time info., do not process the message at display mode
if((__dwDisplayStartTimer==0)&&(__wDiscType&BOOK_CDDA))
return FALSE;
if((gcShowStatus.bOsdDisplay>=2) && (gcShowStatus.bOsdDisplay<=6))
#else
if(gcShowStatus.bOsdDisplay==2)
#endif //#ifdef SHOW_6_DISPLAY_MODE
_bOSDTemp=TRUE;
break;
case MSG_AST_CTL:
case MSG_ANGLE_CTL:
case MSG_SPST_CTL:
#ifdef SHOW_6_DISPLAY_MODE
if(gcShowStatus.bOsdDisplay==1)
#else //#ifdef SHOW_6_DISPLAY_MODE
if(gcShowStatus.bOsdDisplay==2)
#endif //#ifdef SHOW_6_DISPLAY_MODE
_bOSDTemp=TRUE;
break;
case MSG_TRACK:
case MSG_MENU:
case MSG_TITLE:
case MSG_CHAPTER:
case MSG_PROGRAM: // Brian1.07a, display mode needs Program message to update Program ICON
_bOSDTemp=TRUE;
break;
case MSG_ABSTIME:
case MSG_RELTIME:
case MSG_REMAIN_ABSTIME:
case MSG_REMAIN_RELTIME:
case MSG_TITLE_TIME:
case MSG_CHAPTER_TIME:
case MSG_REMAIN_TITLE_TIME:
case MSG_REMAIN_CHAPTER_TIME:
#ifdef SHOW_6_DISPLAY_MODE//XULI1.07, will process these message at display mode.
_bOSDTemp=TRUE;
#endif
break;
// LLY2.78b-3, support "Program Play" message
#ifdef SUPPORT_PROGRAM_PLAY_INFO
case MSG_PROGRAM_PLAY:
_bOSDTemp=TRUE;
break;
#endif // #ifdef SUPPORT_PROGRAM_PLAY_INFO
default:
break;
}
// current in DISPLAY mode
if (gcShowStatus.bOsdDisplay)
return (_bOSDTemp);
return FALSE;
}
// *********************************************************************
// Function : _OSD_MessageGroup
// Description : Group some messages into one message type
// Arguments : bMessage : the input message
// Return : NULL
// Side Effect :
// *********************************************************************
BYTE _OSD_MessageGroup(BYTE bMessage)
{
//#ifndef NO_OSD
// default the message type is the same as the message ID
// LLY.049, don't group message by switch-case
if(((bMessage>=MSG_PLAYING) && (bMessage<=MSG_FREEZE)) ||
((bMessage>=MSG_NEXT) && (bMessage<=MSG_PREV)) )
_bMessageGroup=MSG_PLAYING;
else if((bMessage>=MSG_SETGOTOTIME) && (bMessage<=MSG_GOTOTIME))
_bMessageGroup=MSG_GOTOTIME;
else if((bMessage>=MSG_SETSEARCH) && (bMessage<=MSG_SEARCH))
_bMessageGroup=MSG_GOTOTIME;
else if((bMessage>=SETUP_MSG_BASE) && (bMessage<=SETUP_MSG_END))
_bMessageGroup=MSG_SETUP_MAIN_BASE;
else if((bMessage>=MSG_CLEARPROGRAM) && (bMessage<=MSG_SETPROGRAM))
_bMessageGroup=MSG_PROGRAM;
else // default the message type is same as the message ID
_bMessageGroup=bMessage; //MSG_NULL; //bMessage;
// LLY.046 end ...
return _bMessageGroup;
//#endif // #ifndef NO_OSD
}
// *********************************************************************
// Function : OSD_Output
// Description : Process the output message of OSD
// 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 : NULL
// Side Effect :
// *********************************************************************
void OSD_Output(BYTE bMessage, WORD wParam, BYTE bSec)
{
//CoCo2.34, Don't process the OSD message before OSD is initialized.
if (_bOSDInitial == FALSE)
{
#if defined(SUPPORT_PRINTF) || defined(SERIAL_DEBUG)
printf("\nOSD is not initialized.\n");
#endif
return;
}
// add for skywood,yfxiao0223
{
extern BIT __btMultKey ;
if (__btMultKey )
{
if (bMessage == MSG_INVALID)
{
bMessage = MSG_NULL;
}
__btMultKey = FALSE;
}
}
// end add for skywood
if(bMessage==MSG_NULL)
return;
// Update gcShowStatus first
_OSD_UpdateStatus(bMessage,
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -