/*================================================ * *************** * * ** \ | / ** * * * **** **** ****** * * * * ---**---**-|-**--**--** * * * * ** ** | * ** ** * * * *-----**--**--o-----****----* * * * ** ** | ** * * * * ---**---**-|--*--**---- * * * * **** **** **** * * * ** / | \ ** * * ************** * * Copyright ICP Electronics (C) 2010 * *===============================================*/ /*-----------------------------------------------* $Author: Kenneth $ $Date: $ $Revision: $ *-----------------------------------------------*/ /* * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . */ #include "FmbCmn.h" #include "Screen.h" #include "FmbAp.h" static const char *_screenStr = "\ [[[ Decode settings - Sub menu -> Video resolution ]]]\n\ 'B'<-~~~~~~~~~~~~~~~->Enter\n\ Select following number. (* is current setting)\n\ 1 %c %s\n\ 2 %c %s\n\ 3 %c %s\n\ 4 %c %s\n\ 5 %c %s\n\ 6 %c %s\n\ 7 %c %s\n\ 8 %c %s\n\ 9 %c %s\n\ i %c %s\n\ j %c %s\n\ k %c %s\n\ l %c %s\n\ m %c %s\n\ n %c %s\n\ "; static const char validChars[] = "123456789iIjJkKlLmMnNbB\n"; //Event function when key is input. static BOOL OnKeyHit(char InputCharacterCode); //Event function when show the screen. static BOOL OnShow(void); /** * @brief Initial screen of the video resolution of the encoding setting. * @param[out] scr Screen property * @return None * @note None * @attention None */ void InitSetVideoResolutionDec(struct Screen *scr) { FMB_FUNC(TRUE); scr->displayString = _screenStr; scr->OnKeyFunc = OnKeyHit; scr->OnShowFunc = OnShow; scr->validChars = validChars; FMB_FUNC(FALSE); } /** * @brief Screen display event * @param[in] None * @return TRUE Application execution continuance * @return FALSE Application end * @note None * @attention None */ static BOOL OnShow(void) { enum FMBFuncModeEnum setmode; FMB_FUNC(TRUE); ASSERT_USR(gp_FmbComProperty->setMode == FMBEnmFuncModeDec, "Function mode is illegal."); setmode = gp_FmbComProperty->setMode; printOut(_screenStr, g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1920_1080_60p], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1920_1080_60p], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1920_1080_59p], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1920_1080_59p], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1920_1080_50p], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1920_1080_50p], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1920_1080_60i], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1920_1080_60i], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1920_1080_59i], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1920_1080_59i], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1920_1080_50i], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1920_1080_50i], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1440_1080_60i], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1440_1080_60i], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1440_1080_59i], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1440_1080_59i], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1440_1080_50i], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1440_1080_50i], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1280_720_60p], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1280_720_60p], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1280_720_59p], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1280_720_59p], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_1280_720_50p], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_1280_720_50p], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_720_480_60i], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_720_480_60i], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_720_480_59i], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_720_480_59i], g_selectMarks[gp_FmbProperty[setmode].videoRsltn][FMBEnmVideoRsltn_720_576_50i], g_FmbNameVideoRsltn[FMBEnmVideoRsltn_720_576_50i]); SetInputEnabled(TRUE); FMB_FUNC(FALSE); return TRUE; } /** * @brief Event function when key is input. * @param[in] InputCharacterCode Input character-code * @return TRUE Application execution continuance * @return FALSE Application end * @note None * @attention None */ static BOOL OnKeyHit(char InputCharacterCode) { enum FMBFuncModeEnum setmode; enum FMBVideoResolutionEnum resolution_Fmb; FMB_FUNC(TRUE); ASSERT_USR(gp_FmbComProperty->setMode == FMBEnmFuncModeDec, "Function mode is illegal."); setmode = gp_FmbComProperty->setMode; switch(InputCharacterCode){ case '1': case '2': case '3': case '4': case '5': case '6': case '7': case '8': case '9': resolution_Fmb = InputCharacterCode - '1' + FMBEnmVideoRsltn_1920_1080_60p; FmbSetVideoFormat(resolution_Fmb, setmode); break; case 'i': case 'j': case 'k': case 'l': case 'm': case 'n': resolution_Fmb = InputCharacterCode - 'i' + FMBEnmVideoRsltn_1280_720_60p; FmbSetVideoFormat(resolution_Fmb, setmode); break; case 'I': case 'J': case 'K': case 'L': case 'M': case 'N': resolution_Fmb = InputCharacterCode - 'I' + FMBEnmVideoRsltn_1280_720_60p; FmbSetVideoFormat(resolution_Fmb, setmode); break; case 'b': case 'B': ChangeScreenTo(ScrEnmSetSubMenuDec); FMB_FUNC(FALSE); return TRUE; case '\n': OnShow(); break; default: //'\n' ASSERT_USR(InputCharacterCode=='\n', "Invalid character code."); break; }; ChangeScreenTo(ScrEnmSetSubMenuDec); FMB_FUNC(FALSE); return TRUE; }