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

📄 mainmenu.c

📁 ct952 source code use for Digital Frame Photo
💻 C
📖 第 1 页 / 共 4 页
字号:
        HelpRect.bShadePtr = _bMAINMENUHelpPalette2;        break;    case 2:        HelpRect.bShadePtr = _bMAINMENUHelpPalette3;        break;    case 3:        HelpRect.bShadePtr = _bMAINMENUHelpPalette4;        break;    case 0:    default:        HelpRect.bShadePtr = _bMAINMENUHelpPalette1;        GDI_FillRect(0|GDI_SHADING_OPERATION, &HelpRect);        return;    }    GDI_FillRoundRectBottom(0|GDI_SHADING_OPERATION, MAINMENU_HELP_REGION_ARC, &HelpRect);}void MAINMENU_DrawMainBackground(void){	MAINMENU_DrawMainTitleBackground(__SetupInfo.bUIStyle-SETUP_CUSTOM_UI_STYLE_BEGIN);	MAINMENU_DrawMainContentBackground();	MAINMENU_DrawMainHelpBackground(__SetupInfo.bUIStyle-SETUP_CUSTOM_UI_STYLE_BEGIN);}void MAINMENU_ClearMainBackground(void){	PARM_RECT MainBackgroundRect;    MainBackgroundRect.bColor = PAL_ENTRY_COLOR_TRANSPARENT;    MainBackgroundRect.rect.wLeft = MAINMENU_TITLE_REGION_START_X;    MainBackgroundRect.rect.wTop = MAINMENU_TITLE_REGION_START_Y;    MainBackgroundRect.rect.wRight = MainBackgroundRect.rect.wLeft+MAINMENU_TITLE_REGION_WIDTH-1;    MainBackgroundRect.rect.wBottom = MainBackgroundRect.rect.wTop+MAINMENU_TITLE_REGION_HEIGHT+MAINMENU_CONTENT_REGION_HEIGHT+MAINMENU_HELP_REGION_HEIGHT-1;    GDI_FillRect(0, &MainBackgroundRect);}void MAINMENU_ClearMainTitleBackground(BYTE bUIStyle, PARM_RECT *RectAttr){    PARM_RECT TitleRect;    TitleRect = *RectAttr;    TitleRect.bColor = MAINMENU_TITLE_REGION_HEIGHT;        switch (bUIStyle)    {    case 1:        TitleRect.bShadePtr = _bMAINMENUTitlePalette2;        break;    case 2:        TitleRect.bShadePtr = _bMAINMENUTitlePalette3;        break;    case 3:        TitleRect.bShadePtr = _bMAINMENUTitlePalette4;        break;    case 0:    default:        TitleRect.bShadePtr = _bMAINMENUTitlePalette1;                break;    }    GDI_FillRect(0|GDI_SHADING_OPERATION, &TitleRect);}void MAINMENU_DrawTitleString(WORD *pw1stTitle, WORD *pw2ndTitle, WORD *pw3rdTitle){    PARM_DRAW_STRING TitleStringAttr;        MAINMENU_UseColorKey(&TitleStringAttr);    TitleStringAttr.bTextColor = MAINMENU_PALETTE_ENTRY_TITLE_STRING_1ST;      if (pw1stTitle != NULL)    {        TitleStringAttr.wX = MAINMENU_TITLE_STRING_START_X;        TitleStringAttr.wY = MAINMENU_TITLE_REGION_START_Y+((MAINMENU_TITLE_REGION_HEIGHT-GDI_GetStringHeight(pw1stTitle))>>1);                GDI_DrawString_909(0, &TitleStringAttr, pw1stTitle);    }    else        return;    if (pw2ndTitle != NULL)    {        TitleStringAttr.wX += GDI_GetStringWidth_909(pw1stTitle);        GDI_DrawString_909(0, &TitleStringAttr, aMENUTitleSeparation);        TitleStringAttr.bTextColor = MAINMENU_PALETTE_ENTRY_TITLE_STRING_2ND;        TitleStringAttr.wX += GDI_GetStringWidth_909(aMENUTitleSeparation);        GDI_DrawString_909(0, &TitleStringAttr, pw2ndTitle);    }    else        return;    if (pw3rdTitle != NULL)    {        TitleStringAttr.bTextColor = MAINMENU_PALETTE_ENTRY_TITLE_STRING_1ST;        TitleStringAttr.wX += GDI_GetStringWidth_909(pw2ndTitle);        GDI_DrawString_909(0, &TitleStringAttr, aMENUTitleSeparation);                TitleStringAttr.bTextColor = MAINMENU_PALETTE_ENTRY_TITLE_STRING_3RD;        TitleStringAttr.wX += GDI_GetStringWidth_909(aMENUTitleSeparation);        GDI_DrawString_909(0, &TitleStringAttr, pw3rdTitle);    }    }void MAINMENU_UseColorKey(PARM_DRAW_STRING *StringAttr){	StringAttr->bBackground = 1;    StringAttr->bColorKey = 1;    StringAttr->bShadow1 = 1;    StringAttr->bShadow2 = 1;}void MAINMENU_DrawSelectionHelp(BYTE bUpDownOnly, BYTE bExitHelp){    PARM_DRAW_STRING StringAttr;  	MAINMENU_UseColorKey(&StringAttr);    StringAttr.bTextColor = MAINMENU_PALETTE_ENTRY_HELP_STRING;         StringAttr.wX = MAINMENU_HELP_STRING_START_X;    StringAttr.wY = MAINMENU_HELP_REGION_START_Y+((MAINMENU_HELP_REGION_HEIGHT-GDI_GetStringHeight(aMENUHelpIconLeft))>>1);    if (!bUpDownOnly)    {        GDI_DrawString_909(0, &StringAttr, aMENUHelpIconLeft);        StringAttr.wX += (GDI_GetStringWidth(aMENUHelpIconLeft)+MAINMENU_HELP_ICON_DISTANCE_H);    }        GDI_DrawString_909(0, &StringAttr, aMENUHelpIconUp);    StringAttr.wX += (GDI_GetStringWidth(aMENUHelpIconUp)+MAINMENU_HELP_ICON_DISTANCE_H);        if (!bUpDownOnly)    {        GDI_DrawString_909(0, &StringAttr, aMENUHelpIconRight);        StringAttr.wX += (GDI_GetStringWidth(aMENUHelpIconRight)+MAINMENU_HELP_ICON_DISTANCE_H);    }        GDI_DrawString_909(0, &StringAttr, aMENUHelpIconDown);        StringAttr.wX += GDI_GetStringWidth(aMENUHelpIconDown);    GDI_DrawString_909(0, &StringAttr, aMENUHelpSelect);        if (bExitHelp)    {        //Confirm        StringAttr.wX += (GDI_GetStringWidth(aMENUHelpSelect)+MAINMENU_HELP_SELECT_EXIT_DISTANCE_H);        GDI_DrawString_909(0, &StringAttr, aMENUHelpIconConfirm);        StringAttr.wX += GDI_GetStringWidth(aMENUHelpIconConfirm);        GDI_DrawString_909(0, &StringAttr, aMENUHelpConfirm);                StringAttr.wX = MAINMENU_HELP_REGION_START_X+MAINMENU_HELP_REGION_WIDTH-MAINMENU_HELP_BACKGROUND_STRING_DISTANCE_H-GDI_GetStringWidth(aMENUHelpExit);        GDI_DrawString_909(0, &StringAttr, aMENUHelpExit);            }    else    {        StringAttr.wX = MAINMENU_HELP_REGION_START_X+MAINMENU_HELP_REGION_WIDTH-MAINMENU_HELP_BACKGROUND_STRING_DISTANCE_H-GDI_GetStringWidth(aMENUHelpConfirm);        GDI_DrawString_909(0, &StringAttr, aMENUHelpConfirm);                StringAttr.wX -= GDI_GetStringWidth(aMENUHelpIconConfirm);        GDI_DrawString_909(0, &StringAttr, aMENUHelpIconConfirm);    }}void MAINMENU_DrawExitHelpOnly(void){    PARM_DRAW_STRING StringAttr;        MAINMENU_UseColorKey(&StringAttr);    StringAttr.bTextColor = MAINMENU_PALETTE_ENTRY_HELP_STRING;          StringAttr.wX = MAINMENU_HELP_REGION_START_X+MAINMENU_HELP_REGION_WIDTH-MAINMENU_HELP_BACKGROUND_STRING_DISTANCE_H-GDI_GetStringWidth(aMENUHelpExit);    StringAttr.wY = MAINMENU_HELP_REGION_START_Y+((MAINMENU_HELP_REGION_HEIGHT-GDI_GetStringHeight(aMENUHelpExit))>>1);    GDI_DrawString_909(0, &StringAttr, aMENUHelpExit);}void MAINMENU_ExitAll(BYTE bClearBackground, BYTE bForceExit){#ifdef SUPPORT_STB    BYTE bEntryIndex;#endif //SUPPORT_STB    _bMAINMENUMode = FALSE;    __bSetupMode = FALSE; //Let DVD flow think SETUP mode exists.#ifdef SUPPORT_STB        for (bEntryIndex = 0; bEntryIndex < (sizeof(_MenuFlowTable)/sizeof(MENU_FLOW)); bEntryIndex++)    {        if (_MenuFlowTable[bEntryIndex].Menu_Exit_Func_Ptr != NULL)        {            _MenuFlowTable[bEntryIndex].Menu_Exit_Func_Ptr(FALSE);        }    }        if (bClearBackground)    {        GDI_ClearRegion(0);    }    if ( __bChooseMedia == MEDIA_SELECT_STB)    {        if (!bForceExit)        {            if (__bEPGScheduleMode)            {                ap_ch_reswitch_nowait();                if (normal_play_get_srv_type() == EN_SERVICE_TYPE_RADIO)                {                    FlowCtl_EnterNewState(FS_EPG_LIST_RADIO);                }                else                {                    FlowCtl_EnterNewState(FS_EPG_LIST_TV);                }            }            else            {                FlowCtl_EnterNewState(FS_NORMAL_PLAY);            }        }    }    else //DVD mode.    {        if (!bForceExit)        {            OSD_ChangeUI(OSD_UI_MAIN_MENU, OSD_EXIT_UI);            _MAINMENU_ExitDVDMode();        }    }#else    DVDSETUP_Exit(bClearBackground);            if (!bForceExit)    {        //OSD_ChangeUI(OSD_UI_MAIN_MENU, OSD_EXIT_UI);        OSD_ChangeUI(OSD_UI_SETUP, OSD_EXIT_UI);    }        _MAINMENU_ExitDVDMode();#endif //#ifdef SUPPORT_STB}void _MAINMENU_InitDVDMode(void){    if (!(__wDiscType & BOOK_DVD))    {        if (__btPlaying) // Brian2.81, thumbnail support KEY_PAUSE        {            // brian.171a, change to KEY_PLAY then KEY_PAUSE            // This is a workaround to make SCF/SCB, FF look like paused            // (before the real KEY_PAUSE issue is solved)            // However add this would also make it change to PLAY mode when exit Setup.            // This is a side effect. When KEY_PAUSE issue is sovled for SCF/SCB, FF,            // we could remove this part#ifdef  PLAY_AFTER_EXIT_SETUP            // this for none-DVD            if (__bAttrPlay&TYPE_CDROM_AUDIO) // Brian1.25, audio only could directly enter pause mode. Otherwise ==> // Kevin, MP3 SCF/SCB->Setup->Exit Setup=> jump to next file (below (KEY_PLAY) will reset audio s.t. A2-Rem < 720)                 __bModeCmd = KEY_PLAY;            #ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM            //xuli2.34, Because MP3 still toggle KEY_PAUSE when enter/exit SETUP, need set __bModeCmd to KEY_PLAY before issue KEY_PAUSE, or else KEY_PAUSE will be INVALID.                              // wyc2.00-909S, don't issue play command again when exit setup mode from JPG preview active, because preview mode also is play            // mode and don't need to issue play again. And issue play again also will call reset video and it will abort JPG decode and make            // JPG decoding progress aborted and won't continue to decode after exit setup mode.            if (( __bModeCmd != KEY_PLAY) && (__dwMMJPEGPreview == FALSE) && (!__bThumbnailMode))  // if it is already in play mode, don't need to issue KEY_PLAY again                CC_DoKeyAction (KEY_PLAY);#endif  //#ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM#endif  //#ifdef  PLAY_AFTER_EXIT_SETUP            #ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM //XuLi.230            CC_DoKeyAction (KEY_PAUSE);#endif        }                // Brian1.10, add kevin's support for MP3 Fast Forward.#ifdef  PLAY_AFTER_EXIT_SETUP        //MP3 Fast Forward case, SCF->enter SETUP->exit SETUP => Normal Play        if (__bAttrPlay==ATTR_MP3)        {               // always set to normal play            __bScanLevel=0;            HAL_WriteAM(HAL_AM_FF_SPEED, __bScanLevel);         }#endif        #ifndef NO_DIGEST //LJY1.20, support 4M flash, remove digest        //LJY1.00, fix the noise problem while it entered setup in digest mode.        if(__btDIGEST)        {            CHIPS_OpenAudio(FALSE);        }#endif            }    else if (__btPlaying)    {        // brian.171a, chnage to KEY_PLAY then KEY_PAUSE#ifdef  PLAY_AFTER_EXIT_SETUP#ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM //XuLi.230        // this is for DVD        if (__bModeCmd != KEY_PLAY) // if it is already in play mode, don't need to issue KEY_PLAY again            CC_DoKeyAction (KEY_PLAY);#endif  //#ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM#endif  //#ifdef  PLAY_AFTER_EXIT_SETUP        #ifndef PRESTOP_BEFORE_SETUP_AND_PROGRAM //XuLi.230        CC_DoKeyAction (KEY_PAUSE);#endif    }}void _MAINMENU_ExitDVDMode(){    // Brian0.87, disable one field display when exit Setup    DISP_ForceOneField(FALSE);        // brian.277a Test Tone    // PCM_SCALE may be set by Test Tone, so we turn it off as it was when we enter Setup    // if we don't turn PCM_SCALE off, there may be noise (on AMP) when it change Audio Output    //CHIPS_OpenAudio(FALSE);    #ifndef NO_DISC_MODE //CoCo2.38        //turn on highlight    HAL_ControlHighlight(HAL_HLI_ACTION_SELECT, __bNowBTNNumber+__bGroupOffset);#endif        //__bKey=KEY_NO_KEY;      #ifdef PRESTOP_BEFORE_SETUP_AND_PROGRAM    if (__wDiscType & BOOK_M1)    {        // wyc2.00-909S, only restore main video in MM UI mode because JPG slide show or motion mode we don't disable main video when entering media select UI.        // Also will happen video scramble when open main video during JPG decoding here, so must only open it when MM UI mode.        if ((__bMMMenuID != MM_MENU_NONE) || (__bThumbnailMode))        {            DISP_DisplayCtrl(DISP_MAINVIDEO, TRUE);        }    }    CC_ForceResumeRePlay(CC_FORCE_STOP_FROM_SETUP);#else // #ifdef PRESTOP_BEFORE_SETUP_AND_PROGRAM    if (__btPause)    {        // wyc2.00-909S, because the __bModeCmd is KEY_STOP when JPG preview decoding mode and it will make CC_DoKeyAction(KEY_PAUSE) to issue        // CC_KeyCommand(KEY_STOP) and then JPG preview won't continue when exit setup mode. So we set __bModeCmd to KEY_PLAY to         // cheat CC_DoKeyAction(KEY_PAUSE) to issue CC_KeyCommand(KEY_PLAY) to continue to decode preview after exiting setup mode.        if (__dwMMJPEGPreview == TRUE)            __bModeCmd = KEY_PLAY;        CC_DoKeyAction(KEY_PAUSE);    }#endif        #ifndef NO_DISC_MODE //CoCo2.37p    _IdentifyRegionCode();  // brian.161 check region code (show or clear the error message)#endif //NO_DISC_MODE    #ifndef NO_DIGEST //LJY1.20, support 4M flash, remove digest    //LJY0.87, enable audio for digest mode    if (__btDIGEST)        CHIPS_OpenAudio( TRUE );#endif    }void MAINMENU_Exit(BYTE bClearBackground){    MAINMENU_ExitAll(bClearBackground, TRUE);}#ifdef SUPPORT_STBvoid MAINMENU_DVD_Recover(BYTE bRecoverRegion){    MAINMENU_Recover();}#endif //SUPPORT_STB

⌨️ 快捷键说明

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