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

📄 osd.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 5 页
字号:
//  Notes       :   //***************************************************************************void _OSD_RecoverNBRegion(void){    if (_bOSDCurrentUI == OSD_UI_NONE)    {        //Forever normal bottom message needs to be recovered?        _OSD_RecoverNDMessage(OSD_ND_BOTTOM_REGION);    }    else //Call other UI's recover function to recover the normal bottom region.    {        //Some UI doesn't have to recover the normal bottom message like Search, Bookmark, Program. They coexist with the normal display mode.        //Therefore, the normal bottom message needs to be recovered when current UI is the UI.        if (!_OSD_RecoverUI(_bOSDCurrentUI, OSD_ND_BOTTOM_REGION))                   _OSD_RecoverNDMessage(OSD_ND_BOTTOM_REGION);    }}//***************************************************************************//  Function    :   OSD_AdjustRegion//  Abstract    :   This function will adjust the OSD region. When the TV mode//              :   is changed, need to call this function to adjust the OSD region.//  Arguments   :   none.//  Return      :   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void OSD_AdjustRegion(void){	#ifdef ENLARGE_OSD_FOR_PAL_MODE#ifdef SUPPORT_STB    if (__bChooseMedia != MEDIA_SELECT_STB)#endif //SUPPORT_STB    {        GDI_ChangeRegionHeight(0); // Brian1.20, enlarge OSD for PAL mode, call this before OSD_AdjustOSDPos otherwise the OSD position will be wrong    }#endif //ENLARGE_OSD_FOR_PAL_MODE#ifdef SUPPORT_STB    if (__bChooseMedia == MEDIA_SELECT_STB)    {        extern void AP_ConfigGDIRegion(BYTE bClearRegion);        AP_ConfigGDIRegion(FALSE);    }#endif        OSD_AdjustOSDPos(); // Brian0.75    //CoCo1.20, support large OSD region for PAL mode.#ifdef ENLARGE_OSD_FOR_PAL_MODE    switch (_bOSDCurrentUI)    {    case OSD_UI_THUMBNAIL:    case OSD_UI_DIGEST:    case OSD_UI_MEDIA_MANAGER:        break;    case OSD_UI_SETUP:    case OSD_UI_MAIN_MENU:        OSDND_Update(MSG_DEFAULT_STATE, 0);        break;    default:#ifdef SUPPORT_STB    if (__bChooseMedia != MEDIA_SELECT_STB)#endif //SUPPORT_STB    {        OSDND_ClearRegion(OSD_ND_BOTTOM_REGION);        __bOSDClearNDBRegion = TRUE;        OSDND_Update(MSG_DEFAULT_STATE, 0);        OSDND_Update(_OSDNBCurMsg.bMessage, _OSDNBCurMsg.wParam);        }        break;    }#endif //ENLARGE_OSD_FOR_PAL_MODE        //Some UIs needs to be updated when changing the TV mode.    //Therefore, OSD will call it's "recover all" function to recover the UI.    switch (_bOSDCurrentUI)    {    case OSD_UI_THUMBNAIL:        THUMB_Recover(OSD_RECOVER_ALL);        break;    case OSD_UI_DIGEST:        break;    case OSD_UI_MEDIA_MANAGER:        //Need to tune the position of the JPEG preview.        MM_RecoverPreviewWindow();        OSDMM_TuneRegionForPALMode();        break;    default:        break;    }#ifdef SUPPORT_CHAR_SUBPICTURE     CHAR_SP_AdjustRegion();  // Alan1.20, Set the position for the sub-title#endif} // Brian0.75void OSD_AdjustOSDPos(void){	    WORD wStartX, wStartY;     __bCurrentRegionId = 0;    if (__SetupInfo.bProgressiveScan == SETUP_PROGRESSIVE_SCAN_ON)    {        if (__bMPEGVideoMode == MPEG_VIDEO_MODE_NTSC)        {            wStartX = REGION_X_NTSC;            wStartY = REGION_Y_NTSC;//-5 //CoCo0.90, Doesn't need to adjust it because DISP will adjust it?        }        else        {            wStartX = REGION_X_PAL;//-4 //CoCo0.90, Doesn't need to adjust it because DISP will adjust it?            wStartY = REGION_Y_PAL; //- 4 //CoCo0.90, Doesn't need to adjust it because DISP will adjust it?        }    }    else    {        if (__bMPEGVideoMode == MPEG_VIDEO_MODE_NTSC)        {            wStartX = REGION_X_NTSC;            wStartY = REGION_Y_NTSC;        }        else        {            wStartX = REGION_X_PAL;            wStartY = REGION_Y_PAL;        }    }        //CoCo, Need to modify it as new GDI API.    //GDI_MOVE_REGION(wStartX, wStartY);		    GDI_MoveRegion(0, wStartX, wStartY);	    }//***************************************************************************//  Function    :   OSD_NormalMode//  Abstract    :   This function will clear all UIs and return to normal display mode.//              :   When user presses KEY_OPEN_CLOSE/KEY_POWER, main control module (CC) //              :   needs to call this function before it sends OSD_OUTPUT_MACRO( MSG_OPEN, ....);//  Arguments   :   none.//  Return      :   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void OSD_NormalMode(void){    //Initialize the palette for normal display    OSDND_Update(MSG_INITIAL_PALETTE, 0);    //Recover the normal display attributes.    OSDND_Update(MSG_DEFAULT_STATE, 0);    _OSD_ResetState();    //Clear the region.    GDI_ClearRegion(0);}//***************************************************************************//  Function    :   _OSD_ResetUI//  Abstract    :   This function will reset the UI's stack and set current UI//              :   to normal display mode.//  Arguments   :   none.//  Return      :   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSD_ResetUI(void){    //Initialize current UI to normal display mode.    _bOSDCurrentUI = OSD_UI_NONE;    //Initialize the UI stack.    for (_bOSDTemp = 0; _bOSDTemp < OSD_MAX_DEPTH_OF_UI; _bOSDTemp++)    {        _OSDUIStack[_bOSDTemp] = OSD_UI_NONE;    }    //Initialize the index of the UI stack.    _bOSDUIStackIndex = 0;}//***************************************************************************//  Function    :   _OSD_ClearDisplayRegion//  Abstract    :   This function will clear the normal upper/bottom region for normal display.//  Arguments   :   bMessage: the message.//  Return      :   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSD_ClearDisplayRegion(BYTE bMessage){    switch (bMessage)    {    case MSG_VOLUME:    case MSG_KEY:    case MSG_ECHO:    case MSG_PROGRESS: //CoCo1.10    case MSG_WAITING:        {            _bOSDTemp = OSDND_GetMessagePos(bMessage);                        if (_bOSDTemp == OSD_ND_UPPER_RIGHT_REGION)            {                               if (bMessage != _OSDNUCurMsg.bMessage)                {                    //send MSG_CLEAR to normal display or other UI to clear normal upper message.                    _OSD_ClearNUNBRegion(OSD_ND_UPPER_RIGHT_REGION);                    __bOSDClearNDURegion = TRUE;                }                else                    __bOSDClearNDURegion = FALSE;            }            else if (_bOSDTemp == OSD_ND_BOTTOM_REGION)            {                if (bMessage != _OSDNBCurMsg.bMessage)                {                    //send MSG_CLEAR to normal display or other UI to clear normal bottom message.                    _OSD_ClearNUNBRegion(OSD_ND_BOTTOM_REGION);                    __bOSDClearNDBRegion = TRUE;                }                else                {                    if (!__bOSDForceToClearNBRegion)                    {                        __bOSDClearNDBRegion = FALSE;                    }                    else                    {                        _OSD_ClearNUNBRegion(OSD_ND_BOTTOM_REGION);                        __bOSDClearNDBRegion = TRUE;                        __bOSDForceToClearNBRegion = FALSE;                    }                }            }        }        break;    default:        //send MSG_CLEAR to normal display or other UI to clear normal upper/bottom message.        _OSD_ClearNUNBRegion(OSDND_GetMessagePos(bMessage));        __bOSDClearNDURegion = TRUE;        __bOSDClearNDBRegion = TRUE;        break;    }}//***************************************************************************//  Function    :   _OSD_ClearNUNBRegion//  Abstract    :   This function will clear normal upper/bottom region.//  Arguments   :   bMessage: the message.//  Return      :   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSD_ClearNUNBRegion(BYTE bRegion){    switch (_bOSDCurrentUI)    {    case OSD_UI_MEDIA_MANAGER:        OSDMM_ClearRegion(bRegion);        return;    case OSD_UI_THUMBNAIL:        THUMB_ClearRegion(bRegion);        return;#ifdef SUPPORT_RADIO_TUNER    case OSD_UI_RADIO_TUNER:		//Radio Tuner        RADIO_ClearRegion(bRegion);        return;#endif //SUPPORT_RADIO_TUNER    default:        break;    }#ifdef USE_MINI_OSD_REGION        if ((_bOSDCurrentUI != OSD_UI_SETUP) && (_bOSDCurrentUI != OSD_UI_MAIN_MENU) &&            (_bOSDCurrentUI != OSD_UI_DVD_PROGRAM) && (_bOSDCurrentUI != OSD_UI_BOOKMARK) && (_bOSDCurrentUI != OSD_UI_MEDIA_SELECT_DLG)#ifdef SUPPORT_POWERON_MENU //CoCo2.38            && (_bOSDCurrentUI != OSD_UI_POWERON_MENU)#endif            )#else //USE_MINI_OSD_REGION    //CoCo0.80a, Don't clear the normal display when current UI is SETUP because SETUP will occuply whole scrren and it doesn't show normal display message.    if ((_bOSDCurrentUI != OSD_UI_SETUP) && (_bOSDCurrentUI != OSD_UI_MAIN_MENU)#ifdef SUPPORT_POWERON_MENU //CoCo2.38        && (_bOSDCurrentUI != OSD_UI_POWERON_MENU)#endif        )#endif    {        OSDND_ClearRegion(bRegion);    }}//***************************************************************************//  Function    :   OSD_RemoveUI//  Abstract    :   This function will remove the UI.//  Arguments   :   bUI: OSD_UI_DISPLAY/OSD_UI_MEDIA_MANAGER/OSD_UI_SETUP///              :        OSD_UI_THUMBNAIL/OSD_UI_SEARCH/OSD_UI_DVD_PROGRAM///              :        OSD_UI_DIGEST/OSD_UI_MEDIA_SELECT_DLG/OSD_UI_PSCAN_PROMPT_DLG///              :        OSD_UI_BOOKMARK/OSD_UI_SCREEN_SAVER//  Return      :   TRUE: Remove the UI successfully. FALSE: Can't remove the UI.//  Side Effect :   none.//  Notes       :   //***************************************************************************BYTE OSD_RemoveUI(BYTE bUI){    if (bUI == _bOSDCurrentUI)    {        _OSD_ExitUI(bUI, OSD_UI_EXIT_ALL);        //Check if any UI needs to be recovered.        if (_bOSDUIStackIndex != 0) //Some UI has been pushed to the stack.        {                                                  _bOSDCurrentUI = _OSDUIStack[_bOSDUIStackIndex-1];            _bOSDUIStackIndex--;            //Call the pop-up UI's OSDXXX_Recover().            _OSD_RecoverUI(_bOSDCurrentUI, OSD_RECOVER_ALL);        }        else //The stack doesn't have any UI.        {            _bOSDCurrentUI = OSD_UI_NONE; //Normal Display mode.        }                return TRUE;    }    else    {        //Search if the UI in the stack.        for (_bOSDTemp = 0; _bOSDTemp < _bOSDUIStackIndex; _bOSDTemp++)        {            if (bUI == _OSDUIStack[_bOSDTemp])            {                _OSD_ExitUI(bUI, OSD_UI_EXIT_CONTROL_ONLY);                for (_bOSDTemp1 = _bOSDTemp; _bOSDTemp1 < (_bOSDUIStackIndex-1); _bOSDTemp1++)                {                    _OSDUIStack[_bOSDTemp1] = _OSDUIStack[_bOSDTemp1+1];                  }                _bOSDUIStackIndex--;                return TRUE;            }        }    }    return FALSE;}//***************************************************************************//  Function    :   OSD_PushCurrentNBForeverMsg//  Abstract    :   This function will push the current NB forever message to the stack.//  Arguments   :   bMessage: the message we want to push to the stack.//  Return      :   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void OSD_PushCurrentNBForeverMsg(BYTE bMessage){    if (bMessage == _OSDNBCurMsg.bMessage)    {        _OSD_ClearNUNBRegion(OSD_ND_BOTTOM_REGION);        _OSD_PushForeverMsg(_OSDNBCurMsg.bMessage);    }}//*****************************************************

⌨️ 快捷键说明

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