source: svn/branches/kctv/zasc/app/DST_WinMTSHot.cpp

Last change on this file was 2, checked in by phkim, 11 years ago

1.phkim

  1. revision copy newcon3sk r27
File size: 6.0 KB
Line 
1#include "DST_WinManager.h"
2#include "DST_OSDImage.h"
3#include "DST_UserInterface.h"
4#include "DST_DataStrings.h"
5
6#if 0
7____CAudioWin___()
8#endif
9
10class CAudioWin : public CWindow
11{
12private:
13        int nMTSCount;
14public:
15        CAudioWin(SWinEventMsg event):CWindow(event)
16        {
17                rect.w = DST_GetImageWidth(newcon2_gui_banner_mute_back);
18                rect.h = DST_GetImageHeight(newcon2_gui_banner_mute_back);
19                rect.x = (DST_GetScreenWidth() - rect.w) / 2;
20                rect.y = DST_GetScreenHeight()*9/10 - rect.h;
21
22                SetTimeOut(3);
23        }
24        virtual ~CAudioWin()
25        {
26        }
27        virtual void OnMessage(SWinEventMsg event)
28        {
29                switch (event.cmd)
30                {
31                        case WM_POWER_OFF:
32                                Close();
33                                break;
34                }
35        }
36        virtual void Show(WinID id)
37        {
38                switch(id)
39                {
40                        case WIN_EWS:
41                        case WIN_CHANNEL_BANNER:
42                        case WIN_DIRECT_TUNE:
43                        case WIN_VOLUME:
44                        case WIN_VOLUME_MUTE:
45                        case WIN_SIGNAL_METER:
46                        case WIN_CLOSED_CAPTION_HOT:
47                        //case WIN_AUDIO_HOT:
48                        case WIN_DISPLAY_MODE_HOT:
49                        case WIN_FACTORY_RESET:
50                        case WIN_FACTORY_RESET_ASK:
51                        case WIN_INFOR_BANNER:
52                        case WIN_MAIN_MENU:
53                        case WIN_POWER_DOWN_CAUTION:
54                        case WIN_SUB_MENU_2DEPTH:
55                        case WIN_SUB_MENU_3DEPTH:
56                        case WIN_SUB_MENU_4DEPTH:
57                        case WIN_AUTO_SEARCH:
58                        case WIN_MANUAL_SEARCH:
59                        case WIN_CHANNEL_LIST:
60                        case WIN_PROGRAM_GUIDE:
61                                Close();
62                                break;
63                        default:
64                                break;
65                }
66        }
67       
68        DS_U16* GetString(int nPos)
69        {
70                switch (nPos)
71                {
72                        case  0: return pz_MTS_Main[OSD_Lang];
73                        case  1: return pz_MTS_Sub[OSD_Lang];
74                }
75                return 0;
76        }               
77        virtual void Show()
78        {
79
80                nMTSCount = 2;
81                DrawImage(0, 0, newcon2_gui_banner_mute_back);
82                setFontStyle(25, 0xFFC8C8C8, ALIGN_MIDDLE,ALIGN_CENTER);
83                DrawTextUni(0, 0, rect.w, rect.h, GetString(DST_UI_GetMTS()), &font);
84               
85                RegisterKey(VK_AUDIO, true);
86                RegisterKey(VK_CANCEL, true);
87        }
88
89        virtual void KeyInput(DS_U8 key, bool /*bRepeat*/)
90        {
91                switch (key)
92                {
93                        case VK_AUDIO:
94                                DST_UI_SetMTS((DST_UI_GetMTS() == nMTSCount - 1) ? 0 : DST_UI_GetMTS()+1);
95                                Show();
96
97                                break;
98                        case VK_CANCEL:
99                                Close();
100                                break;
101                }
102        }
103};
104
105void DST_CreateAudioWindow(SWinEventMsg event)
106{
107        DST_AddWin((WinID)(event.data[0]), new CAudioWin(event));
108}
109
110
111class CClosedCaptionWin : public CWindow
112{
113private:
114        int nCCPos;
115public:
116        CClosedCaptionWin(SWinEventMsg event):CWindow(event)
117        {
118                rect.w = DST_GetImageWidth(newcon2_gui_banner_mute_back);
119                rect.h = DST_GetImageHeight(newcon2_gui_banner_mute_back);
120                rect.x = (DST_GetScreenWidth() - rect.w) / 2;
121                rect.y = DST_GetScreenHeight()*9/10 - rect.h;
122
123                SetTimeOut(3);
124                nCCPos = 0;
125
126        }
127        virtual ~CClosedCaptionWin()
128        {
129        }
130        virtual void Show(WinID id)
131        {
132                switch(id)
133                {
134                        case WIN_EWS:
135                        case WIN_CHANNEL_BANNER:
136                        case WIN_DIRECT_TUNE:
137                        case WIN_VOLUME:
138                        case WIN_VOLUME_MUTE:
139                        case WIN_SIGNAL_METER:
140//                      case WIN_CLOSED_CAPTION_HOT:
141                        case WIN_AUDIO_HOT:
142                        case WIN_DISPLAY_MODE_HOT:
143                        case WIN_FACTORY_RESET:
144                        case WIN_FACTORY_RESET_ASK:
145                        case WIN_INFOR_BANNER:
146                        case WIN_MAIN_MENU:
147                        case WIN_POWER_DOWN_CAUTION:
148                        case WIN_SUB_MENU_2DEPTH:
149                        case WIN_SUB_MENU_3DEPTH:
150                        case WIN_SUB_MENU_4DEPTH:
151                        case WIN_AUTO_SEARCH:
152                        case WIN_MANUAL_SEARCH:
153                        case WIN_CHANNEL_LIST:
154                        case WIN_PROGRAM_GUIDE:
155                                Close();
156                                break;
157                        default:
158                                break;
159                }
160        }
161
162        DS_U16* GetString(int nPos)
163        {
164                switch (nPos)
165                {
166                        case  0: return pz_Off[OSD_Lang];
167                        case  1: return pz_Language1[OSD_Lang];
168                        case  2: return pz_Language2[OSD_Lang];
169                        default : return 0;
170                }
171        }
172       
173        virtual void Show()
174        {
175                nCCPos = DST_EEPROM_GetCC();
176
177                DrawImage(0, 0, newcon2_gui_banner_mute_back);
178                setFontStyle(25, 0xFFC8C8C8, ALIGN_MIDDLE,ALIGN_CENTER);
179                DrawTextUni(0, 0, rect.w, rect.h, GetString(nCCPos), &font);
180               
181                RegisterKey(VK_CC, true);
182                RegisterKey(VK_CANCEL, true);
183        }
184
185        virtual void KeyInput(DS_U8 key, bool /*bRepeat*/)
186        {
187                switch (key)
188                {
189                        case VK_CC:
190                                nCCPos = (nCCPos == 3 - 1) ? 0 : nCCPos+1;
191                                DST_UI_SetCloseCaption(nCCPos);
192                                Show();
193                                break;
194                        case VK_CANCEL:
195                                Close();
196                                break;
197                }
198        }
199};
200
201void DST_CreateClosedCaptionHotWindow(SWinEventMsg event)
202{
203        DST_AddWin((WinID)(event.data[0]), new CClosedCaptionWin(event));
204}
205
206
207class CDisplayModeWin : public CWindow
208{
209private:
210        int nDMPos;
211public:
212        CDisplayModeWin(SWinEventMsg event):CWindow(event)
213        {
214                rect.w = DST_GetImageWidth(newcon2_gui_banner_mute_back);
215                rect.h = DST_GetImageHeight(newcon2_gui_banner_mute_back);
216                rect.x = (DST_GetScreenWidth() - rect.w) / 2;
217                rect.y = DST_GetScreenHeight()*9/10 - rect.h;
218
219                SetTimeOut(3);
220                nDMPos = 0;
221
222        }
223        virtual ~CDisplayModeWin()
224        {
225        }
226        virtual void Show(WinID id)
227        {
228                switch(id)
229                {
230                        case WIN_EWS:
231                        case WIN_CHANNEL_BANNER:
232                        case WIN_DIRECT_TUNE:
233                        case WIN_VOLUME:
234                        case WIN_VOLUME_MUTE:
235                        case WIN_SIGNAL_METER:
236                        case WIN_CLOSED_CAPTION_HOT:
237                        case WIN_AUDIO_HOT:
238//                      case WIN_DISPLAY_MODE_HOT:     
239                        case WIN_FACTORY_RESET:
240                        case WIN_FACTORY_RESET_ASK:
241                        case WIN_INFOR_BANNER:
242                        case WIN_MAIN_MENU:
243                        case WIN_POWER_DOWN_CAUTION:
244                        case WIN_SUB_MENU_2DEPTH:
245                        case WIN_SUB_MENU_3DEPTH:
246                        case WIN_SUB_MENU_4DEPTH:
247                        case WIN_AUTO_SEARCH:
248                        case WIN_MANUAL_SEARCH:
249                        case WIN_CHANNEL_LIST:
250                        case WIN_PROGRAM_GUIDE:
251                                Close();
252                                break;
253                        default:
254                                break;
255                }
256        }
257
258        DS_U16* GetString(int nPos)
259        {
260                switch (nPos)
261                {
262                        case DISPLAY_MODE_WIDE: return pz_Wide[OSD_Lang]; break;
263                        case DISPLAY_MODE_NORMAL: return pz_Normal[OSD_Lang]; break;
264                        case DISPLAY_MODE_ZOOM: return pz_Zoom[OSD_Lang]; break;
265                        default : return 0;
266                }
267        }
268       
269        virtual void Show()
270        {
271                nDMPos = DST_UI_GetAspect();
272
273                DrawImage(0, 0, newcon2_gui_banner_mute_back);
274                setFontStyle(25, 0xFFC8C8C8, ALIGN_MIDDLE,ALIGN_CENTER);
275                DrawTextUni(0, 0, rect.w, rect.h, GetString(nDMPos), &font);
276               
277                RegisterKey(VK_ZOOM, true);
278                RegisterKey(VK_CANCEL, true);
279        }
280
281        virtual void KeyInput(DS_U8 key, bool /*bRepeat*/)
282        {
283                switch (key)
284                {
285                        case VK_ZOOM:
286                                DST_UI_SetAspect(DST_UI_GetAspect() < 2 ? DST_UI_GetAspect()+1 : 0);
287                                Show();
288                                break;
289                        case VK_CANCEL:
290                                Close();
291                                break;
292                }
293        }
294};
295
296void DST_CreateDisplayModeWindow(SWinEventMsg event)
297{
298        DST_AddWin((WinID)(event.data[0]), new CDisplayModeWin(event));
299}
300
301
Note: See TracBrowser for help on using the repository browser.