diff options
Diffstat (limited to 'fmb_player_apl/src/scr/ConfEndOfPlay.c')
-rw-r--r-- | fmb_player_apl/src/scr/ConfEndOfPlay.c | 143 |
1 files changed, 143 insertions, 0 deletions
diff --git a/fmb_player_apl/src/scr/ConfEndOfPlay.c b/fmb_player_apl/src/scr/ConfEndOfPlay.c new file mode 100644 index 0000000..a31d400 --- /dev/null +++ b/fmb_player_apl/src/scr/ConfEndOfPlay.c @@ -0,0 +1,143 @@ +/** +* @brief The function of the decode confirmation screen is defined. +* @since 2009/01/08 +* @note None +* @attention None +* <B><I>COPYRIGHT FUJITSU LIMITED 2009</I></B> +*/ + +/* + * 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 2 of the License, or + * (at your option) any later version. + */ + +#include "FmbCmn.h" +#include "Screen.h" +#include "FmbAp.h" + +static const char *_screenStr = "\ +[[[ %s - finished -> Main menu ]]]\n\ + %s ~~~~~~~~->Enter\n\ +Finished %s.\n\ +Press <Enter> key to return to Main menu.\n\ +"; + +static const char validChars[] = "\n"; + +static const char *_screenTitle[2][2] = { + {"Decoding", + " "}, + {"One-picture decoding", + " "} +}; + +static const char *_screenComment[] = { + "decoding", + "One-picture decoding", +}; + +//Event function when key is input. +static BOOL OnKeyHit(char InputCharacterCode); + +//Event function when show the screen. +static BOOL OnShow(void); + +//Event function when fmb-request is complete. +static BOOL OnFmbRequestComplete(enum FMBRequestEnum req); + +/** +* @brief Initial screen of the decode end confirmation. +* @param[out] scr Screen property +* @return None +* @note None +* @attention None +*/ +void InitEndOfPlay(struct Screen *scr) +{ + FMB_FUNC(TRUE); + scr->displayString = _screenStr; + scr->OnKeyFunc = OnKeyHit; + scr->OnFmbRequestCompleteFunc = OnFmbRequestComplete; + 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 ScreenDecodeTypeEnum type = 0; + + FMB_FUNC(TRUE); + + switch(GetPrevScreen()){ + case ScrEnmDecNormal: + case ScrEnmDecPause: + case ScrEnmDecSlow: + type = ScrEnmDecType; + break; + case ScrEnmDec1pic: + type = ScrEnmDec1picType; + break; + default: + ASSERT_USR(FALSE, "Invalid prevScreen"); + break; + } + + printOut(_screenStr, _screenTitle[type][0], _screenTitle[type][1], _screenComment[type]); + + 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) +{ + FMB_FUNC(TRUE); + + //'\n' + ASSERT_USR(InputCharacterCode=='\n', "Invalid character code."); + + ChangeScreenTo(ScrEnmMainMenu); + SetInputEnabled(FALSE); + + FMB_FUNC(FALSE); + return TRUE; +} +/** +* @brief Event function when fmb-request is complete. +* @param[in] req Kind of completed request +* @return TRUE Application execution continuance +* @return FALSE Application end +* @note None +* @attention None +*/ +static BOOL OnFmbRequestComplete(enum FMBRequestEnum req) +{ + + FMB_FUNC(TRUE); + + SetInputEnabled(TRUE); + + FMB_FUNC(FALSE); + return TRUE; +} + |