source: svn/trunk/zasc/app_c/DST_WinMTSHot.c @ 2

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

first commit

File size: 8.8 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
10//class CAudioWin : public CWindow
11//{
12//private:
13        static int CAudioWin_nMTSCount;
14//public:
15//      CAudioWin(SWinEventMsg event):CWindow(event)
16        void CAudioWin_Constructor(CWindow *this, SWinEventMsg event)
17        {
18                this->SetWinName(this,  "Audio");
19                this->rect.w = DST_GetImageWidth(newcon2_gui_banner_mute_back);
20                this->rect.h = DST_GetImageHeight(newcon2_gui_banner_mute_back);
21                this->rect.x = (DST_GetScreenWidth() - this->rect.w) / 2;
22                this->rect.y = DST_GetScreenHeight()*9/10 - this->rect.h;
23
24                this->SetTimeOut(this, 3);
25        }
26
27        void CAudioWin_Destructor(CWindow *this)
28        {
29        }
30       
31//      virtual void OnMessage(SWinEventMsg event)
32        void CAudioWin_OnMessage(CWindow *this, SWinEventMsg event)
33        {
34                switch (event.cmd)
35                {
36                        case WM_POWER_OFF:
37                                this->Close(this);
38                                break;
39                        default: break;
40                }
41        }
42
43//      virtual void Show(WinID id)
44        void CAudioWin_ShowWindow(CWindow *this, WinID id)
45        {
46                switch(id)
47                {
48                        case WIN_DEBUG_SQL:
49                        case WIN_DEBUG_SQL_SUB:
50                        case WIN_ENGINEER_MODE:         
51                        case WIN_EWS:
52                        case WIN_CHANNEL_BANNER:
53                        case WIN_DIRECT_TUNE:
54                        case WIN_VOLUME:
55                        case WIN_VOLUME_MUTE:
56                        case WIN_SIGNAL_METER:
57                        case WIN_CLOSED_CAPTION_HOT:
58                        case WIN_DISPLAY_MODE_HOT:
59                        case WIN_FACTORY_RESET:
60                        case WIN_FACTORY_RESET_ASK:
61                        case WIN_INFOR_BANNER:
62                        case WIN_MAIN_MENU:
63                        case WIN_POWER_DOWN_CAUTION:
64                        case WIN_SUB_MENU_2DEPTH:
65                        case WIN_SUB_MENU_3DEPTH:
66                        case WIN_SUB_MENU_4DEPTH:
67                        case WIN_AUTO_SEARCH:
68                        case WIN_MANUAL_SEARCH:
69                        case WIN_CHANNEL_LIST:
70                        case WIN_PROGRAM_GUIDE:
71                                this->Close(this);
72                                break;
73                        default:
74                                break;
75                }
76        }
77       
78        DS_U16* CAudioWin_GetString(int nPos)
79        {
80                switch (nPos)
81                {
82                        case  0: return pz_MTS_Main[OSD_Lang];
83                        case  1: return pz_MTS_Sub[OSD_Lang];
84                }
85                return 0;
86        }               
87       
88//      virtual void Show()
89        void CAudioWin_Show(CWindow *this)
90        {
91                CAudioWin_nMTSCount = 2;
92                this->DrawImage(this, 0, 0, newcon2_gui_banner_mute_back, false);
93                this->setFontStyle(this, 25, 0xFFC8C8C8, ALIGN_MIDDLE,ALIGN_CENTER);
94                this->DrawTextUni(this, 0, 0, this->rect.w, this->rect.h, CAudioWin_GetString(DST_UI_GetMTS()), &(this->font));
95               
96                this->RegisterKey(this, VK_AUDIO, true, 0, 0);
97                this->RegisterKey(this, VK_CANCEL, true, 0, 0);
98        }
99
100//      virtual void KeyInput(DS_U8 key, bool /*bRepeat*/)
101        void CAudioWin_KeyInput(CWindow *this, DS_U8 key, bool bRepeat)
102        {
103                switch (key)
104                {
105                        case VK_AUDIO:
106                                DST_UI_SetMTS((DST_UI_GetMTS() == CAudioWin_nMTSCount - 1) ? 0 : DST_UI_GetMTS()+1);
107                                this->Show(this);
108
109                                break;
110                        case VK_CANCEL:
111                                this->Close(this);
112                                break;
113                        default: break;
114                }
115        }
116//};
117
118void DST_CreateAudioWindow(SWinEventMsg event)
119{
120        CWindow*pWin = NewCWindow(event);
121        pWin->Destructor        = CAudioWin_Destructor;
122        pWin->KeyInput          = CAudioWin_KeyInput;
123        pWin->OnMessage         = CAudioWin_OnMessage;
124        pWin->ShowWindow        = CAudioWin_ShowWindow;
125        pWin->Show                      = CAudioWin_Show;
126        // »ý¼ºÀÚ È£Ãâ
127        CAudioWin_Constructor(pWin, event);
128        // À©µµ¿ì ¸Þ´ÏÀú¿¡ µî·Ï
129        DST_AddWin((WinID)(event.data[0]), pWin);
130}
131
132
133//class CClosedCaptionWin : public CWindow
134//{
135//private:
136        static int CClosedCaptionWin_nCCPos;
137//public:
138//      CClosedCaptionWin(SWinEventMsg event):CWindow(event)
139        void CClosedCaptionWin_Constructor(CWindow *this, SWinEventMsg event)
140        {
141                this->SetWinName(this,  "ClosedCaption");
142                this->rect.w = DST_GetImageWidth(newcon2_gui_banner_mute_back);
143                this->rect.h = DST_GetImageHeight(newcon2_gui_banner_mute_back);
144                this->rect.x = (DST_GetScreenWidth() - this->rect.w) / 2;
145                this->rect.y = DST_GetScreenHeight()*9/10 - this->rect.h;
146
147                this->SetTimeOut(this, 3);
148                CClosedCaptionWin_nCCPos = 0;
149
150        }
151
152        void CClosedCaptionWin_Destructor(CWindow *this)
153        {
154        }
155       
156//      virtual void Show(WinID id)
157        void CClosedCaptionWin_ShowWindow(CWindow *this, WinID id)
158        {
159                switch(id)
160                {
161                        case WIN_DEBUG_SQL:
162                        case WIN_DEBUG_SQL_SUB:
163                        case WIN_ENGINEER_MODE:         
164                        case WIN_EWS:
165//                      case WIN_CHANNEL_BANNER:
166                        case WIN_DIRECT_TUNE:
167//                      case WIN_VOLUME:
168//                      case WIN_VOLUME_MUTE:
169                        case WIN_SIGNAL_METER:
170                        case WIN_AUDIO_HOT:
171                        case WIN_DISPLAY_MODE_HOT:
172                        case WIN_FACTORY_RESET:
173                        case WIN_FACTORY_RESET_ASK:
174                        case WIN_INFOR_BANNER:
175                        case WIN_MAIN_MENU:
176                        case WIN_POWER_DOWN_CAUTION:
177                        case WIN_SUB_MENU_2DEPTH:
178                        case WIN_SUB_MENU_3DEPTH:
179                        case WIN_SUB_MENU_4DEPTH:
180                        case WIN_AUTO_SEARCH:
181                        case WIN_MANUAL_SEARCH:
182                        case WIN_CHANNEL_LIST:
183                        case WIN_PROGRAM_GUIDE:
184                                this->Close(this);
185                                break;
186                        default:
187                                break;
188                }
189        }
190
191        DS_U16* CClosedCaptionWin_GetString(int nPos)
192        {
193                switch (nPos)
194                {
195                        case  0: return pz_Off[OSD_Lang];
196                        case  1: return pz_On[OSD_Lang];
197                        default : return 0;
198                }
199        }
200       
201//      virtual void Show()
202        void CClosedCaptionWin_Show(CWindow *this)
203        {
204                CClosedCaptionWin_nCCPos = DST_EEPROM_GetCC();
205
206                this->DrawImage(this, 0, 0, newcon2_gui_banner_mute_back, false);
207                this->setFontStyle(this, 25, 0xFFC8C8C8, ALIGN_MIDDLE,ALIGN_CENTER);
208                this->DrawTextUni(this, 0, 0, this->rect.w, this->rect.h, CClosedCaptionWin_GetString(CClosedCaptionWin_nCCPos), &(this->font));
209               
210                this->RegisterKey(this, VK_CC, true, 0, 0);
211                this->RegisterKey(this, VK_CANCEL, true, 0, 0);
212        }
213
214//      virtual void KeyInput(DS_U8 key, bool /*bRepeat*/)
215        void CClosedCaptionWin_KeyInput(CWindow *this, DS_U8 key, bool bRepeat)
216        {
217                switch (key)
218                {
219                        case VK_CC:
220                                CClosedCaptionWin_nCCPos = (CClosedCaptionWin_nCCPos == 2 - 1) ? 0 : CClosedCaptionWin_nCCPos+1;
221                                DST_UI_SetCloseCaption(CClosedCaptionWin_nCCPos);
222                                this->Show(this);
223                                break;
224                        case VK_CANCEL:
225                                this->Close(this);
226                                break;
227                        default: break;
228                }
229        }
230//};
231
232void DST_CreateClosedCaptionHotWindow(SWinEventMsg event)
233{
234        CWindow*pWin = NewCWindow(event);
235        pWin->Destructor        = CClosedCaptionWin_Destructor;
236        pWin->KeyInput          = CClosedCaptionWin_KeyInput;
237        pWin->ShowWindow        = CClosedCaptionWin_ShowWindow;
238        pWin->Show                      = CClosedCaptionWin_Show;
239        // »ý¼ºÀÚ È£Ãâ
240        CClosedCaptionWin_Constructor(pWin, event);
241        // À©µµ¿ì ¸Þ´ÏÀú¿¡ µî·Ï
242        DST_AddWin((WinID)(event.data[0]), pWin);
243}
244
245
246//class CDisplayModeWin : public CWindow
247//{
248//private:
249        static int CDisplayModeWin_nDMPos;
250//public:
251//      CDisplayModeWin(SWinEventMsg event):CWindow(event)
252        void CDisplayModeWin_Constructor(CWindow *this, SWinEventMsg event)
253        {
254                this->SetWinName(this,  "DispMode");
255                this->rect.w = DST_GetImageWidth(newcon2_gui_banner_mute_back);
256                this->rect.h = DST_GetImageHeight(newcon2_gui_banner_mute_back);
257                this->rect.x = (DST_GetScreenWidth() - this->rect.w) / 2;
258                this->rect.y = DST_GetScreenHeight()*9/10 - this->rect.h;
259
260                this->SetTimeOut(this, 3);
261                CDisplayModeWin_nDMPos = 0;
262
263        }
264
265        void CDisplayModeWin_Destructor(CWindow *this)
266        {
267        }
268       
269//      virtual void Show(WinID id)
270        void CDisplayModeWin_ShowWindow(CWindow *this, WinID id)
271        {
272                switch(id)
273                {
274                        case WIN_DEBUG_SQL:
275                        case WIN_DEBUG_SQL_SUB:
276                        case WIN_ENGINEER_MODE:         
277                        case WIN_EWS:
278                        case WIN_CHANNEL_BANNER:
279                        case WIN_DIRECT_TUNE:
280                        case WIN_VOLUME:
281                        case WIN_VOLUME_MUTE:
282                        case WIN_SIGNAL_METER:
283                        case WIN_CLOSED_CAPTION_HOT:
284                        case WIN_AUDIO_HOT:
285                        case WIN_FACTORY_RESET:
286                        case WIN_FACTORY_RESET_ASK:
287                        case WIN_INFOR_BANNER:
288                        case WIN_MAIN_MENU:
289                        case WIN_POWER_DOWN_CAUTION:
290                        case WIN_SUB_MENU_2DEPTH:
291                        case WIN_SUB_MENU_3DEPTH:
292                        case WIN_SUB_MENU_4DEPTH:
293                        case WIN_AUTO_SEARCH:
294                        case WIN_MANUAL_SEARCH:
295                        case WIN_CHANNEL_LIST:
296                        case WIN_PROGRAM_GUIDE:
297                                this->Close(this);
298                                break;
299                        default:
300                                break;
301                }
302        }
303
304        DS_U16* CDisplayModeWin_GetString(int nPos)
305        {
306                switch (nPos)
307                {
308                        case DISPLAY_MODE_WIDE: return pz_Wide[OSD_Lang]; break;
309                        case DISPLAY_MODE_NORMAL: return pz_Normal[OSD_Lang]; break;
310                        case DISPLAY_MODE_ZOOM: return pz_Zoom[OSD_Lang]; break;
311                        default : return 0;
312                }
313        }
314       
315//      virtual void Show()
316        void CDisplayModeWin_Show(CWindow *this)
317        {
318                CDisplayModeWin_nDMPos = DST_UI_GetAspect();
319
320                this->DrawImage(this, 0, 0, newcon2_gui_banner_mute_back, false);
321                this->setFontStyle(this, 25, 0xFFC8C8C8, ALIGN_MIDDLE,ALIGN_CENTER);
322                this->DrawTextUni(this, 0, 0, this->rect.w, this->rect.h, CDisplayModeWin_GetString(CDisplayModeWin_nDMPos), &(this->font));
323               
324                this->RegisterKey(this, VK_ZOOM, true, 0, 0);
325                this->RegisterKey(this, VK_CANCEL, true, 0, 0);
326        }
327
328//      virtual void KeyInput(DS_U8 key, bool /*bRepeat*/)
329        void CDisplayModeWin_KeyInput(CWindow *this, DS_U8 key, bool bRepeat)
330        {
331                switch (key)
332                {
333                        case VK_ZOOM:
334                                DST_UI_SetAspect(DST_UI_GetAspect() < 2 ? DST_UI_GetAspect()+1 : 0);
335                                this->Show(this);
336                                break;
337                        case VK_CANCEL:
338                                this->Close(this);
339                                break;
340                }
341        }
342//};
343
344void DST_CreateDisplayModeWindow(SWinEventMsg event)
345{
346        CWindow*pWin = NewCWindow(event);
347        pWin->Destructor        = CDisplayModeWin_Destructor;
348        pWin->KeyInput          = CDisplayModeWin_KeyInput;
349        pWin->ShowWindow        = CDisplayModeWin_ShowWindow;
350        pWin->Show                      = CDisplayModeWin_Show;
351        // »ý¼ºÀÚ È£Ãâ
352        CDisplayModeWin_Constructor(pWin, event);
353        // À©µµ¿ì ¸Þ´ÏÀú¿¡ µî·Ï
354        DST_AddWin((WinID)(event.data[0]), pWin);
355}
356
357
Note: See TracBrowser for help on using the repository browser.