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

📄 osd3.c

📁 车载电子影音系统dvd播放系统原程序代码
💻 C
📖 第 1 页 / 共 5 页
字号:
	// also set Setup color
	GDI_ChangePALEntry(OSDSETUP_ENTRY_MAIN_COLOR_BG, OSDSETUP_VALUE_MAIN_COLOR_BG, TRUE);
	GDI_ChangePALEntry(OSDSETUP_ENTRY_HELP_COLOR_BG, OSDSETUP_VALUE_HELP_COLOR_BG, TRUE);
	GDI_ChangePALEntry(OSDSETUP_ENTRY_ICON_COLOR_BG, OSDSETUP_VALUE_ICON_COLOR_BG, TRUE);

	GDI_ChangePALEntry(OSDSETUP_ENTRY_SPEAKER_HIGHLIGHT, OSDSETUP_VALUE_SPEAKER_HIGHLIGHT, FALSE);

#ifdef REMOVE_SETUP_ICON
	GDI_ChangePALEntry(OSDSETUP_ENTRY_ICON_COLOR_ORANGE, OSDSETUP_VALUE_ICON_ORANGE, FALSE);	
	GDI_ChangePALEntry(OSDSETUP_ENTRY_ICON_COLOR_BLUE, OSDSETUP_VALUE_ICON_BLUE, FALSE); //Brian1.24a //Iris0312	
	GDI_ChangePALEntry(OSDSETUP_ENTRY_ICON_COLOR_RED, OSDSETUP_VALUE_ICON_RED, FALSE); //Brian1.24a //Iris0318	
	GDI_ChangePALEntry(OSDSETUP_ENTRY_ICON_COLOR_GREEN, OSDSETUP_VALUE_ICON_GREEN, FALSE); //Brian1.24a //Iris0318
#endif

	//GDI_ChangePALEntry(OSDSETUP_ENTRY_ICON_NORMAL, OSDSETUP_VALUE_ICON_NORMAL, FALSE);
	//GDI_ChangePALEntry(OSDSETUP_ENTRY_ICON_OVER, OSDSETUP_VALUE_ICON_OVER, FALSE);
	//GDI_ChangePALEntry(OSDSETUP_ENTRY_ICON_DOWN, OSDSETUP_VALUE_ICON_DOWN, FALSE);

}

void OSDMENU_DisplayTheMenu(void)
{
	switch (_bMenuType)
    {
        case MENU_TYPE_SETUP:
			OSDMENU_DisplayMenu(__bCurrentMenuId, __bMENUSelect[__bMENUCurrentLevel], __bMENUCurrentLevel);
			if (__bMENUCurrentLevel == 0)
            {
				OSDSETUP_ShowDescriptionText();
                // Brian1.08a, display menu settings when menu cursor in on Icon menu 
#ifdef SUPPORT_MENU_SETTINGS_DISPLAY
                _DisplayCurrentSettings();
#endif
            }

			OSDMENU_DisplaySubMenu(__bMENUSelect[__bMENUCurrentLevel], __bMENUCurrentLevel);
			break;
        case MENU_TYPE_AV_SYS:
            break;
        case MENU_TYPE_EQUALIZER:
			OSDMENU_DisplayAVSysMenu(__bMENUCurrentLevel);
			// the current item ID is the one found by OSDMENU_DisplayAVSysMenu, usually is the checked item
            // Brian1.08, the item ID may not be sequential, so don't use Position+MenuBase to get ID
			//__wMENUCurrentItemId = __bMENUSelect[__bMENUCurrentLevel] + GET_MENU_BASE(_pTempMenu);
            __wMENUCurrentItemId = GET_ITEM_ID(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]);

			OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], __bMENUSelect[__bMENUCurrentLevel], OSDMENU_ENTRY_ITEM_COLOR_HIGHLIGHT);
			break;
	}

}

/*
void OSDMENU_DisplaySetupMenu(void)
{
    //__bCurrentMenuId = SETUP_MENU_LANGUAGE;
    //__bMENUCurrentLevel = 1;
    //__bMENUSelect[__bMENUCurrentLevel] = 3;
    //__bMENUDisplayStart[__bMENUCurrentLevel] = 0;

    OSDMENU_DisplayMenu(__bCurrentMenuId, __bMENUSelect[__bMENUCurrentLevel], __bMENUCurrentLevel);
    if (__bMENUCurrentLevel == 0)
		OSDSETUP_ShowDescriptionText();

    //_pTempMenu = _SetupMenuIndex[SETUP_MENU_LANGUAGE];
    
    //OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], __bMENUSelect[__bMENUCurrentLevel], MENU_ITEM_COLOR_HIGHLIGHT);

    OSDMENU_DisplaySubMenu(__bMENUSelect[__bMENUCurrentLevel], __bMENUCurrentLevel);
}

void nd)
{

    OSDMENU_DisplayMenu(__bCurrentMenuId, __bMENUSelect[__bMENUCurrentLevel], __bMENUCurrentLevel);

}
*/


void OSDMENU_MenuOperation(BYTE bKey)
{

    BYTE bItemNum, bOrgItem;
    BYTE bMenuOperation; // Brian1.08a

    // Brian1.08a, transfer Key to menu operation
#ifdef SUPPORT_SETUP_HORIZONTAL_ICON_MENU
    // Horizontal icon menu

    if (__bMENUCurrentLevel == 0) 
    {
        // at root (icon) menu
        switch (bKey)
        {
            case KEY_UP:
                return;
            case KEY_DOWN:
                bMenuOperation = OSDMENU_GOTO_SUB_MENU;
                break;
            case KEY_RIGHT:
                bMenuOperation = OSDMENU_GOTO_NEXT_ITEM;
                break;
            case KEY_LEFT:
                bMenuOperation = OSDMENU_GOTO_PREV_ITEM;
                break;
            case KEY_ENTER:
            case KEY_PLAY:
            case KEY_PLAY_PAUSE:
                bMenuOperation = OSDMENU_SELECT_ITEM;
                break;
        } 

    }
    else // it is not root menu
    {
        // none root (icon) menu
        switch (bKey)
        {
            case KEY_UP:
                // need to check when it's the topest item
                // it's more convenient to do the check when processing the operation, 
                // for the condition code is already there 
                bMenuOperation = OSDMENU_GOTO_PREV_ITEM;
                break;
            case KEY_DOWN:
                bMenuOperation = OSDMENU_GOTO_NEXT_ITEM;
                break;
            case KEY_RIGHT:
                bMenuOperation = OSDMENU_GOTO_SUB_MENU;
                break;
            case KEY_STOP: // allow use KEY_STOP to go to parent menu
            case KEY_LEFT:
                // need chech when it's the left most item
                // it's more convenient to do the check when processing the operation, 
                // for the condition code is already there 
                bMenuOperation = OSDMENU_GOTO_PARENT_MENU;
                break;
            case KEY_ENTER:
            case KEY_PLAY:
            case KEY_PLAY_PAUSE:
                bMenuOperation = OSDMENU_SELECT_ITEM;
                break;
        } 
    }

#else
    // Vertical icno menu
    // just 1-to-1 mapping
    switch (bKey)
    {
        case KEY_UP:
            bMenuOperation = OSDMENU_GOTO_PREV_ITEM;
            break;
        case KEY_DOWN:
            bMenuOperation = OSDMENU_GOTO_NEXT_ITEM;
            break;
        case KEY_RIGHT:
            bMenuOperation = OSDMENU_GOTO_SUB_MENU;
            break;
        case KEY_LEFT:
            bMenuOperation = OSDMENU_GOTO_PARENT_MENU;
            break;
        case KEY_ENTER:
        case KEY_PLAY:
        case KEY_PLAY_PAUSE:
            bMenuOperation = OSDMENU_SELECT_ITEM;
            break;
    } 

#endif // SUPPORT_SETUP_HORIZONTAL_ICON_MENU

process_key_op:

    _pTempMenu = _pMenuIndex[__bCurrentMenuId];
    bItemNum = GET_MENU_ITEM_NUM(_pTempMenu);

    // Brian1.08a
    //switch (bKey)
    switch (bMenuOperation)
    {
        // Brian1.08a
        //case KEY_UP:
        case OSDMENU_GOTO_PREV_ITEM:
            // Brian1.08a, support Horizontal icon menu
#ifdef SUPPORT_SETUP_HORIZONTAL_ICON_MENU
            if (__bMENUSelect[__bMENUCurrentLevel] == 0)
            {
                if (__bMENUCurrentLevel == 1) // menu level 2 ==> value menu, don't go to paranet menu
                {
                    
                    // it is the topest item, so need to move to icon menu
                    bMenuOperation = OSDMENU_GOTO_PARENT_MENU;
                    goto process_key_op;
                }
            }
            else
#else
            if (__bMENUSelect[__bMENUCurrentLevel] != 0)
#endif
            {
				
#ifdef SKIP_DISABLED_ITEM
                // Brian1.05, don't move cursor onto disabled item.
                bOrgItem = __bMENUSelect[__bMENUCurrentLevel]; // keep the current select

                while(__bMENUSelect[__bMENUCurrentLevel] != 0)
                {
                    __bMENUSelect[__bMENUCurrentLevel]--;

                    _bMENUTemp = __bMENUSelect[__bMENUCurrentLevel]; 

                    if(GET_ITEM_ATTRIBUTE(_pTempMenu, _bMENUTemp) == IS_ITEM ||
                       GET_ITEM_ATTRIBUTE(_pTempMenu, _bMENUTemp) == IS_DIALOG)
                    {
                        if (*(GET_MENU_ENABLE(_pTempMenu)+_bMENUTemp/8) & (1 << (_bMENUTemp%8))) // if enabled
                        {
                            break; // find a enabled item
                        }
                        else
                        {
                            if (__bMENUSelect[__bMENUCurrentLevel] == 0)
                            {
                                // no enabled item is found, so the cursor remain still
                                __bMENUSelect[__bMENUCurrentLevel] = bOrgItem;
// Brian1.08a, support Horizontal icon menu
#ifdef SUPPORT_SETUP_HORIZONTAL_ICON_MENU
                                // since there is no Up items, so go to Icon menu
                                bMenuOperation = OSDMENU_GOTO_PARENT_MENU;
                                goto process_key_op;
                                
#else
                                return;
#endif
                            }
                        }
                    } // if IS_ITEM
                    else
                    {
                        break; // for value, no such consideration, just move the cursor as usual

                    }
                } // while
#else
                // allow move to disabled item
                __bMENUSelect[__bMENUCurrentLevel]--;

#endif


                if (__bMENUCurrentLevel < MENU_LEVEL-1)
				    __bMENUSelect[__bMENUCurrentLevel+1] = 0; // set select to 0, the first item. 

				__wMENUPrevItemId = __wMENUCurrentItemId;

				if (__bMENUCurrentLevel == 0 && _bMenuType == MENU_TYPE_SETUP)
                {
					OSDSETUP_ShowDescriptionText();
                    // Brian1.08a, display menu settings when menu cursor in on Icon menu 
#ifdef SUPPORT_MENU_SETTINGS_DISPLAY
                    _ClearCurrentSettings();
                    _DisplayCurrentSettings();
#endif

                }

                if(GET_ITEM_ATTRIBUTE(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]) == IS_LINE)
                {
                    // I assume nobody will put a seperate line as the first item,
                    // so I don't check if it is out of the range
                    __bMENUSelect[__bMENUCurrentLevel]--;
                    bItemNum = 1; // just use it to keep if this is a seperate line
                }
                else
                    bItemNum = 0; // just use it to keep if this is a seperate line

                //OSDMENU_DisplaySetupMenu();
                if (__bMENUSelect[__bMENUCurrentLevel] < __bMENUDisplayStart[__bMENUCurrentLevel])
                {
#ifdef SKIP_DISABLED_ITEM
                    __bMENUDisplayStart[__bMENUCurrentLevel] = __bMENUSelect[__bMENUCurrentLevel] -bItemNum;
#else
                    __bMENUDisplayStart[__bMENUCurrentLevel] -= (1+bItemNum);
#endif
                    OSDMENU_DisplayMenu(__bCurrentMenuId, 0xFF, __bMENUCurrentLevel);
                }
                else
                {
#ifdef SKIP_DISABLED_ITEM
                    // Brian1.05, don't move cursor onto disabled item.
                    OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], (BYTE)(bOrgItem+bItemNum), (BYTE)OSDMENU_ENTRY_ITEM_COLOR_NORMAL);
#else
                    OSDMENU_DrawItem(__bMENUDisplayStart[__bMENUCurrentLevel], (BYTE)(__bMENUSelect[__bMENUCurrentLevel]+1+bItemNum), (BYTE)OSDMENU_ENTRY_ITEM_COLOR_NORMAL);
#endif

                }

				__wMENUCurrentItemId = GET_ITEM_ID(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]);

                // clear the previous menu
#ifdef SKIP_DISABLED_ITEM
                _pTempMenu = GET_SUB_MENU(_pTempMenu, bOrgItem+bItemNum);
#else
                _pTempMenu = GET_SUB_MENU(_pTempMenu, __bMENUSelect[__bMENUCurrentLevel]+1+bItemNum);
#endif
                if (_pTempMenu)
                {
                    OSDMENU_ClearMenu();
                    __bMENUStatus[__bMENUCurrentLevel+1] &= 0xFE; // clear scroll-up bit
                    __bMENUStatus[__bMENUCurrentLevel+1] &= 0xFD; // clear scroll-down bit
                }
                _pTempMenu = _pMenuIndex[__bCurrentMenuId];
                

                _bMENUTemp = __bMENUSelect[__bMENUCurrentLevel];
                if(GET_ITEM_ATTRIBUTE(_pTempMenu, _bMENUTemp) == IS_ITEM)

⌨️ 快捷键说明

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