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

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

1.phkim

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