| 1 | /**************************************************************************** |
|---|
| 2 | * NAME: App_Proc_Main.c |
|---|
| 3 | *---------------------------------------------------------------------------- |
|---|
| 4 | * Copyright (c) DIGITAL STREAM Technology Inc. |
|---|
| 5 | *---------------------------------------------------------------------------- |
|---|
| 6 | * CREATED_BY: Park Yong-Dae |
|---|
| 7 | * CREATION_DATE: 2009/08/25 |
|---|
| 8 | * $Author: x2silo $ |
|---|
| 9 | * $Revision: 1.0 $ |
|---|
| 10 | * $Date: 2010/01/27 14:07:25 $ |
|---|
| 11 | *---------------------------------------------------------------------------- |
|---|
| 12 | * PURPOSE: |
|---|
| 13 | * - |
|---|
| 14 | *****************************************************************************/ |
|---|
| 15 | |
|---|
| 16 | /*_____ I N C L U D E __________________________________________*/ |
|---|
| 17 | |
|---|
| 18 | |
|---|
| 19 | #include "App_Main.h" |
|---|
| 20 | |
|---|
| 21 | #include "App_OSD_Common.h" |
|---|
| 22 | #include "App_OSD_Main.h" |
|---|
| 23 | #include "App_OSD_Banner.h" |
|---|
| 24 | |
|---|
| 25 | #include "App_Proc.h" |
|---|
| 26 | |
|---|
| 27 | #include "App_Res_Resources.h" |
|---|
| 28 | |
|---|
| 29 | |
|---|
| 30 | #include "App_Fnc_Common.h" |
|---|
| 31 | |
|---|
| 32 | #include "cc_api.h" |
|---|
| 33 | #include "App_Fnc_CC.h" |
|---|
| 34 | #include "App_Fnc_Video.h" |
|---|
| 35 | #include "App_Fnc_Audio.h" |
|---|
| 36 | #include "App_Fnc_ChTune.h" |
|---|
| 37 | |
|---|
| 38 | #include "App_Fnc_Time.h" |
|---|
| 39 | #include "App_Fnc_Power.h" |
|---|
| 40 | |
|---|
| 41 | #include "App_Fnc_Pod.h" |
|---|
| 42 | |
|---|
| 43 | #include "App_Fnc_SignalMonitor.h" |
|---|
| 44 | #include "App_Fnc_Comm.h" |
|---|
| 45 | |
|---|
| 46 | #include "App_Fnc_RRT.h" |
|---|
| 47 | |
|---|
| 48 | /*_____ D E F I N I T I O N ____________________________________*/ |
|---|
| 49 | |
|---|
| 50 | #if COMMENT |
|---|
| 51 | _____DbgPrint_____(){} |
|---|
| 52 | #endif |
|---|
| 53 | |
|---|
| 54 | DHL_MODULE("@p_mai", 0); |
|---|
| 55 | |
|---|
| 56 | |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | |
|---|
| 60 | #if COMMENT |
|---|
| 61 | _____Config_____(){} |
|---|
| 62 | #endif |
|---|
| 63 | |
|---|
| 64 | |
|---|
| 65 | |
|---|
| 66 | |
|---|
| 67 | |
|---|
| 68 | #if COMMENT |
|---|
| 69 | _____Types_____(){} |
|---|
| 70 | #endif |
|---|
| 71 | |
|---|
| 72 | typedef enum { |
|---|
| 73 | eAPP_MAIN_NORMAL, |
|---|
| 74 | eAPP_MAIN_CONFIRM, |
|---|
| 75 | eAPP_MAIN_ENTERPIN, |
|---|
| 76 | eAPP_MAIN_RRT_US_TV, |
|---|
| 77 | eAPP_MAIN_RRT_US_MPAA, |
|---|
| 78 | eAPP_MAIN_RRT_SET_DRRT, |
|---|
| 79 | eAPP_MAIN_RRT_UPDATE_DRRT, |
|---|
| 80 | eAPP_MAIN_RRT_CHANGE_PIN, |
|---|
| 81 | eAPP_MAIN_DRRT_WARNING, |
|---|
| 82 | eAPP_MAIN_NO_DRRT_AVAILABLE, |
|---|
| 83 | } tApp_MAINMODE; |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | |
|---|
| 87 | |
|---|
| 88 | #if COMMENT |
|---|
| 89 | _____Variables_____(){} |
|---|
| 90 | #endif |
|---|
| 91 | |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | /*_____ F U N C T I O N ________________________________________*/ |
|---|
| 97 | |
|---|
| 98 | #if COMMENT |
|---|
| 99 | __Local_Func__(){} |
|---|
| 100 | #endif |
|---|
| 101 | |
|---|
| 102 | static int p_get_parent(int fid) |
|---|
| 103 | { |
|---|
| 104 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 105 | return pframe->parent; |
|---|
| 106 | } |
|---|
| 107 | |
|---|
| 108 | static int p_get_child(int fid) |
|---|
| 109 | { |
|---|
| 110 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 111 | |
|---|
| 112 | return pframe->units[pframe->cur_unit].link; |
|---|
| 113 | } |
|---|
| 114 | |
|---|
| 115 | static int p_get_prev_uid(int fid) |
|---|
| 116 | { |
|---|
| 117 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 118 | int new_uid; |
|---|
| 119 | |
|---|
| 120 | if(pframe->depth == 3){ // 4 depth |
|---|
| 121 | #if 0 |
|---|
| 122 | if((pframe->cur_unit%D4_ICON_MAX_ROWS) == 0) |
|---|
| 123 | new_uid = ID_DEF; |
|---|
| 124 | #else |
|---|
| 125 | if(pframe->cur_unit == 0) |
|---|
| 126 | new_uid = pframe->num_unit-1; |
|---|
| 127 | #endif |
|---|
| 128 | else |
|---|
| 129 | new_uid=pframe->cur_unit-1; |
|---|
| 130 | } |
|---|
| 131 | else { // general depth |
|---|
| 132 | if(new_uid=pframe->cur_unit==0) new_uid=pframe->num_unit-1; |
|---|
| 133 | else new_uid=pframe->cur_unit-1; |
|---|
| 134 | } |
|---|
| 135 | return new_uid; |
|---|
| 136 | } |
|---|
| 137 | |
|---|
| 138 | static int p_get_next_uid(int fid) |
|---|
| 139 | { |
|---|
| 140 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 141 | int new_uid; |
|---|
| 142 | |
|---|
| 143 | if(pframe->depth == 3){ // 4 depth |
|---|
| 144 | #if 0 |
|---|
| 145 | if((pframe->cur_unit%D4_ICON_MAX_ROWS) == 4) |
|---|
| 146 | new_uid = ID_DEF; |
|---|
| 147 | else if(pframe->cur_unit == (pframe->num_unit-1)) |
|---|
| 148 | new_uid = ID_DEF; |
|---|
| 149 | #else |
|---|
| 150 | if(pframe->cur_unit == (pframe->num_unit-1)) |
|---|
| 151 | new_uid = 0; |
|---|
| 152 | #endif |
|---|
| 153 | else |
|---|
| 154 | new_uid=pframe->cur_unit+1; |
|---|
| 155 | } |
|---|
| 156 | else { // general depth |
|---|
| 157 | if(new_uid=pframe->cur_unit==pframe->num_unit-1) new_uid=0; |
|---|
| 158 | else new_uid=pframe->cur_unit+1; |
|---|
| 159 | } |
|---|
| 160 | |
|---|
| 161 | return new_uid; |
|---|
| 162 | } |
|---|
| 163 | |
|---|
| 164 | static int p_d4_get_right_uid(int fid) |
|---|
| 165 | { |
|---|
| 166 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 167 | int new_uid; |
|---|
| 168 | |
|---|
| 169 | if(pframe->depth == 3){ // 4 depth |
|---|
| 170 | if((pframe->num_unit > D4_ICON_MAX_ROWS) && (pframe->cur_unit+D4_ICON_MAX_ROWS)<=pframe->num_unit) { |
|---|
| 171 | int num_rows=(pframe->num_unit+1)/2; |
|---|
| 172 | |
|---|
| 173 | new_uid = pframe->cur_unit+num_rows; |
|---|
| 174 | if(new_uid>=pframe->num_unit) new_uid=pframe->num_unit-1; |
|---|
| 175 | } |
|---|
| 176 | else |
|---|
| 177 | new_uid = ID_DEF; |
|---|
| 178 | } |
|---|
| 179 | else { // general depth |
|---|
| 180 | new_uid = ID_DEF; |
|---|
| 181 | } |
|---|
| 182 | return new_uid; |
|---|
| 183 | } |
|---|
| 184 | |
|---|
| 185 | static int p_d4_get_left_uid(int fid) |
|---|
| 186 | { |
|---|
| 187 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 188 | int new_uid; |
|---|
| 189 | |
|---|
| 190 | if(pframe->depth == 3){ // 4 depth |
|---|
| 191 | int num_rows=(pframe->num_unit+1)/2; |
|---|
| 192 | |
|---|
| 193 | //if((pframe->cur_unit-D4_ICON_MAX_ROWS) >= 0) |
|---|
| 194 | if((pframe->num_unit > D4_ICON_MAX_ROWS) && ((pframe->cur_unit - num_rows) >= 0)) |
|---|
| 195 | new_uid = pframe->cur_unit-num_rows; |
|---|
| 196 | else |
|---|
| 197 | new_uid = ID_DEF; |
|---|
| 198 | } |
|---|
| 199 | else { // general depth |
|---|
| 200 | new_uid = ID_DEF; |
|---|
| 201 | } |
|---|
| 202 | return new_uid; |
|---|
| 203 | } |
|---|
| 204 | |
|---|
| 205 | /** |
|---|
| 206 | @brief ÇØ´ç fidÀÇ unitÀÇ ¼ö¸¦ °¡Á®¿À´Â ÇÔ¼ö. |
|---|
| 207 | |
|---|
| 208 | @param[in] fid ¼³Á¤ÇϰíÀÚ ÇÏ´Â frame id |
|---|
| 209 | */ |
|---|
| 210 | static int p_get_num_unit(int fid) |
|---|
| 211 | { |
|---|
| 212 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 213 | return pframe->num_unit; |
|---|
| 214 | } |
|---|
| 215 | |
|---|
| 216 | /** |
|---|
| 217 | @brief ÇØ´ç fidÀÇ selected unitÀ» cur unitÀ¸·Î º¯°æÇÏ´Â ÇÔ¼ö. |
|---|
| 218 | |
|---|
| 219 | @param[in] fid ¼³Á¤ÇϰíÀÚ ÇÏ´Â frame id |
|---|
| 220 | */ |
|---|
| 221 | static int p_change_select2cur_unit(int fid) |
|---|
| 222 | { |
|---|
| 223 | int i=0; |
|---|
| 224 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 225 | |
|---|
| 226 | for(i=0;i<pframe->num_unit;i++) { |
|---|
| 227 | if(pframe->units[i].bselected == TRUE) { |
|---|
| 228 | pframe->cur_unit=i; |
|---|
| 229 | break; |
|---|
| 230 | } |
|---|
| 231 | } |
|---|
| 232 | |
|---|
| 233 | return pframe->cur_unit; |
|---|
| 234 | } |
|---|
| 235 | |
|---|
| 236 | /** |
|---|
| 237 | @brief ÇØ´ç fidÀÇ Æ¯Á¤ unitÀÌ selected »óÅÂÀÎÁö üũÇÏ´Â ÇÔ¼ö. |
|---|
| 238 | |
|---|
| 239 | @param[in] fid È®ÀÎÇϰíÀÚ ÇÏ´Â frame id |
|---|
| 240 | @param[in] uid È®ÀÎÇϰíÀÚ ÇÏ´Â unit id, °ªÀÌ ID_DEF(-1)À̸é cur_unitÀ¸·Î uid »ç¿ë. |
|---|
| 241 | */ |
|---|
| 242 | static BOOL p_is_selected(int fid, int uid) |
|---|
| 243 | { |
|---|
| 244 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 245 | |
|---|
| 246 | if(uid==ID_DEF) uid=pframe->cur_unit; |
|---|
| 247 | |
|---|
| 248 | return pframe->units[uid].bselected; |
|---|
| 249 | } |
|---|
| 250 | |
|---|
| 251 | /** |
|---|
| 252 | @brief ÇØ´ç fidÀÇ Æ¯Á¤ unitÀÌ leaf unitÀÎÁö üũÇÏ´Â ÇÔ¼ö. |
|---|
| 253 | |
|---|
| 254 | @param[in] fid È®ÀÎÇϰíÀÚ ÇÏ´Â frame id |
|---|
| 255 | @param[in] uid È®ÀÎÇϰíÀÚ ÇÏ´Â unit id, °ªÀÌ ID_DEF(-1)À̸é cur_unitÀ¸·Î uid »ç¿ë. |
|---|
| 256 | */ |
|---|
| 257 | static BOOL p_is_leaf(int fid, int uid) |
|---|
| 258 | { |
|---|
| 259 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 260 | |
|---|
| 261 | if(uid==ID_DEF) uid=pframe->cur_unit; |
|---|
| 262 | |
|---|
| 263 | return pframe->units[uid].bleaf; |
|---|
| 264 | } |
|---|
| 265 | |
|---|
| 266 | /** |
|---|
| 267 | @brief ÇØ´ç fidÀÇ depth °ªÀ» °¡Á®¿À´Â ÇÔ¼ö. |
|---|
| 268 | |
|---|
| 269 | @param[in] fid È®ÀÎÇϰíÀÚ ÇÏ´Â frame id |
|---|
| 270 | */ |
|---|
| 271 | static int p_get_depth(int fid) |
|---|
| 272 | { |
|---|
| 273 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 274 | return pframe->depth; |
|---|
| 275 | } |
|---|
| 276 | |
|---|
| 277 | /** |
|---|
| 278 | @brief ÇØ´ç fidÀÇ cur unitÀÇ °ªÀ» °¡Á®¿À´Â ÇÔ¼ö. |
|---|
| 279 | |
|---|
| 280 | @param[in] fid È®ÀÎÇϰíÀÚ ÇÏ´Â frame id |
|---|
| 281 | */ |
|---|
| 282 | static int p_get_curuid(int fid) |
|---|
| 283 | { |
|---|
| 284 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 285 | return pframe->cur_unit; |
|---|
| 286 | } |
|---|
| 287 | |
|---|
| 288 | static void p_change_num_disp_mode(BOOL bsrc_disp_same) |
|---|
| 289 | { |
|---|
| 290 | /* src¿Í display°¡ °°Àº °æ¿ì¿Í ´Ù¸¥ °æ¿ì¸¦ ´Þ¸® ó¸®ÇÔ */ |
|---|
| 291 | tApp_MmFrame *pframe=AppO_GetFrameInfo(FID_VID_MODE); |
|---|
| 292 | |
|---|
| 293 | if(bsrc_disp_same) { |
|---|
| 294 | pframe->num_unit=1; |
|---|
| 295 | } |
|---|
| 296 | else { |
|---|
| 297 | pframe->num_unit=4; |
|---|
| 298 | } |
|---|
| 299 | |
|---|
| 300 | } |
|---|
| 301 | |
|---|
| 302 | static void p_enable_cable(BOOL is_enable) |
|---|
| 303 | { |
|---|
| 304 | /* src¿Í display°¡ °°Àº °æ¿ì¿Í ´Ù¸¥ °æ¿ì¸¦ ´Þ¸® ó¸®ÇÔ */ |
|---|
| 305 | tApp_MmFrame *pframe=AppO_GetFrameInfo(FID_CH_INPUT); |
|---|
| 306 | |
|---|
| 307 | if(is_enable) { |
|---|
| 308 | pframe->num_unit=2; |
|---|
| 309 | } |
|---|
| 310 | else { |
|---|
| 311 | pframe->num_unit=1; |
|---|
| 312 | } |
|---|
| 313 | |
|---|
| 314 | } |
|---|
| 315 | |
|---|
| 316 | |
|---|
| 317 | /** |
|---|
| 318 | @brief ÇØ´ç fidÀÇ uid¸¦ selected·Î ¼³Á¤ÇÏ´Â ÇÔ¼ö. |
|---|
| 319 | |
|---|
| 320 | @param[in] fid ¼³Á¤ÇϰíÀÚ ÇÏ´Â frame id |
|---|
| 321 | @param[in] uid ÇØ´ç frameÀÇ unit id |
|---|
| 322 | */ |
|---|
| 323 | static void p_set_value(int fid, int uid) |
|---|
| 324 | { |
|---|
| 325 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 326 | int i; |
|---|
| 327 | |
|---|
| 328 | for(i=0; i<pframe->num_unit; i++) |
|---|
| 329 | pframe->units[i].bselected = FALSE; |
|---|
| 330 | |
|---|
| 331 | if(uid==ID_DEF) uid=pframe->cur_unit; |
|---|
| 332 | pframe->units[uid].bselected=TRUE; |
|---|
| 333 | } |
|---|
| 334 | |
|---|
| 335 | |
|---|
| 336 | /** |
|---|
| 337 | @brief Main Menu¿¡¼ ÇØ´ç frameÀÇ current unit id °ªÀ» 0À¸·Î ÃʱâÈÇÏ´Â ÇÔ¼ö. |
|---|
| 338 | |
|---|
| 339 | @param[in] fid current unitÀ» º¯°æÇÒ frame id |
|---|
| 340 | */ |
|---|
| 341 | static void p_init_cur_unit(int fid) |
|---|
| 342 | { |
|---|
| 343 | tApp_MmFrame *pframe=AppO_GetFrameInfo(fid); |
|---|
| 344 | int i=0; |
|---|
| 345 | |
|---|
| 346 | pframe->cur_unit = 0; |
|---|
| 347 | } |
|---|
| 348 | |
|---|
| 349 | static void p_init_menu_var() |
|---|
| 350 | { |
|---|
| 351 | //frameÀÇ param1:selected item id |
|---|
| 352 | int temp; |
|---|
| 353 | |
|---|
| 354 | dprint(0, "## menu var init\n"); |
|---|
| 355 | |
|---|
| 356 | |
|---|
| 357 | /******************* Channel *****************/ |
|---|
| 358 | // Air, Cable |
|---|
| 359 | p_set_value(FID_CH_INPUT, g_CurChannelType?1:0); |
|---|
| 360 | |
|---|
| 361 | /******************* CC *****************/ |
|---|
| 362 | /* cc - on/off */ |
|---|
| 363 | p_set_value(FID_CC_DISP, DCC_IsReady()?0:1); |
|---|
| 364 | |
|---|
| 365 | p_set_value(FID_CC_OPT, DCC_GetOption()?1:0); |
|---|
| 366 | |
|---|
| 367 | temp=DCC_GetService(); |
|---|
| 368 | |
|---|
| 369 | if(temp>=eDCC_S_CS1 && temp<=eDCC_S_CS6) temp=temp-eDCC_S_CS1; |
|---|
| 370 | else if(temp>=eDCC_S_CC1 && temp<=eDCC_S_CC2) temp=temp-eDCC_S_CC1+6; |
|---|
| 371 | else if(temp>=eDCC_S_T1 && temp<=eDCC_S_T2) temp=temp-eDCC_S_T1+8; |
|---|
| 372 | else { |
|---|
| 373 | DCC_SetService(eDCC_S_CS1); |
|---|
| 374 | App_CC_SaveVar(); |
|---|
| 375 | temp=0; |
|---|
| 376 | } |
|---|
| 377 | |
|---|
| 378 | p_set_value(FID_CC_SERV, temp); |
|---|
| 379 | |
|---|
| 380 | /* cc text */ |
|---|
| 381 | { |
|---|
| 382 | tDCC_PenUserAttr pen_attr; |
|---|
| 383 | |
|---|
| 384 | DCC_GetPenUserAttr(&pen_attr); |
|---|
| 385 | |
|---|
| 386 | temp= |
|---|
| 387 | pen_attr.s==eDCC_S_SMALL?1: |
|---|
| 388 | pen_attr.s==eDCC_S_STANDARD?2: |
|---|
| 389 | pen_attr.s==eDCC_S_LARGE?3:0; |
|---|
| 390 | |
|---|
| 391 | p_set_value(FID_CC_F_SIZE, temp); /* pen size */ |
|---|
| 392 | |
|---|
| 393 | temp= |
|---|
| 394 | pen_attr.fc==eDCC_C_BLACK?1: |
|---|
| 395 | pen_attr.fc==eDCC_C_RED?3: |
|---|
| 396 | pen_attr.fc==eDCC_C_GREEN?4: |
|---|
| 397 | pen_attr.fc==eDCC_C_YELLOW?6: |
|---|
| 398 | pen_attr.fc==eDCC_C_BLUE?5: |
|---|
| 399 | pen_attr.fc==eDCC_C_MAGENTA?7: |
|---|
| 400 | pen_attr.fc==eDCC_C_CYAN?8: |
|---|
| 401 | pen_attr.fc==eDCC_C_WHITE?2:0; |
|---|
| 402 | |
|---|
| 403 | p_set_value(FID_CC_F_COLOR, temp); /* text color */ |
|---|
| 404 | |
|---|
| 405 | temp= |
|---|
| 406 | (pen_attr.fs>=1 && pen_attr.fs<=7)?pen_attr.fs:0; |
|---|
| 407 | |
|---|
| 408 | p_set_value(FID_CC_F_STYLE, temp); |
|---|
| 409 | |
|---|
| 410 | temp= |
|---|
| 411 | pen_attr.bc==eDCC_C_BLACK?1: |
|---|
| 412 | pen_attr.bc==eDCC_C_RED?3: |
|---|
| 413 | pen_attr.bc==eDCC_C_GREEN?4: |
|---|
| 414 | pen_attr.bc==eDCC_C_YELLOW?6: |
|---|
| 415 | pen_attr.bc==eDCC_C_BLUE?5: |
|---|
| 416 | pen_attr.bc==eDCC_C_MAGENTA?7: |
|---|
| 417 | pen_attr.bc==eDCC_C_CYAN?8: |
|---|
| 418 | pen_attr.bc==eDCC_C_WHITE?2:0; |
|---|
| 419 | |
|---|
| 420 | p_set_value(FID_CC_B_COLOR, temp); /* bc color */ |
|---|
| 421 | |
|---|
| 422 | temp= |
|---|
| 423 | pen_attr.fo==eDCC_O_SOLID?3: |
|---|
| 424 | pen_attr.fo==eDCC_O_TRANSLUCENT?2: |
|---|
| 425 | pen_attr.fo==eDCC_O_TRANSPARENT?1:0; |
|---|
| 426 | |
|---|
| 427 | p_set_value(FID_CC_F_TRANS, temp); /* fc opacity */ |
|---|
| 428 | |
|---|
| 429 | temp= |
|---|
| 430 | pen_attr.bo==eDCC_O_SOLID?3: |
|---|
| 431 | pen_attr.bo==eDCC_O_TRANSLUCENT?2: |
|---|
| 432 | pen_attr.bo==eDCC_O_TRANSPARENT?1:0; |
|---|
| 433 | |
|---|
| 434 | p_set_value(FID_CC_B_TRANS, temp); /* bc opacity */ |
|---|
| 435 | } |
|---|
| 436 | |
|---|
| 437 | DCC_GetWinPosition(NULL, &temp); |
|---|
| 438 | temp=temp==0?0:temp==-100?1:2; |
|---|
| 439 | p_set_value(FID_CC_POS, temp); |
|---|
| 440 | |
|---|
| 441 | /**************** rating ********************/ |
|---|
| 442 | p_set_value(FID_RT_ONOFF, AppRating_GetMasterBlock()?0:1); |
|---|
| 443 | |
|---|
| 444 | /* ea */ |
|---|
| 445 | p_set_value(FID_EA_MID, AppF_IsEAMedium()?0:1); |
|---|
| 446 | p_set_value(FID_EA_LOW, AppF_IsEALow()?0:1); |
|---|
| 447 | |
|---|
| 448 | /**************** audio/video ***************/ |
|---|
| 449 | |
|---|
| 450 | /* display mode */ |
|---|
| 451 | { |
|---|
| 452 | BOOL bsrc_wide, bscr_wide; |
|---|
| 453 | APP_DISP_MODE disp_mode; |
|---|
| 454 | |
|---|
| 455 | disp_mode=App_VideoGetCurrentDisplayMode(&bsrc_wide); |
|---|
| 456 | bscr_wide=App_VideoGetScrRatio()==APP_DISP_RATIO_WIDE?TRUE:FALSE; |
|---|
| 457 | |
|---|
| 458 | if(bsrc_wide==bscr_wide) { |
|---|
| 459 | p_change_num_disp_mode(TRUE); |
|---|
| 460 | temp=0; |
|---|
| 461 | } |
|---|
| 462 | else { |
|---|
| 463 | p_change_num_disp_mode(FALSE); |
|---|
| 464 | temp= |
|---|
| 465 | disp_mode==APP_DISP_MODE_WIDE?1: |
|---|
| 466 | disp_mode==APP_DISP_MODE_14_9?2: |
|---|
| 467 | disp_mode==APP_DISP_MODE_NORM?3:0; |
|---|
| 468 | } |
|---|
| 469 | p_set_value(FID_VID_MODE, temp); |
|---|
| 470 | } |
|---|
| 471 | |
|---|
| 472 | /* audio lang*/ |
|---|
| 473 | { |
|---|
| 474 | APP_AUDIO_LANG_ID aud_lang_id; |
|---|
| 475 | |
|---|
| 476 | aud_lang_id=App_AudioGetPreferredLanguageId(); |
|---|
| 477 | |
|---|
| 478 | temp= |
|---|
| 479 | aud_lang_id==APP_AUDIO_LANG_AUTO?0: |
|---|
| 480 | aud_lang_id==APP_AUDIO_LANG_SPA?1:2; |
|---|
| 481 | |
|---|
| 482 | p_set_value(FID_AUD_PREF, temp); |
|---|
| 483 | } |
|---|
| 484 | |
|---|
| 485 | /* audio downmix*/ |
|---|
| 486 | { |
|---|
| 487 | if(App_AudioGetDownMix()==APP_AUDIO_DOWNMIX_LTRT) temp=0; |
|---|
| 488 | else temp=1; |
|---|
| 489 | |
|---|
| 490 | p_set_value(FID_AUD_DOWNMIX, temp); |
|---|
| 491 | } |
|---|
| 492 | |
|---|
| 493 | /******************* function *****************/ |
|---|
| 494 | /* menu language */ |
|---|
| 495 | p_set_value(FID_MENU_LANG, App_NVM_GetMenuLang()); |
|---|
| 496 | DMG_SetLanguage(App_NVM_GetMenuLang()); |
|---|
| 497 | |
|---|
| 498 | /* time zone */ |
|---|
| 499 | switch(App_GetTimeZone()) |
|---|
| 500 | { |
|---|
| 501 | case APP_TIMEZONE_CENTRAL: temp=0; break; |
|---|
| 502 | case APP_TIMEZONE_MOUNTAIN: temp=1; break; |
|---|
| 503 | case APP_TIMEZONE_PACIFIC: temp=2; break; |
|---|
| 504 | default: temp=0; break; |
|---|
| 505 | } |
|---|
| 506 | p_set_value(FID_TIME_ZONE, temp); |
|---|
| 507 | |
|---|
| 508 | /* daylight saving time */ |
|---|
| 509 | if(App_GetDayLightSaving()) temp = 0; |
|---|
| 510 | else temp = 1; |
|---|
| 511 | |
|---|
| 512 | p_set_value(FID_TIME_SUMMER, temp); |
|---|
| 513 | |
|---|
| 514 | |
|---|
| 515 | /* sleep timer */ |
|---|
| 516 | temp=App_GetSleepTimer()*5; |
|---|
| 517 | temp=temp==0?0:temp==15?1:temp==30?2:temp==60?3:temp==120?4:0; |
|---|
| 518 | |
|---|
| 519 | p_set_value(FID_TIME_SLEEP, temp); |
|---|
| 520 | |
|---|
| 521 | /* auto power down */ |
|---|
| 522 | temp=App_GetNoKeyPowerDownTimeout()/6; |
|---|
| 523 | temp=temp==1?1:temp==2?2:temp==4?3:temp==8?4:0; |
|---|
| 524 | |
|---|
| 525 | p_set_value(FID_TIME_NOSIG, temp); |
|---|
| 526 | //temp=APP_GetMenuOpacity(); |
|---|
| 527 | //temp=temp==eDHL_ALPHA_60?1:temp==eDHL_ALPHA_80?0:2; |
|---|
| 528 | //p_set_value(FID_MENU_TRANS, temp); |
|---|
| 529 | |
|---|
| 530 | |
|---|
| 531 | } |
|---|
| 532 | |
|---|
| 533 | |
|---|
| 534 | |
|---|
| 535 | static void p_change_cc_value(tDMG_FrameId frame_id, UINT32 item_id) |
|---|
| 536 | { |
|---|
| 537 | tDCC_PenUserAttr pen_attr; |
|---|
| 538 | |
|---|
| 539 | DCC_GetPenUserAttr(&pen_attr); |
|---|
| 540 | |
|---|
| 541 | switch(frame_id) { |
|---|
| 542 | |
|---|
| 543 | case FID_CC_DISP : /* caption display */ |
|---|
| 544 | if(item_id==0) {DCC_Ready(); DMG_MenuStart(MID_CC);} |
|---|
| 545 | else {DCC_Exit(); DMG_MenuExit(MID_CC);} |
|---|
| 546 | |
|---|
| 547 | App_CC_SaveVar(); |
|---|
| 548 | break; |
|---|
| 549 | |
|---|
| 550 | |
|---|
| 551 | case FID_CC_SERV : /* caption service */ |
|---|
| 552 | |
|---|
| 553 | if(item_id<6) item_id=eDCC_S_CS1+item_id; |
|---|
| 554 | else if(item_id<8) item_id=eDCC_S_CC1+item_id-6; |
|---|
| 555 | else item_id=eDCC_S_T1+item_id-8; |
|---|
| 556 | |
|---|
| 557 | DCC_SetService(item_id); |
|---|
| 558 | break; |
|---|
| 559 | |
|---|
| 560 | case FID_CC_OPT : /* caption option */ |
|---|
| 561 | DCC_SetOption(item_id==0?FALSE:TRUE); |
|---|
| 562 | |
|---|
| 563 | break; |
|---|
| 564 | |
|---|
| 565 | case FID_CC_POS : |
|---|
| 566 | DCC_MoveWinPosition(0, item_id==0?0:item_id==1?-100:100); |
|---|
| 567 | break; |
|---|
| 568 | |
|---|
| 569 | case FID_CC_F_SIZE : |
|---|
| 570 | pen_attr.s= |
|---|
| 571 | item_id==1?eDCC_S_SMALL:item_id==2?eDCC_S_STANDARD:item_id==3?eDCC_S_LARGE:DCC_AUTO_SET; |
|---|
| 572 | break; |
|---|
| 573 | |
|---|
| 574 | case FID_CC_F_COLOR : |
|---|
| 575 | pen_attr.fc= |
|---|
| 576 | item_id==1?eDCC_C_BLACK: |
|---|
| 577 | item_id==2?eDCC_C_WHITE: |
|---|
| 578 | item_id==3?eDCC_C_RED: |
|---|
| 579 | item_id==4?eDCC_C_GREEN: |
|---|
| 580 | item_id==5?eDCC_C_BLUE: |
|---|
| 581 | item_id==6?eDCC_C_YELLOW: |
|---|
| 582 | item_id==7?eDCC_C_MAGENTA: |
|---|
| 583 | item_id==8?eDCC_C_CYAN:DCC_AUTO_SET; |
|---|
| 584 | break; |
|---|
| 585 | |
|---|
| 586 | case FID_CC_F_STYLE : |
|---|
| 587 | pen_attr.fs=item_id==0?DCC_AUTO_SET:item_id; |
|---|
| 588 | break; |
|---|
| 589 | |
|---|
| 590 | case FID_CC_B_COLOR : |
|---|
| 591 | pen_attr.bc= |
|---|
| 592 | item_id==1?eDCC_C_BLACK: |
|---|
| 593 | item_id==2?eDCC_C_WHITE: |
|---|
| 594 | item_id==3?eDCC_C_RED: |
|---|
| 595 | item_id==4?eDCC_C_GREEN: |
|---|
| 596 | item_id==5?eDCC_C_BLUE: |
|---|
| 597 | item_id==6?eDCC_C_YELLOW: |
|---|
| 598 | item_id==7?eDCC_C_MAGENTA: |
|---|
| 599 | item_id==8?eDCC_C_CYAN:DCC_AUTO_SET; |
|---|
| 600 | break; |
|---|
| 601 | |
|---|
| 602 | case FID_CC_F_TRANS : |
|---|
| 603 | pen_attr.fo= |
|---|
| 604 | item_id==3?eDCC_O_SOLID: |
|---|
| 605 | item_id==1?eDCC_O_TRANSPARENT: |
|---|
| 606 | item_id==2?eDCC_O_TRANSLUCENT:DCC_AUTO_SET; |
|---|
| 607 | break; |
|---|
| 608 | |
|---|
| 609 | case FID_CC_B_TRANS : |
|---|
| 610 | pen_attr.bo= |
|---|
| 611 | item_id==3?eDCC_O_SOLID: |
|---|
| 612 | item_id==1?eDCC_O_TRANSPARENT: |
|---|
| 613 | item_id==2?eDCC_O_TRANSLUCENT:DCC_AUTO_SET; |
|---|
| 614 | break; |
|---|
| 615 | } |
|---|
| 616 | |
|---|
| 617 | DCC_SetPenUserAttr(&pen_attr); |
|---|
| 618 | App_CC_SaveVar(); |
|---|
| 619 | } |
|---|
| 620 | |
|---|
| 621 | |
|---|
| 622 | static void p_change_av_value(tDMG_FrameId frame_id, UINT32 item_id) |
|---|
| 623 | { |
|---|
| 624 | int value; |
|---|
| 625 | |
|---|
| 626 | switch(frame_id) |
|---|
| 627 | { |
|---|
| 628 | case FID_VID_RATIO : |
|---|
| 629 | value=item_id==0?APP_DISP_RATIO_WIDE:APP_DISP_RATIO_NARROW; |
|---|
| 630 | App_VideoSetScrRatio((APP_DISP_RATIO)value==0?APP_DISP_RATIO_WIDE:APP_DISP_RATIO_NARROW, TRUE); |
|---|
| 631 | |
|---|
| 632 | /* display mode */ |
|---|
| 633 | { |
|---|
| 634 | BOOL bsrc_wide, bscr_wide; |
|---|
| 635 | APP_DISP_MODE disp_mode; |
|---|
| 636 | int temp; |
|---|
| 637 | |
|---|
| 638 | disp_mode=App_VideoGetCurrentDisplayMode(&bsrc_wide); |
|---|
| 639 | bscr_wide=App_VideoGetScrRatio()==APP_DISP_RATIO_WIDE?TRUE:FALSE; |
|---|
| 640 | |
|---|
| 641 | if(bsrc_wide==bscr_wide) { |
|---|
| 642 | p_change_num_disp_mode(TRUE); |
|---|
| 643 | temp=0; |
|---|
| 644 | } |
|---|
| 645 | else { |
|---|
| 646 | p_change_num_disp_mode(FALSE); |
|---|
| 647 | temp= |
|---|
| 648 | disp_mode==APP_DISP_MODE_WIDE?1: |
|---|
| 649 | disp_mode==APP_DISP_MODE_14_9?2: |
|---|
| 650 | disp_mode==APP_DISP_MODE_NORM?3:0; |
|---|
| 651 | } |
|---|
| 652 | p_set_value(FID_VID_MODE, temp); |
|---|
| 653 | |
|---|
| 654 | App_VideoChangeDisplayMode(disp_mode, TRUE); |
|---|
| 655 | |
|---|
| 656 | } |
|---|
| 657 | |
|---|
| 658 | break; |
|---|
| 659 | |
|---|
| 660 | case FID_VID_MODE : |
|---|
| 661 | value= |
|---|
| 662 | item_id==0?APP_DISP_MODE_ZOOM: |
|---|
| 663 | item_id==1?APP_DISP_MODE_WIDE: |
|---|
| 664 | item_id==2?APP_DISP_MODE_14_9:APP_DISP_MODE_NORM; |
|---|
| 665 | |
|---|
| 666 | App_VideoChangeDisplayMode((APP_DISP_MODE)value, TRUE); |
|---|
| 667 | break; |
|---|
| 668 | |
|---|
| 669 | case FID_VID_RES : |
|---|
| 670 | AppO_EraseMainMenu(ID_DEF); |
|---|
| 671 | |
|---|
| 672 | value= |
|---|
| 673 | item_id==0?APP_VIDEO_FORMAT_1080I: |
|---|
| 674 | item_id==1?APP_VIDEO_FORMAT_720P: |
|---|
| 675 | item_id==2?APP_VIDEO_FORMAT_480P: |
|---|
| 676 | item_id==3?APP_VIDEO_FORMAT_480I:APP_VIDEO_FORMAT_NONE; |
|---|
| 677 | |
|---|
| 678 | App_VideoSetPreferedResolution((APP_VIDEO_FORMAT)value, TRUE); |
|---|
| 679 | DMG_MenuStart(MID_MAIN); |
|---|
| 680 | break; |
|---|
| 681 | |
|---|
| 682 | case FID_AUD_PREF : |
|---|
| 683 | value= |
|---|
| 684 | item_id==0?APP_AUDIO_LANG_AUTO: |
|---|
| 685 | item_id==1?APP_AUDIO_LANG_SPA:APP_AUDIO_LANG_ENG; |
|---|
| 686 | |
|---|
| 687 | App_AudioSetPreferredLanguageId((APP_AUDIO_LANG_ID)value, TRUE); |
|---|
| 688 | break; |
|---|
| 689 | |
|---|
| 690 | case FID_AUD_DOWNMIX : |
|---|
| 691 | value= |
|---|
| 692 | item_id==0?APP_AUDIO_DOWNMIX_LTRT:APP_AUDIO_DOWNMIX_LORO; |
|---|
| 693 | |
|---|
| 694 | App_AudioSetDownMix(value, TRUE); |
|---|
| 695 | break; |
|---|
| 696 | |
|---|
| 697 | case FID_AUD_DIGITAL : |
|---|
| 698 | value=item_id==0?APP_AUDIO_SPDIF_PCM:APP_AUDIO_SPDIF_AC3; |
|---|
| 699 | App_AudioSetDigitalAudio((APP_AUDIO_SPDIF_MODE)value, TRUE); |
|---|
| 700 | break; |
|---|
| 701 | } |
|---|
| 702 | } |
|---|
| 703 | |
|---|
| 704 | |
|---|
| 705 | static void p_change_value(tDMG_FrameId frame_id, UINT32 item_id) |
|---|
| 706 | { |
|---|
| 707 | int value; |
|---|
| 708 | |
|---|
| 709 | switch(frame_id) { |
|---|
| 710 | |
|---|
| 711 | case FID_CH_INPUT : |
|---|
| 712 | App_ChangeChannelType(item_id==0?ChannelType_Air:ChannelType_Cable); |
|---|
| 713 | break; |
|---|
| 714 | |
|---|
| 715 | case FID_CC_DISP : |
|---|
| 716 | case FID_CC_SERV : /* caption service */ |
|---|
| 717 | case FID_CC_OPT : /* caption option */ |
|---|
| 718 | case FID_CC_POS : |
|---|
| 719 | case FID_CC_F_SIZE : |
|---|
| 720 | case FID_CC_F_COLOR : |
|---|
| 721 | case FID_CC_F_STYLE: |
|---|
| 722 | case FID_CC_B_COLOR : |
|---|
| 723 | case FID_CC_F_TRANS : |
|---|
| 724 | case FID_CC_B_TRANS : |
|---|
| 725 | p_change_cc_value(frame_id, item_id); |
|---|
| 726 | break; |
|---|
| 727 | |
|---|
| 728 | case FID_VID_MODE : |
|---|
| 729 | case FID_VID_RATIO : |
|---|
| 730 | case FID_VID_RES : |
|---|
| 731 | case FID_AUD_PREF : |
|---|
| 732 | case FID_AUD_DOWNMIX : |
|---|
| 733 | case FID_AUD_DIGITAL : |
|---|
| 734 | p_change_av_value(frame_id, item_id); |
|---|
| 735 | break; |
|---|
| 736 | |
|---|
| 737 | case FID_RT_ONOFF: |
|---|
| 738 | AppRating_SetMasterBlock(item_id==0?TRUE:FALSE, TRUE); |
|---|
| 739 | break; |
|---|
| 740 | |
|---|
| 741 | case FID_EA_MID : |
|---|
| 742 | AppF_EASetMedium(item_id==0?TRUE:FALSE); |
|---|
| 743 | break; |
|---|
| 744 | |
|---|
| 745 | case FID_EA_LOW : |
|---|
| 746 | AppF_EASetLow(item_id==0?TRUE:FALSE); |
|---|
| 747 | break; |
|---|
| 748 | |
|---|
| 749 | case FID_TIME_SLEEP : |
|---|
| 750 | |
|---|
| 751 | value=item_id==0?0: |
|---|
| 752 | item_id==1?15: |
|---|
| 753 | item_id==2?30: |
|---|
| 754 | item_id==3?60: |
|---|
| 755 | item_id==4?120:0; |
|---|
| 756 | |
|---|
| 757 | App_SetSleepTimer(value/5); |
|---|
| 758 | /* sleep timer ÇÊ¿äÇÔ */ |
|---|
| 759 | |
|---|
| 760 | if(value==0) |
|---|
| 761 | DMG_KillTimer(TIMER_ID_SLEEP); |
|---|
| 762 | else |
|---|
| 763 | DMG_SetTimer(TIMER_ID_SLEEP, (value-1)*60*1000, eDMG_CMD_OPT_TIMER_ONESHOT); |
|---|
| 764 | break; |
|---|
| 765 | |
|---|
| 766 | case FID_TIME_NOSIG: |
|---|
| 767 | value=item_id==0?0xff: |
|---|
| 768 | item_id==1?6: |
|---|
| 769 | item_id==2?12: |
|---|
| 770 | item_id==3?24: |
|---|
| 771 | item_id==4?48:0xff; |
|---|
| 772 | |
|---|
| 773 | App_SetNoKeyPowerDownTimeout(value, TRUE); |
|---|
| 774 | break; |
|---|
| 775 | |
|---|
| 776 | case FID_MENU_LANG : |
|---|
| 777 | #if 0 |
|---|
| 778 | switch(item_id) { |
|---|
| 779 | case 0 : value=eDMG_LANG_ENG; break; |
|---|
| 780 | case 1 : value=eDMG_LANG_SPA; break; |
|---|
| 781 | case 2 : value=eDMG_LANG_KOR; break; |
|---|
| 782 | default: value=eDMG_LANG_ENG; break; |
|---|
| 783 | } |
|---|
| 784 | #endif |
|---|
| 785 | DMG_SetLanguage(item_id); |
|---|
| 786 | App_NVM_SetMenuLang(item_id); |
|---|
| 787 | DMG_SetRedraw(TRUE); |
|---|
| 788 | break; |
|---|
| 789 | case FID_TIME_ZONE : |
|---|
| 790 | switch(item_id) |
|---|
| 791 | { |
|---|
| 792 | case 0: value=APP_TIMEZONE_CENTRAL; break; |
|---|
| 793 | case 1: value=APP_TIMEZONE_MOUNTAIN; break; |
|---|
| 794 | case 2: value=APP_TIMEZONE_PACIFIC; break; |
|---|
| 795 | default: value=APP_TIMEZONE_CENTRAL; break; |
|---|
| 796 | } |
|---|
| 797 | App_SetTimeZone(value, TRUE); |
|---|
| 798 | break; |
|---|
| 799 | |
|---|
| 800 | case FID_TIME_SUMMER: |
|---|
| 801 | if(item_id == 0) |
|---|
| 802 | { |
|---|
| 803 | App_SetDayLightSaving(TRUE, TRUE); |
|---|
| 804 | } |
|---|
| 805 | else |
|---|
| 806 | { |
|---|
| 807 | App_SetDayLightSaving(FALSE, TRUE); |
|---|
| 808 | } |
|---|
| 809 | break; |
|---|
| 810 | |
|---|
| 811 | case FID_MENU_TRANS : |
|---|
| 812 | |
|---|
| 813 | #if 0 |
|---|
| 814 | value=item_id==0?eDHL_ALPHA_80:item_id==1?eDHL_ALPHA_60:eDHL_ALPHA_100; |
|---|
| 815 | |
|---|
| 816 | APP_SetMenuOpacity((tDHL_AlphaMode)value); |
|---|
| 817 | |
|---|
| 818 | if((tDHL_AlphaMode)value==eDHL_ALPHA_80) |
|---|
| 819 | DHL_SetPlaneOpacity(APP_PLANE_DISP, eDHL_ALPHA_UNUSE); |
|---|
| 820 | else |
|---|
| 821 | DHL_SetPlaneOpacity(APP_PLANE_DISP, (tDHL_AlphaMode)value); |
|---|
| 822 | #endif |
|---|
| 823 | break; |
|---|
| 824 | |
|---|
| 825 | default : |
|---|
| 826 | dprint(0, "!! not implemented yet(fid 0x%x, item_idx 0x%x)\n", frame_id, item_id); |
|---|
| 827 | |
|---|
| 828 | } |
|---|
| 829 | |
|---|
| 830 | } |
|---|
| 831 | |
|---|
| 832 | |
|---|
| 833 | static void p_set_pin(UINT16 pin_num) |
|---|
| 834 | { |
|---|
| 835 | char passwd[5]; |
|---|
| 836 | |
|---|
| 837 | sprintf(passwd, "%04d", pin_num); |
|---|
| 838 | |
|---|
| 839 | AppRating_SetRatingPassword(passwd, TRUE); |
|---|
| 840 | } |
|---|
| 841 | |
|---|
| 842 | |
|---|
| 843 | static BOOL p_is_pin_matched(UINT16 pin_num) |
|---|
| 844 | { |
|---|
| 845 | char passwd[5]; |
|---|
| 846 | |
|---|
| 847 | dprint(0, "###################################################\n"); |
|---|
| 848 | dprint(0, "################### input pin is %d\n", pin_num); |
|---|
| 849 | |
|---|
| 850 | sprintf(passwd, "%04d", pin_num); |
|---|
| 851 | |
|---|
| 852 | return AppRating_CheckIfPasswordMatch((UINT8 *)passwd, FALSE); |
|---|
| 853 | } |
|---|
| 854 | |
|---|
| 855 | |
|---|
| 856 | #if COMMENT |
|---|
| 857 | __Menu_User_Proc__(){} |
|---|
| 858 | #endif |
|---|
| 859 | |
|---|
| 860 | static int cur_fid=0; |
|---|
| 861 | |
|---|
| 862 | static BOOL p_proc_enter_pin(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 863 | { |
|---|
| 864 | BOOL bdone=TRUE; |
|---|
| 865 | static UINT16 input_pin=0; |
|---|
| 866 | tDMG_Menu *pmenu=(tDMG_Menu *)param1; |
|---|
| 867 | |
|---|
| 868 | switch(param2) { |
|---|
| 869 | case APP_VK_0: |
|---|
| 870 | case APP_VK_1: |
|---|
| 871 | case APP_VK_2: |
|---|
| 872 | case APP_VK_3: |
|---|
| 873 | case APP_VK_4: |
|---|
| 874 | case APP_VK_5: |
|---|
| 875 | case APP_VK_6: |
|---|
| 876 | case APP_VK_7: |
|---|
| 877 | case APP_VK_8: |
|---|
| 878 | case APP_VK_9: |
|---|
| 879 | |
|---|
| 880 | if(pmenu->param2==0) input_pin=0; |
|---|
| 881 | |
|---|
| 882 | AppO_UpdateEnterPin(pmenu->param2++); |
|---|
| 883 | |
|---|
| 884 | input_pin=input_pin*10+param2-APP_VK_0; |
|---|
| 885 | |
|---|
| 886 | if(pmenu->param2==4) { //¸ðµç ¼ýÀÚ°¡ ´Ù ÀԷµǾú±â ¶§¹®¿¡ üũ¸¦ ÇØºÁ¾ß ÇÔ. |
|---|
| 887 | |
|---|
| 888 | if(p_is_pin_matched(input_pin)) { |
|---|
| 889 | |
|---|
| 890 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 891 | pmenu->param2 = 0; |
|---|
| 892 | |
|---|
| 893 | AppO_DrawMainMenuBg(0); |
|---|
| 894 | AppO_DrawMainMenuBg(1); |
|---|
| 895 | |
|---|
| 896 | p_init_cur_unit(FID_RT_MAIN); |
|---|
| 897 | |
|---|
| 898 | p_change_select2cur_unit(FID_RT_MAIN); |
|---|
| 899 | |
|---|
| 900 | AppO_UpdateMainMenu(FID_RT_MAIN, ID_DEF); |
|---|
| 901 | |
|---|
| 902 | AppO_DrawMainMenu(FID_RT_MAIN); |
|---|
| 903 | cur_fid=FID_RT_MAIN; |
|---|
| 904 | } |
|---|
| 905 | else { |
|---|
| 906 | pmenu->param2=0; |
|---|
| 907 | input_pin=0; |
|---|
| 908 | |
|---|
| 909 | AppO_DrawEnterPin(); |
|---|
| 910 | } |
|---|
| 911 | |
|---|
| 912 | } |
|---|
| 913 | |
|---|
| 914 | break; |
|---|
| 915 | |
|---|
| 916 | case APP_VK_MENU: |
|---|
| 917 | case APP_VK_BACK: |
|---|
| 918 | //µÇµ¹¾Æ°¡¾ß ÇÔ. |
|---|
| 919 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 920 | pmenu->param2 = 0; |
|---|
| 921 | |
|---|
| 922 | AppO_DrawMainMenuBg(0); |
|---|
| 923 | //AppO_DrawMainMenuBg(1); |
|---|
| 924 | AppO_EraseMainMenuBg(2); |
|---|
| 925 | |
|---|
| 926 | AppO_DrawMainMenu(cur_fid); |
|---|
| 927 | break; |
|---|
| 928 | |
|---|
| 929 | case APP_VK_EPG: |
|---|
| 930 | case APP_VK_INFO: |
|---|
| 931 | break; |
|---|
| 932 | |
|---|
| 933 | default: |
|---|
| 934 | bdone=FALSE; |
|---|
| 935 | } |
|---|
| 936 | |
|---|
| 937 | return bdone; |
|---|
| 938 | } |
|---|
| 939 | |
|---|
| 940 | static BOOL p_proc_tv_rating(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 941 | { |
|---|
| 942 | BOOL bdone=TRUE; |
|---|
| 943 | tDMG_Menu *pmenu=(tDMG_Menu *)param1; |
|---|
| 944 | static int cur_row=0, cur_col=0; |
|---|
| 945 | int i; |
|---|
| 946 | |
|---|
| 947 | switch(param2) { |
|---|
| 948 | |
|---|
| 949 | case APP_VK_CUSTOM9: |
|---|
| 950 | //Main Proc¿¡¼ ÀÌ procÀÌ ½ÃÀ۵Ǿú´Ù´Â °ÍÀ» ¾Ë·ÁÁÜ. |
|---|
| 951 | cur_row=0; |
|---|
| 952 | cur_col=0; |
|---|
| 953 | |
|---|
| 954 | AppO_InitRating(); |
|---|
| 955 | AppO_DrawUsRRT(0, 0, TRUE); |
|---|
| 956 | break; |
|---|
| 957 | |
|---|
| 958 | case APP_VK_LEFT: |
|---|
| 959 | for(i=1; i<7; i++) { |
|---|
| 960 | if(AppO_IsValidUsPos(cur_row, cur_col-i<0?cur_col-i+7:cur_col-i)) { |
|---|
| 961 | cur_col=cur_col-i<0?cur_col-i+7:cur_col-i; |
|---|
| 962 | AppO_DrawUsRRT(cur_row, cur_col, FALSE); |
|---|
| 963 | break; |
|---|
| 964 | } |
|---|
| 965 | } |
|---|
| 966 | break; |
|---|
| 967 | |
|---|
| 968 | case APP_VK_RIGHT: |
|---|
| 969 | for(i=1; i<7; i++) { |
|---|
| 970 | if(AppO_IsValidUsPos(cur_row, (cur_col+i)%7)) { |
|---|
| 971 | cur_col=(cur_col+i)%7; |
|---|
| 972 | AppO_DrawUsRRT(cur_row, cur_col, FALSE); |
|---|
| 973 | break; |
|---|
| 974 | } |
|---|
| 975 | } |
|---|
| 976 | break; |
|---|
| 977 | |
|---|
| 978 | case APP_VK_UP: |
|---|
| 979 | for(i=1; i<7; i++) { |
|---|
| 980 | if(AppO_IsValidUsPos(cur_row-i<0?cur_row-i+7:cur_row-i, cur_col)) { |
|---|
| 981 | cur_row=cur_row-i<0?cur_row-i+7:cur_row-i; |
|---|
| 982 | AppO_DrawUsRRT(cur_row, cur_col, FALSE); |
|---|
| 983 | break; |
|---|
| 984 | } |
|---|
| 985 | } |
|---|
| 986 | break; |
|---|
| 987 | |
|---|
| 988 | case APP_VK_DOWN: |
|---|
| 989 | |
|---|
| 990 | for(i=1; i<7; i++) { |
|---|
| 991 | if(AppO_IsValidUsPos((cur_row+i)%7, cur_col)) { |
|---|
| 992 | cur_row=(cur_row+i)%7; |
|---|
| 993 | AppO_DrawUsRRT(cur_row, cur_col, FALSE); |
|---|
| 994 | break; |
|---|
| 995 | } |
|---|
| 996 | } |
|---|
| 997 | break; |
|---|
| 998 | |
|---|
| 999 | case APP_VK_OK: |
|---|
| 1000 | AppO_ToggleUsRRT(); |
|---|
| 1001 | break; |
|---|
| 1002 | |
|---|
| 1003 | case APP_VK_MENU: |
|---|
| 1004 | case APP_VK_BACK: |
|---|
| 1005 | //µÇµ¹¾Æ°¡¾ß ÇÔ. |
|---|
| 1006 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1007 | pmenu->param2 = 0; |
|---|
| 1008 | |
|---|
| 1009 | AppO_EraseUsRRT(); |
|---|
| 1010 | |
|---|
| 1011 | AppO_DrawMainMenuBg(0); |
|---|
| 1012 | AppO_DrawMainMenuBg(1); |
|---|
| 1013 | //AppO_DrawMainMenuBg(2); |
|---|
| 1014 | |
|---|
| 1015 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1016 | break; |
|---|
| 1017 | |
|---|
| 1018 | default: |
|---|
| 1019 | bdone=FALSE; |
|---|
| 1020 | } |
|---|
| 1021 | |
|---|
| 1022 | return bdone; |
|---|
| 1023 | } |
|---|
| 1024 | |
|---|
| 1025 | static BOOL p_proc_mpaa_rating(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1026 | { |
|---|
| 1027 | BOOL bdone=TRUE; |
|---|
| 1028 | tDMG_Menu *pmenu=(tDMG_Menu *)param1; |
|---|
| 1029 | static int cur_col=0; |
|---|
| 1030 | int i; |
|---|
| 1031 | |
|---|
| 1032 | switch(param2) { |
|---|
| 1033 | |
|---|
| 1034 | case APP_VK_CUSTOM9: |
|---|
| 1035 | //Main Proc¿¡¼ ÀÌ procÀÌ ½ÃÀ۵Ǿú´Ù´Â °ÍÀ» ¾Ë·ÁÁÜ. |
|---|
| 1036 | cur_col=0; |
|---|
| 1037 | |
|---|
| 1038 | AppO_InitRating(); |
|---|
| 1039 | AppO_DrawMpaaRRT(cur_col, TRUE); |
|---|
| 1040 | break; |
|---|
| 1041 | |
|---|
| 1042 | case APP_VK_LEFT: |
|---|
| 1043 | if(cur_col<4) break; |
|---|
| 1044 | |
|---|
| 1045 | cur_col-=4; |
|---|
| 1046 | AppO_DrawMpaaRRT(cur_col, FALSE); |
|---|
| 1047 | break; |
|---|
| 1048 | |
|---|
| 1049 | case APP_VK_RIGHT: |
|---|
| 1050 | if(cur_col>=4) break; |
|---|
| 1051 | |
|---|
| 1052 | if(cur_col==3) cur_col=6; |
|---|
| 1053 | else cur_col+=4; |
|---|
| 1054 | |
|---|
| 1055 | AppO_DrawMpaaRRT(cur_col, FALSE); |
|---|
| 1056 | break; |
|---|
| 1057 | |
|---|
| 1058 | case APP_VK_UP: |
|---|
| 1059 | if(cur_col==0) break; |
|---|
| 1060 | |
|---|
| 1061 | AppO_DrawMpaaRRT(--cur_col, FALSE); |
|---|
| 1062 | break; |
|---|
| 1063 | |
|---|
| 1064 | case APP_VK_DOWN: |
|---|
| 1065 | |
|---|
| 1066 | if(cur_col==6) break; |
|---|
| 1067 | |
|---|
| 1068 | AppO_DrawMpaaRRT(++cur_col, FALSE); |
|---|
| 1069 | break; |
|---|
| 1070 | |
|---|
| 1071 | case APP_VK_OK: |
|---|
| 1072 | AppO_ToggleMpaaRRT(cur_col); |
|---|
| 1073 | break; |
|---|
| 1074 | |
|---|
| 1075 | case APP_VK_MENU: |
|---|
| 1076 | case APP_VK_BACK: |
|---|
| 1077 | //µÇµ¹¾Æ°¡¾ß ÇÔ. |
|---|
| 1078 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1079 | pmenu->param2 = 0; |
|---|
| 1080 | |
|---|
| 1081 | AppO_DrawMainMenuBg(0); |
|---|
| 1082 | AppO_DrawMainMenuBg(1); |
|---|
| 1083 | //AppO_DrawMainMenuBg(2); |
|---|
| 1084 | |
|---|
| 1085 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1086 | break; |
|---|
| 1087 | |
|---|
| 1088 | default: |
|---|
| 1089 | bdone=FALSE; |
|---|
| 1090 | } |
|---|
| 1091 | |
|---|
| 1092 | return bdone; |
|---|
| 1093 | |
|---|
| 1094 | } |
|---|
| 1095 | |
|---|
| 1096 | static BOOL p_proc_set_drating(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1097 | { |
|---|
| 1098 | BOOL bdone=TRUE; |
|---|
| 1099 | tDMG_Menu *pmenu=DMG_GetCurMenu(); |
|---|
| 1100 | |
|---|
| 1101 | if(cmd==eDMG_CMD_ON_TIME) { |
|---|
| 1102 | |
|---|
| 1103 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1104 | pmenu->param2 = 0; |
|---|
| 1105 | |
|---|
| 1106 | AppO_DrawMainMenuBg(0); |
|---|
| 1107 | AppO_DrawMainMenuBg(1); |
|---|
| 1108 | //AppO_DrawMainMenuBg(2); |
|---|
| 1109 | |
|---|
| 1110 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1111 | |
|---|
| 1112 | return TRUE; |
|---|
| 1113 | } |
|---|
| 1114 | |
|---|
| 1115 | switch(param2) { |
|---|
| 1116 | |
|---|
| 1117 | case APP_VK_CUSTOM9: |
|---|
| 1118 | //Main Proc¿¡¼ ÀÌ procÀÌ ½ÃÀ۵Ǿú´Ù´Â °ÍÀ» ¾Ë·ÁÁÜ. |
|---|
| 1119 | //¸ÕÀú dratingÀÌ ÀÖ´ÂÁö üũÇÔ. |
|---|
| 1120 | if(!AppO_InitSetDrating()) { |
|---|
| 1121 | //popupÀ» 3ÃÊ µ¿¾È ¶ç¿ì°í Áö¿ò. |
|---|
| 1122 | AppO_DrawNoDrrtWarning(); |
|---|
| 1123 | DMG_SetTimer(TIMER_ID_L2, 3000, eDMG_CMD_OPT_TIMER_ONESHOT); |
|---|
| 1124 | break; |
|---|
| 1125 | } |
|---|
| 1126 | |
|---|
| 1127 | AppO_DrawSetDrating(0, TRUE); |
|---|
| 1128 | break; |
|---|
| 1129 | |
|---|
| 1130 | case APP_VK_LEFT: |
|---|
| 1131 | AppO_DrawSetDrating(param2, FALSE); |
|---|
| 1132 | break; |
|---|
| 1133 | |
|---|
| 1134 | case APP_VK_RIGHT: |
|---|
| 1135 | AppO_DrawSetDrating(param2, FALSE); |
|---|
| 1136 | break; |
|---|
| 1137 | |
|---|
| 1138 | case APP_VK_UP: |
|---|
| 1139 | AppO_DrawSetDrating(param2, FALSE); |
|---|
| 1140 | break; |
|---|
| 1141 | |
|---|
| 1142 | case APP_VK_DOWN: |
|---|
| 1143 | AppO_DrawSetDrating(param2, FALSE); |
|---|
| 1144 | break; |
|---|
| 1145 | |
|---|
| 1146 | case APP_VK_OK: |
|---|
| 1147 | AppO_ToggleSetDrating(); |
|---|
| 1148 | break; |
|---|
| 1149 | |
|---|
| 1150 | case APP_VK_MENU: |
|---|
| 1151 | case APP_VK_BACK: |
|---|
| 1152 | //µÇµ¹¾Æ°¡¾ß ÇÔ. |
|---|
| 1153 | DMG_KillTimer(TIMER_ID_L2); |
|---|
| 1154 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1155 | pmenu->param2 = 0; |
|---|
| 1156 | |
|---|
| 1157 | AppO_DrawMainMenuBg(0); |
|---|
| 1158 | AppO_DrawMainMenuBg(1); |
|---|
| 1159 | //AppO_DrawMainMenuBg(2); |
|---|
| 1160 | |
|---|
| 1161 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1162 | break; |
|---|
| 1163 | |
|---|
| 1164 | default: |
|---|
| 1165 | bdone=FALSE; |
|---|
| 1166 | } |
|---|
| 1167 | |
|---|
| 1168 | return bdone; |
|---|
| 1169 | } |
|---|
| 1170 | |
|---|
| 1171 | static BOOL p_proc_update_drating(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1172 | { |
|---|
| 1173 | BOOL bdone=TRUE; |
|---|
| 1174 | tDMG_Menu *pmenu=DMG_GetCurMenu(); |
|---|
| 1175 | static int progress=0; |
|---|
| 1176 | static int rrt_count=0; |
|---|
| 1177 | |
|---|
| 1178 | if(cmd==eDMG_CMD_ON_TIME) { |
|---|
| 1179 | |
|---|
| 1180 | if(param1==TIMER_ID_L2) { |
|---|
| 1181 | if(Dmc_EpgCurrentRrtUpdateCount()>rrt_count) { |
|---|
| 1182 | |
|---|
| 1183 | AppO_CompleteDrrtUpdate(); |
|---|
| 1184 | |
|---|
| 1185 | AppO_InitSetDrating(); |
|---|
| 1186 | |
|---|
| 1187 | DMG_KillTimer(TIMER_ID_L2); |
|---|
| 1188 | DMG_SetTimer(TIMER_ID_L3, 3000, eDMG_CMD_OPT_TIMER_ONESHOT); |
|---|
| 1189 | } |
|---|
| 1190 | else { |
|---|
| 1191 | AppO_DrawDrrtUpdate(++progress*100/60, FALSE); |
|---|
| 1192 | |
|---|
| 1193 | if(progress>=60) { |
|---|
| 1194 | |
|---|
| 1195 | AppO_FailedDrrtUpdate(); |
|---|
| 1196 | |
|---|
| 1197 | DMG_KillTimer(TIMER_ID_L2); |
|---|
| 1198 | DMG_SetTimer(TIMER_ID_L3, 3000, eDMG_CMD_OPT_TIMER_ONESHOT); |
|---|
| 1199 | } |
|---|
| 1200 | } |
|---|
| 1201 | } |
|---|
| 1202 | else if(param1==TIMER_ID_L3) { |
|---|
| 1203 | DMG_KillTimer(TIMER_ID_L2); |
|---|
| 1204 | DMG_KillTimer(TIMER_ID_L3); |
|---|
| 1205 | |
|---|
| 1206 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1207 | pmenu->param2 = 0; |
|---|
| 1208 | |
|---|
| 1209 | AppO_DrawMainMenuBg(0); |
|---|
| 1210 | AppO_DrawMainMenuBg(1); |
|---|
| 1211 | //AppO_DrawMainMenuBg(2); |
|---|
| 1212 | |
|---|
| 1213 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1214 | |
|---|
| 1215 | DMG_SetMenuTimeout(MID_MAIN, 30000); |
|---|
| 1216 | } |
|---|
| 1217 | |
|---|
| 1218 | return TRUE; |
|---|
| 1219 | } |
|---|
| 1220 | |
|---|
| 1221 | switch(param2) { |
|---|
| 1222 | |
|---|
| 1223 | case APP_VK_CUSTOM9: |
|---|
| 1224 | progress=0; |
|---|
| 1225 | AppO_DrawDrrtUpdate(progress, TRUE); |
|---|
| 1226 | DMG_SetTimer(TIMER_ID_L2, 1000, 0); |
|---|
| 1227 | |
|---|
| 1228 | rrt_count=Dmc_EpgCurrentRrtUpdateCount(); |
|---|
| 1229 | Dmc_EpgRrtForceUpdateMode(TRUE); |
|---|
| 1230 | |
|---|
| 1231 | DMG_SetMenuTimeout(MID_MAIN, DMG_TIME_FOREVER); |
|---|
| 1232 | |
|---|
| 1233 | break; |
|---|
| 1234 | |
|---|
| 1235 | case APP_VK_LEFT: |
|---|
| 1236 | break; |
|---|
| 1237 | |
|---|
| 1238 | case APP_VK_RIGHT: |
|---|
| 1239 | break; |
|---|
| 1240 | |
|---|
| 1241 | case APP_VK_UP: |
|---|
| 1242 | break; |
|---|
| 1243 | |
|---|
| 1244 | case APP_VK_DOWN: |
|---|
| 1245 | break; |
|---|
| 1246 | |
|---|
| 1247 | case APP_VK_OK: |
|---|
| 1248 | break; |
|---|
| 1249 | |
|---|
| 1250 | case APP_VK_MENU: |
|---|
| 1251 | case APP_VK_BACK: |
|---|
| 1252 | //µÇµ¹¾Æ°¡¾ß ÇÔ. |
|---|
| 1253 | DMG_KillTimer(TIMER_ID_L2); |
|---|
| 1254 | DMG_KillTimer(TIMER_ID_L3); |
|---|
| 1255 | |
|---|
| 1256 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1257 | pmenu->param2 = 0; |
|---|
| 1258 | |
|---|
| 1259 | AppO_DrawMainMenuBg(0); |
|---|
| 1260 | AppO_DrawMainMenuBg(1); |
|---|
| 1261 | //AppO_DrawMainMenuBg(2); |
|---|
| 1262 | |
|---|
| 1263 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1264 | |
|---|
| 1265 | DMG_SetMenuTimeout(MID_MAIN, 30000); |
|---|
| 1266 | break; |
|---|
| 1267 | |
|---|
| 1268 | default: |
|---|
| 1269 | bdone=FALSE; |
|---|
| 1270 | } |
|---|
| 1271 | |
|---|
| 1272 | return bdone; |
|---|
| 1273 | } |
|---|
| 1274 | |
|---|
| 1275 | static BOOL p_proc_drrt_warning(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1276 | { |
|---|
| 1277 | BOOL bdone=TRUE; |
|---|
| 1278 | tDMG_Menu *pmenu=(tDMG_Menu *)param1; |
|---|
| 1279 | int i; |
|---|
| 1280 | static BOOL byes=TRUE; |
|---|
| 1281 | |
|---|
| 1282 | switch(param2) { |
|---|
| 1283 | |
|---|
| 1284 | case APP_VK_CUSTOM9: |
|---|
| 1285 | //Main Proc¿¡¼ ÀÌ procÀÌ ½ÃÀ۵Ǿú´Ù´Â °ÍÀ» ¾Ë·ÁÁÜ. |
|---|
| 1286 | |
|---|
| 1287 | byes=TRUE; |
|---|
| 1288 | AppO_DrawDrrtUpdateWarning(byes, TRUE); |
|---|
| 1289 | break; |
|---|
| 1290 | |
|---|
| 1291 | case APP_VK_LEFT: |
|---|
| 1292 | byes=1-byes; |
|---|
| 1293 | DHL_OS_Printf("########## BYES : %d\n", byes); |
|---|
| 1294 | AppO_DrawDrrtUpdateWarning(byes, FALSE); |
|---|
| 1295 | break; |
|---|
| 1296 | |
|---|
| 1297 | case APP_VK_RIGHT: |
|---|
| 1298 | byes=1-byes; |
|---|
| 1299 | DHL_OS_Printf("########## BYES : %d\n", byes); |
|---|
| 1300 | AppO_DrawDrrtUpdateWarning(byes, FALSE); |
|---|
| 1301 | break; |
|---|
| 1302 | |
|---|
| 1303 | case APP_VK_UP: |
|---|
| 1304 | break; |
|---|
| 1305 | |
|---|
| 1306 | case APP_VK_DOWN: |
|---|
| 1307 | break; |
|---|
| 1308 | |
|---|
| 1309 | case APP_VK_OK: |
|---|
| 1310 | if(byes) { |
|---|
| 1311 | pmenu->param1 = eAPP_MAIN_RRT_UPDATE_DRRT; |
|---|
| 1312 | pmenu->param2 = 0; |
|---|
| 1313 | p_proc_update_drating(cmd, opt, param1, APP_VK_CUSTOM9); |
|---|
| 1314 | } |
|---|
| 1315 | else { |
|---|
| 1316 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1317 | pmenu->param2 = 0; |
|---|
| 1318 | |
|---|
| 1319 | AppO_DrawMainMenuBg(0); |
|---|
| 1320 | AppO_DrawMainMenuBg(1); |
|---|
| 1321 | //AppO_DrawMainMenuBg(2); |
|---|
| 1322 | |
|---|
| 1323 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1324 | } |
|---|
| 1325 | break; |
|---|
| 1326 | |
|---|
| 1327 | case APP_VK_MENU: |
|---|
| 1328 | case APP_VK_BACK: |
|---|
| 1329 | //µÇµ¹¾Æ°¡¾ß ÇÔ. |
|---|
| 1330 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1331 | pmenu->param2 = 0; |
|---|
| 1332 | |
|---|
| 1333 | AppO_DrawMainMenuBg(0); |
|---|
| 1334 | AppO_DrawMainMenuBg(1); |
|---|
| 1335 | //AppO_DrawMainMenuBg(2); |
|---|
| 1336 | |
|---|
| 1337 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1338 | break; |
|---|
| 1339 | |
|---|
| 1340 | default: |
|---|
| 1341 | bdone=FALSE; |
|---|
| 1342 | } |
|---|
| 1343 | |
|---|
| 1344 | return bdone; |
|---|
| 1345 | } |
|---|
| 1346 | |
|---|
| 1347 | static BOOL p_proc_change_pin(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1348 | { |
|---|
| 1349 | BOOL bdone=TRUE; |
|---|
| 1350 | tDMG_Menu *pmenu=(tDMG_Menu *)param1; |
|---|
| 1351 | static int row=0; |
|---|
| 1352 | static int pos=0; |
|---|
| 1353 | static int pin1, pin2; |
|---|
| 1354 | |
|---|
| 1355 | switch(param2) { |
|---|
| 1356 | |
|---|
| 1357 | case APP_VK_CUSTOM9: |
|---|
| 1358 | //Main Proc¿¡¼ ÀÌ procÀÌ ½ÃÀ۵Ǿú´Ù´Â °ÍÀ» ¾Ë·ÁÁÜ. |
|---|
| 1359 | row=0; |
|---|
| 1360 | pos=0; |
|---|
| 1361 | pin1=0, pin2=0; |
|---|
| 1362 | |
|---|
| 1363 | AppO_DrawChangePin(); |
|---|
| 1364 | break; |
|---|
| 1365 | |
|---|
| 1366 | case APP_VK_LEFT: |
|---|
| 1367 | break; |
|---|
| 1368 | |
|---|
| 1369 | case APP_VK_RIGHT: |
|---|
| 1370 | break; |
|---|
| 1371 | |
|---|
| 1372 | case APP_VK_UP: |
|---|
| 1373 | break; |
|---|
| 1374 | |
|---|
| 1375 | case APP_VK_DOWN: |
|---|
| 1376 | break; |
|---|
| 1377 | |
|---|
| 1378 | case APP_VK_OK: |
|---|
| 1379 | break; |
|---|
| 1380 | |
|---|
| 1381 | case APP_VK_0: |
|---|
| 1382 | case APP_VK_1: |
|---|
| 1383 | case APP_VK_2: |
|---|
| 1384 | case APP_VK_3: |
|---|
| 1385 | case APP_VK_4: |
|---|
| 1386 | case APP_VK_5: |
|---|
| 1387 | case APP_VK_6: |
|---|
| 1388 | case APP_VK_7: |
|---|
| 1389 | case APP_VK_8: |
|---|
| 1390 | case APP_VK_9: |
|---|
| 1391 | |
|---|
| 1392 | AppO_UpdateChangePin(row, pos++); |
|---|
| 1393 | |
|---|
| 1394 | if(row==0) { |
|---|
| 1395 | pin1=pin1*10+param2-APP_VK_0; |
|---|
| 1396 | |
|---|
| 1397 | if(pos==4) { |
|---|
| 1398 | row=1; |
|---|
| 1399 | pos=0; |
|---|
| 1400 | } |
|---|
| 1401 | } |
|---|
| 1402 | else { |
|---|
| 1403 | pin2=pin2*10+param2-APP_VK_0; |
|---|
| 1404 | |
|---|
| 1405 | if(pos==4) { |
|---|
| 1406 | //pin ºñ±³ |
|---|
| 1407 | if(pin1==pin2) { |
|---|
| 1408 | char temp[8]; |
|---|
| 1409 | |
|---|
| 1410 | sprintf(temp, "%04d", pin1); |
|---|
| 1411 | AppRating_SetRatingPassword(temp, TRUE); |
|---|
| 1412 | |
|---|
| 1413 | //µÇµ¹¾Æ°¡¾ß ÇÔ. |
|---|
| 1414 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1415 | pmenu->param2 = 0; |
|---|
| 1416 | |
|---|
| 1417 | AppO_DrawMainMenuBg(0); |
|---|
| 1418 | AppO_DrawMainMenuBg(1); |
|---|
| 1419 | //AppO_DrawMainMenuBg(2); |
|---|
| 1420 | |
|---|
| 1421 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1422 | |
|---|
| 1423 | } |
|---|
| 1424 | else { |
|---|
| 1425 | row=0; |
|---|
| 1426 | pos=0; |
|---|
| 1427 | pin1=0, pin2=0; |
|---|
| 1428 | |
|---|
| 1429 | AppO_DrawChangePin(); |
|---|
| 1430 | } |
|---|
| 1431 | |
|---|
| 1432 | } |
|---|
| 1433 | |
|---|
| 1434 | } |
|---|
| 1435 | break; |
|---|
| 1436 | |
|---|
| 1437 | case APP_VK_MENU: |
|---|
| 1438 | case APP_VK_BACK: |
|---|
| 1439 | //µÇµ¹¾Æ°¡¾ß ÇÔ. |
|---|
| 1440 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1441 | pmenu->param2 = 0; |
|---|
| 1442 | |
|---|
| 1443 | AppO_DrawMainMenuBg(0); |
|---|
| 1444 | AppO_DrawMainMenuBg(1); |
|---|
| 1445 | //AppO_DrawMainMenuBg(2); |
|---|
| 1446 | |
|---|
| 1447 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1448 | break; |
|---|
| 1449 | |
|---|
| 1450 | default: |
|---|
| 1451 | bdone=FALSE; |
|---|
| 1452 | } |
|---|
| 1453 | |
|---|
| 1454 | return bdone; |
|---|
| 1455 | } |
|---|
| 1456 | |
|---|
| 1457 | static BOOL p_proc_no_drrt_available(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1458 | { |
|---|
| 1459 | BOOL bdone=TRUE; |
|---|
| 1460 | tDMG_Menu *pmenu=(tDMG_Menu *)param1; |
|---|
| 1461 | static int cur_col=0; |
|---|
| 1462 | int i; |
|---|
| 1463 | |
|---|
| 1464 | switch(param2) { |
|---|
| 1465 | |
|---|
| 1466 | case APP_VK_CUSTOM9: |
|---|
| 1467 | //Main Proc¿¡¼ ÀÌ procÀÌ ½ÃÀ۵Ǿú´Ù´Â °ÍÀ» ¾Ë·ÁÁÜ. |
|---|
| 1468 | cur_col=0; |
|---|
| 1469 | |
|---|
| 1470 | AppO_InitRating(); |
|---|
| 1471 | AppO_DrawMpaaRRT(cur_col, TRUE); |
|---|
| 1472 | break; |
|---|
| 1473 | |
|---|
| 1474 | case APP_VK_LEFT: |
|---|
| 1475 | if(cur_col<4) break; |
|---|
| 1476 | |
|---|
| 1477 | cur_col-=4; |
|---|
| 1478 | AppO_DrawMpaaRRT(cur_col, FALSE); |
|---|
| 1479 | break; |
|---|
| 1480 | |
|---|
| 1481 | case APP_VK_RIGHT: |
|---|
| 1482 | if(cur_col>=4) break; |
|---|
| 1483 | |
|---|
| 1484 | if(cur_col==3) cur_col=6; |
|---|
| 1485 | else cur_col+=4; |
|---|
| 1486 | |
|---|
| 1487 | AppO_DrawMpaaRRT(cur_col, FALSE); |
|---|
| 1488 | break; |
|---|
| 1489 | |
|---|
| 1490 | case APP_VK_UP: |
|---|
| 1491 | if(cur_col==0) break; |
|---|
| 1492 | |
|---|
| 1493 | AppO_DrawMpaaRRT(--cur_col, FALSE); |
|---|
| 1494 | break; |
|---|
| 1495 | |
|---|
| 1496 | case APP_VK_DOWN: |
|---|
| 1497 | |
|---|
| 1498 | if(cur_col==6) break; |
|---|
| 1499 | |
|---|
| 1500 | AppO_DrawMpaaRRT(++cur_col, FALSE); |
|---|
| 1501 | break; |
|---|
| 1502 | |
|---|
| 1503 | case APP_VK_OK: |
|---|
| 1504 | AppO_ToggleMpaaRRT(cur_col); |
|---|
| 1505 | break; |
|---|
| 1506 | |
|---|
| 1507 | case APP_VK_MENU: |
|---|
| 1508 | case APP_VK_BACK: |
|---|
| 1509 | //µÇµ¹¾Æ°¡¾ß ÇÔ. |
|---|
| 1510 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1511 | pmenu->param2 = 0; |
|---|
| 1512 | |
|---|
| 1513 | AppO_DrawMainMenuBg(0); |
|---|
| 1514 | AppO_DrawMainMenuBg(1); |
|---|
| 1515 | //AppO_DrawMainMenuBg(2); |
|---|
| 1516 | |
|---|
| 1517 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1518 | break; |
|---|
| 1519 | |
|---|
| 1520 | default: |
|---|
| 1521 | bdone=FALSE; |
|---|
| 1522 | } |
|---|
| 1523 | |
|---|
| 1524 | return bdone; |
|---|
| 1525 | } |
|---|
| 1526 | |
|---|
| 1527 | |
|---|
| 1528 | BOOL App_Proc_Menu_Main(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1529 | { |
|---|
| 1530 | BOOL bdone=TRUE; |
|---|
| 1531 | tDMG_Menu *pmenu=DMG_GetCurMenu(); |
|---|
| 1532 | |
|---|
| 1533 | int temp_id; |
|---|
| 1534 | static int orig_font_size; |
|---|
| 1535 | extern BOOL bWarningBanner; |
|---|
| 1536 | |
|---|
| 1537 | if (bWarningBanner) |
|---|
| 1538 | APP_OSD_EraseWarningBanner(); |
|---|
| 1539 | |
|---|
| 1540 | switch(cmd) |
|---|
| 1541 | { |
|---|
| 1542 | case eDMG_CMD_ON_MENU_ENTER : |
|---|
| 1543 | p_enable_cable(App_IsForceEnableAirCable()); |
|---|
| 1544 | |
|---|
| 1545 | //Ç×»ó óÀ½Àº depth 0, unit 0(CH)¿¡¼ ½ÃÀÛÇÔ.. |
|---|
| 1546 | cur_fid=FID_MAIN; |
|---|
| 1547 | AppO_SetCurFrame(cur_fid); |
|---|
| 1548 | p_init_menu_var(); /* ¸Þ´º °¢ Ç׸ñÀÇ ±âº» °ªÀ» ¼³Á¤ÇÑ´Ù */ |
|---|
| 1549 | //DMG_SetMenuTimeout(MID_MAIN, App_GetMenuTimeout()*1000); |
|---|
| 1550 | /* »ç¿ëÀڷκÎÅÍ Á¤º¸¸¦ ¾ò¾î¿Í¼ menu »ç¶óÁü¿¡ ´ëÇÑ timeoutÀ» ¼³Á¤ÇÑ´Ù.*/ |
|---|
| 1551 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1552 | break; |
|---|
| 1553 | |
|---|
| 1554 | case eDMG_CMD_ON_MENU_ACTIVE : |
|---|
| 1555 | if(APP_GetMenuOpacity()==eDHL_ALPHA_80) |
|---|
| 1556 | DHL_SetPlaneOpacity(APP_PLANE_DISP, eDHL_ALPHA_UNUSE); |
|---|
| 1557 | else |
|---|
| 1558 | DHL_SetPlaneOpacity(APP_PLANE_DISP, APP_GetMenuOpacity()); |
|---|
| 1559 | |
|---|
| 1560 | orig_font_size=DMG_GetFontSize(); |
|---|
| 1561 | DMG_SetFontSize(24); |
|---|
| 1562 | |
|---|
| 1563 | AppO_DrawMainMenuBg(0); |
|---|
| 1564 | |
|---|
| 1565 | if(p_get_depth(cur_fid)==2) { |
|---|
| 1566 | AppO_DrawMainMenuBg(1); |
|---|
| 1567 | } |
|---|
| 1568 | |
|---|
| 1569 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1570 | |
|---|
| 1571 | // ToDo. signal level °ª ÁÖ±âÀûÀ¸·Î ¼³Á¤ÇÏ´Â timer ±¸µ¿. |
|---|
| 1572 | //DMG_SetTimer(TIMER_ID_UPDATE_SIGNAL_LEVEL, 500, 0); |
|---|
| 1573 | DMG_SetTimer(TIMER_ID_L1, 500, eDMG_CMD_OPT_TIMER_LOCAL1); |
|---|
| 1574 | break; |
|---|
| 1575 | |
|---|
| 1576 | case eDMG_CMD_ON_MENU_INVISIBLE : |
|---|
| 1577 | /* opacity ¼³Á¤ ÇØÁ¦ */ |
|---|
| 1578 | DHL_SetPlaneOpacity(APP_PLANE_DISP, eDHL_ALPHA_UNUSE); |
|---|
| 1579 | |
|---|
| 1580 | DMG_SetFontSize(orig_font_size); |
|---|
| 1581 | |
|---|
| 1582 | AppO_EraseMainMenu(ID_DEF); |
|---|
| 1583 | |
|---|
| 1584 | break; |
|---|
| 1585 | case eDMG_CMD_ON_MENU_EXIT: |
|---|
| 1586 | /* opacity ¼³Á¤ ÇØÁ¦ */ |
|---|
| 1587 | DHL_SetPlaneOpacity(APP_PLANE_DISP, eDHL_ALPHA_UNUSE); |
|---|
| 1588 | |
|---|
| 1589 | DMG_SetFontSize(orig_font_size); |
|---|
| 1590 | |
|---|
| 1591 | AppO_EraseMainMenu(ID_DEF); |
|---|
| 1592 | |
|---|
| 1593 | break; |
|---|
| 1594 | |
|---|
| 1595 | case eDMG_CMD_ON_REDRAW : |
|---|
| 1596 | AppO_DrawMainMenuBg(0); |
|---|
| 1597 | |
|---|
| 1598 | cur_fid=AppO_GetCurFrame(); |
|---|
| 1599 | |
|---|
| 1600 | if(p_get_depth(cur_fid)==2) { |
|---|
| 1601 | AppO_DrawMainMenuBg(1); |
|---|
| 1602 | } |
|---|
| 1603 | |
|---|
| 1604 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1605 | DMG_SetFrame(eDMG_CMD_SET_FRAME_ACTIVE, pmenu->id, cur_fid, TRUE); |
|---|
| 1606 | break; |
|---|
| 1607 | case eDMG_CMD_ON_TIMEOUT : |
|---|
| 1608 | DMG_MenuExit(MID_MAIN); |
|---|
| 1609 | break; |
|---|
| 1610 | |
|---|
| 1611 | case eDMG_CMD_ON_TIME: |
|---|
| 1612 | |
|---|
| 1613 | if(param1==TIMER_ID_L1) { // Signal Level °ªÀ» ÁÖ±âÀûÀ¸·Î ¾÷µ¥ÀÌÆ® Çϴ ŸÀ̸Ó. |
|---|
| 1614 | if(cur_fid == FID_CH_MAIN && p_get_curuid(cur_fid) == 4) { |
|---|
| 1615 | int sigLevel = SigMon_GetStrength(); |
|---|
| 1616 | AppO_UpdateSignalLevelBar(sigLevel); |
|---|
| 1617 | } |
|---|
| 1618 | } |
|---|
| 1619 | else if(param1==TIMER_ID_L2) { |
|---|
| 1620 | //ȸéÀ» Áö¿ö¾ß ÇÔ. |
|---|
| 1621 | if(pmenu->param1==eAPP_MAIN_RRT_SET_DRRT) { |
|---|
| 1622 | DHL_OS_Printf(" timer id l2, set_drrt....\n"); |
|---|
| 1623 | bdone=p_proc_set_drating(cmd, opt, param1, param2); |
|---|
| 1624 | } |
|---|
| 1625 | else if(pmenu->param1==eAPP_MAIN_RRT_UPDATE_DRRT) { |
|---|
| 1626 | bdone=p_proc_update_drating(cmd, opt, param1, param2); |
|---|
| 1627 | } |
|---|
| 1628 | } |
|---|
| 1629 | else if(param1==TIMER_ID_L3) { |
|---|
| 1630 | bdone=p_proc_update_drating(cmd, opt, param1, param2); |
|---|
| 1631 | } |
|---|
| 1632 | else |
|---|
| 1633 | bdone=FALSE; |
|---|
| 1634 | break; |
|---|
| 1635 | |
|---|
| 1636 | case eDMG_CMD_ON_KEY : |
|---|
| 1637 | if(pmenu->param1 == eAPP_MAIN_NORMAL) { |
|---|
| 1638 | switch(param2) { |
|---|
| 1639 | case APP_VK_LEFT: |
|---|
| 1640 | if(p_get_depth(cur_fid)==3) { // popup menu ¼³Á¤ frame ó¸®. |
|---|
| 1641 | temp_id=p_d4_get_left_uid(cur_fid); |
|---|
| 1642 | if(temp_id == ID_DEF) break; |
|---|
| 1643 | AppO_UpdateMainMenu(cur_fid, temp_id); |
|---|
| 1644 | } |
|---|
| 1645 | else { // normal depth frame ó¸® |
|---|
| 1646 | temp_id=p_get_parent(cur_fid); |
|---|
| 1647 | if(temp_id==0) break; |
|---|
| 1648 | |
|---|
| 1649 | if(p_get_depth(temp_id)==0) { |
|---|
| 1650 | AppO_EraseMainMenuBg(1); |
|---|
| 1651 | } |
|---|
| 1652 | |
|---|
| 1653 | AppO_UpdateMainMenu(temp_id, ID_DEF); |
|---|
| 1654 | |
|---|
| 1655 | cur_fid=temp_id; |
|---|
| 1656 | } |
|---|
| 1657 | break; |
|---|
| 1658 | |
|---|
| 1659 | case APP_VK_RIGHT: |
|---|
| 1660 | |
|---|
| 1661 | if(cur_fid==FID_D1 && p_get_curuid(cur_fid)==2) { //OK¸¦ ´©¸£¸é POPUPÀ» ¶ç¿ö¾ß ÇÔ. |
|---|
| 1662 | /* 2012.11.23. ¸ß½ÃÄÚ¿¡¼´Â ratingÀ» Áö¿øÇÏÁö ¾ÊÀ½ |
|---|
| 1663 | pmenu->param1 = eAPP_MAIN_ENTERPIN; |
|---|
| 1664 | pmenu->param2 = 0; //ù ¹øÂ° ¹øÈ£ |
|---|
| 1665 | |
|---|
| 1666 | AppO_DrawEnterPin(); |
|---|
| 1667 | */ |
|---|
| 1668 | break; |
|---|
| 1669 | } |
|---|
| 1670 | |
|---|
| 1671 | if(cur_fid==FID_RT_USA && p_get_curuid(cur_fid) == 0) { //us tv |
|---|
| 1672 | pmenu->param1 = eAPP_MAIN_RRT_US_TV; |
|---|
| 1673 | pmenu->param2 = 0; |
|---|
| 1674 | p_proc_tv_rating(cmd, opt, param1, APP_VK_CUSTOM9); |
|---|
| 1675 | break; |
|---|
| 1676 | } |
|---|
| 1677 | else if(cur_fid==FID_RT_USA && p_get_curuid(cur_fid) == 1) { //us mpaa |
|---|
| 1678 | pmenu->param1 = eAPP_MAIN_RRT_US_MPAA; |
|---|
| 1679 | pmenu->param2 = 0; |
|---|
| 1680 | p_proc_mpaa_rating(cmd, opt, param1, APP_VK_CUSTOM9); |
|---|
| 1681 | break; |
|---|
| 1682 | } |
|---|
| 1683 | |
|---|
| 1684 | if(p_get_depth(cur_fid)==3) { // popup menu ¼³Á¤ frame ó¸®. |
|---|
| 1685 | temp_id=p_d4_get_right_uid(cur_fid); |
|---|
| 1686 | if(temp_id == ID_DEF) break; |
|---|
| 1687 | AppO_UpdateMainMenu(cur_fid, temp_id); |
|---|
| 1688 | } |
|---|
| 1689 | else { // normal depth frame ó¸® |
|---|
| 1690 | temp_id=p_get_child(cur_fid); |
|---|
| 1691 | if(temp_id==0) break; |
|---|
| 1692 | |
|---|
| 1693 | p_init_cur_unit(temp_id); // next depthÀÇ frame·Î ÁøÀԽÿ¡´Â unit 0ÀÌ cur_unitÀÌ µÊ. default |
|---|
| 1694 | |
|---|
| 1695 | if(p_get_depth(temp_id)==1) { |
|---|
| 1696 | AppO_DrawMainMenuBg(1); |
|---|
| 1697 | } |
|---|
| 1698 | |
|---|
| 1699 | // bselectµÈ Ç׸ñÀÌ Á¸ÀçÇϸé ÇØ´ç fid·Î update ½Ã, cur_unit °ªÀº Ç×»ó bselectµÈ Ç׸ñÀÇ idÀÌ´Ù. |
|---|
| 1700 | p_change_select2cur_unit(temp_id); |
|---|
| 1701 | |
|---|
| 1702 | AppO_UpdateMainMenu(temp_id, ID_DEF); |
|---|
| 1703 | cur_fid=temp_id; |
|---|
| 1704 | } |
|---|
| 1705 | break; |
|---|
| 1706 | |
|---|
| 1707 | case APP_VK_UP: |
|---|
| 1708 | if(p_get_depth(cur_fid)==3) { // popup menu ¼³Á¤ frame ó¸®. |
|---|
| 1709 | temp_id=p_get_prev_uid(cur_fid); |
|---|
| 1710 | if(temp_id == ID_DEF) break; |
|---|
| 1711 | AppO_UpdateMainMenu(cur_fid, temp_id); |
|---|
| 1712 | } |
|---|
| 1713 | else { // normal depth frame ó¸® |
|---|
| 1714 | temp_id=p_get_prev_uid(cur_fid); |
|---|
| 1715 | AppO_UpdateMainMenu(cur_fid, temp_id); |
|---|
| 1716 | } |
|---|
| 1717 | break; |
|---|
| 1718 | |
|---|
| 1719 | case APP_VK_DOWN: |
|---|
| 1720 | if(p_get_depth(cur_fid)==3) { // popup menu ¼³Á¤ frame ó¸®. |
|---|
| 1721 | temp_id=p_get_next_uid(cur_fid); |
|---|
| 1722 | if(temp_id == ID_DEF) break; |
|---|
| 1723 | AppO_UpdateMainMenu(cur_fid, temp_id); |
|---|
| 1724 | } |
|---|
| 1725 | else { // normal depth frame ó¸® |
|---|
| 1726 | temp_id=p_get_next_uid(cur_fid); |
|---|
| 1727 | AppO_UpdateMainMenu(cur_fid, temp_id); |
|---|
| 1728 | } |
|---|
| 1729 | break; |
|---|
| 1730 | |
|---|
| 1731 | case APP_VK_OK: |
|---|
| 1732 | |
|---|
| 1733 | if(cur_fid==FID_RT_USA && p_get_curuid(cur_fid) == 0) { //us tv |
|---|
| 1734 | pmenu->param1 = eAPP_MAIN_RRT_US_TV; |
|---|
| 1735 | pmenu->param2 = 0; |
|---|
| 1736 | p_proc_tv_rating(cmd, opt, param1, APP_VK_CUSTOM9); |
|---|
| 1737 | } |
|---|
| 1738 | else if(cur_fid==FID_RT_USA && p_get_curuid(cur_fid) == 1) { //us mpaa |
|---|
| 1739 | pmenu->param1 = eAPP_MAIN_RRT_US_MPAA; |
|---|
| 1740 | pmenu->param2 = 0; |
|---|
| 1741 | p_proc_mpaa_rating(cmd, opt, param1, APP_VK_CUSTOM9); |
|---|
| 1742 | } |
|---|
| 1743 | |
|---|
| 1744 | else if(cur_fid == FID_CH_MAIN && p_get_curuid(cur_fid) == 3) { // "EPG" |
|---|
| 1745 | DMG_MenuStart(MID_EPG); /* ch edit */ |
|---|
| 1746 | } |
|---|
| 1747 | |
|---|
| 1748 | else if(cur_fid == FID_CH_MAIN && p_get_curuid(cur_fid) == 1) { // "ÀÚµ¿ ä³Î ¼±±¹" |
|---|
| 1749 | DMG_MenuStart(MID_AUTOSCAN);/* ch search */ |
|---|
| 1750 | } |
|---|
| 1751 | else if(cur_fid == FID_CH_MAIN && p_get_curuid(cur_fid) == 2) { // "ä³Î ÆíÁý" |
|---|
| 1752 | DMG_MenuStart(MID_CHEDIT); /* ch edit */ |
|---|
| 1753 | } |
|---|
| 1754 | else if(cur_fid==FID_CC_MAIN && p_get_curuid(cur_fid) == 1) { // CC Service |
|---|
| 1755 | |
|---|
| 1756 | p_init_cur_unit(FID_CC_SERV); // next depthÀÇ frame·Î ÁøÀԽÿ¡´Â unit 0ÀÌ cur_unitÀÌ µÊ. default |
|---|
| 1757 | |
|---|
| 1758 | // bselectµÈ Ç׸ñÀÌ Á¸ÀçÇϸé ÇØ´ç fid·Î update ½Ã, cur_unit °ªÀº Ç×»ó bselectµÈ Ç׸ñÀÇ idÀÌ´Ù. |
|---|
| 1759 | p_change_select2cur_unit(FID_CC_SERV); |
|---|
| 1760 | |
|---|
| 1761 | AppO_UpdateMainMenu(FID_CC_SERV, ID_DEF); |
|---|
| 1762 | cur_fid=FID_CC_SERV; |
|---|
| 1763 | } |
|---|
| 1764 | |
|---|
| 1765 | else if(cur_fid==FID_RT_MAIN && p_get_curuid(cur_fid) == 2) { |
|---|
| 1766 | |
|---|
| 1767 | //¸ÕÀú drrt°¡ availableÇÑÁö ÆÄ¾ÇÇØ¾ß ÇÔ. |
|---|
| 1768 | pmenu->param1 = eAPP_MAIN_RRT_SET_DRRT; |
|---|
| 1769 | pmenu->param2 = 0; |
|---|
| 1770 | p_proc_set_drating(cmd, opt, param1, APP_VK_CUSTOM9); |
|---|
| 1771 | } |
|---|
| 1772 | |
|---|
| 1773 | else if(cur_fid==FID_RT_MAIN && p_get_curuid(cur_fid) == 3) { |
|---|
| 1774 | pmenu->param1 = eAPP_MAIN_DRRT_WARNING; |
|---|
| 1775 | pmenu->param2 = 0; |
|---|
| 1776 | //p_proc_update_drating(cmd, opt, param1, APP_VK_CUSTOM9); |
|---|
| 1777 | p_proc_drrt_warning(cmd, opt, param1, APP_VK_CUSTOM9); |
|---|
| 1778 | } |
|---|
| 1779 | |
|---|
| 1780 | else if(cur_fid==FID_RT_MAIN && p_get_curuid(cur_fid) == 4) { |
|---|
| 1781 | pmenu->param1 = eAPP_MAIN_RRT_CHANGE_PIN; |
|---|
| 1782 | pmenu->param2 = 0; |
|---|
| 1783 | p_proc_change_pin(cmd, opt, param1, APP_VK_CUSTOM9); |
|---|
| 1784 | } |
|---|
| 1785 | else if(cur_fid == FID_FC_MAIN && p_get_curuid(cur_fid) == 4) { // "°øÀå ÃʱâÈ" |
|---|
| 1786 | pmenu->param1 = eAPP_MAIN_CONFIRM; |
|---|
| 1787 | pmenu->param2 = 1; // Yes(0) or No(1) |
|---|
| 1788 | { |
|---|
| 1789 | char str1[40]={0,}; |
|---|
| 1790 | char str2[40]={0,}; |
|---|
| 1791 | |
|---|
| 1792 | GET_STR2(str1, RESET_WARN_STR1); |
|---|
| 1793 | GET_STR2(str2, RESET_WARN_STR2); |
|---|
| 1794 | |
|---|
| 1795 | AppO_DrawMainReset(0, str1, str2); |
|---|
| 1796 | AppO_UpdateMainReset(pmenu->param2); //Ä¿¼°¡ NO¿¡ ÀÖ¾î¾ß ÇÔ. |
|---|
| 1797 | } |
|---|
| 1798 | } |
|---|
| 1799 | else if(p_is_leaf(cur_fid, ID_DEF) && p_get_depth(cur_fid)>=2) { //depth3, 4ÀÇ leafÀÎ °æ¿ì´Â..°ªµéÀ» ¼³Á¤ÇØ¾ß ÇÔ.. |
|---|
| 1800 | //ƯÀÌÇϰԵµ usratingÀº depth3¿¡ Àֱ⠶§¹®¿¡ ¿©±â¼ ¼³Á¤ÇØÁÖ¾î¾ß ÇÔ. |
|---|
| 1801 | if(!p_is_selected(cur_fid, ID_DEF)) { // cur unitÀÌ selected »óÅÂÀÎÁö¸¦ È®ÀÎ. |
|---|
| 1802 | p_set_value(cur_fid, ID_DEF); |
|---|
| 1803 | AppO_UpdateMainMenu(cur_fid, ID_DEF); |
|---|
| 1804 | p_change_value(cur_fid, p_get_curuid(cur_fid)); |
|---|
| 1805 | |
|---|
| 1806 | if(p_get_depth(cur_fid)==2) { |
|---|
| 1807 | //°ªÀÌ º¯°æµÇ¸é ¹Ù·Î ÀÌÀü ¸Þ´º·Î backÇÔ. |
|---|
| 1808 | temp_id=p_get_parent(cur_fid); |
|---|
| 1809 | AppO_UpdateMainMenu(temp_id, ID_DEF); |
|---|
| 1810 | cur_fid=temp_id; |
|---|
| 1811 | } |
|---|
| 1812 | } |
|---|
| 1813 | } |
|---|
| 1814 | else if(p_is_leaf(cur_fid, ID_DEF) && p_get_depth(cur_fid) < 2) { |
|---|
| 1815 | // ToDo.. ä³Î ÆíÁý, ÀÚµ¿ ä³Î ¼±±¹ µî L2 MenuÀÇ submenu ½ÇÇà. |
|---|
| 1816 | } |
|---|
| 1817 | else { // RIGHT¿Í µ¿ÀÏÇÏ°Ô ÀÛµ¿ÇÔ.. |
|---|
| 1818 | |
|---|
| 1819 | if(cur_fid==FID_D1 && p_get_curuid(cur_fid)==2) { //OK¸¦ ´©¸£¸é POPUPÀ» ¶ç¿ö¾ß ÇÔ. |
|---|
| 1820 | /* 2012.11.23. ¸ß½ÃÄÚ¿¡¼´Â ratingÀ» Áö¿øÇÏÁö ¾ÊÀ½ |
|---|
| 1821 | pmenu->param1 = eAPP_MAIN_ENTERPIN; |
|---|
| 1822 | pmenu->param2 = 0; //ù ¹øÂ° ¹øÈ£ |
|---|
| 1823 | |
|---|
| 1824 | AppO_DrawEnterPin(); |
|---|
| 1825 | */ |
|---|
| 1826 | break; |
|---|
| 1827 | } |
|---|
| 1828 | |
|---|
| 1829 | temp_id=p_get_child(cur_fid); |
|---|
| 1830 | if(temp_id==0) break; |
|---|
| 1831 | |
|---|
| 1832 | p_init_cur_unit(temp_id); // next depthÀÇ frame·Î ÁøÀԽÿ¡´Â unit 0ÀÌ cur_unitÀÌ µÊ. default |
|---|
| 1833 | |
|---|
| 1834 | if(p_get_depth(temp_id)==1) { |
|---|
| 1835 | AppO_DrawMainMenuBg(1); |
|---|
| 1836 | } |
|---|
| 1837 | |
|---|
| 1838 | // bselectµÈ Ç׸ñÀÌ Á¸ÀçÇϸé ÇØ´ç fid·Î update ½Ã, cur_unit °ªÀº Ç×»ó bselectµÈ Ç׸ñÀÇ idÀÌ´Ù. |
|---|
| 1839 | p_change_select2cur_unit(temp_id); |
|---|
| 1840 | |
|---|
| 1841 | AppO_UpdateMainMenu(temp_id, ID_DEF); |
|---|
| 1842 | cur_fid=temp_id; |
|---|
| 1843 | } |
|---|
| 1844 | break; |
|---|
| 1845 | |
|---|
| 1846 | case APP_VK_BACK: |
|---|
| 1847 | if(p_get_depth(cur_fid)==3) { // popup menu ¼³Á¤ frame ó¸®. |
|---|
| 1848 | temp_id=p_get_parent(cur_fid); |
|---|
| 1849 | AppO_DrawMainMenuBg(0); |
|---|
| 1850 | AppO_DrawMainMenuBg(1); |
|---|
| 1851 | AppO_UpdateMainMenu(temp_id, ID_DEF); // frame ¼³Á¤ º¯°æÀ» À§ÇØ. |
|---|
| 1852 | AppO_DrawMainMenu(temp_id); |
|---|
| 1853 | cur_fid=temp_id; |
|---|
| 1854 | } |
|---|
| 1855 | else { // normal depth frame ó¸® |
|---|
| 1856 | temp_id=p_get_parent(cur_fid); |
|---|
| 1857 | if(temp_id==0) break; |
|---|
| 1858 | |
|---|
| 1859 | if(p_get_depth(temp_id)==0) { |
|---|
| 1860 | AppO_EraseMainMenuBg(1); |
|---|
| 1861 | } |
|---|
| 1862 | |
|---|
| 1863 | AppO_UpdateMainMenu(temp_id, ID_DEF); |
|---|
| 1864 | |
|---|
| 1865 | cur_fid=temp_id; |
|---|
| 1866 | } |
|---|
| 1867 | break; |
|---|
| 1868 | |
|---|
| 1869 | case APP_VK_MENU: |
|---|
| 1870 | if(p_get_depth(cur_fid)==3) { // popup menu ¼³Á¤ frame ó¸®. |
|---|
| 1871 | temp_id=p_get_parent(cur_fid); |
|---|
| 1872 | AppO_DrawMainMenuBg(0); |
|---|
| 1873 | AppO_DrawMainMenuBg(1); |
|---|
| 1874 | AppO_UpdateMainMenu(temp_id, ID_DEF); // frame ¼³Á¤ º¯°æÀ» À§ÇØ. |
|---|
| 1875 | AppO_DrawMainMenu(temp_id); |
|---|
| 1876 | cur_fid=temp_id; |
|---|
| 1877 | } |
|---|
| 1878 | else { |
|---|
| 1879 | DMG_MenuExit(MID_MAIN); // kill menu (Main Menu) |
|---|
| 1880 | } |
|---|
| 1881 | break; |
|---|
| 1882 | default: |
|---|
| 1883 | bdone = FALSE; |
|---|
| 1884 | break; |
|---|
| 1885 | } |
|---|
| 1886 | break; |
|---|
| 1887 | } |
|---|
| 1888 | else if(pmenu->param1 == eAPP_MAIN_CONFIRM) { |
|---|
| 1889 | switch(param2) { |
|---|
| 1890 | case APP_VK_LEFT: |
|---|
| 1891 | pmenu->param2 = 1-pmenu->param2; |
|---|
| 1892 | AppO_UpdateMainReset(pmenu->param2); |
|---|
| 1893 | break; |
|---|
| 1894 | |
|---|
| 1895 | case APP_VK_RIGHT: |
|---|
| 1896 | pmenu->param2 = 1-pmenu->param2; |
|---|
| 1897 | AppO_UpdateMainReset(pmenu->param2); |
|---|
| 1898 | break; |
|---|
| 1899 | |
|---|
| 1900 | case APP_VK_OK: |
|---|
| 1901 | if(pmenu->param2 == 0) { |
|---|
| 1902 | char str1[40]={0,}; |
|---|
| 1903 | char str2[40]={0,}; |
|---|
| 1904 | |
|---|
| 1905 | GET_STR2(str1, RESET_RESET_STR1); |
|---|
| 1906 | GET_STR2(str2, RESET_RESET_STR2); |
|---|
| 1907 | |
|---|
| 1908 | DMG_SetFontSize(22); |
|---|
| 1909 | |
|---|
| 1910 | AppO_DrawMainReset(1, str1, str2); |
|---|
| 1911 | DMG_AutoRefresh(); |
|---|
| 1912 | |
|---|
| 1913 | DMG_SetFontSize(24); |
|---|
| 1914 | |
|---|
| 1915 | DHL_OS_Delay(2000); // 2Ãʸ¦ º¸¿©ÁÜ |
|---|
| 1916 | |
|---|
| 1917 | App_ChTuneStopTVEx(TRUE); |
|---|
| 1918 | |
|---|
| 1919 | App_ChangeChannelType(ChannelType_Air); //°Á¦·Î air·Î º¯°æÇÔ. |
|---|
| 1920 | |
|---|
| 1921 | DMW_CDB_ClearAll(); |
|---|
| 1922 | |
|---|
| 1923 | App_NVM_FormatNvParam(TRUE); |
|---|
| 1924 | |
|---|
| 1925 | memset(&APP_CUR_CH, 0, sizeof(DST_CURCHANNEL)); |
|---|
| 1926 | if(App_Fnc_ExistMicom()) { |
|---|
| 1927 | UINT8 send_data[MICOM_UART_MSG_LEN]={ |
|---|
| 1928 | MICOM_UART_START_CODE, eCMD_SET_STANDBY, 0x0, 0x0, 0x0, 0x1}; |
|---|
| 1929 | |
|---|
| 1930 | App_Fnc_SendData(send_data, MICOM_UART_MSG_LEN); //¾à 1ÃÊ ÈÄ¿¡ ±ú¾î³ªµµ·Ï ÇÔ. |
|---|
| 1931 | |
|---|
| 1932 | DHL_SYS_Reset(eDHL_RESET_Reboot); |
|---|
| 1933 | } |
|---|
| 1934 | else { |
|---|
| 1935 | DMG_SetMenuParam1(MID_STANDBY, 0); |
|---|
| 1936 | DMG_MenuStart(MID_STANDBY); |
|---|
| 1937 | DMG_MenuStart(MID_IDLE); |
|---|
| 1938 | DMG_MenuExit(MID_STANDBY); |
|---|
| 1939 | } |
|---|
| 1940 | } |
|---|
| 1941 | else { |
|---|
| 1942 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1943 | pmenu->param2 = 0; |
|---|
| 1944 | AppO_DrawMainMenuBg(0); |
|---|
| 1945 | |
|---|
| 1946 | if(p_get_depth(cur_fid)==2 || p_get_depth(cur_fid)==1) { |
|---|
| 1947 | AppO_DrawMainMenuBg(1); |
|---|
| 1948 | } |
|---|
| 1949 | |
|---|
| 1950 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1951 | } |
|---|
| 1952 | break; |
|---|
| 1953 | |
|---|
| 1954 | case APP_VK_MENU: |
|---|
| 1955 | case APP_VK_BACK: |
|---|
| 1956 | pmenu->param1 = eAPP_MAIN_NORMAL; |
|---|
| 1957 | pmenu->param2 = 0; |
|---|
| 1958 | AppO_DrawMainMenuBg(0); |
|---|
| 1959 | |
|---|
| 1960 | if(p_get_depth(cur_fid)==2 || p_get_depth(cur_fid)==1) { |
|---|
| 1961 | AppO_DrawMainMenuBg(1); |
|---|
| 1962 | } |
|---|
| 1963 | |
|---|
| 1964 | AppO_DrawMainMenu(cur_fid); |
|---|
| 1965 | break; |
|---|
| 1966 | default: |
|---|
| 1967 | bdone = TRUE; // ´Ù¸¥ ۵éÀº Àü¹« ¹«½Ã. |
|---|
| 1968 | break; |
|---|
| 1969 | } |
|---|
| 1970 | break; |
|---|
| 1971 | } |
|---|
| 1972 | else if(pmenu->param1 == eAPP_MAIN_ENTERPIN) { |
|---|
| 1973 | bdone=p_proc_enter_pin(cmd, opt, param1, param2); |
|---|
| 1974 | } |
|---|
| 1975 | else if(pmenu->param1 == eAPP_MAIN_RRT_US_TV) { |
|---|
| 1976 | bdone=p_proc_tv_rating(cmd, opt, param1, param2); |
|---|
| 1977 | } |
|---|
| 1978 | else if(pmenu->param1 == eAPP_MAIN_RRT_US_MPAA) { |
|---|
| 1979 | bdone=p_proc_mpaa_rating(cmd, opt, param1, param2); |
|---|
| 1980 | } |
|---|
| 1981 | else if(pmenu->param1 == eAPP_MAIN_RRT_SET_DRRT) { |
|---|
| 1982 | bdone=p_proc_set_drating(cmd, opt, param1, param2); |
|---|
| 1983 | } |
|---|
| 1984 | else if(pmenu->param1 == eAPP_MAIN_RRT_UPDATE_DRRT) { |
|---|
| 1985 | bdone=p_proc_update_drating(cmd, opt, param1, param2); |
|---|
| 1986 | } |
|---|
| 1987 | else if(pmenu->param1 == eAPP_MAIN_RRT_CHANGE_PIN) { |
|---|
| 1988 | bdone=p_proc_change_pin(cmd, opt, param1, param2); |
|---|
| 1989 | } |
|---|
| 1990 | else if(pmenu->param1 == eAPP_MAIN_DRRT_WARNING) { |
|---|
| 1991 | bdone=p_proc_drrt_warning(cmd, opt, param1, param2); |
|---|
| 1992 | } |
|---|
| 1993 | |
|---|
| 1994 | break; |
|---|
| 1995 | |
|---|
| 1996 | default: |
|---|
| 1997 | bdone=FALSE; |
|---|
| 1998 | } |
|---|
| 1999 | |
|---|
| 2000 | if(!bdone) { |
|---|
| 2001 | bdone=App_Proc_Idle(cmd, opt, param1, param2); |
|---|
| 2002 | } |
|---|
| 2003 | |
|---|
| 2004 | DMG_AutoRefresh(); |
|---|
| 2005 | return bdone; |
|---|
| 2006 | } |
|---|
| 2007 | |
|---|
| 2008 | |
|---|
| 2009 | |
|---|
| 2010 | |
|---|
| 2011 | |
|---|
| 2012 | #if COMMENT |
|---|
| 2013 | __Menu_Create__() {} |
|---|
| 2014 | #endif |
|---|
| 2015 | |
|---|
| 2016 | void App_Menu_CreateMain() |
|---|
| 2017 | { |
|---|
| 2018 | int i; |
|---|
| 2019 | tDMG_Menu *pmenu; |
|---|
| 2020 | |
|---|
| 2021 | pmenu=DMG_GetMenu(MID_MAIN); |
|---|
| 2022 | |
|---|
| 2023 | if(pmenu) return; |
|---|
| 2024 | |
|---|
| 2025 | pmenu = DMG_CreateMenu(MID_MAIN_CFG); |
|---|
| 2026 | |
|---|
| 2027 | AppO_BackupMainBG(); |
|---|
| 2028 | } |
|---|
| 2029 | #if 0 |
|---|
| 2030 | void App_Menu_SetAllVars() |
|---|
| 2031 | { |
|---|
| 2032 | int i; |
|---|
| 2033 | tApp_MainMenuFrame *pmenu_frame; |
|---|
| 2034 | tDMG_Frame *pframe; |
|---|
| 2035 | |
|---|
| 2036 | for(i=0;;i++) { |
|---|
| 2037 | pmenu_frame=App_GetFrameInfoByIdx(i); |
|---|
| 2038 | |
|---|
| 2039 | if(!pmenu_frame || !pmenu_frame->is_leaf) break; |
|---|
| 2040 | |
|---|
| 2041 | pframe=DMG_GetFrame(MID_MAIN, pmenu_frame->fid); |
|---|
| 2042 | |
|---|
| 2043 | |
|---|
| 2044 | p_change_value(pmenu_frame->fid, pframe->cur_item_id); |
|---|
| 2045 | } |
|---|
| 2046 | } |
|---|
| 2047 | |
|---|
| 2048 | void App_Menu_InitPos() |
|---|
| 2049 | { |
|---|
| 2050 | // ¸Þ´ºÀÇ focusingµÇ´Â index¸¦ ¸ðµÎ 0À¸·Î ÃʱâÈÇÔ. |
|---|
| 2051 | int i; |
|---|
| 2052 | tApp_MainMenuFrame *pmenu_frame; |
|---|
| 2053 | tDMG_Frame *pframe; |
|---|
| 2054 | |
|---|
| 2055 | for(i=0;;i++) { |
|---|
| 2056 | pmenu_frame=App_GetFrameInfoByIdx(i); |
|---|
| 2057 | |
|---|
| 2058 | if(!pmenu_frame) break; |
|---|
| 2059 | if(pmenu_frame->is_leaf) continue; |
|---|
| 2060 | |
|---|
| 2061 | pframe=DMG_GetFrame(MID_MAIN, pmenu_frame->fid); |
|---|
| 2062 | |
|---|
| 2063 | pframe->cur_item_id=0; |
|---|
| 2064 | } |
|---|
| 2065 | } |
|---|
| 2066 | #endif |
|---|
| 2067 | |
|---|
| 2068 | |
|---|
| 2069 | #if 0 |
|---|
| 2070 | __Test_Func__() |
|---|
| 2071 | #endif |
|---|
| 2072 | |
|---|
| 2073 | void enable_cable(BOOL is_enable) |
|---|
| 2074 | { |
|---|
| 2075 | p_enable_cable(is_enable); |
|---|
| 2076 | } |
|---|
| 2077 | |
|---|
| 2078 | |
|---|
| 2079 | |
|---|
| 2080 | |
|---|
| 2081 | /* end of file */ |
|---|