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

📄 osd.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 5 页
字号:
                if (bMessage == _OSDNUCurMsg.bMessage)        {            _OSDNUCurMsg.bMessage = MSG_NULL;            _OSDNUCurMsg.bSec = 0;        }        else if (bMessage == _OSDNBCurMsg.bMessage)        {            _OSDNBCurMsg.bMessage = MSG_NULL;            _OSDNBCurMsg.bSec = 0;        }    }    _OSD_RemoveMsgFromStack(bMessage);}//***************************************************************************//  Function    :   OSD_ChangeUI//  Abstract    :   This function will change the UI and do recovery for each UI.//  Arguments   :   bUI: The UI//              :   bAction : OSD_ENTER_UI==>The UI enters.//              :           : OSD_EXIT_UI==>The UI exits.//  Return      :   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void OSD_ChangeUI(BYTE bUI, BYTE bAction){    BYTE bRecoverDynamicRegion = FALSE;    //Recover the normal display attributes.    OSDND_Update(MSG_DEFAULT_STATE, 0);    //Reset this flag to prevent volume bar/Key/Echo bar is not re-drawed again.    //__bOSDClearNDBRegion = TRUE;    __bOSDForceToClearNBRegion = TRUE;    if (bAction == OSD_ENTER_UI)    {        //judge the UI's layer        if (_OSD_GetUILayer(bUI) > _OSD_GetUILayer(_bOSDCurrentUI))        {            //Push current UI to UI's stack.            _OSDUIStack[_bOSDUIStackIndex] = _bOSDCurrentUI;            _bOSDUIStackIndex++;        }        else if (_OSD_GetUILayer(bUI) == _OSD_GetUILayer(_bOSDCurrentUI))        {            //Call current UI's "exit" function to exit the UI and don't do the recovery.(The UI can't call OSD_ChangeUI(bUI, OSD_EXIT_UI))            //_OSD_ExitUI(bUI, OSD_UI_EXIT_ALL);            _OSD_ExitUI(_bOSDCurrentUI, OSD_UI_EXIT_ALL);        }        else // The new UI's layer < current UI. This is an illegal case        {            return;        }        _bOSDCurrentUI = bUI;#ifdef USE_MINI_OSD_REGION        if ((_bOSDCurrentUI == OSD_UI_SETUP) || (_bOSDCurrentUI == OSD_UI_MAIN_MENU) || (_bOSDCurrentUI == OSD_UI_SCREEN_SAVER) ||            (_bOSDCurrentUI == OSD_UI_DVD_PROGRAM) || (_bOSDCurrentUI == OSD_UI_BOOKMARK) || (_bOSDCurrentUI == OSD_UI_MEDIA_SELECT_DLG))#else        if ((_bOSDCurrentUI == OSD_UI_SETUP) || (_bOSDCurrentUI == OSD_UI_MAIN_MENU) || (_bOSDCurrentUI == OSD_UI_SCREEN_SAVER))#endif //USE_MINI_OSD_REGION        {            if (_OSDNBCurMsg.bMessage != MSG_NULL && _OSDNBCurMsg.bSec != 0xFF)            {                __bOSDClearNDBRegion = TRUE;                                    _OSDNBCurMsg.bMessage = MSG_NULL;                if (_bOSDNBIndex > 0) //The stack has forever message to be recovered.                {                    _OSDNBCurMsg.bMessage = _OSDNBStack[_bOSDNBIndex-1].bMessage;                    _OSDNBCurMsg.wParam = _OSDNBStack[_bOSDNBIndex-1].wParam;                    _OSDNBCurMsg.bSec = _OSDNBStack[_bOSDNBIndex-1].bSec;                    _bOSDNBIndex--;                }            }            if (_OSDNUCurMsg.bMessage != MSG_NULL && _OSDNUCurMsg.bSec != 0xFF)            {                _OSDNUCurMsg.bMessage = MSG_NULL;                if (_bOSDNUIndex > 0) //The stack has forever message to be recovered.                {                    _OSDNUCurMsg.bMessage = _OSDNUStack[_bOSDNUIndex-1].bMessage;                    _OSDNUCurMsg.wParam = _OSDNUStack[_bOSDNUIndex-1].wParam;                    _OSDNUCurMsg.bSec = _OSDNUStack[_bOSDNUIndex-1].bSec;                    _bOSDNUIndex--;                }            }        }                //Config each UI's region        _OSD_ConfigRegion(_bOSDCurrentUI);#ifdef SUPPORT_GRAPH_ZOOM        //Clear PIP        if ((_bOSDCurrentUI != OSD_UI_DISPLAY) && (__bZoomFactor != VIEW_NORMAL))        {            OSDND_Update(MSG_ZOOM, VIEW_NORMAL);        }#endif    }    else if (bAction == OSD_EXIT_UI)    {        //Recover the normal display attributes.        //OSDND_Update(MSG_DEFAULT_STATE, 0);        //Setup UI is a special UI that we will recover NU/NB message always.#ifdef USE_MINI_OSD_REGION        if ((_bOSDCurrentUI == OSD_UI_SETUP) || (_bOSDCurrentUI == OSD_UI_MAIN_MENU) || (_bOSDCurrentUI == OSD_UI_SCREEN_SAVER) ||#ifdef SUPPORT_POWERON_MENU //CoCo2.38            (_bOSDCurrentUI == OSD_UI_POWERON_MENU) ||#endif            (_bOSDCurrentUI == OSD_UI_DVD_PROGRAM) || (_bOSDCurrentUI == OSD_UI_BOOKMARK) || (_bOSDCurrentUI == OSD_UI_MEDIA_SELECT_DLG))#else //USE_MINI_OSD_REGION        if ((_bOSDCurrentUI == OSD_UI_SETUP) || (_bOSDCurrentUI == OSD_UI_MAIN_MENU) || (_bOSDCurrentUI == OSD_UI_SCREEN_SAVER)#ifdef SUPPORT_POWERON_MENU //CoCo2.38            || (_bOSDCurrentUI == OSD_UI_POWERON_MENU)#endif                        )#endif //USE_MINI_OSD_REGION        {            //CoCo1.10, support OSD dynamic region            bRecoverDynamicRegion = TRUE;                        if (_OSDNUCurMsg.bSec == 0xFF)            {                _OSD_ConfigRegion(OSD_UI_NONE);                OSDND_Update(_OSDNUCurMsg.bMessage, _OSDNUCurMsg.wParam);            }                        if (_OSDNBCurMsg.bSec == 0xFF)            {                _OSD_ConfigRegion(OSD_UI_NONE);                OSDND_Update(_OSDNBCurMsg.bMessage, _OSDNBCurMsg.wParam);            }        }        //Pop-up the UI from UI's stack.        //Check if any UI needs to be recovered.        if (_bOSDUIStackIndex != 0) //Some UI has been pushed to the stack.        {                        //Set current UI to the pop-up UI.            _bOSDCurrentUI = _OSDUIStack[_bOSDUIStackIndex-1];            _bOSDUIStackIndex--;

            //CoCo2.56, fix the problem about subtitle will be recovered abnormally in 64M solution.
            if ((_bOSDCurrentUI == OSD_UI_SETUP) || (_bOSDCurrentUI == OSD_UI_MAIN_MENU)
#ifdef SUPPORT_POWERON_MENU 
                || (_bOSDCurrentUI == OSD_UI_POWERON_MENU)
#endif            
                )
            {
                bRecoverDynamicRegion = FALSE;
            }            //Call the pop-up UI's OSDXXX_Recover().            if (!_OSD_RecoverUI(_bOSDCurrentUI, OSD_RECOVER_ALL))
            {
                //CoCo, fix the problem about "Repeat A-B" message is not recovered after SETUP==>SETUP==>MM UI.
                if (_OSDNUCurMsg.bSec == 0xFF)
                {
                    OSDND_Update(_OSDNUCurMsg.bMessage, _OSDNUCurMsg.wParam);
                }

                if (_OSDNBCurMsg.bSec == 0xFF)
                {
                    OSDND_Update(_OSDNBCurMsg.bMessage, _OSDNBCurMsg.wParam);
                }
            }        }        else //The stack doesn't have any UI.        {            _bOSDCurrentUI = OSD_UI_NONE; //Normal Display mode.            _OSD_ConfigRegion(_bOSDCurrentUI);        }        if (bRecoverDynamicRegion)        {            _OSD_RecoverDynamicRegion();        }#ifdef SUPPORT_GRAPH_ZOOM        //Recover PIP        //if ((_bOSDCurrentUI != OSD_UI_DISPLAY) && (__bZoomFactor != VIEW_NORMAL))        if (((_bOSDCurrentUI == OSD_UI_DISPLAY) || (_bOSDCurrentUI == OSD_UI_NONE)) && (__bZoomFactor != VIEW_NORMAL)) //CoCo1.02        {            OSDND_Update(MSG_ZOOM, __bZoomFactor);        }#endif    }}//***************************************************************************//  Function    :   _OSD_GetUILayer//  Abstract    :   This function will get the layer of the UI.//  Arguments   :   bUI: The UI//  Return      :   The layer of the UI.//  Side Effect :   none.//  Notes       :   //***************************************************************************BYTE _OSD_GetUILayer(BYTE bUI){    switch (bUI)    {    case OSD_UI_NONE:                   //Normal Display        _bOSDTemp = OSD_UI_LAYER_0;        break;    case OSD_UI_DISPLAY:                //Display mode        _bOSDTemp = OSD_UI_LAYER_1;        break;    case OSD_UI_MEDIA_MANAGER:          //Media Manager    case OSD_UI_THUMBNAIL:              //Thumbnail    case OSD_UI_SEARCH:                 //Search UI    case OSD_UI_DVD_PROGRAM:            //VCD/DVD Program    case OSD_UI_DIGEST:                 //Digest    case OSD_UI_BOOKMARK:               //Bookmark    case OSD_UI_PASSWORD:               //DVD Password Dialog#ifdef SUPPORT_POWERON_MENU //CoCo2.38    case OSD_UI_POWERON_MENU:           //Power on Menu //CoCo2.38#endif //#ifdef SUPPORT_INDEPENDENT_NAVIGATOR //CoCo1.0, support independent Navigator UI    case OSD_UI_NAVIGATOR:#endif
#ifdef SUPPORT_COPY_FILE_IN_SLIDE_SHOW
    case OSD_UI_COPY_DELETE_DLG:
#endif //SUPPORT_COPY_FILE_IN_SLIDE_SHOW#ifdef SUPPORT_RADIO_TUNER    case OSD_UI_RADIO_TUNER:#endif //SUPPORT_RADIO_TUNER		        _bOSDTemp = OSD_UI_LAYER_2;        break;    case OSD_UI_MEDIA_SELECT_DLG:       //Media Select Dialog box    case OSD_UI_SETUP:                  //SETUP    case OSD_UI_MAIN_MENU:              //Main Menu        _bOSDTemp = OSD_UI_LAYER_3;        break;    case OSD_UI_PSCAN_PROMPT_DLG:    case OSD_UI_COMMON_DLG:        _bOSDTemp = OSD_UI_LAYER_4;        break;    case OSD_UI_SCREEN_SAVER:           //Screen Saver        _bOSDTemp = OSD_UI_LAYER_5;        break;    default:                            //unknown UI        _bOSDTemp = OSD_UI_LAYER_0;        break;    }    return _bOSDTemp;}//***************************************************************************//  Function    :   _OSD_ExitUI//  Abstract    :   This function will call the UI's "exit" function to notify //              :   the UI to exit and don't do recovery.//  Arguments   :   bUI: the UI. bExitMode: OSD_UI_EXIT_ALL/OSD_UI_EXIT_CONTROL_ONLY.//  Return      :   none.//  Side Effect :   none.//  Notes       :   //***************************************************************************void _OSD_ExitUI(BYTE bUI, BYTE bExitMode){    switch (bUI)    {    case OSD_UI_DISPLAY:                //Display mode        OSDDSPLY_Exit(bExitMode);        break;    case OSD_UI_MEDIA_MANAGER:          //File Manager                MM_Exit(bExitMode);        break;    case OSD_UI_THUMBNAIL:              //Thumbnail                THUMB_Exit(bExitMode);        break;#ifndef NO_SEARCH_UI //++CoCo2.37p    case OSD_UI_SEARCH:                 //Search UI        OSDSRCH_Exit(bExitMode);        break;#endif //#ifndef NO_SEARCH_UI //++CoCo2.37p#ifndef NO_DVD_PASSWORD_DLG //CoCo2.38    case OSD_UI_PASSWORD:               //DVD Password Dialog        OSDPASSWORD_Exit(bExitMode);        break;#endif //NO_DVD_PASSWORD_DLG#ifndef NO_PROGRAM_UI //++CoCo2.37p    case OSD_UI_DVD_PROGRAM:            //VCD/DVD Program        OSDPRGM_Exit(bExitMode);        break;#endif //#ifndef NO_PROGRAM_UI //++CoCo2.37p    case OSD_UI_DIGEST:                 //Digest        break;    case OSD_UI_MEDIA_SELECT_DLG:       //Media Select Dialog box        MEDIA_MediaSelection_Exit(bExitMode);        break;    case OSD_UI_PSCAN_PROMPT_DLG:       //The PSCAN prompt dialog box        break;    case OSD_UI_BOOKMARK:               //Bookmark#ifdef SUPPORT_BOOKMARK        OSDBOOKMARK_Exit(bExitMode);#endif //        break;#ifndef SUPPORT_STB    case OSD_UI_SETUP:                  //SETUP#ifdef IMAGE_FRAME_SETUP        MAINMENU_Exit(bExitMode);#else        SETUP_Exit(bExitMode);#endif //IMAGE_FRAME_SETUP        break;#endif //SUPPORT_STB#ifdef SUPPORT_STB    case OSD_UI_MAIN_MENU:              //Main Menu        MAINMENU_Exit(bExitMode);        break;#endif //SUPPORT_STB    case OSD_UI_SCREEN_SAVER:           //Screen Saver#ifndef NO_SCREEN_SAVER        OSDSS_Exit(bExitMode);#endif //        break;    case OSD_UI_COMMON_DLG:        OSDCOMDLG_Exit(bExitMode);         //For common dialog box.        break;#ifdef SUPPORT_NAVIGATOR //++CoCo2.37p#ifdef SUPPORT_INDEPENDENT_NAVIGATOR //CoCo1.0, support independent Navigator UI    case OSD_UI_NAVIGATOR:        OSDDSPLY_NAVIGATOR_Exit(bExitMode);        break;#endif //SUPPORT_INDEPENDENT_NAVIGATOR#endif //#ifdef SUPPORT_NAVIGATOR //++CoCo2.37p#ifdef SUPPORT_POWERON_MENU //CoCo2.38    case OSD_UI_POWERON_MENU:           //Power on Menu        POWERONMENU_Exit(bExitMode);        break;#endif //SUPPORT_POWERON_MENU
#ifdef SUPPORT_COPY_FILE_IN_SLIDE_SHOW
    case OSD_UI_COPY_DELETE_DLG:
        OSDMM_CopyDeleteDlg_Exit(bExitMode);
        break;
#endif //SUPPORT_COPY_FILE_IN_SLIDE_SHOW#ifdef SUPPORT_RADIO_TUNER    case OSD_UI_RADIO_TUNER:		//Radio Tuner        RADIO_Exit(bExitMode);        break;#endif //SUPPORT_RADIO_TUNER    default:                            //unknown UI        break;    }    }//***************************************************************************//  Function    :   _OSD_RecoverUI//  Abstract    :   This function will call the UI's OSDXXX_Recover function to //              :   recover the UI.//  Arguments   :   bUI: The UI needs to be recovered.//              :   bRecoverType:   OSD_RECOVER_ALL==>Recover all region.//              :                   OSD_RECOVER_UPPER_REGION==>Recover upper region.//              :                   OSD_RECOVER_BOTTOM_REGION==>Recover bottom region.//  Return      :   TRUE: It has been recoverd. FALSE: The UI doesn't do recovery for this region.//  Side Effect :   none.//  Notes       :   //***************************************************************************BYTE _OSD_RecoverUI(BYTE bUI, BYTE bRecoverType){    _bOSDTemp = FALSE;    if (bRecoverType == OSD_RECOVER_ALL)    {        _OSD_ConfigRegion(bUI);

⌨️ 快捷键说明

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