aboutsummaryrefslogtreecommitdiff
path: root/fmb_player_apl/src/scr/SetVideoOutMode.c
blob: 147a65d2152b1ff0c68e714b27af0acefa563e1a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
/*================================================
 *               ***************                 *
 *            **      \ | /      **              *
 *          *  ****   ****   ****** *            *
 *         * ---**---**-|-**--**--** *           *
 *        *     **  **  |  *  **  **  *          *
 *        *-----**--**--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 <http://www.gnu.org/licenses/>.
 */

#include "FmbCmn.h"
#include "Screen.h"
#include "FmbAp.h"

static const char	*_screenStr = "\
< Device list >\n\
                             'B'<-~~~~~~~~~~~~~~~->Enter\n\
Select following number. (* is current setting)\n\
\n\
  1 %c Bypass Mode\n\
  2 %c H.264 Mode\n\
\n\
";

static const char validChars[] = "bB12";

//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 main menu.
*	@param[out]	scr	Screen property
*	@return		None
*	@note		None
*	@attention	None
*/
void InitSetVideoOutMode(struct Screen *scr)
{
	FMB_FUNC(TRUE);

	scr->OnKeyFunc = OnKeyHit;
	scr->OnShowFunc = OnShow;
	scr->displayString = _screenStr;
	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 MMUX_OUTPUT_MODE outputMode;

	FMB_FUNC(TRUE);
	
	outputMode = MmuxGetOutputMode(FmbGetCurMmuxHd(), 0);
	
	printOut(_screenStr,
		g_selectMarks[outputMode][MMUX_OUT_MODE_BYPASS],
		g_selectMarks[outputMode][MMUX_OUT_MODE_H264]);


	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);

	switch (InputCharacterCode) {
	case	'b':
	case	'B':
		ChangeScreenTo(ScrEnmSetVideoInOut);
		FMB_FUNC(FALSE);
		return TRUE;
		break;
	case	'1':
		ChangeScreenTo(ScrEnmSetVideoOutBypass);
		break;
	case	'2':
		ChangeScreenTo(ScrEnmSetVideoOutH264);
		break;
	default:
		ASSERT_USR(FALSE, "Invalid character code.");
		break;
	}

	FMB_FUNC(FALSE);
	return TRUE;
}