📄 menu_new_ntsc.c
字号:
g_ucFactoryFlag=0x80;
g_SysSetting.Languange =LANGUAGE_ENGLISH;
g_ucMenuPageIndex = MENU_FACTORY;
g_ucMenuItemIndex = 1;
g_ucOsdTimeCounter = 0;
DrawOsdMenu();
break;
case MIA_GOTO_FACTORY:
g_ucFactoryFlag=0x80;
g_ucMenuPageIndex = MENU_FACTORY_COLOR_MODE;
g_SysSetting.Languange = LANGUAGE_ENGLISH;
g_ucMenuItemIndex = 0;
g_ucOsdTimeCounter = 0;
menuAction=MIA_REDRAWMENU;
bProcessEvent=TRUE;
break;
case MIA_GOTOROOT:
usrSaveMenu(USER_SAVE_OSD_CURRENT);
#if WHITE_BALANCE_AUTO
UART_WB_ID = 0;
#endif
g_ucMenuPageIndex = MENU_ROOT;
g_ucMenuItemIndex = 0;
g_ucOsdTimeCounter = 0;
menuAction = MIA_REDRAWMENU;
bProcessEvent = TRUE;
break;
case MIA_SOURCE:
msOsdDisableSubWinAll();
menuAction = MIA_REDRAWMENU;
g_ucPrevMenuPageIndex = g_ucMenuPageIndex;
g_ucMenuPageIndex = MENU_SOURCE;
g_ucMenuItemIndex = ConvertInputSourceIndexToMenuItemIndex();
bProcessEvent = TRUE;
break;
case MIA_TVCHINC:
if(IsTVInUse())
{
ExecTVChannelInc();
}
else
{
g_SysSetting.ucInputSourceType = INPUTSOURCE_TV;
InputSourceSwitch(g_SysSetting.ucInputSourceType);
usrSaveSystemSetting();
}
break;
case MIA_TVCHDEC:
if(IsTVInUse())
{
ExecTVChannelDec();
}
else
{
g_SysSetting.ucInputSourceType = INPUTSOURCE_TV;
InputSourceSwitch(g_SysSetting.ucInputSourceType);
usrSaveSystemSetting();
}
break;
case MIA_TVCHRET:
if(IsTVInUse())
{
ExecTVChannelRet();
}
else
{
g_SysSetting.ucInputSourceType = INPUTSOURCE_TV;
InputSourceSwitch(g_SysSetting.ucInputSourceType);
usrSaveSystemSetting();
}
break;
case MIA_SEARCH_STOP:
if (g_eSearchMode == TVSearch_INVALID)
{
menuAction = MIA_GOTOPREV;
bProcessEvent=TRUE;
}
else
{
TV_ChannelSearchStop();
}
break;
case MIA_POWER:
if (g_ucPowerManagerState == pmPowerIdle)
{
if (g_SysSetting.PowerOn)
{
if (!g_bPowerBootOn)
{
usrSaveMenu(USER_SAVE_OSD_CURRENT);
g_ucMenuPageIndex = MENU_POWER_OFF;
g_ucMenuItemIndex = 0;
g_ucOsdTimeCounter = 0;
menuAction = MIA_REDRAWMENU;
bProcessEvent = TRUE;
}
}
else
{
menuAction = MIA_GOTONEXT;
bProcessEvent = TRUE;
}
}
break;
case MIA_VOLUME:
g_ucMenuPageIndex = MENU_VOLUME;
g_ucMenuItemIndex = 0;
menuAction = MIA_REDRAWMENU;
bProcessEvent = TRUE;
break;
case MIA_MUTE:
g_bAudioMute = !g_bAudioMute;
devAudioVolumeCtl( AUDIO_VOLUME_TURN_ON );
g_ucMenuPageIndex = MENU_INPUT_MESSAGE;
g_ucMenuItemIndex = 0;
DrawOsdMenu();
if (g_bAudioMute)
{
g_ucOsdTimeCounter = 0;
}
break;
case MIA_INFO:
if (g_ucMenuPageIndex != MENU_INPUT_MESSAGE)
{
g_ucMenuPageIndex = MENU_INPUT_MESSAGE;
}
else
{
g_ucMenuPageIndex = MENU_ROOT;
}
g_ucMenuItemIndex = 0;
DrawOsdMenu();
break;
case MIA_PICTURE_MODE:
if(g_ucMenuPageIndex == MENU_PICTURE_MODE)
{
AdjustPicturePictureMode(MIA_INCVALUE);
}
else
{
AdjustPicturePictureMode(0);//open PIC Mode menu
}
g_ucMenuPageIndex = MENU_PICTURE_MODE;
g_ucMenuItemIndex = 0;
DrawOsdMenu();
break;
case MIA_SOUND_MODE:
if(g_ucMenuPageIndex == MENU_SOUND_MODE)
{
AdjustSoundSoundMode(MIA_INCVALUE);
}
else
{
AdjustSoundSoundMode(0);//open Sound Mode menu
}
g_ucMenuPageIndex = MENU_SOUND_MODE;
g_ucMenuItemIndex = 0;
DrawOsdMenu();
break;
case MIA_MAIN_SOURCE:
if(g_ucMenuPageIndex == MENU_SOURCE)
{
if(g_SysSetting.ucInputSourceType != ConvertMenuItemIndexToInputSouceIndex(g_ucMenuItemIndex) )
{
g_SysSetting.ucInputSourceType = ConvertMenuItemIndexToInputSouceIndex(g_ucMenuItemIndex);
usrSaveMenu(USER_SAVE_SOURCE_DIRECTLY);
CURRENT_MENU_ITEM_FUNC.ExecFunction();
}
}
break;
#if ( ENABLE_CC_VCHIP )
case MIA_CC:
ExecFunctionClosedCaptionAdjust();
break;
case MIA_TV_RATING_UP:
case MIA_TV_RATING_DOWN:
case MIA_TV_RATING_LEFT:
case MIA_TV_RATING_RIGHT:
case MIA_TV_RATING_ENTER:
MenuTVRating_ProcessEvent( menuAction );
break;
#endif
default:
return FALSE;
break;
}
}
g_ucMenuAction = MIA_NOTHING;
return TRUE;
}
//============================================================================
void OsdHandler(void)
{
BYTE ucFlag = 0;
if( g_SrcInfo.bPassDoModeSetting ) // PC/YPBPR
{
g_SrcInfo.bPassDoModeSetting = 0;
if( IsSrcUseAnalogPort() )
{
if( g_SrcInfo.bModeInputTimingChange )
{
return;
}
if( SrcTypeIsPC() && g_SrcInfo.bModeUnsupportMode )
{
g_ucDrawOSDFlag = OSD_FLAG_DRAW_MENU_UNSUPPORTED_MODE;
}
else if( SrcTypeIsPC() && mdSyncLossFlag() ) // PC DPMS message
{
g_ucDrawOSDFlag = OSD_FLAG_DRAW_MENU_STANDBY;
}
else if( SRC_TYPE_IS_VGA() && (!mdSyncLossFlag()) ) // VGA has signal
{
// VGA auto-tune
#if WHITE_BALANCE_AUTO
if (g_ucMenuPageIndex == MENU_FACTORY_COLOR_MODE)
{
AutoConfig();
}
else if ( g_ModeSetting.AutoSign == 0 )
#else
if ( g_ModeSetting.AutoSign != 3 ) // check auto sign
#endif
{
g_ucDrawOSDFlag = OSD_FLAG_DRAW_MENU_AUTO_ADJUST;
}
else
{
g_ucDrawOSDFlag = OSD_FLAG_DRAW_INPUT_MESSAGE;
}
}
else
{
g_ucDrawOSDFlag = OSD_FLAG_DRAW_INPUT_MESSAGE;
}
}
else
{
g_ucDrawOSDFlag = OSD_FLAG_DRAW_INPUT_MESSAGE;
}
}
if( g_ucDrawOSDFlag )
{
//printf("\r\nPage=%x",g_ucMenuPageIndex);
//printf("\r\nItem=%x",g_ucMenuItemIndex);
//printf("\r\nFlag=%x",g_ucDrawOSDFlag);
switch( g_ucDrawOSDFlag )
{
case OSD_FLAG_DRAW_MENU:
DrawOsdMenu();
break;
case OSD_FLAG_REDRAW:
ExecuteKeyEvent(MIA_REDRAWMENU);
break;
case OSD_FLAG_REDRAW_FACTORY:
DrawOsdMenuPage(g_ucMenuPageIndex);
msOsdShow();
break;
case OSD_FLAG_DRAW_INPUT_MESSAGE:
#if WHITE_BALANCE_AUTO
if (g_ucMenuPageIndex != MENU_FACTORY_COLOR_MODE)
#endif
{
g_ucMenuItemIndex = 0;
g_ucMenuPageIndex = MENU_INPUT_MESSAGE;
g_ucOsdTimeCounter = 5; // Reset OSD timeout timer.
DrawOsdMenu();
}
break;
case OSD_FLAG_DRAW_MENU_AUTO_ADJUST:
g_ucMenuPageIndex = MENU_AUTO_ADJUST;
g_ucMenuItemIndex = 0;
ExecuteKeyEvent(MIA_REDRAWMENU);
break;
case OSD_FLAG_DRAW_MENU_UNSUPPORTED_MODE:
g_ucMenuPageIndex = MENU_UNSUPPORTED_MODE;
g_ucMenuItemIndex = 0;
ExecuteKeyEvent(MIA_REDRAWMENU);
g_ucOsdTimeCounter = 0;
break;
case OSD_FLAG_DRAW_MENU_STANDBY:
g_ucMenuPageIndex = MENU_STANDBY;
g_ucMenuItemIndex = 0;
ExecuteKeyEvent(MIA_REDRAWMENU);
g_ucOsdTimeCounter = 0;
break;
case OSD_FLAG_TIMEOUT:
usrSaveMenu(USER_SAVE_OSD_CURRENT);
g_ucMenuItemIndex = 0;
if (g_bAudioMute)
{
g_ucMenuPageIndex = MENU_INPUT_MESSAGE;
g_ucMenuAction = MIA_MUTE;
}
else
{
g_ucMenuItemIndex = 0;
g_ucMenuPageIndex = MENU_ROOT;
}
DrawOsdMenu();
g_ucOsdTimeCounter = 0;
break;
case OSD_FLAG_DRAW_CHANEL_SCAN:
DrawOsdMenuItem(g_ucMenuPageIndex, g_ucMenuItemIndex);
g_ucOsdTimeCounter = 0;
break;
} // End of switch
g_ucDrawOSDFlag = 0;
}
}
BOOL GetMenuState(void)
{
if (((g_ucMenuPageIndex>=MENU_MAIN) && (g_ucMenuPageIndex < MENU_VOLUME)) ||
(g_ucFactoryFlag&0x80))
{
return TRUE;
}
else
{
return FALSE;
}
}
//Bruce.Ding add 060302 15:27 --[UI]
extern MenuItemActionType code m_eKeyActionMap[];
//---------------------------------------------
void UserInterfaceHandler(void)
{
BYTE cMenuAction = MIA_NOTHING;
BYTE cKeyCode = KEY_INVALID;
MenuItemKeyAction* psMenuItemKeyAction;
KeyActionMap* psKeyActionMap;
cKeyCode = ScanKeyInput();
psMenuItemKeyAction = CURRENT_MENU_ITEM.KeyEvents;
if ((psMenuItemKeyAction != NULL) && (KEY_INVALID > cKeyCode))
{
//printf("\r\nKey=%x",cKeyCode);
//printf("\r\nPageIndex=%x",g_ucMenuPageIndex);
//printf("\r\nItemIndex=%x",g_ucMenuItemIndex);
if (psMenuItemKeyAction->cActionFlags & MI_KEY_MAP)
{
cMenuAction = m_eKeyActionMap[cKeyCode];
}
psKeyActionMap = psMenuItemKeyAction->psKeyAction;
while(psKeyActionMap->eKeyType != KEY_INVALID)
{
if (psKeyActionMap->eKeyType == cKeyCode)
{
cMenuAction = psKeyActionMap->eItemAction;
break;
}
psKeyActionMap++;
}
}
if (MIA_NOTHING != cMenuAction)
{
ExecuteKeyEvent(cMenuAction);
if (GetKeypadCode() != BUTTON_INVALID)
{
Clr_KeypadReleaseFlag();
g_cKeypadReleaseCount = 120;
}
}
OsdHandler();
}
//Bruce.Ding add end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -