| 1 | /* |
|---|
| 2 | App_OSD_ServiceMenu.c |
|---|
| 3 | |
|---|
| 4 | Implementation of Service Menu |
|---|
| 5 | |
|---|
| 6 | Digital STREAM Technology, Inc |
|---|
| 7 | |
|---|
| 8 | */ |
|---|
| 9 | |
|---|
| 10 | |
|---|
| 11 | #include "App_Main.h" |
|---|
| 12 | #include "App_Res_Resources.h" |
|---|
| 13 | #include "App_Proc.h" |
|---|
| 14 | #include "App_OSD_Factory.h" |
|---|
| 15 | |
|---|
| 16 | #include "App_Fnc_Common.h" |
|---|
| 17 | #include "App_Fnc_Video.h" |
|---|
| 18 | #include "App_Fnc_Audio.h" |
|---|
| 19 | #include "App_Fnc_Ucm.h" |
|---|
| 20 | #include "App_Fnc_NvRam.h" |
|---|
| 21 | #include "App_Fnc_ChTune.h" |
|---|
| 22 | #include "App_Fnc_Rating.h" |
|---|
| 23 | #include "App_Fnc_Sdds.h" |
|---|
| 24 | |
|---|
| 25 | #include "App_Version.h" |
|---|
| 26 | |
|---|
| 27 | #include "DMW_Channel.h" |
|---|
| 28 | #include "DMW_CodeConv.h" |
|---|
| 29 | |
|---|
| 30 | // system query |
|---|
| 31 | #include "DHL_NVM.h" |
|---|
| 32 | #include "DHL_SYS.h" |
|---|
| 33 | |
|---|
| 34 | |
|---|
| 35 | #if COMMENT |
|---|
| 36 | ____DEF____(){} |
|---|
| 37 | #endif |
|---|
| 38 | |
|---|
| 39 | |
|---|
| 40 | |
|---|
| 41 | // menu windowÀÇ °¡·Î, ¼¼·Î grid Å©±â |
|---|
| 42 | |
|---|
| 43 | int SM_HORZ = 80; // °¡·Î 80 ±ÛÀÚ |
|---|
| 44 | int SM_VERT = 25; // ¼¼·Î 25 ±ÛÀÚ |
|---|
| 45 | |
|---|
| 46 | // ÇÑ gridÀÇ °¡·Î ¼¼·Î pixel Å©±â |
|---|
| 47 | |
|---|
| 48 | int SM_CHAR_W = 8; |
|---|
| 49 | int SM_CHAR_H = 16; |
|---|
| 50 | |
|---|
| 51 | |
|---|
| 52 | |
|---|
| 53 | #define GRID_TO_PIXEL_X(x) (sm_base_x + (x) * SM_CHAR_W) |
|---|
| 54 | #define GRID_TO_PIXEL_Y(y) (sm_base_y + (y) * SM_CHAR_H) |
|---|
| 55 | #define GRID_TO_PIXEL_W(w) ((w) * SM_CHAR_W) |
|---|
| 56 | #define GRID_TO_PIXEL_H(h) ((h) * SM_CHAR_H) |
|---|
| 57 | |
|---|
| 58 | |
|---|
| 59 | int sm_fa_style = 3; |
|---|
| 60 | int sm_fa_size = 13; |
|---|
| 61 | |
|---|
| 62 | |
|---|
| 63 | // °¢Á¾ windowÀÇ ÁÂÇ¥ Á¤ÀÇ.. ¸ðµÎ grid ´ÜÀ§ÀÌ´Ù. |
|---|
| 64 | |
|---|
| 65 | // Status Window |
|---|
| 66 | #define SM_STAT_WIN_X 0 |
|---|
| 67 | #define SM_STAT_WIN_Y 0 |
|---|
| 68 | #define SM_STAT_WIN_W SM_HORZ |
|---|
| 69 | #define SM_STAT_WIN_H 9//8 |
|---|
| 70 | |
|---|
| 71 | // Selection Window |
|---|
| 72 | #define SM_SEL_WIN_X 0 |
|---|
| 73 | #define SM_SEL_WIN_Y SM_STAT_WIN_H |
|---|
| 74 | #define SM_SEL_WIN_W SM_HORZ |
|---|
| 75 | #define SM_SEL_WIN_H (SM_VERT-SM_STAT_WIN_H-1) |
|---|
| 76 | |
|---|
| 77 | // Help Window |
|---|
| 78 | #define SM_HELP_WIN_X 0 |
|---|
| 79 | #define SM_HELP_WIN_Y (SM_VERT-1) |
|---|
| 80 | #define SM_HELP_WIN_W SM_HORZ |
|---|
| 81 | #define SM_HELP_WIN_H 1 |
|---|
| 82 | |
|---|
| 83 | |
|---|
| 84 | |
|---|
| 85 | |
|---|
| 86 | // menu windowÀÇ Á»ó´Ü pixel ÁÂÇ¥. |
|---|
| 87 | // °¢ ÇØ»óµµ º°·Î pixmap plane Å©±â°¡ ´Ù¸£´Ï±î |
|---|
| 88 | // menu window°¡ center positionµÇµµ·Ï ÁÂÇ¥¸¦ Á¶Á¤ÇÑ´Ù. |
|---|
| 89 | // ÇØ»óµµ°¡ ´Þ¶óµµ gridÀÇ Å©±â´Â º¯ÇÏÁö ¾Ê°í ´Ù¸¸ position¸¸ Á¶Á¤ÇÑ´Ù. |
|---|
| 90 | // |
|---|
| 91 | int sm_base_x, sm_base_y; |
|---|
| 92 | |
|---|
| 93 | |
|---|
| 94 | |
|---|
| 95 | |
|---|
| 96 | #define SM_TAB_SZ 4 |
|---|
| 97 | |
|---|
| 98 | |
|---|
| 99 | |
|---|
| 100 | // adjust (v) from minimum (mn) to maximum (mx) |
|---|
| 101 | |
|---|
| 102 | #define SM_ADJUST(v, mn, mx) \ |
|---|
| 103 | do { \ |
|---|
| 104 | if ((v) < (mn)) v = (mn); \ |
|---|
| 105 | if ((v) > (mx)) v = (mx); \ |
|---|
| 106 | } while (0) |
|---|
| 107 | |
|---|
| 108 | |
|---|
| 109 | |
|---|
| 110 | |
|---|
| 111 | // Help Message ID |
|---|
| 112 | enum |
|---|
| 113 | { |
|---|
| 114 | SM_KEY_MENU = 1, |
|---|
| 115 | SM_KEY_BACK = 2, |
|---|
| 116 | SM_KEY_DIGIT = 4, |
|---|
| 117 | SM_KEY_UPDN = 8, |
|---|
| 118 | SM_KEY_LFRG = 0x10, |
|---|
| 119 | SM_KEY_SEL = 0x20, |
|---|
| 120 | }; |
|---|
| 121 | |
|---|
| 122 | |
|---|
| 123 | |
|---|
| 124 | int sm_period_stat_info = 2; |
|---|
| 125 | // FE Á¤º¸¸¦ Á¦¿ÜÇÑ ´Ù¸¥ Á¤º¸µéÀÇ refresh period.. second.. |
|---|
| 126 | |
|---|
| 127 | |
|---|
| 128 | |
|---|
| 129 | #if COMMENT |
|---|
| 130 | ____GRP____(){} |
|---|
| 131 | #endif |
|---|
| 132 | |
|---|
| 133 | |
|---|
| 134 | #define SM_SCREEN_WIDTH 720 // sm_cv->w |
|---|
| 135 | #define SM_SCREEN_HEIGHT 480 // sm_cv->h |
|---|
| 136 | |
|---|
| 137 | #define SM_COLOR_BLACK eDMG_C_BLACK |
|---|
| 138 | #define SM_COLOR_BLUE eDMG_C_BLUE |
|---|
| 139 | #define SM_COLOR_GREEN eDMG_C_GREEN |
|---|
| 140 | #define SM_COLOR_CYAN eDMG_C_CYAN |
|---|
| 141 | #define SM_COLOR_RED eDMG_C_RED |
|---|
| 142 | #define SM_COLOR_MAGENTA eDMG_C_MAGENTA |
|---|
| 143 | #define SM_COLOR_YELLOW eDMG_C_YELLOW |
|---|
| 144 | #define SM_COLOR_WHITE eDMG_C_WHITE |
|---|
| 145 | |
|---|
| 146 | #define SM_COLOR_DARK_GRAY 0xc0000000 // Á¤È®È÷´Â ¹ÝÅõ¸íÇÑ black |
|---|
| 147 | |
|---|
| 148 | |
|---|
| 149 | int sm_cur_fcolor = SM_COLOR_WHITE; |
|---|
| 150 | int sm_cur_bcolor = SM_COLOR_DARK_GRAY; |
|---|
| 151 | |
|---|
| 152 | |
|---|
| 153 | // Graphic status |
|---|
| 154 | //CANVAS *sm_cv; |
|---|
| 155 | //GRP_CANVAS_ACCESS sm_canvas_mode; |
|---|
| 156 | |
|---|
| 157 | |
|---|
| 158 | //GFN_FONT_ATTR sm_prev_font_attr; |
|---|
| 159 | tDMG_FontAttr sm_prev_font_attr; |
|---|
| 160 | |
|---|
| 161 | |
|---|
| 162 | |
|---|
| 163 | // ÇöÀç Ä¿¼ À§Ä¡ |
|---|
| 164 | // |
|---|
| 165 | int sm_cur_pos_x; // column 0 ~ |
|---|
| 166 | int sm_cur_pos_y; // line 0 ~ |
|---|
| 167 | |
|---|
| 168 | |
|---|
| 169 | |
|---|
| 170 | void sm_drawbox(int x, int y, int w, int h, int c) |
|---|
| 171 | { |
|---|
| 172 | DMG_FillRect(x, y, w, h, (UINT32)c); |
|---|
| 173 | } |
|---|
| 174 | |
|---|
| 175 | |
|---|
| 176 | void sm_clrbox(int x, int y, int w, int h) |
|---|
| 177 | { |
|---|
| 178 | int gx, gy, gw, gh; |
|---|
| 179 | |
|---|
| 180 | SM_ADJUST(x, 0, SM_HORZ-1); |
|---|
| 181 | SM_ADJUST(y, 0, SM_VERT-1); |
|---|
| 182 | |
|---|
| 183 | gx = GRID_TO_PIXEL_X(x); |
|---|
| 184 | gy = GRID_TO_PIXEL_Y(y); |
|---|
| 185 | gw = GRID_TO_PIXEL_W(w); |
|---|
| 186 | gh = GRID_TO_PIXEL_H(h); |
|---|
| 187 | |
|---|
| 188 | DMG_FillRect(gx, gy, gw, gh, sm_cur_bcolor); |
|---|
| 189 | } |
|---|
| 190 | |
|---|
| 191 | void sm_clrscr(void) |
|---|
| 192 | { |
|---|
| 193 | // Àüü ȸéÀ» ´Ù Áö¿ìÀÚ. |
|---|
| 194 | DMG_EraseRect(0, 0, SM_SCREEN_WIDTH, SM_SCREEN_HEIGHT, sm_cur_bcolor); |
|---|
| 195 | } |
|---|
| 196 | |
|---|
| 197 | void sm_gotoxy(int x, int y) |
|---|
| 198 | { |
|---|
| 199 | SM_ADJUST(x, 0, SM_HORZ-1); |
|---|
| 200 | SM_ADJUST(y, 0, SM_VERT-1); |
|---|
| 201 | |
|---|
| 202 | sm_cur_pos_x = x; |
|---|
| 203 | sm_cur_pos_y = y; |
|---|
| 204 | } |
|---|
| 205 | |
|---|
| 206 | void sm_putcharxy(int x, int y, char str) |
|---|
| 207 | { |
|---|
| 208 | int gx, gy; |
|---|
| 209 | int w; |
|---|
| 210 | //char buf[10]; |
|---|
| 211 | |
|---|
| 212 | gx = GRID_TO_PIXEL_X(x); |
|---|
| 213 | gy = GRID_TO_PIXEL_Y(y); |
|---|
| 214 | |
|---|
| 215 | #if 1 |
|---|
| 216 | w = DMG_GetChWidth(str); |
|---|
| 217 | DMG_PrintCh(gx+(SM_CHAR_W-w)/2, gy, str, sm_cur_fcolor); |
|---|
| 218 | #else |
|---|
| 219 | buf[0] = str; |
|---|
| 220 | buf[1] = 0; |
|---|
| 221 | |
|---|
| 222 | // ÀÌ»óÇÏ°Ô ±ÛÀÚ°¡ ÇÑ pixel ¾Æ·¡ boundary¸¦ ³Ñ¾î°¡¼ |
|---|
| 223 | // ÇÑÁÙÀ» À§·Î ¿Ã·Á printÇÑ´Ù. |
|---|
| 224 | GFN_PrintXY(sm_cv, gx, gy-1, buf, sm_cur_fcolor); |
|---|
| 225 | #endif |
|---|
| 226 | } |
|---|
| 227 | |
|---|
| 228 | #define SM_ADJUST_LINE() \ |
|---|
| 229 | if (sm_cur_pos_x >= SM_HORZ) { \ |
|---|
| 230 | sm_cur_pos_x = 0; \ |
|---|
| 231 | if (++sm_cur_pos_y >= SM_VERT) \ |
|---|
| 232 | sm_cur_pos_y = SM_VERT-1; \ |
|---|
| 233 | } |
|---|
| 234 | |
|---|
| 235 | |
|---|
| 236 | void sm_putsxy(int x, int y, char *s) |
|---|
| 237 | { |
|---|
| 238 | SM_ADJUST(x, 0, SM_HORZ-1); |
|---|
| 239 | SM_ADJUST(y, 0, SM_VERT-1); |
|---|
| 240 | |
|---|
| 241 | sm_cur_pos_x = x; |
|---|
| 242 | sm_cur_pos_y = y; |
|---|
| 243 | |
|---|
| 244 | for (; *s; s++) |
|---|
| 245 | { |
|---|
| 246 | if (*s == '\r') { |
|---|
| 247 | sm_cur_pos_x = 0; |
|---|
| 248 | continue; |
|---|
| 249 | } |
|---|
| 250 | else if (*s == '\n') { |
|---|
| 251 | sm_cur_pos_x = 0; |
|---|
| 252 | if (++sm_cur_pos_y >= SM_VERT) |
|---|
| 253 | sm_cur_pos_y = SM_VERT-1; |
|---|
| 254 | continue; |
|---|
| 255 | } |
|---|
| 256 | else if (*s == '\t') { |
|---|
| 257 | // tab size is 4 |
|---|
| 258 | sm_cur_pos_x = (sm_cur_pos_x + SM_TAB_SZ+1)/SM_TAB_SZ*SM_TAB_SZ; |
|---|
| 259 | SM_ADJUST_LINE(); |
|---|
| 260 | } |
|---|
| 261 | else if (*s == '\b') { |
|---|
| 262 | if (sm_cur_pos_x > 0) sm_cur_pos_x--; |
|---|
| 263 | } |
|---|
| 264 | |
|---|
| 265 | sm_putcharxy(sm_cur_pos_x, sm_cur_pos_y, *s); |
|---|
| 266 | |
|---|
| 267 | ++sm_cur_pos_x; |
|---|
| 268 | SM_ADJUST_LINE() |
|---|
| 269 | |
|---|
| 270 | } |
|---|
| 271 | } |
|---|
| 272 | |
|---|
| 273 | void sm_puts(char *s) |
|---|
| 274 | { |
|---|
| 275 | sm_putsxy(sm_cur_pos_x, sm_cur_pos_y, s); |
|---|
| 276 | } |
|---|
| 277 | |
|---|
| 278 | int sm_printf(const char *fmt, ...) |
|---|
| 279 | { |
|---|
| 280 | va_list v; |
|---|
| 281 | int n = 0; |
|---|
| 282 | char buf[256]; |
|---|
| 283 | |
|---|
| 284 | va_start(v, fmt); |
|---|
| 285 | |
|---|
| 286 | if (fmt) |
|---|
| 287 | n = vsprintf(buf, fmt, v); |
|---|
| 288 | else |
|---|
| 289 | strcpy(buf, "NULL"); |
|---|
| 290 | |
|---|
| 291 | va_end(v); |
|---|
| 292 | |
|---|
| 293 | sm_puts(buf); |
|---|
| 294 | |
|---|
| 295 | return n; |
|---|
| 296 | } |
|---|
| 297 | |
|---|
| 298 | |
|---|
| 299 | void sm_setfont(int style, int w, int h) |
|---|
| 300 | { |
|---|
| 301 | #if 1 |
|---|
| 302 | tDMG_FontAttr fa; |
|---|
| 303 | |
|---|
| 304 | DMG_GetFontAttr(&fa); |
|---|
| 305 | fa.font_style = (tDMG_FontStyle)style; |
|---|
| 306 | fa.size = w; |
|---|
| 307 | DMG_SetFontAttr(&fa); |
|---|
| 308 | #else |
|---|
| 309 | GFN_FONT_ATTR fa; |
|---|
| 310 | |
|---|
| 311 | GFN_GetFontAttr(sm_cv, &fa); |
|---|
| 312 | fa.font_style = style; |
|---|
| 313 | fa.font_width = w; |
|---|
| 314 | fa.font_height = h; |
|---|
| 315 | GFN_SetFontAttr(sm_cv, &fa); |
|---|
| 316 | #endif |
|---|
| 317 | } |
|---|
| 318 | |
|---|
| 319 | void sm_refresh(void) |
|---|
| 320 | { |
|---|
| 321 | DMG_AutoRefresh(); |
|---|
| 322 | } |
|---|
| 323 | |
|---|
| 324 | int sm_open_graphic(void) |
|---|
| 325 | { |
|---|
| 326 | #if 0 |
|---|
| 327 | sm_cv = GRP_GetCanvas(APP_PLANE); |
|---|
| 328 | if (sm_cv == NULL) { |
|---|
| 329 | printf("!! cv null\n"); |
|---|
| 330 | return -1; |
|---|
| 331 | } |
|---|
| 332 | GFN_GetFontAttr(sm_cv, &sm_prev_font_attr); |
|---|
| 333 | |
|---|
| 334 | printf("Cur res: %d, (%d %d, %d %d)\n", sm_cv->resolution, |
|---|
| 335 | sm_cv->x, sm_cv->y, sm_cv->w, sm_cv->h); |
|---|
| 336 | #endif |
|---|
| 337 | |
|---|
| 338 | DMG_GetFontAttr(&sm_prev_font_attr); |
|---|
| 339 | |
|---|
| 340 | if (SM_SCREEN_WIDTH < SM_HORZ*SM_CHAR_W) { |
|---|
| 341 | printf("!! canvas width short\n"); |
|---|
| 342 | sm_base_x = 0; |
|---|
| 343 | } |
|---|
| 344 | else |
|---|
| 345 | sm_base_x = ((SM_SCREEN_WIDTH - SM_HORZ*SM_CHAR_W)/2) & ~7; |
|---|
| 346 | |
|---|
| 347 | if (SM_SCREEN_HEIGHT < SM_VERT*SM_CHAR_H) { |
|---|
| 348 | printf("!! canvas height short\n"); |
|---|
| 349 | sm_base_y = 0; |
|---|
| 350 | } |
|---|
| 351 | else |
|---|
| 352 | sm_base_y = ((SM_SCREEN_HEIGHT - SM_VERT*SM_CHAR_H)/2); |
|---|
| 353 | |
|---|
| 354 | printf("Base x, y = (%d, %d)\n", sm_base_x, sm_base_y); |
|---|
| 355 | |
|---|
| 356 | |
|---|
| 357 | //sm_canvas_mode = GRP_GetCanvasMode(); |
|---|
| 358 | //GRP_SetCanvasMode(GRP_DIRECT_WRITE); |
|---|
| 359 | |
|---|
| 360 | //GRP_SetNation(sm_cv,GRP_KOREA); |
|---|
| 361 | //GFN_SetFontMode(sm_cv, GFN_JUNGLE_MODE); |
|---|
| 362 | |
|---|
| 363 | sm_setfont(sm_fa_style, sm_fa_size, sm_fa_size); |
|---|
| 364 | |
|---|
| 365 | //GRP_Recoordinate(sm_cv,&Temp_FontAttr.font_width,&Temp_FontAttr.font_height); |
|---|
| 366 | //Temp_FontAttr.font_height = Temp_FontAttr.font_width+1; |
|---|
| 367 | |
|---|
| 368 | //GFN_SetFontAttr(sm_cv, &Temp_FontAttr); |
|---|
| 369 | |
|---|
| 370 | return 0; |
|---|
| 371 | |
|---|
| 372 | } |
|---|
| 373 | |
|---|
| 374 | void sm_close_graphic(void) |
|---|
| 375 | { |
|---|
| 376 | #if 1 |
|---|
| 377 | DMG_SetFontAttr(&sm_prev_font_attr); |
|---|
| 378 | DMG_FillRect(0, 0, SM_SCREEN_WIDTH, SM_SCREEN_HEIGHT, eDMG_C_TRANSPARENT); |
|---|
| 379 | sm_refresh(); |
|---|
| 380 | #else |
|---|
| 381 | GFN_SetFontAttr(sm_cv, &sm_prev_font_attr); |
|---|
| 382 | |
|---|
| 383 | GRP_ClearCanvas(sm_cv); |
|---|
| 384 | |
|---|
| 385 | GRP_SetCanvasMode(sm_canvas_mode); |
|---|
| 386 | |
|---|
| 387 | // cafrii 060929 add |
|---|
| 388 | // À§¿Í °°ÀÌ Canvas Mode¸¦ º¯°æÇÏ°Ô µÇ¸é |
|---|
| 389 | // ³»ºÎÀûÀ¸·Î plane buffer¸¦ º¯°æÇعö¸®°Ô µÇ¹Ç·Î |
|---|
| 390 | // Á÷Á¢ direct write¸¦ »ç¿ëÇÏ´Â CC¿¡°Ô´Â ±× »ç½ÇÀ» ¾Ë·ÁÁà¾ß ÇÑ´Ù. |
|---|
| 391 | // |
|---|
| 392 | printf(" update CC (canvas mode may be changed)\n"); |
|---|
| 393 | App_CC_Control(4,0,FALSE); |
|---|
| 394 | |
|---|
| 395 | AppGrp_ReleaseToken(PNX_OSD_MENU); |
|---|
| 396 | #endif |
|---|
| 397 | } |
|---|
| 398 | |
|---|
| 399 | |
|---|
| 400 | |
|---|
| 401 | #if COMMENT |
|---|
| 402 | ___Menu____(){} |
|---|
| 403 | #endif |
|---|
| 404 | |
|---|
| 405 | |
|---|
| 406 | |
|---|
| 407 | #define printf DHL_OS_Printf |
|---|
| 408 | |
|---|
| 409 | enum { |
|---|
| 410 | SM_MENU_HOME = 0x0000, |
|---|
| 411 | SM_MENU_VERSION = 0x1000, |
|---|
| 412 | SM_MENU_CHANNEL = 0x2000, |
|---|
| 413 | SM_MENU_VIDEO = 0x3000, |
|---|
| 414 | SM_MENU_AUDIO = 0x4000, |
|---|
| 415 | SM_MENU_GUI = 0x5000, |
|---|
| 416 | SM_MENU_EPG = 0x6000, |
|---|
| 417 | SM_MENU_DEBUG = 0x7000, |
|---|
| 418 | SM_MENU_SYSTEM = 0x8000, |
|---|
| 419 | }; |
|---|
| 420 | |
|---|
| 421 | |
|---|
| 422 | //int sm_service_menu_action; |
|---|
| 423 | UINT32 s_sm_menu_id; |
|---|
| 424 | |
|---|
| 425 | |
|---|
| 426 | static void sm_menu_exit(void) |
|---|
| 427 | { |
|---|
| 428 | DMG_MenuExit(MID_FACTORY); |
|---|
| 429 | } |
|---|
| 430 | |
|---|
| 431 | void sm_send_msg(UINT32 param2) |
|---|
| 432 | { |
|---|
| 433 | tDMG_Menu *pmenu=DMG_GetMenu(MID_FACTORY); |
|---|
| 434 | |
|---|
| 435 | if(!pmenu) { |
|---|
| 436 | printf("!! error : factory menu is not inited\n"); |
|---|
| 437 | return; |
|---|
| 438 | } |
|---|
| 439 | pmenu->param1=eAPP_FAC_SERVICE_MENU; |
|---|
| 440 | DMG_MenuUpdate(MID_FACTORY, param2); |
|---|
| 441 | } |
|---|
| 442 | |
|---|
| 443 | |
|---|
| 444 | #if COMMENT |
|---|
| 445 | ____common____(){} |
|---|
| 446 | #endif |
|---|
| 447 | |
|---|
| 448 | |
|---|
| 449 | #define SM_STAT_MASK_HDR 0x01 |
|---|
| 450 | #define SM_STAT_MASK_VER 0x02 |
|---|
| 451 | #define SM_STAT_MASK_FE 0x04 |
|---|
| 452 | #define SM_STAT_MASK_CH 0x08 |
|---|
| 453 | #define SM_STAT_MASK_AV 0x10 |
|---|
| 454 | #define SM_STAT_MASK_RA 0x20 |
|---|
| 455 | #define SM_STAT_MASK_MEM 0x40 |
|---|
| 456 | #define SM_STAT_MASK_AGE 0x80 |
|---|
| 457 | |
|---|
| 458 | #define SM_STAT_MASK_ALL 0xffff |
|---|
| 459 | |
|---|
| 460 | |
|---|
| 461 | // cafrii 061010 add |
|---|
| 462 | // convert digit to printable string form including comma |
|---|
| 463 | // |
|---|
| 464 | char *sm_digit(UINT32 val, char *buf) |
|---|
| 465 | { |
|---|
| 466 | static char _buf[22]; |
|---|
| 467 | char *p = &_buf[20]; |
|---|
| 468 | int len = 0; |
|---|
| 469 | |
|---|
| 470 | // UINT32 ÃÖ´ë°ª: 4,294,967,295 10ÀÚ¸® -> 13ÀÚ¸® + null term. |
|---|
| 471 | |
|---|
| 472 | *p = 0; |
|---|
| 473 | while (1) { |
|---|
| 474 | *--p = (val % 10) + '0'; |
|---|
| 475 | len++; |
|---|
| 476 | val /= 10; |
|---|
| 477 | if (val == 0) break; |
|---|
| 478 | if (len % 3 == 0 && val) *--p = ','; |
|---|
| 479 | } |
|---|
| 480 | |
|---|
| 481 | if (buf) { |
|---|
| 482 | strcpy(buf, p); |
|---|
| 483 | return buf; |
|---|
| 484 | } |
|---|
| 485 | return p; // return static buffer ptr |
|---|
| 486 | } |
|---|
| 487 | |
|---|
| 488 | BOOL sm_is_digitkey(int key) |
|---|
| 489 | { |
|---|
| 490 | if (key >= APP_VK_0 && key <= APP_VK_9) return TRUE; |
|---|
| 491 | return FALSE; |
|---|
| 492 | } |
|---|
| 493 | |
|---|
| 494 | |
|---|
| 495 | #define SM_DISP_STR(d) (\ |
|---|
| 496 | (d)==eDHL_DISP_720x480i?"480i":\ |
|---|
| 497 | (d)==eDHL_DISP_720x480p?"480p":\ |
|---|
| 498 | (d)==eDHL_DISP_960x540p?"540p":\ |
|---|
| 499 | (d)==eDHL_DISP_1280x720p?"720p":\ |
|---|
| 500 | (d)==eDHL_DISP_1920x1080i?"1080i":\ |
|---|
| 501 | "?") |
|---|
| 502 | |
|---|
| 503 | |
|---|
| 504 | void sm_show_status(int level) |
|---|
| 505 | { |
|---|
| 506 | if (level == SM_STAT_MASK_ALL) { |
|---|
| 507 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y, SM_STAT_WIN_W, SM_STAT_WIN_H); |
|---|
| 508 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y); |
|---|
| 509 | } |
|---|
| 510 | |
|---|
| 511 | // y+0 |
|---|
| 512 | if (level & SM_STAT_MASK_HDR) |
|---|
| 513 | { |
|---|
| 514 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y+0, SM_STAT_WIN_W, 1); |
|---|
| 515 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y+0); |
|---|
| 516 | sm_printf(" **** STATUS ****\n"); |
|---|
| 517 | } |
|---|
| 518 | |
|---|
| 519 | |
|---|
| 520 | // y+1 |
|---|
| 521 | if (level & SM_STAT_MASK_VER) |
|---|
| 522 | { |
|---|
| 523 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y+1, SM_STAT_WIN_W, 1); |
|---|
| 524 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y+1); |
|---|
| 525 | // cafrii 070711 |
|---|
| 526 | // Ç×»ó ¹öÀü ¾Õ¿¡ ¾î¶² model ÀÎÁö °°ÀÌ ºÎ¸£µµ·Ï ÇÑ´Ù. |
|---|
| 527 | sm_printf(" Version: %s(%d) %s %s, Build %s %s\n", |
|---|
| 528 | App_GetPrjName(), APP_PRJ_ID, |
|---|
| 529 | App_GetSwVersion(), App_GetBuildNumber(), |
|---|
| 530 | App_GetBuildDateString(), App_GetBuildTimeString()); |
|---|
| 531 | } |
|---|
| 532 | |
|---|
| 533 | // y+2 |
|---|
| 534 | if (level & SM_STAT_MASK_FE) |
|---|
| 535 | { |
|---|
| 536 | DHL_RESULT dhr; |
|---|
| 537 | //UINT32 ser = 0, quality = 0; |
|---|
| 538 | UINT32 lock = 0, strength = 0; |
|---|
| 539 | char vendor[30] = {0, }; |
|---|
| 540 | |
|---|
| 541 | dhr = DHL_FE_GetSignalStatus(0, eDHL_SIGNAL_LOCK, &lock); |
|---|
| 542 | dhr = DHL_FE_GetSignalStatus(0, eDHL_SIGNAL_STRENGTH, &strength); |
|---|
| 543 | //dhr = DHL_FE_GetSignalStatus(0, SIGNAL_SER_1SEC, &ser); |
|---|
| 544 | //dhr = DHL_FE_GetSignalStatus(0, SIGNAL_QUALITY, &quality); |
|---|
| 545 | |
|---|
| 546 | dhr = DHL_FE_GetDeviceInfo(0, eDHL_FE_DEV_VENDOR_NAME, (UINT32 *)vendor); |
|---|
| 547 | if (dhr) strcpy(vendor, "?"); |
|---|
| 548 | |
|---|
| 549 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y+2, SM_STAT_WIN_W, 1); |
|---|
| 550 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y+2); |
|---|
| 551 | //sm_printf(" FrontEnd: %s, SER %d, Quality %d\n", lock ? "lock" : "unlock", ser, quality); |
|---|
| 552 | sm_printf(" FrontEnd: %s, %s, strength %d\n", |
|---|
| 553 | vendor, lock ? "lock" : "unlock", strength); |
|---|
| 554 | } |
|---|
| 555 | |
|---|
| 556 | // y+3 |
|---|
| 557 | if (level & SM_STAT_MASK_CH) |
|---|
| 558 | { |
|---|
| 559 | DST_CURCHANNEL *ch; |
|---|
| 560 | char channel[20]; |
|---|
| 561 | |
|---|
| 562 | ch = App_Ucm_GetCurChInfo(NULL); |
|---|
| 563 | if (ch->nMinor == ONE_PART_CHANNEL_INDICATOR) |
|---|
| 564 | sprintf(channel, "%d", ch->nMajor); |
|---|
| 565 | else |
|---|
| 566 | sprintf(channel, "%d-%d", ch->nMajor, ch->nMinor); |
|---|
| 567 | |
|---|
| 568 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y+3, SM_STAT_WIN_W, 1); |
|---|
| 569 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y+3); |
|---|
| 570 | sm_printf(" Tuning: %s %s, RF %d, Uid %d, #%d, $%d, [%s], pva %04x/%04x/%04x %x/%x\n", |
|---|
| 571 | ch->nChannelType == ChannelType_Air ? "Air" : "Cable", |
|---|
| 572 | channel, ch->nRF, |
|---|
| 573 | ch->nUid, ch->nProgramNumber, ch->nSourceId, |
|---|
| 574 | DMW_Unicode2Ks(ch->ShortName, 7, NULL), |
|---|
| 575 | ch->uPcrPid, ch->uVidPid, ch->uAudPid, |
|---|
| 576 | ch->VideoType, ch->AudioType); |
|---|
| 577 | } |
|---|
| 578 | |
|---|
| 579 | // y+4 |
|---|
| 580 | if (level & SM_STAT_MASK_AV) |
|---|
| 581 | { |
|---|
| 582 | #if 1 // cafrii enable.. |
|---|
| 583 | char resolution[60]; |
|---|
| 584 | tDHL_VideoSeqHdr seq_0, *seq = &seq_0; |
|---|
| 585 | DMW_AudioElement *pMLInfo; |
|---|
| 586 | int nAudioCount; |
|---|
| 587 | int nCurIndex; |
|---|
| 588 | UINT32 langCode; |
|---|
| 589 | int err; |
|---|
| 590 | tDHL_VideoStatus videoStatus; |
|---|
| 591 | char display[60]; |
|---|
| 592 | |
|---|
| 593 | if (DHL_AV_VideoSeqInfo(0, seq) == DHL_OK) |
|---|
| 594 | sprintf(resolution, "%dx%d%c %d.%02dHz %s", |
|---|
| 595 | seq->horizontal_size, seq->vertical_size, |
|---|
| 596 | seq->progressive_sequence ? 'p' : 'i', |
|---|
| 597 | (int)(seq->frame_rate), (int)(seq->frame_rate*100)%100, |
|---|
| 598 | DHL_AV_IsWideoFormat(seq) ? "wide" : "narrow"); |
|---|
| 599 | else |
|---|
| 600 | sprintf(resolution, "No info"); |
|---|
| 601 | |
|---|
| 602 | if (DHL_AV_VideoGetStatus(0, &videoStatus) == DHL_OK) |
|---|
| 603 | sprintf(display, "%s(%d)", SM_DISP_STR(videoStatus.curDisplayFormat), videoStatus.curDisplayFormat); |
|---|
| 604 | |
|---|
| 605 | err = App_AudioGetMLInfo(&pMLInfo, &nAudioCount, &nCurIndex); |
|---|
| 606 | if (err == statusOK && nAudioCount > 0 && nCurIndex >= 0 && nCurIndex < nAudioCount) { |
|---|
| 607 | langCode = pMLInfo[nCurIndex].ISO639_LanguageCode; |
|---|
| 608 | } |
|---|
| 609 | else { |
|---|
| 610 | langCode = 0; |
|---|
| 611 | } |
|---|
| 612 | |
|---|
| 613 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y+4, SM_STAT_WIN_W, 1); |
|---|
| 614 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y+4); |
|---|
| 615 | sm_printf(" AV: source (%s), output %s, audio: '%s'\n", |
|---|
| 616 | resolution, |
|---|
| 617 | display, |
|---|
| 618 | App_AudioLangCodeStr(langCode, 0)); |
|---|
| 619 | #else |
|---|
| 620 | sm_printf(" AV: Not yet\n"); |
|---|
| 621 | #endif |
|---|
| 622 | |
|---|
| 623 | //Ãß°¡..av format |
|---|
| 624 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y+5, SM_STAT_WIN_W, 1); |
|---|
| 625 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y+5); |
|---|
| 626 | |
|---|
| 627 | { |
|---|
| 628 | UINT32 fmt_vid, fmt_aud; |
|---|
| 629 | DHL_AV_Query(eDHL_AV_QUERY_VIDEO_FMT, &fmt_vid); |
|---|
| 630 | DHL_AV_Query(eDHL_AV_QUERY_AUDIO_FMT, &fmt_aud); |
|---|
| 631 | |
|---|
| 632 | sm_printf(" AV format: video(%s), audio(%s)\n", |
|---|
| 633 | fmt_vid==eDHL_VIDEO_TYPE_MPEG1?"MPEG1": |
|---|
| 634 | fmt_vid==eDHL_VIDEO_TYPE_MPEG2?"MPEG2": |
|---|
| 635 | fmt_vid==eDHL_VIDEO_TYPE_MPEG4P2?"MPEG4P2": |
|---|
| 636 | fmt_vid==eDHL_VIDEO_TYPE_H263?"H.263": |
|---|
| 637 | fmt_vid==eDHL_VIDEO_TYPE_H264?"H.264": |
|---|
| 638 | fmt_vid==eDHL_VIDEO_TYPE_VC1?"VC1": |
|---|
| 639 | fmt_vid==eDHL_VIDEO_TYPE_VC1SM?"VC1SM": |
|---|
| 640 | fmt_vid==eDHL_VIDEO_TYPE_DIVX311?"DIVX311": |
|---|
| 641 | fmt_vid==eDHL_VIDEO_TYPE_AVS?"AVS":"UNKNOWN", |
|---|
| 642 | fmt_aud==eDHL_AUDIO_TYPE_PCM?"PCM": |
|---|
| 643 | fmt_aud==eDHL_AUDIO_TYPE_AC3?"AC3": |
|---|
| 644 | fmt_aud==eDHL_AUDIO_TYPE_AAC_ADTS?"AAC_ADTS": |
|---|
| 645 | fmt_aud==eDHL_AUDIO_TYPE_AAC_LATM?"AAC_LATM": |
|---|
| 646 | fmt_aud==eDHL_AUDIO_TYPE_DTS?"DTS": |
|---|
| 647 | fmt_aud==eDHL_AUDIO_TYPE_MPEG_1?"MPEG1": |
|---|
| 648 | fmt_aud==eDHL_AUDIO_TYPE_MPEG_2?"MPEG2": |
|---|
| 649 | fmt_aud==eDHL_AUDIO_TYPE_MPEG_L1?"MPEGL1": |
|---|
| 650 | fmt_aud==eDHL_AUDIO_TYPE_MPEG_L2?"MPEGL2": |
|---|
| 651 | fmt_aud==eDHL_AUDIO_TYPE_MPEG_L3?"MPEGL3": |
|---|
| 652 | fmt_aud==eDHL_AUDIO_TYPE_AIFF?"AIFF": |
|---|
| 653 | fmt_aud==eDHL_AUDIO_TYPE_SINEWAVE?"SINEWAVE":"UNKNOWN"); |
|---|
| 654 | } |
|---|
| 655 | |
|---|
| 656 | } |
|---|
| 657 | |
|---|
| 658 | // y+5 |
|---|
| 659 | if (level & SM_STAT_MASK_RA) |
|---|
| 660 | { |
|---|
| 661 | #if 1 // cafrii enable |
|---|
| 662 | DMW_Rating5 rating; |
|---|
| 663 | //int i; |
|---|
| 664 | BOOL bRet; |
|---|
| 665 | STATUS status; |
|---|
| 666 | char region_1[20] = {0, }; |
|---|
| 667 | UINT16 region_5u[20] = {0, }; |
|---|
| 668 | |
|---|
| 669 | AppRating_GetRatingInfo(&rating); |
|---|
| 670 | |
|---|
| 671 | if (rating.region_count > 0) |
|---|
| 672 | { |
|---|
| 673 | status = DMW_EPG_GetRatingStringByRRT(&rating, region_5u, 20); |
|---|
| 674 | if (status) // error occurred |
|---|
| 675 | region_5u[0] = 0; |
|---|
| 676 | |
|---|
| 677 | bRet = AppRating_GetR12RatingString(&rating, region_1); |
|---|
| 678 | if (bRet == FALSE) |
|---|
| 679 | region_1[0] = 0; |
|---|
| 680 | } |
|---|
| 681 | |
|---|
| 682 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y+6, SM_STAT_WIN_W, 1); |
|---|
| 683 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y+6); |
|---|
| 684 | sm_printf(" Rating: %sR12 (%s), R5 (%s)\n", |
|---|
| 685 | AppRating_IsBlockOn() ? "BLOCK! " : "", |
|---|
| 686 | region_1, DMW_Unicode2Ks(region_5u, -1, NULL)); |
|---|
| 687 | #else |
|---|
| 688 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y+6, SM_STAT_WIN_W, 1); |
|---|
| 689 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y+6); |
|---|
| 690 | sm_printf(" Rating: Not yet\n"); |
|---|
| 691 | #endif |
|---|
| 692 | } |
|---|
| 693 | |
|---|
| 694 | // y+6 |
|---|
| 695 | if (level & SM_STAT_MASK_MEM) |
|---|
| 696 | { |
|---|
| 697 | #if 1 |
|---|
| 698 | DHL_OS_HEAP_STATUS hs; |
|---|
| 699 | DHL_RESULT dhr; |
|---|
| 700 | |
|---|
| 701 | char vendor[40], device[40]; |
|---|
| 702 | char buf[4][32]; |
|---|
| 703 | UINT32 size; |
|---|
| 704 | |
|---|
| 705 | DHL_OS_GetHeapStatus(&hs); |
|---|
| 706 | |
|---|
| 707 | dhr = DHL_NVM_FlashQuery(eNVMQRY_VendorName, vendor); |
|---|
| 708 | if (dhr) strcpy(vendor, "?"); |
|---|
| 709 | dhr = DHL_NVM_FlashQuery(eNVMQRY_DeviceName, device); |
|---|
| 710 | if (dhr) strcpy(device, "?"); |
|---|
| 711 | dhr = DHL_NVM_FlashQuery(eNVMQRY_DeviceSize, &size); |
|---|
| 712 | if (dhr) size = 0; |
|---|
| 713 | |
|---|
| 714 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y+7, SM_STAT_WIN_W, 1); |
|---|
| 715 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y+7); |
|---|
| 716 | sm_printf(" Memory: Heap %sK/%sK/%sK, Flash %uMB %s %s\n", |
|---|
| 717 | sm_digit(hs.size_heap>>10, buf[0]), |
|---|
| 718 | sm_digit(hs.size_alloc>>10, buf[1]), |
|---|
| 719 | sm_digit(hs.size_free>>10, buf[2]), |
|---|
| 720 | size>>20, vendor, device); |
|---|
| 721 | #else |
|---|
| 722 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y+7, SM_STAT_WIN_W, 1); |
|---|
| 723 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y+7); |
|---|
| 724 | sm_printf(" Memory: Not yet\n"); |
|---|
| 725 | #endif |
|---|
| 726 | } |
|---|
| 727 | |
|---|
| 728 | // y+7 |
|---|
| 729 | if (level & SM_STAT_MASK_AGE) |
|---|
| 730 | { |
|---|
| 731 | int run_time = Dmc_GetSystemRunningTime(); |
|---|
| 732 | UINT32 ddrclk; |
|---|
| 733 | DHL_RESULT dhr = DHL_SYS_Query(eSYSQRY_DDRClock, &ddrclk); |
|---|
| 734 | |
|---|
| 735 | sm_clrbox(SM_STAT_WIN_X, SM_STAT_WIN_Y+8, SM_STAT_WIN_W, 1); |
|---|
| 736 | sm_gotoxy(SM_STAT_WIN_X, SM_STAT_WIN_Y+8); |
|---|
| 737 | sm_printf(" Running time: %d hours %d min, ", |
|---|
| 738 | run_time/60/60, (run_time/60)%60); |
|---|
| 739 | if (dhr == DHL_OK) |
|---|
| 740 | sm_printf("DDR %u MHz\n", ddrclk); |
|---|
| 741 | else |
|---|
| 742 | sm_printf("No clock info\n"); |
|---|
| 743 | } |
|---|
| 744 | |
|---|
| 745 | } |
|---|
| 746 | |
|---|
| 747 | |
|---|
| 748 | |
|---|
| 749 | void sm_show_version_detail(void) |
|---|
| 750 | { |
|---|
| 751 | //DHL_SYS_Info sys_info; |
|---|
| 752 | //DHL_SYS_GetInfo(&sys_info); |
|---|
| 753 | DHL_BOARD_TYPE bdtype = eDHL_BOARD_UNKNOWN; |
|---|
| 754 | DHL_BOARD_REV bdrev = eREV_None; |
|---|
| 755 | |
|---|
| 756 | DHL_SYS_GetBoardTypeVersion(&bdtype, &bdrev); |
|---|
| 757 | |
|---|
| 758 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 759 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 760 | |
|---|
| 761 | sm_printf("\n"); |
|---|
| 762 | sm_printf(" Detail version information\n"); |
|---|
| 763 | sm_printf("\n"); |
|---|
| 764 | |
|---|
| 765 | |
|---|
| 766 | sm_printf(" * APP: %s (%s)\n", App_GetSwVersion(), App_GetBuildNumber()); |
|---|
| 767 | sm_printf(" * Build: %s %s\n", App_GetBuildDateString(), App_GetBuildTimeString()); |
|---|
| 768 | #if 0 |
|---|
| 769 | sm_printf(" * Channel/EPG/CC: %d / %d / %d\n", DMW_GetChannelMWVersion(), DMW_EpgGetVersion(), 0); |
|---|
| 770 | sm_printf(" * DHL: %d\n", sys_info.dsthal_version); |
|---|
| 771 | sm_printf(" * FE/HDMI: %d / %d.%d\n", sys_info.fe_version, |
|---|
| 772 | (sys_info.hdmi_version>>8) & 0xff, sys_info.hdmi_version & 0xff); |
|---|
| 773 | sm_printf(" * Core Driver: %d.%d\n", (sys_info.driver_version>>16) & 0xffff, |
|---|
| 774 | sys_info.driver_version & 0xffff); |
|---|
| 775 | sm_printf(" * OS kernel: %s\n", sys_info.kernel_version); |
|---|
| 776 | sm_printf(" * HW board: %d\n", sys_info.board_verion); |
|---|
| 777 | #else |
|---|
| 778 | sm_printf(" * HW board: type 0x%x, rev 0x%x\n", bdtype, bdrev); |
|---|
| 779 | #endif |
|---|
| 780 | } |
|---|
| 781 | |
|---|
| 782 | |
|---|
| 783 | |
|---|
| 784 | |
|---|
| 785 | |
|---|
| 786 | void sm_show_help(UINT32 flag) |
|---|
| 787 | { |
|---|
| 788 | char buf[100] = {0, }; |
|---|
| 789 | int n_help = 0; |
|---|
| 790 | |
|---|
| 791 | sm_clrbox(SM_HELP_WIN_X, SM_HELP_WIN_Y, SM_HELP_WIN_W, SM_HELP_WIN_H); |
|---|
| 792 | sm_gotoxy(SM_HELP_WIN_X, SM_HELP_WIN_Y); |
|---|
| 793 | |
|---|
| 794 | strcat(buf, " "); |
|---|
| 795 | |
|---|
| 796 | // maximum 5, |
|---|
| 797 | |
|---|
| 798 | if ((flag & SM_KEY_MENU) && n_help < 5) { |
|---|
| 799 | strcat(buf, "[MENU] Exit Menu "); |
|---|
| 800 | n_help++; |
|---|
| 801 | } |
|---|
| 802 | if ((flag & SM_KEY_BACK) && n_help < 5) { |
|---|
| 803 | strcat(buf, "[BACK] PREV Menu "); |
|---|
| 804 | n_help++; |
|---|
| 805 | } |
|---|
| 806 | if ((flag & SM_KEY_DIGIT) && n_help < 5) { |
|---|
| 807 | strcat(buf, "[0..9] Select "); |
|---|
| 808 | n_help++; |
|---|
| 809 | } |
|---|
| 810 | if ((flag & SM_KEY_SEL) && n_help < 5) { |
|---|
| 811 | strcat(buf, "[SEL] "); |
|---|
| 812 | n_help++; |
|---|
| 813 | } |
|---|
| 814 | if ((flag & SM_KEY_UPDN) && n_help < 5) { |
|---|
| 815 | strcat(buf, "[UP/DN] Move Page "); |
|---|
| 816 | n_help++; |
|---|
| 817 | } |
|---|
| 818 | if ((flag & SM_KEY_LFRG) && n_help < 5) { |
|---|
| 819 | strcat(buf, "[LF/RG] Move Page "); |
|---|
| 820 | n_help++; |
|---|
| 821 | } |
|---|
| 822 | sm_printf(buf); |
|---|
| 823 | } |
|---|
| 824 | |
|---|
| 825 | |
|---|
| 826 | void sm_show_commands(void) |
|---|
| 827 | { |
|---|
| 828 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 829 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 830 | |
|---|
| 831 | sm_printf("\n"); |
|---|
| 832 | sm_printf(" **** commands ****\n"); |
|---|
| 833 | sm_printf("\n"); |
|---|
| 834 | sm_printf(" 1. show detail version\n"); |
|---|
| 835 | sm_printf(" 2. tune/channel setting\n"); |
|---|
| 836 | sm_printf(" 3. video setting\n"); |
|---|
| 837 | sm_printf(" 4. audio setting\n"); |
|---|
| 838 | sm_printf(" 5. graphic/ui setting\n"); |
|---|
| 839 | sm_printf(" 6. epg/rating setting\n"); |
|---|
| 840 | sm_printf(" 7. debug option\n"); |
|---|
| 841 | sm_printf(" 8. system reset & format\n"); |
|---|
| 842 | } |
|---|
| 843 | |
|---|
| 844 | |
|---|
| 845 | |
|---|
| 846 | #if COMMENT |
|---|
| 847 | ____grp____(){} |
|---|
| 848 | #endif |
|---|
| 849 | |
|---|
| 850 | #if 0 |
|---|
| 851 | void sm_show_palette(void) |
|---|
| 852 | { |
|---|
| 853 | int x, y, gx, gy; |
|---|
| 854 | int col; |
|---|
| 855 | char buf[10]; |
|---|
| 856 | |
|---|
| 857 | for (y=0; y<SM_VERT; y++) |
|---|
| 858 | { |
|---|
| 859 | for (x=0; x<SM_HORZ; x++) |
|---|
| 860 | { |
|---|
| 861 | col = (x/5)%16 + (y%16)*16; |
|---|
| 862 | |
|---|
| 863 | gx = GRID_TO_PIXEL_X(x); |
|---|
| 864 | gy = GRID_TO_PIXEL_Y(y); |
|---|
| 865 | |
|---|
| 866 | DMG_FillRect(gx, gy, SM_CHAR_W, SM_CHAR_H, col); |
|---|
| 867 | |
|---|
| 868 | if (x%5 == 0) { |
|---|
| 869 | sprintf(buf, "%1X", (col>>4)&0xf ); |
|---|
| 870 | DMG_PrintStr(gx, gy, buf, sm_cur_fcolor); |
|---|
| 871 | } |
|---|
| 872 | if (x%5 == 1) { |
|---|
| 873 | sprintf(buf, "%01X", col & 0xf); |
|---|
| 874 | DMG_PrintStr(gx, gy, buf, sm_cur_fcolor); |
|---|
| 875 | } |
|---|
| 876 | } |
|---|
| 877 | } |
|---|
| 878 | } |
|---|
| 879 | |
|---|
| 880 | |
|---|
| 881 | BOOL sm_proc_palette(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 882 | { |
|---|
| 883 | int k; |
|---|
| 884 | |
|---|
| 885 | sm_show_palette(); |
|---|
| 886 | sm_show_help(SM_KEY_BACK); |
|---|
| 887 | |
|---|
| 888 | while(1) |
|---|
| 889 | { |
|---|
| 890 | k = sm_get_key(); |
|---|
| 891 | |
|---|
| 892 | switch (k) |
|---|
| 893 | { |
|---|
| 894 | case G2H_POWER_OFF: |
|---|
| 895 | return SM_EXIT_POWER; |
|---|
| 896 | |
|---|
| 897 | case G2H_BACK: |
|---|
| 898 | case G2H_MENU: |
|---|
| 899 | return SM_EXIT_BACK; |
|---|
| 900 | |
|---|
| 901 | default: |
|---|
| 902 | sm_process_default_key(k); |
|---|
| 903 | break; |
|---|
| 904 | } |
|---|
| 905 | } |
|---|
| 906 | return SM_EXIT_BACK; // actually, not reachable |
|---|
| 907 | } |
|---|
| 908 | |
|---|
| 909 | |
|---|
| 910 | void sm_show_colorbar(int type) |
|---|
| 911 | { |
|---|
| 912 | int i; |
|---|
| 913 | int color[8] = { |
|---|
| 914 | SM_COLOR_WHITE, |
|---|
| 915 | SM_COLOR_YELLOW, |
|---|
| 916 | SM_COLOR_CYAN, |
|---|
| 917 | SM_COLOR_GREEN, |
|---|
| 918 | SM_COLOR_MAGENTA, |
|---|
| 919 | SM_COLOR_RED, |
|---|
| 920 | SM_COLOR_BLUE, |
|---|
| 921 | SM_COLOR_BLACK, |
|---|
| 922 | }; |
|---|
| 923 | |
|---|
| 924 | if (sm_cv == NULL) |
|---|
| 925 | sm_cv = GRP_GetCanvas(APP_PLANE); |
|---|
| 926 | if (sm_cv == NULL) { |
|---|
| 927 | printf("!! cv null\n"); |
|---|
| 928 | return; |
|---|
| 929 | } |
|---|
| 930 | |
|---|
| 931 | if (type == 0) { |
|---|
| 932 | for (i=0; i<8; i++) { |
|---|
| 933 | GRP_DrawBox(sm_cv, sm_cv->w*i/8, 0, sm_cv->w/8, sm_cv->h, color[i]); |
|---|
| 934 | } |
|---|
| 935 | } |
|---|
| 936 | |
|---|
| 937 | } |
|---|
| 938 | |
|---|
| 939 | int sm_proc_colorbar(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 940 | { |
|---|
| 941 | int k; |
|---|
| 942 | |
|---|
| 943 | sm_show_colorbar(0); |
|---|
| 944 | //sm_show_help(SM_KEY_BACK); |
|---|
| 945 | |
|---|
| 946 | while(1) |
|---|
| 947 | { |
|---|
| 948 | k = sm_get_key(); |
|---|
| 949 | |
|---|
| 950 | switch (k) |
|---|
| 951 | { |
|---|
| 952 | case G2H_POWER_OFF: |
|---|
| 953 | return SM_EXIT_POWER; |
|---|
| 954 | |
|---|
| 955 | case G2H_BACK: |
|---|
| 956 | case G2H_MENU: |
|---|
| 957 | return SM_EXIT_BACK; |
|---|
| 958 | |
|---|
| 959 | default: |
|---|
| 960 | sm_process_default_key(k); |
|---|
| 961 | break; |
|---|
| 962 | } |
|---|
| 963 | } |
|---|
| 964 | return SM_EXIT_BACK; // actually, not reachable |
|---|
| 965 | } |
|---|
| 966 | |
|---|
| 967 | |
|---|
| 968 | void sm_show_font(int style) |
|---|
| 969 | { |
|---|
| 970 | int px, py; // pixel x/y |
|---|
| 971 | int sz; |
|---|
| 972 | char buf[200]; |
|---|
| 973 | |
|---|
| 974 | // restore to default. ¾Æ·¡¿¡¼ Å×½ºÆ® ÇÑ´Ù°í º¯°æ µÇ¾úÀ» ¼ö ÀÖÀ¸¹Ç·Î.. |
|---|
| 975 | sm_setfont(sm_fa_style, sm_fa_size, sm_fa_size); |
|---|
| 976 | |
|---|
| 977 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 978 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 979 | |
|---|
| 980 | sm_printf(" **** Font style %d ****\n", style); |
|---|
| 981 | |
|---|
| 982 | px = GRID_TO_PIXEL_X(SM_SEL_WIN_X+1); // ÁÂÃø ¿©¹é Àû´çÈ÷.. |
|---|
| 983 | py = GRID_TO_PIXEL_Y(SM_SEL_WIN_Y+1); |
|---|
| 984 | |
|---|
| 985 | for (sz=8; sz<=24; sz++) |
|---|
| 986 | { |
|---|
| 987 | if (py+sz+4 > GRID_TO_PIXEL_Y(SM_HELP_WIN_Y)) |
|---|
| 988 | // not to overwrite help window. margin is 4 pixel.. |
|---|
| 989 | break; |
|---|
| 990 | |
|---|
| 991 | sm_setfont(style, sz, sz); |
|---|
| 992 | |
|---|
| 993 | sprintf(buf, "%2d: 0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz", sz); |
|---|
| 994 | |
|---|
| 995 | // font test ¸¸ÅÀº ¾î¿¼ö ¾øÀÌ GRP API¸¦ »ç¿ëÇÑ´Ù. |
|---|
| 996 | GFN_PrintXY(sm_cv, px, py, buf, sm_cur_fcolor); |
|---|
| 997 | |
|---|
| 998 | py += (sz + 2); |
|---|
| 999 | } |
|---|
| 1000 | |
|---|
| 1001 | sm_setfont(sm_fa_style, sm_fa_size, sm_fa_size); |
|---|
| 1002 | |
|---|
| 1003 | } |
|---|
| 1004 | |
|---|
| 1005 | int sm_proc_font(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1006 | { |
|---|
| 1007 | int k; |
|---|
| 1008 | int style = 3; |
|---|
| 1009 | |
|---|
| 1010 | sm_show_font(style); |
|---|
| 1011 | sm_show_help(SM_KEY_BACK); |
|---|
| 1012 | |
|---|
| 1013 | while(1) |
|---|
| 1014 | { |
|---|
| 1015 | k = sm_get_key(); |
|---|
| 1016 | |
|---|
| 1017 | switch (k) |
|---|
| 1018 | { |
|---|
| 1019 | case G2H_POWER_OFF: |
|---|
| 1020 | return SM_EXIT_POWER; |
|---|
| 1021 | |
|---|
| 1022 | case G2H_LEFT: |
|---|
| 1023 | if (style > 1) style--; |
|---|
| 1024 | sm_show_font(style); |
|---|
| 1025 | break; |
|---|
| 1026 | |
|---|
| 1027 | case G2H_RIGHT: |
|---|
| 1028 | if (style < 7) style++; |
|---|
| 1029 | sm_show_font(style); |
|---|
| 1030 | break; |
|---|
| 1031 | |
|---|
| 1032 | case G2H_BACK: |
|---|
| 1033 | case G2H_MENU: |
|---|
| 1034 | return SM_EXIT_BACK; |
|---|
| 1035 | |
|---|
| 1036 | default: |
|---|
| 1037 | sm_process_default_key(k); |
|---|
| 1038 | break; |
|---|
| 1039 | } |
|---|
| 1040 | } |
|---|
| 1041 | |
|---|
| 1042 | return SM_EXIT_BACK; // actually, not reachable |
|---|
| 1043 | } |
|---|
| 1044 | |
|---|
| 1045 | |
|---|
| 1046 | int sm_proc_ir(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1047 | { |
|---|
| 1048 | BOOL IR_SetPromiscuousMode(BOOL); |
|---|
| 1049 | |
|---|
| 1050 | int rval; |
|---|
| 1051 | //int k; |
|---|
| 1052 | UINT32 raw_data; |
|---|
| 1053 | UINT32 prev_raw_data = 0; |
|---|
| 1054 | BOOL old_p_mode; |
|---|
| 1055 | |
|---|
| 1056 | int repeat_count = 0; |
|---|
| 1057 | |
|---|
| 1058 | old_p_mode = IR_SetPromiscuousMode(TRUE); |
|---|
| 1059 | |
|---|
| 1060 | sm_show_help(SM_KEY_BACK | SM_KEY_DIGIT); |
|---|
| 1061 | |
|---|
| 1062 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 1063 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 1064 | |
|---|
| 1065 | sm_printf("\n **** IR input test ****\n\n"); |
|---|
| 1066 | sm_printf(" press same key 4 times to exit\n\n"); |
|---|
| 1067 | |
|---|
| 1068 | while (1) |
|---|
| 1069 | { |
|---|
| 1070 | rval = sm_get_key_ex(&raw_data); // raw key¸¦ ÀÔ·Â ¹Þ´Â´Ù. |
|---|
| 1071 | |
|---|
| 1072 | if (rval) continue; // ¿¡·¯, timeout µîÀ̶ó¸é ¹«½Ã. |
|---|
| 1073 | |
|---|
| 1074 | sm_clrbox(0, sm_cur_pos_y, SM_SEL_WIN_W, 1); // ÇöÀç Ä¿¼ À§Ä¡ ÇÑÁÙ »èÁ¦. |
|---|
| 1075 | sm_gotoxy(0, sm_cur_pos_y); |
|---|
| 1076 | sm_printf(" Raw code: %02X %02X %02X %02X ", |
|---|
| 1077 | raw_data >> 24, |
|---|
| 1078 | (raw_data >> 16) & 0xff, |
|---|
| 1079 | (raw_data >> 8) & 0xff, |
|---|
| 1080 | raw_data & 0xff); |
|---|
| 1081 | |
|---|
| 1082 | // ¾î¶² Á¶°Ç¿¡¼ ÀÌ ¸Þ´º¸¦ ³ª°¡µµ·Ï ÇÒ °ÍÀΰ¡? |
|---|
| 1083 | |
|---|
| 1084 | if (prev_raw_data == raw_data) { |
|---|
| 1085 | repeat_count++; |
|---|
| 1086 | sm_printf(" (%d)", repeat_count); |
|---|
| 1087 | if (repeat_count >= 4) |
|---|
| 1088 | break; |
|---|
| 1089 | } |
|---|
| 1090 | else |
|---|
| 1091 | repeat_count = 0; |
|---|
| 1092 | |
|---|
| 1093 | prev_raw_data = raw_data; |
|---|
| 1094 | } |
|---|
| 1095 | |
|---|
| 1096 | IR_SetPromiscuousMode(old_p_mode); |
|---|
| 1097 | |
|---|
| 1098 | return SM_EXIT_BACK; // actually, not reachable |
|---|
| 1099 | } |
|---|
| 1100 | #endif |
|---|
| 1101 | |
|---|
| 1102 | int sm_proc_gui(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1103 | { |
|---|
| 1104 | #if 0 |
|---|
| 1105 | int rval; |
|---|
| 1106 | int k; |
|---|
| 1107 | int input_idx, input[2]={0,}; |
|---|
| 1108 | |
|---|
| 1109 | label_begin: |
|---|
| 1110 | |
|---|
| 1111 | sm_show_help(SM_KEY_BACK | SM_KEY_DIGIT); |
|---|
| 1112 | |
|---|
| 1113 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 1114 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 1115 | |
|---|
| 1116 | sm_printf("\n **** graphic/ui info/setting ****\n\n"); |
|---|
| 1117 | sm_printf(" 1: show palette\n"); |
|---|
| 1118 | sm_printf(" 2: colorbar graphics\n"); |
|---|
| 1119 | sm_printf(" 3: font test\n"); |
|---|
| 1120 | sm_printf(" 4: IR input test\n"); |
|---|
| 1121 | //iskang 080331. add. |
|---|
| 1122 | //analog pass through timeouº¯°æ |
|---|
| 1123 | sm_printf(" 5: change Analog Pass Through Timeout(current :%d m sec.) \n",g_AnalogPassExTimeOut); |
|---|
| 1124 | sm_printf("\n"); |
|---|
| 1125 | |
|---|
| 1126 | while (1) |
|---|
| 1127 | { |
|---|
| 1128 | k = sm_get_key(); |
|---|
| 1129 | |
|---|
| 1130 | switch (k) |
|---|
| 1131 | { |
|---|
| 1132 | case G2H_POWER_OFF: |
|---|
| 1133 | return SM_EXIT_POWER; |
|---|
| 1134 | |
|---|
| 1135 | case G2H_1: |
|---|
| 1136 | rval = sm_proc_palette(); |
|---|
| 1137 | if (rval == SM_EXIT_POWER) |
|---|
| 1138 | return SM_EXIT_POWER; |
|---|
| 1139 | sm_show_status(SM_STAT_MASK_ALL); |
|---|
| 1140 | goto label_begin; |
|---|
| 1141 | |
|---|
| 1142 | case G2H_2: |
|---|
| 1143 | rval = sm_proc_colorbar(); |
|---|
| 1144 | sm_clrscr(); |
|---|
| 1145 | if (rval == SM_EXIT_POWER) |
|---|
| 1146 | return SM_EXIT_POWER; |
|---|
| 1147 | sm_show_status(SM_STAT_MASK_ALL); |
|---|
| 1148 | goto label_begin; |
|---|
| 1149 | |
|---|
| 1150 | case G2H_3: |
|---|
| 1151 | rval = sm_proc_font(); |
|---|
| 1152 | sm_clrscr(); |
|---|
| 1153 | if (rval == SM_EXIT_POWER) |
|---|
| 1154 | return SM_EXIT_POWER; |
|---|
| 1155 | sm_show_status(SM_STAT_MASK_ALL); |
|---|
| 1156 | goto label_begin; |
|---|
| 1157 | |
|---|
| 1158 | case G2H_4: |
|---|
| 1159 | rval = sm_proc_ir(); |
|---|
| 1160 | sm_clrscr(); |
|---|
| 1161 | if (rval == SM_EXIT_POWER) |
|---|
| 1162 | return SM_EXIT_POWER; |
|---|
| 1163 | sm_show_status(SM_STAT_MASK_ALL); |
|---|
| 1164 | goto label_begin; |
|---|
| 1165 | |
|---|
| 1166 | //iskang 080331. add. |
|---|
| 1167 | //analog pass through timeoutº¯°æ. |
|---|
| 1168 | case G2H_5: |
|---|
| 1169 | |
|---|
| 1170 | sm_printf("Input Time(100 msec/number), "); |
|---|
| 1171 | input[0] = input[1]= 0; |
|---|
| 1172 | input_idx = 0; |
|---|
| 1173 | while(1) |
|---|
| 1174 | { |
|---|
| 1175 | k = sm_get_key(); |
|---|
| 1176 | |
|---|
| 1177 | switch (k) |
|---|
| 1178 | { |
|---|
| 1179 | case G2H_POWER_OFF: |
|---|
| 1180 | return SM_EXIT_POWER; |
|---|
| 1181 | |
|---|
| 1182 | case G2H_BACK: |
|---|
| 1183 | case G2H_MENU: |
|---|
| 1184 | break; |
|---|
| 1185 | |
|---|
| 1186 | case G2H_0: |
|---|
| 1187 | case G2H_1: |
|---|
| 1188 | case G2H_2: |
|---|
| 1189 | case G2H_3: |
|---|
| 1190 | case G2H_4: |
|---|
| 1191 | case G2H_5: |
|---|
| 1192 | case G2H_6: |
|---|
| 1193 | case G2H_7: |
|---|
| 1194 | case G2H_8: |
|---|
| 1195 | case G2H_9: |
|---|
| 1196 | input[input_idx] = k - G2H_0; |
|---|
| 1197 | sm_printf("%d", input[input_idx]); |
|---|
| 1198 | input_idx++; |
|---|
| 1199 | break; |
|---|
| 1200 | } |
|---|
| 1201 | if (input_idx >= 2) |
|---|
| 1202 | break; |
|---|
| 1203 | } |
|---|
| 1204 | g_AnalogPassExTimeOut = input[0]*1000+input[1]*100; |
|---|
| 1205 | goto label_begin; |
|---|
| 1206 | |
|---|
| 1207 | case G2H_BACK: |
|---|
| 1208 | case G2H_MENU: |
|---|
| 1209 | return SM_EXIT_BACK; |
|---|
| 1210 | |
|---|
| 1211 | default: |
|---|
| 1212 | sm_process_default_key(k); |
|---|
| 1213 | break; |
|---|
| 1214 | } |
|---|
| 1215 | } |
|---|
| 1216 | #endif |
|---|
| 1217 | return TRUE; |
|---|
| 1218 | } |
|---|
| 1219 | |
|---|
| 1220 | |
|---|
| 1221 | |
|---|
| 1222 | #if COMMENT |
|---|
| 1223 | ____ver____(){} |
|---|
| 1224 | #endif |
|---|
| 1225 | |
|---|
| 1226 | |
|---|
| 1227 | BOOL sm_proc_version(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1228 | { |
|---|
| 1229 | BOOL bRet = TRUE; |
|---|
| 1230 | |
|---|
| 1231 | switch(cmd) |
|---|
| 1232 | { |
|---|
| 1233 | case eDMG_CMD_ON_MENU_UPDATE : |
|---|
| 1234 | sm_show_version_detail(); |
|---|
| 1235 | sm_show_help(SM_KEY_BACK); |
|---|
| 1236 | sm_refresh(); |
|---|
| 1237 | break; |
|---|
| 1238 | |
|---|
| 1239 | case eDMG_CMD_ON_TIME : |
|---|
| 1240 | break; |
|---|
| 1241 | |
|---|
| 1242 | case eDMG_CMD_ON_KEY : |
|---|
| 1243 | switch (param2) |
|---|
| 1244 | { |
|---|
| 1245 | case APP_VK_BACK: |
|---|
| 1246 | case APP_VK_MENU: |
|---|
| 1247 | s_sm_menu_id = SM_MENU_HOME; |
|---|
| 1248 | sm_send_msg(0); // let parent to update his screen |
|---|
| 1249 | break; |
|---|
| 1250 | default: |
|---|
| 1251 | bRet = FALSE; |
|---|
| 1252 | break; |
|---|
| 1253 | } |
|---|
| 1254 | break; |
|---|
| 1255 | |
|---|
| 1256 | default: |
|---|
| 1257 | bRet = FALSE; // cannot process this command. |
|---|
| 1258 | break; |
|---|
| 1259 | } |
|---|
| 1260 | |
|---|
| 1261 | return bRet; |
|---|
| 1262 | } |
|---|
| 1263 | |
|---|
| 1264 | |
|---|
| 1265 | #if COMMENT |
|---|
| 1266 | ____audio____(){} |
|---|
| 1267 | #endif |
|---|
| 1268 | |
|---|
| 1269 | |
|---|
| 1270 | void sm_show_audio_info() |
|---|
| 1271 | { |
|---|
| 1272 | DMW_AudioElement *pMLInfo; |
|---|
| 1273 | int nAudioCount; |
|---|
| 1274 | int nCurIndex; |
|---|
| 1275 | UINT32 langCode; |
|---|
| 1276 | int err; |
|---|
| 1277 | int i; |
|---|
| 1278 | APP_AUDIO_LANG_ID id = App_AudioGetPreferredLanguageId(); |
|---|
| 1279 | |
|---|
| 1280 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 1281 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 1282 | |
|---|
| 1283 | err = App_AudioGetMLInfo(&pMLInfo, &nAudioCount, &nCurIndex); |
|---|
| 1284 | if (err == statusOK && nAudioCount > 0) { |
|---|
| 1285 | langCode = pMLInfo[nCurIndex].ISO639_LanguageCode; |
|---|
| 1286 | } |
|---|
| 1287 | else { |
|---|
| 1288 | langCode = 0; |
|---|
| 1289 | nAudioCount = 0; |
|---|
| 1290 | } |
|---|
| 1291 | |
|---|
| 1292 | sm_printf("\n"); |
|---|
| 1293 | |
|---|
| 1294 | #if 0 // SPDIF not support |
|---|
| 1295 | sm_printf(" Audio SPDIF type: %s\n", |
|---|
| 1296 | g_App_AudioModeSPDIF == PNX_AUDIO_SPDIF_PCM ? "PCM" : |
|---|
| 1297 | g_App_AudioModeSPDIF == PNX_AUDIO_SPDIF_AC3 ? "AC3" : "?"); |
|---|
| 1298 | #endif |
|---|
| 1299 | |
|---|
| 1300 | sm_printf(" Audio Volume: %d\n", App_AudioGetVolume()); |
|---|
| 1301 | |
|---|
| 1302 | #if 1 // use ID instead of Code |
|---|
| 1303 | sm_printf(" Perferred audio: %s\n", |
|---|
| 1304 | id == APP_AUDIO_LANG_AUTO ? "Auto" : |
|---|
| 1305 | id == APP_AUDIO_LANG_ENG ? "English" : |
|---|
| 1306 | id == APP_AUDIO_LANG_SPA ? "Spanish" : |
|---|
| 1307 | id == APP_AUDIO_LANG_FRE ? "French" : |
|---|
| 1308 | id == APP_AUDIO_LANG_KOR ? "Korean" : "??"); |
|---|
| 1309 | #else |
|---|
| 1310 | langCode = g_App_AudioUserLanguageCode; |
|---|
| 1311 | sm_printf(" User audio: 0x%x, %s\n", |
|---|
| 1312 | langCode, App_AudioLangCodeStr(langCode, 0)); |
|---|
| 1313 | |
|---|
| 1314 | #endif |
|---|
| 1315 | |
|---|
| 1316 | sm_printf(" Audio information: %d streams\n", nAudioCount); |
|---|
| 1317 | sm_printf("\n"); |
|---|
| 1318 | |
|---|
| 1319 | for (i=0; i<nAudioCount; i++) |
|---|
| 1320 | { |
|---|
| 1321 | langCode = pMLInfo[i].ISO639_LanguageCode; |
|---|
| 1322 | sm_printf(" (%2d) Pid 0x%04x, type %d, lang %06x '%s' %s\n", |
|---|
| 1323 | i, pMLInfo[i].elementaryPid, pMLInfo[i].audioType, |
|---|
| 1324 | langCode, App_AudioLangCodeStr(langCode, 0), |
|---|
| 1325 | i==nCurIndex ? "<--- playing" : ""); |
|---|
| 1326 | |
|---|
| 1327 | if (sm_cur_pos_y >= SM_SEL_WIN_Y + SM_SEL_WIN_H) |
|---|
| 1328 | break; |
|---|
| 1329 | } |
|---|
| 1330 | } |
|---|
| 1331 | |
|---|
| 1332 | int sm_proc_audio(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1333 | { |
|---|
| 1334 | BOOL bRet = TRUE; |
|---|
| 1335 | |
|---|
| 1336 | switch(cmd) |
|---|
| 1337 | { |
|---|
| 1338 | case eDMG_CMD_ON_MENU_UPDATE : |
|---|
| 1339 | sm_show_audio_info(); |
|---|
| 1340 | sm_show_help(SM_KEY_BACK); |
|---|
| 1341 | sm_refresh(); |
|---|
| 1342 | break; |
|---|
| 1343 | |
|---|
| 1344 | case eDMG_CMD_ON_TIME : |
|---|
| 1345 | sm_show_audio_info(); |
|---|
| 1346 | sm_refresh(); |
|---|
| 1347 | break; |
|---|
| 1348 | |
|---|
| 1349 | case eDMG_CMD_ON_KEY : |
|---|
| 1350 | switch (param2) |
|---|
| 1351 | { |
|---|
| 1352 | case APP_VK_BACK: |
|---|
| 1353 | case APP_VK_MENU: |
|---|
| 1354 | s_sm_menu_id = SM_MENU_HOME; |
|---|
| 1355 | sm_send_msg(0); |
|---|
| 1356 | break; |
|---|
| 1357 | default: |
|---|
| 1358 | bRet = FALSE; |
|---|
| 1359 | break; |
|---|
| 1360 | } |
|---|
| 1361 | if (sm_is_digitkey(param2)) bRet = TRUE; |
|---|
| 1362 | break; |
|---|
| 1363 | |
|---|
| 1364 | default: |
|---|
| 1365 | bRet = FALSE; // cannot process this command. |
|---|
| 1366 | break; |
|---|
| 1367 | } |
|---|
| 1368 | |
|---|
| 1369 | return bRet; |
|---|
| 1370 | } |
|---|
| 1371 | |
|---|
| 1372 | |
|---|
| 1373 | #if COMMENT |
|---|
| 1374 | ____channel____(){} |
|---|
| 1375 | #endif |
|---|
| 1376 | |
|---|
| 1377 | #if 0 |
|---|
| 1378 | int sm_show_partial_channel_db(int i_page) |
|---|
| 1379 | { |
|---|
| 1380 | int n_active = 0; |
|---|
| 1381 | int n_page; |
|---|
| 1382 | int i_start; |
|---|
| 1383 | int sz_page; |
|---|
| 1384 | |
|---|
| 1385 | int i, k; |
|---|
| 1386 | UCM_DB_T *ucm; |
|---|
| 1387 | |
|---|
| 1388 | char channel[20], surf[10], short_name[40]; |
|---|
| 1389 | |
|---|
| 1390 | #define SimpleServiceTypeString(type) ( \ |
|---|
| 1391 | type == Modulation_NTSC ? "N" : \ |
|---|
| 1392 | type == Modulation_8VSB ? "V" : \ |
|---|
| 1393 | type == Modulation_64QAM ? "6" : \ |
|---|
| 1394 | type == Modulation_256QAM ? "2" : \ |
|---|
| 1395 | type == Modulation_CableAuto ? "C" : \ |
|---|
| 1396 | type == Modulation_QAM ? "Q" : "?") |
|---|
| 1397 | |
|---|
| 1398 | |
|---|
| 1399 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 1400 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 1401 | |
|---|
| 1402 | |
|---|
| 1403 | DMW_MSC_LockUcm(); |
|---|
| 1404 | |
|---|
| 1405 | for (i=0; g_UCM && i<g_UCM_number; i++) { |
|---|
| 1406 | if (g_UCM[i].Skipped == 0) n_active++; |
|---|
| 1407 | } |
|---|
| 1408 | |
|---|
| 1409 | |
|---|
| 1410 | sz_page = 10; //SM_SEL_WIN_H-1; |
|---|
| 1411 | |
|---|
| 1412 | //i_start = i_page * sz_page; // ½ÃÀÛ index |
|---|
| 1413 | |
|---|
| 1414 | n_page = (g_UCM_number + sz_page-1)/sz_page; // page ¹üÀ§: 0 ~ n_page-1 |
|---|
| 1415 | |
|---|
| 1416 | if (i_page < 0) i_page = 0; |
|---|
| 1417 | if (i_page >= n_page) i_page = n_page-1; |
|---|
| 1418 | |
|---|
| 1419 | i_start = i_page * sz_page; |
|---|
| 1420 | |
|---|
| 1421 | sm_printf("\n*** Total %d channels, %d active, page %d of total %d pages ***\n\n", |
|---|
| 1422 | g_UCM_number, n_active, i_page+1, n_page); |
|---|
| 1423 | |
|---|
| 1424 | for (i=i_start, k=0; g_UCM && i<g_UCM_number && k<sz_page; i++, k++) |
|---|
| 1425 | { |
|---|
| 1426 | ucm = &g_UCM[i]; |
|---|
| 1427 | |
|---|
| 1428 | // surf |
|---|
| 1429 | if (ucm->SurfIndex) |
|---|
| 1430 | sprintf(surf, "%02d", ucm->SurfIndex % 100); |
|---|
| 1431 | else sprintf(surf, ".."); |
|---|
| 1432 | |
|---|
| 1433 | // short_name |
|---|
| 1434 | if (ucm->VctFlag) |
|---|
| 1435 | strcpy(short_name, DMW_Unicode2Ks(g_UCM[i].ShortName, 7, NULL)); |
|---|
| 1436 | else if (ucm->Service_type == 0) |
|---|
| 1437 | strcpy(short_name, "NTSC"); |
|---|
| 1438 | else |
|---|
| 1439 | strcpy(short_name, "PSI"); |
|---|
| 1440 | |
|---|
| 1441 | if (ucm->VctFlag) // from VCT |
|---|
| 1442 | { |
|---|
| 1443 | if (ucm->Minor == ONE_PART_CHANNEL_INDICATOR) |
|---|
| 1444 | sprintf(channel, "%3d", ucm->Major); // ÀÚ¸®°¡ ³ÐÀ¸¸é ¿À¸¥ÂÊÀ¸·Î ³ÑÄ¥ °ÍÀÓ. |
|---|
| 1445 | else |
|---|
| 1446 | sprintf(channel, "%3d-%-3d", ucm->Major, ucm->Minor); |
|---|
| 1447 | |
|---|
| 1448 | sm_printf(" %c(%02d) %-7s %-3d %c%c[%03d] %s #%-3d $%-3d %s %04x/%04x/%04x %x [%s]\n", |
|---|
| 1449 | ucm->hidden ? 'h' : |
|---|
| 1450 | ucm->Skipped ? ' ' : |
|---|
| 1451 | ucm->blocked ? 'b' : '+', |
|---|
| 1452 | i, channel, |
|---|
| 1453 | ucm->RF, |
|---|
| 1454 | ucm->scrambled ? '*' : ' ', |
|---|
| 1455 | ucm->VctFlag ? 'v' : ' ', |
|---|
| 1456 | ucm->Uid, surf, |
|---|
| 1457 | ucm->Prog_number, ucm->source_id, |
|---|
| 1458 | SimpleServiceTypeString(ucm->Service_type), |
|---|
| 1459 | ucm->Pcr_pid, ucm->Video_pid, ucm->Audio_pid, |
|---|
| 1460 | ucm->pmt_pid, |
|---|
| 1461 | short_name //DMW_Unicode2Ks(ucm->ShortName, 7, NULL) |
|---|
| 1462 | ); |
|---|
| 1463 | } |
|---|
| 1464 | else // from PSI |
|---|
| 1465 | { |
|---|
| 1466 | sprintf(channel, "%3d-%-3d", ucm->Major, ucm->Minor); |
|---|
| 1467 | |
|---|
| 1468 | sm_printf(" %c(%02d) %-7s %-3d %c%c[%03d] %s #%-3d $%-3d %s %04x/%04x/%04x %x [%s]\n", |
|---|
| 1469 | ucm->Skipped ? ' ' : |
|---|
| 1470 | ucm->blocked ? 'b' : '+', |
|---|
| 1471 | i, channel, |
|---|
| 1472 | ucm->RF, |
|---|
| 1473 | ucm->scrambled ? '*' : ' ', |
|---|
| 1474 | ucm->VctFlag ? 'v' : ' ', |
|---|
| 1475 | ucm->Uid, surf, |
|---|
| 1476 | ucm->Prog_number, ucm->source_id, |
|---|
| 1477 | SimpleServiceTypeString(ucm->Service_type), |
|---|
| 1478 | ucm->Pcr_pid, ucm->Video_pid, ucm->Audio_pid, |
|---|
| 1479 | ucm->pmt_pid, |
|---|
| 1480 | short_name |
|---|
| 1481 | ); |
|---|
| 1482 | } |
|---|
| 1483 | |
|---|
| 1484 | //if (sm_cur_pos_y >= SM_SEL_WIN_Y + SM_SEL_WIN_H) |
|---|
| 1485 | // break; |
|---|
| 1486 | |
|---|
| 1487 | } |
|---|
| 1488 | sm_printf("\n"); |
|---|
| 1489 | |
|---|
| 1490 | DMW_MSC_UnlockUcm(); |
|---|
| 1491 | |
|---|
| 1492 | return i_page; |
|---|
| 1493 | |
|---|
| 1494 | } |
|---|
| 1495 | |
|---|
| 1496 | void sm_tune_channel(int idx) |
|---|
| 1497 | { |
|---|
| 1498 | DMW_MSC_LockUcm(); |
|---|
| 1499 | |
|---|
| 1500 | if (idx >= 0 && idx < g_UCM_number) |
|---|
| 1501 | { |
|---|
| 1502 | sm_clrbox(0, sm_cur_pos_y, SM_SEL_WIN_W, 1); |
|---|
| 1503 | sm_printf(" tune channel [%d], %d-%d ...\r", idx, |
|---|
| 1504 | g_UCM[idx].Major, g_UCM[idx].Minor); |
|---|
| 1505 | |
|---|
| 1506 | App_TuneChannelByUid(g_UCM[idx].Uid); |
|---|
| 1507 | } |
|---|
| 1508 | else { |
|---|
| 1509 | sm_clrbox(0, sm_cur_pos_y, SM_SEL_WIN_W, 1); |
|---|
| 1510 | sm_printf(" invalid channel index %d\r", idx); |
|---|
| 1511 | } |
|---|
| 1512 | |
|---|
| 1513 | DMW_MSC_UnlockUcm(); |
|---|
| 1514 | } |
|---|
| 1515 | |
|---|
| 1516 | int sm_proc_channel_db(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1517 | { |
|---|
| 1518 | int k, idx; |
|---|
| 1519 | int i_page = 0; |
|---|
| 1520 | |
|---|
| 1521 | sm_show_help(SM_KEY_BACK | SM_KEY_UPDN); |
|---|
| 1522 | sm_show_partial_channel_db(i_page); |
|---|
| 1523 | |
|---|
| 1524 | while(1) |
|---|
| 1525 | { |
|---|
| 1526 | k = sm_get_key(); |
|---|
| 1527 | |
|---|
| 1528 | switch (k) |
|---|
| 1529 | { |
|---|
| 1530 | case G2H_POWER_OFF: |
|---|
| 1531 | return SM_EXIT_POWER; |
|---|
| 1532 | |
|---|
| 1533 | case G2H_BACK: |
|---|
| 1534 | case G2H_MENU: |
|---|
| 1535 | return SM_EXIT_BACK; |
|---|
| 1536 | |
|---|
| 1537 | case G2H_0: |
|---|
| 1538 | case G2H_1: |
|---|
| 1539 | case G2H_2: |
|---|
| 1540 | case G2H_3: |
|---|
| 1541 | case G2H_4: |
|---|
| 1542 | case G2H_5: |
|---|
| 1543 | case G2H_6: |
|---|
| 1544 | case G2H_7: |
|---|
| 1545 | case G2H_8: |
|---|
| 1546 | case G2H_9: |
|---|
| 1547 | idx = i_page*10 + (k - G2H_0); |
|---|
| 1548 | sm_tune_channel(idx); |
|---|
| 1549 | break; |
|---|
| 1550 | |
|---|
| 1551 | case G2H_DOWN: |
|---|
| 1552 | i_page++; |
|---|
| 1553 | i_page = sm_show_partial_channel_db(i_page); |
|---|
| 1554 | break; |
|---|
| 1555 | |
|---|
| 1556 | case G2H_UP: |
|---|
| 1557 | i_page--; |
|---|
| 1558 | i_page = sm_show_partial_channel_db(i_page); |
|---|
| 1559 | break; |
|---|
| 1560 | |
|---|
| 1561 | default: |
|---|
| 1562 | sm_process_default_key(k); |
|---|
| 1563 | break; |
|---|
| 1564 | |
|---|
| 1565 | } |
|---|
| 1566 | } |
|---|
| 1567 | |
|---|
| 1568 | } |
|---|
| 1569 | #endif |
|---|
| 1570 | |
|---|
| 1571 | |
|---|
| 1572 | BOOL sm_proc_channel(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1573 | { |
|---|
| 1574 | #if 0 |
|---|
| 1575 | int k; |
|---|
| 1576 | int input[10], input_idx; |
|---|
| 1577 | int bDigitalRF = FALSE; |
|---|
| 1578 | int counter = 0; |
|---|
| 1579 | |
|---|
| 1580 | label_begin: |
|---|
| 1581 | sm_show_help(SM_KEY_BACK | SM_KEY_DIGIT); |
|---|
| 1582 | |
|---|
| 1583 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 1584 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 1585 | |
|---|
| 1586 | sm_printf("\n **** channel ****\n\n"); |
|---|
| 1587 | sm_printf(" 1: show/tune channel\n"); |
|---|
| 1588 | sm_printf(" 2: direct digital RF tuning\n"); |
|---|
| 1589 | #if SUPPORT_ANALOG_RF |
|---|
| 1590 | sm_printf(" 3: direct analog RF tuning\n"); |
|---|
| 1591 | #endif |
|---|
| 1592 | //sm_printf(" 4: channel tune by DB\n"); |
|---|
| 1593 | sm_printf("\n"); |
|---|
| 1594 | |
|---|
| 1595 | while(1) |
|---|
| 1596 | { |
|---|
| 1597 | k = sm_get_key(); |
|---|
| 1598 | |
|---|
| 1599 | if (k == G2H_USER_TIMER) { |
|---|
| 1600 | counter++; |
|---|
| 1601 | sm_show_status(SM_STAT_MASK_FE | SM_STAT_MASK_MEM); |
|---|
| 1602 | if (counter % sm_period_stat_info == 0) |
|---|
| 1603 | sm_show_status(SM_STAT_MASK_CH | SM_STAT_MASK_AV | |
|---|
| 1604 | SM_STAT_MASK_RA | SM_STAT_MASK_AGE); |
|---|
| 1605 | continue; |
|---|
| 1606 | } |
|---|
| 1607 | |
|---|
| 1608 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y+9); |
|---|
| 1609 | |
|---|
| 1610 | switch (k) |
|---|
| 1611 | { |
|---|
| 1612 | case G2H_POWER_OFF: |
|---|
| 1613 | return SM_EXIT_POWER; |
|---|
| 1614 | |
|---|
| 1615 | case G2H_BACK: |
|---|
| 1616 | case G2H_MENU: |
|---|
| 1617 | return SM_EXIT_BACK; |
|---|
| 1618 | |
|---|
| 1619 | case G2H_1: |
|---|
| 1620 | sm_proc_channel_db(); |
|---|
| 1621 | goto label_begin; |
|---|
| 1622 | |
|---|
| 1623 | case G2H_2: |
|---|
| 1624 | #if SUPPORT_ANALOG_RF |
|---|
| 1625 | case G2H_3: |
|---|
| 1626 | #endif |
|---|
| 1627 | bDigitalRF = k == G2H_2 ? 1 : 0; |
|---|
| 1628 | sm_printf("\n %s\n Enter RF number (3 digit) : ", |
|---|
| 1629 | bDigitalRF ? "Digital RF" : "Analog RF"); |
|---|
| 1630 | input[0] = input[1] = input[2] = 0; |
|---|
| 1631 | input_idx = 0; |
|---|
| 1632 | while(1) |
|---|
| 1633 | { |
|---|
| 1634 | k = sm_get_key(); |
|---|
| 1635 | |
|---|
| 1636 | switch (k) |
|---|
| 1637 | { |
|---|
| 1638 | case G2H_POWER_OFF: |
|---|
| 1639 | return SM_EXIT_POWER; |
|---|
| 1640 | |
|---|
| 1641 | case G2H_BACK: |
|---|
| 1642 | case G2H_MENU: |
|---|
| 1643 | break; |
|---|
| 1644 | |
|---|
| 1645 | case G2H_0: |
|---|
| 1646 | case G2H_1: |
|---|
| 1647 | case G2H_2: |
|---|
| 1648 | case G2H_3: |
|---|
| 1649 | case G2H_4: |
|---|
| 1650 | case G2H_5: |
|---|
| 1651 | case G2H_6: |
|---|
| 1652 | case G2H_7: |
|---|
| 1653 | case G2H_8: |
|---|
| 1654 | case G2H_9: |
|---|
| 1655 | input[input_idx] = k - G2H_0; |
|---|
| 1656 | sm_printf("%d", input[input_idx]); |
|---|
| 1657 | input_idx++; |
|---|
| 1658 | break; |
|---|
| 1659 | } |
|---|
| 1660 | |
|---|
| 1661 | if (input_idx >= 3) |
|---|
| 1662 | break; |
|---|
| 1663 | } |
|---|
| 1664 | |
|---|
| 1665 | if (input_idx >= 3) { |
|---|
| 1666 | int rf = 0; |
|---|
| 1667 | int val = input[0]*100 + input[1]*10 + input[2]; |
|---|
| 1668 | if (g_App_Channel.nChannelType == ChannelType_Air && |
|---|
| 1669 | val >= 2 && val <= 69) |
|---|
| 1670 | rf = val; |
|---|
| 1671 | else if (g_App_Channel.nChannelType == ChannelType_Cable && |
|---|
| 1672 | val >= 1 && val <= 135) |
|---|
| 1673 | rf = val; |
|---|
| 1674 | |
|---|
| 1675 | if (rf == 0) { |
|---|
| 1676 | sm_printf("\n !! %d is invalid number\n", val); |
|---|
| 1677 | OS_Delay(OS_GetTicksPerSecond()); |
|---|
| 1678 | } |
|---|
| 1679 | else { |
|---|
| 1680 | if (bDigitalRF) |
|---|
| 1681 | App_ChTuneQuickScanAndTune(rf, 0, PNX_QUICKSCAN_DRF); |
|---|
| 1682 | #if SUPPORT_ANALOG_RF |
|---|
| 1683 | else |
|---|
| 1684 | App_ChTuneAnalogScanAndTune(rf, PNX_QUICKSCAN_ARF); |
|---|
| 1685 | #endif |
|---|
| 1686 | } |
|---|
| 1687 | } |
|---|
| 1688 | goto label_begin; |
|---|
| 1689 | |
|---|
| 1690 | default: |
|---|
| 1691 | sm_process_default_key(k); |
|---|
| 1692 | break; |
|---|
| 1693 | |
|---|
| 1694 | } |
|---|
| 1695 | } |
|---|
| 1696 | #endif |
|---|
| 1697 | return TRUE; |
|---|
| 1698 | } |
|---|
| 1699 | |
|---|
| 1700 | |
|---|
| 1701 | #if COMMENT |
|---|
| 1702 | ____epg_rating____(){} |
|---|
| 1703 | #endif |
|---|
| 1704 | |
|---|
| 1705 | #if 0 |
|---|
| 1706 | void sm_show_rrt(int idim, int offset) |
|---|
| 1707 | { |
|---|
| 1708 | rrtSectionPtr_t rrt = NULL; |
|---|
| 1709 | rrtDimensionPtr_t dim; // ÇöÀç Ç¥½ÃµÇ°í ÀÖ´Â dim.. idim ¹øÂ° dimension ptrÀÌ´Ù. |
|---|
| 1710 | rrtValuePtr_t value; |
|---|
| 1711 | |
|---|
| 1712 | int k; |
|---|
| 1713 | static char mssbuf[200]; |
|---|
| 1714 | STATUS status; |
|---|
| 1715 | |
|---|
| 1716 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 1717 | |
|---|
| 1718 | rrt = Dmc_EpgGetCurrentRrt(); |
|---|
| 1719 | if (rrt == NULL) { |
|---|
| 1720 | sm_printf("\n No RRT information\n"); |
|---|
| 1721 | goto label_end; |
|---|
| 1722 | } |
|---|
| 1723 | |
|---|
| 1724 | status = Dmc_ConvertMss2Ks(rrt->rating_region_name, |
|---|
| 1725 | rrt->rating_region_name_length, mssbuf, 200, NULL, 0); |
|---|
| 1726 | |
|---|
| 1727 | sm_printf("\n"); |
|---|
| 1728 | sm_printf(" Region %d { %s }, ver %d, %d dimensions\n\n", |
|---|
| 1729 | rrt->rating_region, status ? "err" : mssbuf, // region |
|---|
| 1730 | (int)rrt->version_number, (int)rrt->dimensions_defined); |
|---|
| 1731 | |
|---|
| 1732 | if (idim >= 0 && idim < rrt->dimensions_defined) |
|---|
| 1733 | { |
|---|
| 1734 | dim = &rrt->dimension[idim]; |
|---|
| 1735 | status = Dmc_ConvertMss2Ks(dim->dimension_name, |
|---|
| 1736 | dim->dimension_name_length, mssbuf, 200, NULL, 0); |
|---|
| 1737 | |
|---|
| 1738 | sm_printf(" [%d] { %s } grad %d, %d values \n\n", |
|---|
| 1739 | idim, |
|---|
| 1740 | status ? ".." : mssbuf, |
|---|
| 1741 | (int)dim->graduated_scale, |
|---|
| 1742 | (int)dim->values_defined); |
|---|
| 1743 | |
|---|
| 1744 | for (k=0; k<dim->values_defined; k++) |
|---|
| 1745 | { |
|---|
| 1746 | value = &dim->value[k]; |
|---|
| 1747 | status = Dmc_ConvertMss2Ks(value->abbrev_rating_value, |
|---|
| 1748 | value->abbrev_rating_value_length, mssbuf, 200, NULL, 0); |
|---|
| 1749 | sm_printf(" (%d) { %-10s } %s\n", k + offset, |
|---|
| 1750 | status ? ".." : mssbuf, |
|---|
| 1751 | value->block_on ? "ON" : "--"); |
|---|
| 1752 | } |
|---|
| 1753 | sm_printf("\n"); |
|---|
| 1754 | } |
|---|
| 1755 | else { |
|---|
| 1756 | sm_printf(" [%d] dimension #%d not defined\n\n", idim, idim); |
|---|
| 1757 | } |
|---|
| 1758 | |
|---|
| 1759 | label_end: |
|---|
| 1760 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 1761 | |
|---|
| 1762 | } |
|---|
| 1763 | |
|---|
| 1764 | int sm_proc_d_rating_setting(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1765 | { |
|---|
| 1766 | int rval; |
|---|
| 1767 | int k, idx; |
|---|
| 1768 | int counter = 0; |
|---|
| 1769 | int rrt_ver = -1; |
|---|
| 1770 | |
|---|
| 1771 | rrtSectionPtr_t rrt = NULL; |
|---|
| 1772 | int idim = 0; |
|---|
| 1773 | //rrtDimensionPtr_t dim; // ÇöÀç Ç¥½ÃµÇ°í ÀÖ´Â dim.. idim ¹øÂ° dimension ptrÀÌ´Ù. |
|---|
| 1774 | int offset = 0; // value offset |
|---|
| 1775 | |
|---|
| 1776 | UINT32 tickstart = OS_GetTickCount(); |
|---|
| 1777 | BOOL rrt_invalid_err; |
|---|
| 1778 | |
|---|
| 1779 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 1780 | rrt = Dmc_EpgGetCurrentRrt(); |
|---|
| 1781 | if (rrt == NULL) |
|---|
| 1782 | rrt_ver = -1; |
|---|
| 1783 | else |
|---|
| 1784 | rrt_ver = rrt->version_number; |
|---|
| 1785 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 1786 | |
|---|
| 1787 | label_begin: |
|---|
| 1788 | sm_show_help(SM_KEY_BACK | SM_KEY_DIGIT); |
|---|
| 1789 | |
|---|
| 1790 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 1791 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 1792 | |
|---|
| 1793 | sm_show_rrt(idim, offset); |
|---|
| 1794 | |
|---|
| 1795 | while(1) |
|---|
| 1796 | { |
|---|
| 1797 | k = sm_get_key(); |
|---|
| 1798 | |
|---|
| 1799 | if (k == G2H_USER_TIMER) { |
|---|
| 1800 | counter++; |
|---|
| 1801 | //sm_show_status(SM_STAT_MASK_FE | SM_STAT_MASK_MEM); |
|---|
| 1802 | if (counter % sm_period_stat_info == 0) |
|---|
| 1803 | sm_show_status(/* SM_STAT_MASK_CH | SM_STAT_MASK_AV | */ |
|---|
| 1804 | SM_STAT_MASK_RA /* | SM_STAT_MASK_MEM | SM_STAT_MASK_AGE */); |
|---|
| 1805 | continue; |
|---|
| 1806 | } |
|---|
| 1807 | |
|---|
| 1808 | if (k == G2H_IDLE) |
|---|
| 1809 | { |
|---|
| 1810 | if (OS_GetTickCount()-tickstart > OS_GetTicksPerSecond()/2) |
|---|
| 1811 | { |
|---|
| 1812 | int new_rrt_ver = -1; |
|---|
| 1813 | |
|---|
| 1814 | tickstart = OS_GetTickCount(); |
|---|
| 1815 | |
|---|
| 1816 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 1817 | rrt = Dmc_EpgGetCurrentRrt(); |
|---|
| 1818 | if (rrt) |
|---|
| 1819 | new_rrt_ver = rrt->version_number; |
|---|
| 1820 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 1821 | |
|---|
| 1822 | if (rrt_ver != new_rrt_ver) { // rrt state changed. |
|---|
| 1823 | rrt_ver = new_rrt_ver; |
|---|
| 1824 | idim = offset = 0; |
|---|
| 1825 | sm_printf(" rrt is updated.\n"); |
|---|
| 1826 | OS_Delay(OS_GetTicksPerSecond()); |
|---|
| 1827 | goto label_begin; |
|---|
| 1828 | } |
|---|
| 1829 | } |
|---|
| 1830 | sm_process_default_key(k); |
|---|
| 1831 | |
|---|
| 1832 | continue; |
|---|
| 1833 | } |
|---|
| 1834 | |
|---|
| 1835 | rrt_invalid_err = FALSE; |
|---|
| 1836 | switch (k) |
|---|
| 1837 | { |
|---|
| 1838 | case G2H_POWER_OFF: |
|---|
| 1839 | rval = SM_EXIT_POWER; |
|---|
| 1840 | goto label_end; |
|---|
| 1841 | |
|---|
| 1842 | case G2H_BACK: |
|---|
| 1843 | case G2H_MENU: |
|---|
| 1844 | rval = SM_EXIT_BACK; |
|---|
| 1845 | goto label_end; |
|---|
| 1846 | |
|---|
| 1847 | case G2H_LEFT: // previous dimension |
|---|
| 1848 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 1849 | if (!(rrt && idim >= 0 && idim < rrt->dimensions_defined)) { |
|---|
| 1850 | rrt_invalid_err = TRUE; |
|---|
| 1851 | } |
|---|
| 1852 | else if (idim > 0) { |
|---|
| 1853 | idim--; |
|---|
| 1854 | offset = 0; // reset value offset.. |
|---|
| 1855 | } |
|---|
| 1856 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 1857 | |
|---|
| 1858 | if (rrt_invalid_err) |
|---|
| 1859 | goto label_rrt_invalid; |
|---|
| 1860 | goto label_begin; |
|---|
| 1861 | |
|---|
| 1862 | case G2H_RIGHT: // next dimension |
|---|
| 1863 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 1864 | if (!(rrt && idim >= 0 && idim < rrt->dimensions_defined)) { |
|---|
| 1865 | rrt_invalid_err = TRUE; |
|---|
| 1866 | } |
|---|
| 1867 | else if (idim+1 < rrt->dimensions_defined) { |
|---|
| 1868 | idim++; |
|---|
| 1869 | offset = 0; |
|---|
| 1870 | } |
|---|
| 1871 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 1872 | |
|---|
| 1873 | if (rrt_invalid_err) |
|---|
| 1874 | goto label_rrt_invalid; |
|---|
| 1875 | goto label_begin; |
|---|
| 1876 | |
|---|
| 1877 | case G2H_DOWN: // next value page.. |
|---|
| 1878 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 1879 | if (!(rrt && idim >= 0 && idim < rrt->dimensions_defined)) { |
|---|
| 1880 | rrt_invalid_err = TRUE; |
|---|
| 1881 | } |
|---|
| 1882 | else if (offset+10 < rrt->dimension[idim].values_defined) |
|---|
| 1883 | offset += 10; |
|---|
| 1884 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 1885 | |
|---|
| 1886 | if (rrt_invalid_err) |
|---|
| 1887 | goto label_rrt_invalid; |
|---|
| 1888 | goto label_begin; |
|---|
| 1889 | |
|---|
| 1890 | case G2H_UP: // previous value page.. |
|---|
| 1891 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 1892 | if (!(rrt && idim >= 0 && idim < rrt->dimensions_defined)) { |
|---|
| 1893 | rrt_invalid_err = TRUE; |
|---|
| 1894 | } |
|---|
| 1895 | else if (offset-10 >= 0) |
|---|
| 1896 | offset -= 10; |
|---|
| 1897 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 1898 | |
|---|
| 1899 | if (rrt_invalid_err) |
|---|
| 1900 | goto label_rrt_invalid; |
|---|
| 1901 | goto label_begin; |
|---|
| 1902 | |
|---|
| 1903 | label_rrt_invalid: |
|---|
| 1904 | if (rrt_invalid_err) { |
|---|
| 1905 | sm_printf("!! rrt dim %d, idx %d invalid\n", idim, offset); |
|---|
| 1906 | idim = offset = 0; |
|---|
| 1907 | OS_Delay(OS_GetTicksPerSecond()); |
|---|
| 1908 | } |
|---|
| 1909 | goto label_begin; |
|---|
| 1910 | |
|---|
| 1911 | case G2H_0: |
|---|
| 1912 | case G2H_1: |
|---|
| 1913 | case G2H_2: |
|---|
| 1914 | case G2H_3: |
|---|
| 1915 | case G2H_4: |
|---|
| 1916 | case G2H_5: |
|---|
| 1917 | case G2H_6: |
|---|
| 1918 | case G2H_7: |
|---|
| 1919 | case G2H_8: |
|---|
| 1920 | case G2H_9: |
|---|
| 1921 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 1922 | idx = offset + k - G2H_0; |
|---|
| 1923 | if (!(rrt && idim >= 0 && idim < rrt->dimensions_defined)) { |
|---|
| 1924 | rrt_invalid_err = TRUE; |
|---|
| 1925 | } |
|---|
| 1926 | else if (idx >= 0 && idx < rrt->dimension[idim].values_defined) |
|---|
| 1927 | { |
|---|
| 1928 | if (Dmc_EpgSetRrtOption(idim, idx, RRT_OPTION_TOGGLE)) { |
|---|
| 1929 | AppRating_CheckRatingBlock(0); |
|---|
| 1930 | AppRrt_SaveRrt(); |
|---|
| 1931 | } |
|---|
| 1932 | } |
|---|
| 1933 | else { |
|---|
| 1934 | rrt_invalid_err = TRUE; |
|---|
| 1935 | } |
|---|
| 1936 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 1937 | |
|---|
| 1938 | if (rrt_invalid_err) { |
|---|
| 1939 | sm_printf("!! rrt dim %d, value idx %d invalid\n", idim, idx); |
|---|
| 1940 | OS_Delay(OS_GetTicksPerSecond()); |
|---|
| 1941 | } |
|---|
| 1942 | goto label_begin; |
|---|
| 1943 | |
|---|
| 1944 | default: |
|---|
| 1945 | sm_process_default_key(k); |
|---|
| 1946 | break; |
|---|
| 1947 | |
|---|
| 1948 | } |
|---|
| 1949 | } |
|---|
| 1950 | |
|---|
| 1951 | label_end: |
|---|
| 1952 | |
|---|
| 1953 | return rval; |
|---|
| 1954 | |
|---|
| 1955 | } |
|---|
| 1956 | |
|---|
| 1957 | |
|---|
| 1958 | int sm_proc_epg_rating(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 1959 | { |
|---|
| 1960 | int rval; |
|---|
| 1961 | int k; |
|---|
| 1962 | int counter = 0; |
|---|
| 1963 | int upcnt; |
|---|
| 1964 | |
|---|
| 1965 | label_begin: |
|---|
| 1966 | sm_show_help(SM_KEY_BACK | SM_KEY_DIGIT); |
|---|
| 1967 | |
|---|
| 1968 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 1969 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 1970 | |
|---|
| 1971 | sm_printf("\n **** epg/rating ****\n\n"); |
|---|
| 1972 | //sm_printf(" 1: rating control: %s\n", App_CAS_GetMasterBlock() ? "ON" : "OFF"); |
|---|
| 1973 | //sm_printf(" 2: rating setting..\n"); |
|---|
| 1974 | //sm_printf(" 3: D.rating control: %s\n", App_CAS_GetDtvRatingBlock() ? "ON" : "OFF"); |
|---|
| 1975 | sm_printf(" 4: D.rating setting\n"); |
|---|
| 1976 | sm_printf(" 5: update D.rating\n"); |
|---|
| 1977 | sm_printf(" 6: reset D.rating\n"); |
|---|
| 1978 | sm_printf("\n"); |
|---|
| 1979 | |
|---|
| 1980 | while(1) |
|---|
| 1981 | { |
|---|
| 1982 | k = sm_get_key(); |
|---|
| 1983 | |
|---|
| 1984 | if (k == G2H_USER_TIMER) { |
|---|
| 1985 | counter++; |
|---|
| 1986 | //sm_show_status(SM_STAT_MASK_FE | SM_STAT_MASK_MEM); |
|---|
| 1987 | if (counter % sm_period_stat_info == 0) |
|---|
| 1988 | goto label_begin; |
|---|
| 1989 | // sm_show_status(/* SM_STAT_MASK_CH | SM_STAT_MASK_AV | */ |
|---|
| 1990 | // SM_STAT_MASK_RA /* | SM_STAT_MASK_MEM | SM_STAT_MASK_AGE */); |
|---|
| 1991 | continue; |
|---|
| 1992 | } |
|---|
| 1993 | |
|---|
| 1994 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y+9); |
|---|
| 1995 | |
|---|
| 1996 | switch (k) |
|---|
| 1997 | { |
|---|
| 1998 | case G2H_POWER_OFF: |
|---|
| 1999 | return SM_EXIT_POWER; |
|---|
| 2000 | |
|---|
| 2001 | case G2H_BACK: |
|---|
| 2002 | case G2H_MENU: |
|---|
| 2003 | return SM_EXIT_BACK; |
|---|
| 2004 | |
|---|
| 2005 | //case G2H_1: |
|---|
| 2006 | // App_CAS_SetMasterBlock(App_CAS_GetMasterBlock() ? 0 : 1, TRUE); |
|---|
| 2007 | // goto label_begin; |
|---|
| 2008 | |
|---|
| 2009 | //case G2H_2: |
|---|
| 2010 | // sm_proc_rating_setting(); |
|---|
| 2011 | // goto label_begin; |
|---|
| 2012 | |
|---|
| 2013 | //case G2H_3: |
|---|
| 2014 | // App_CAS_SetDtvRatingBlock(App_CAS_GetDtvRatingBlock() ? 0 : 1, TRUE); |
|---|
| 2015 | // goto label_begin; |
|---|
| 2016 | |
|---|
| 2017 | case G2H_4: |
|---|
| 2018 | { |
|---|
| 2019 | rrtSectionPtr_t rrt; |
|---|
| 2020 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 2021 | rrt = Dmc_EpgGetCurrentRrt(); |
|---|
| 2022 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 2023 | if (rrt == NULL) { |
|---|
| 2024 | sm_printf("!! rrt not ready\n"); |
|---|
| 2025 | OS_Delay(OS_GetTicksPerSecond()*2); |
|---|
| 2026 | } |
|---|
| 2027 | else { |
|---|
| 2028 | rval = sm_proc_d_rating_setting(); |
|---|
| 2029 | if (rval == G2H_POWER_OFF) |
|---|
| 2030 | return SM_EXIT_POWER; |
|---|
| 2031 | } |
|---|
| 2032 | } |
|---|
| 2033 | goto label_begin; |
|---|
| 2034 | |
|---|
| 2035 | case G2H_5: |
|---|
| 2036 | if (1) |
|---|
| 2037 | { |
|---|
| 2038 | rrtSectionPtr_t rrt; |
|---|
| 2039 | int ver = -1; |
|---|
| 2040 | UINT32 tickStart; |
|---|
| 2041 | int nElapsedSec, nLastMsgPrintSec = 0; |
|---|
| 2042 | int timeoutSec = 30; |
|---|
| 2043 | |
|---|
| 2044 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 2045 | rrt = Dmc_EpgGetCurrentRrt(); |
|---|
| 2046 | if (rrt) |
|---|
| 2047 | ver = rrt->version_number; |
|---|
| 2048 | upcnt = Dmc_EpgCurrentRrtUpdateCount(); |
|---|
| 2049 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 2050 | |
|---|
| 2051 | Dmc_EpgRrtForceUpdateMode(TRUE); |
|---|
| 2052 | sm_printf(" cur update count %d, ver %d\n", upcnt, ver); |
|---|
| 2053 | sm_printf(" press MENU to cancel update\n"); |
|---|
| 2054 | |
|---|
| 2055 | tickStart = OS_GetTickCount(); |
|---|
| 2056 | while(1) |
|---|
| 2057 | { |
|---|
| 2058 | k = sm_get_key(); |
|---|
| 2059 | |
|---|
| 2060 | if (k == G2H_POWER_OFF) |
|---|
| 2061 | return SM_EXIT_POWER; // º°´Ù¸£°Ô ó¸®ÇÒ °Íµé ¾øÀ½.. |
|---|
| 2062 | else if (k == G2H_MENU) |
|---|
| 2063 | break; // ±×³É ³ª°¡±â¸¸ Çϸé loop ¹Û¿¡¼ ó¸®.. |
|---|
| 2064 | else // if (k == G2H_USER_TIMER) |
|---|
| 2065 | { |
|---|
| 2066 | if (upcnt != Dmc_EpgCurrentRrtUpdateCount()) |
|---|
| 2067 | break; // rrt updated. |
|---|
| 2068 | if (OS_GetTickCount()-tickStart >= OS_GetTicksPerSecond()*timeoutSec) |
|---|
| 2069 | break; // timeout! |
|---|
| 2070 | |
|---|
| 2071 | nElapsedSec = (OS_GetTickCount()-tickStart)/OS_GetTicksPerSecond(); |
|---|
| 2072 | if (nElapsedSec != nLastMsgPrintSec) { |
|---|
| 2073 | sm_clrbox(sm_cur_pos_x, sm_cur_pos_y, 70, 1); |
|---|
| 2074 | sm_printf(" wait for %d seconds.. \r", timeoutSec-nElapsedSec); |
|---|
| 2075 | nLastMsgPrintSec = nElapsedSec; |
|---|
| 2076 | } |
|---|
| 2077 | continue; |
|---|
| 2078 | } |
|---|
| 2079 | } |
|---|
| 2080 | |
|---|
| 2081 | if (upcnt == Dmc_EpgCurrentRrtUpdateCount()) { |
|---|
| 2082 | sm_printf("\n rrt update failed\n"); |
|---|
| 2083 | Dmc_EpgRrtForceUpdateMode(FALSE); |
|---|
| 2084 | OS_Delay(OS_GetTicksPerSecond()*2); |
|---|
| 2085 | } |
|---|
| 2086 | else { |
|---|
| 2087 | ver = -1; |
|---|
| 2088 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 2089 | rrt = Dmc_EpgGetCurrentRrt(); |
|---|
| 2090 | if (rrt) |
|---|
| 2091 | ver = rrt->version_number; |
|---|
| 2092 | upcnt = Dmc_EpgCurrentRrtUpdateCount(); |
|---|
| 2093 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 2094 | sm_printf("\n rrt updated. update cnt %d, ver %d\n", |
|---|
| 2095 | upcnt, ver); |
|---|
| 2096 | OS_Delay(OS_GetTicksPerSecond()*2); |
|---|
| 2097 | } |
|---|
| 2098 | } |
|---|
| 2099 | goto label_begin; |
|---|
| 2100 | |
|---|
| 2101 | case G2H_6: |
|---|
| 2102 | Dmc_EpgLockRrtDB(TRUE, TRUE); |
|---|
| 2103 | Dmc_EpgSetCurrentRrt(NULL); |
|---|
| 2104 | Dmc_EpgLockRrtDB(FALSE, TRUE); |
|---|
| 2105 | sm_printf("\n rrt is cleared\n"); |
|---|
| 2106 | goto label_begin; |
|---|
| 2107 | |
|---|
| 2108 | default: |
|---|
| 2109 | sm_process_default_key(k); |
|---|
| 2110 | break; |
|---|
| 2111 | |
|---|
| 2112 | } |
|---|
| 2113 | } |
|---|
| 2114 | |
|---|
| 2115 | } |
|---|
| 2116 | |
|---|
| 2117 | #endif |
|---|
| 2118 | |
|---|
| 2119 | |
|---|
| 2120 | #if COMMENT |
|---|
| 2121 | ____debug____(){} |
|---|
| 2122 | #endif |
|---|
| 2123 | |
|---|
| 2124 | |
|---|
| 2125 | #if 0 |
|---|
| 2126 | |
|---|
| 2127 | /* |
|---|
| 2128 | cafrii 070730, |
|---|
| 2129 | auto system reboot ±â´ÉÀ» on/off ÇÒ ¼ö ÀÖ´Â ¸Þ´º Ãß°¡ |
|---|
| 2130 | */ |
|---|
| 2131 | |
|---|
| 2132 | UINT32 sm_read_debug_autoreset(void) |
|---|
| 2133 | { |
|---|
| 2134 | BOOL bReady = 0x33; // to check no_change |
|---|
| 2135 | DHL_SYS_SystemCommand(DHL_SYS_QUERY_PRE_RESET, (UINT32)&bReady); |
|---|
| 2136 | |
|---|
| 2137 | if (bReady == 0x33) |
|---|
| 2138 | OS_DbgPrintf("!! DHL_SYS_QUERY_PRE_RESET not impl\n"); |
|---|
| 2139 | |
|---|
| 2140 | return bReady ? 1 : 0; |
|---|
| 2141 | } |
|---|
| 2142 | |
|---|
| 2143 | void sm_write_debug_autoreset(UINT32 value) |
|---|
| 2144 | { |
|---|
| 2145 | DHL_SYS_SystemCommand(DHL_SYS_PRE_RESET, value ? 1 : 0); |
|---|
| 2146 | } |
|---|
| 2147 | |
|---|
| 2148 | |
|---|
| 2149 | UINT32 sm_read_debug_sigcheckmode(void) |
|---|
| 2150 | { |
|---|
| 2151 | return App_GetSigMonParam(PNX_SM_PARAM_SKIP_LOW_SIG_MODE) ? 1 : 0; |
|---|
| 2152 | } |
|---|
| 2153 | |
|---|
| 2154 | void sm_write_debug_sigcheckmode(UINT32 value) |
|---|
| 2155 | { |
|---|
| 2156 | App_ChangeSigMonParam(PNX_SM_PARAM_SKIP_LOW_SIG_MODE, value ? 1 : 0); |
|---|
| 2157 | } |
|---|
| 2158 | |
|---|
| 2159 | // chjeon 071005 add |
|---|
| 2160 | // Watchdog Á¦¾î ÇÔ¼ö Ãß°¡ |
|---|
| 2161 | BOOL sm_read_debug_watchdogmode() |
|---|
| 2162 | { |
|---|
| 2163 | return DHL_IsWatchdogEnabled(); |
|---|
| 2164 | } |
|---|
| 2165 | |
|---|
| 2166 | void sm_write_debug_watchdogmode(UINT32 value) |
|---|
| 2167 | { |
|---|
| 2168 | if(value) |
|---|
| 2169 | DHL_EnableWatchdog(); |
|---|
| 2170 | else |
|---|
| 2171 | DHL_DisableWatchdog(); |
|---|
| 2172 | } |
|---|
| 2173 | |
|---|
| 2174 | |
|---|
| 2175 | |
|---|
| 2176 | // cafrii 070713, make to variable |
|---|
| 2177 | //#define NUM_DEBUG_OPTION_PAGE 3 |
|---|
| 2178 | int NUM_DEBUG_OPTION_PAGE; |
|---|
| 2179 | |
|---|
| 2180 | void sm_show_change_debug_option(int page, int choice, BOOL bIncrease) |
|---|
| 2181 | { |
|---|
| 2182 | int i, k; |
|---|
| 2183 | char buf_d[100]; |
|---|
| 2184 | DHL_RESULT dhlResult; |
|---|
| 2185 | |
|---|
| 2186 | typedef struct |
|---|
| 2187 | { |
|---|
| 2188 | char *desc; |
|---|
| 2189 | |
|---|
| 2190 | char *name; // if option is variable.. |
|---|
| 2191 | |
|---|
| 2192 | UINT32 (*read_fn)(void); // if option is function.. |
|---|
| 2193 | void (*write_fn)(UINT32); |
|---|
| 2194 | |
|---|
| 2195 | int step; |
|---|
| 2196 | int minval, maxval; |
|---|
| 2197 | |
|---|
| 2198 | } SM_DEBUG_OPTION_INFO; |
|---|
| 2199 | |
|---|
| 2200 | typedef struct |
|---|
| 2201 | { |
|---|
| 2202 | int size; |
|---|
| 2203 | SM_DEBUG_OPTION_INFO list[10]; |
|---|
| 2204 | |
|---|
| 2205 | } SM_DEBUG_OPTION_PAGE; |
|---|
| 2206 | |
|---|
| 2207 | SM_DEBUG_OPTION_PAGE OpPageList[] = |
|---|
| 2208 | { |
|---|
| 2209 | 9, |
|---|
| 2210 | { |
|---|
| 2211 | { "Channel MW (DmcMain)", "g_Trace_DmcMain", 0, 0, 1, 1, 4, }, |
|---|
| 2212 | { "Channel MW (Scan)", "g_Trace_ChannelScan", 0, 0, 1, 1, 4, }, |
|---|
| 2213 | { "Channel MW (NvRam)", "g_Trace_NvRamDebug", 0, 0, 1, 1, 4, }, |
|---|
| 2214 | { "DHL AVCAP", "g_Trace_DHLAVCAP", 0, 0, 1, 1, 4, }, |
|---|
| 2215 | { "EPG MW (Base)", "g_Trace_EpgBase", 0, 0, 1, 1, 4, }, |
|---|
| 2216 | { "EPG MW (Interface)", "g_Trace_EpgIntf", 0, 0, 1, 1, 4, }, |
|---|
| 2217 | |
|---|
| 2218 | //{ "Demux leak Trap", "g_Test_CheckDemuxAllFree", 0, 0, 1, 0, 1, }, |
|---|
| 2219 | { "Rating 4->1 fake", "g_bUseRatingRegion4AsRegion1", 0, 0, 1, 0, 1, }, |
|---|
| 2220 | { "RRT 4->5 fake", "gUseRrtRegion4AsRegion5", 0, 0, 1, 0, 1, }, |
|---|
| 2221 | }, |
|---|
| 2222 | |
|---|
| 2223 | 7, |
|---|
| 2224 | { |
|---|
| 2225 | { "Signal Check Mode", 0, |
|---|
| 2226 | sm_read_debug_sigcheckmode, |
|---|
| 2227 | sm_write_debug_sigcheckmode, |
|---|
| 2228 | 1, 0, 1, }, |
|---|
| 2229 | |
|---|
| 2230 | // cafrii 070912 add. in level 3, signal status is shown on screen. |
|---|
| 2231 | { "Signal Status Display", 0, |
|---|
| 2232 | (UINT32 (*)(void))SigMon_GetDbgLevel, |
|---|
| 2233 | (void (*)(UINT32))SigMon_SetDbgLevel, |
|---|
| 2234 | 1, 0, 3, }, |
|---|
| 2235 | |
|---|
| 2236 | // cafrii 071122 add |
|---|
| 2237 | { "SNR window size", "g_dhl_snr_window", 0, 0, 1, 1, 8, }, |
|---|
| 2238 | |
|---|
| 2239 | { "AutoScan Signal Lock Timeout Override", "g_Timeout_AutoscanLock", 0, 0, 100, 0, 3000, }, |
|---|
| 2240 | // autoscan signal lock timeout. 0 ~ 3 second. |
|---|
| 2241 | // 0 means that default value |
|---|
| 2242 | |
|---|
| 2243 | { "Auto Reboot when system reset", 0, |
|---|
| 2244 | (UINT32 (*)(void))sm_read_debug_autoreset, |
|---|
| 2245 | (void (*)(UINT32))sm_write_debug_autoreset, |
|---|
| 2246 | 1, 0, 1, }, |
|---|
| 2247 | |
|---|
| 2248 | // chjeon 071005 add |
|---|
| 2249 | { "Enable Watchdog", 0, |
|---|
| 2250 | (UINT32 (*)(void))sm_read_debug_watchdogmode, |
|---|
| 2251 | (void (*)(UINT32))sm_write_debug_watchdogmode, |
|---|
| 2252 | 1, 0, 1, }, |
|---|
| 2253 | |
|---|
| 2254 | // cafrii 080212 add |
|---|
| 2255 | { "Power down step delay (ms)", "g_App_nPowerDownStepDelay", 0, 0, 100, 0, 5000, }, |
|---|
| 2256 | }, |
|---|
| 2257 | |
|---|
| 2258 | 0, |
|---|
| 2259 | }; |
|---|
| 2260 | |
|---|
| 2261 | SM_DEBUG_OPTION_INFO *OpList; |
|---|
| 2262 | int OpListSize; |
|---|
| 2263 | |
|---|
| 2264 | int nPage = sizeof(OpPageList)/sizeof(OpPageList[0]); |
|---|
| 2265 | |
|---|
| 2266 | // decide actual number of page. |
|---|
| 2267 | for (k=0; k<nPage; k++) { |
|---|
| 2268 | if (OpPageList[k].size == 0) { |
|---|
| 2269 | nPage = k; |
|---|
| 2270 | break; |
|---|
| 2271 | } |
|---|
| 2272 | } |
|---|
| 2273 | NUM_DEBUG_OPTION_PAGE = nPage; |
|---|
| 2274 | |
|---|
| 2275 | sm_show_help(SM_KEY_BACK | SM_KEY_DIGIT); |
|---|
| 2276 | |
|---|
| 2277 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 2278 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 2279 | |
|---|
| 2280 | if (nPage <= 0) { |
|---|
| 2281 | sm_printf("\n No page\n"); |
|---|
| 2282 | return; |
|---|
| 2283 | } |
|---|
| 2284 | |
|---|
| 2285 | page = page % nPage; |
|---|
| 2286 | |
|---|
| 2287 | OpList = OpPageList[page].list; |
|---|
| 2288 | OpListSize = OpPageList[page].size; |
|---|
| 2289 | |
|---|
| 2290 | sm_printf("\n"); |
|---|
| 2291 | sm_printf(" Show/Change Debug Options, %s, page %d of %d\n", |
|---|
| 2292 | bIncrease ? "increase" : "decrease", page+1, NUM_DEBUG_OPTION_PAGE); |
|---|
| 2293 | sm_printf("\n"); |
|---|
| 2294 | |
|---|
| 2295 | sprintf(buf_d, " %%d. %%-%ds %%d\n", SM_SEL_WIN_W-30); |
|---|
| 2296 | |
|---|
| 2297 | // ù¹øÂ°¿¡´Â º¯°æ °ªÀ» Àû¿ëÇϰí, µÎ¹øÂ°¿¡´Â list |
|---|
| 2298 | // |
|---|
| 2299 | for (k=0; k<2; k++) |
|---|
| 2300 | { |
|---|
| 2301 | // k:0 --> query and change value |
|---|
| 2302 | // k:1 --> query and show value |
|---|
| 2303 | |
|---|
| 2304 | for (i=0; i<OpListSize; i++) |
|---|
| 2305 | { |
|---|
| 2306 | void *ptr; int type; |
|---|
| 2307 | UINT32 val; |
|---|
| 2308 | |
|---|
| 2309 | if (OpList[i].name) // variable option |
|---|
| 2310 | { |
|---|
| 2311 | dhlResult = DHL_DBG_QuerySymbol(OpList[i].name, &ptr, &type); |
|---|
| 2312 | |
|---|
| 2313 | if (dhlResult != DHL_OK) |
|---|
| 2314 | continue; |
|---|
| 2315 | |
|---|
| 2316 | if (ptr == NULL || (type != DHL_SYM_V1 && type != DHL_SYM_V2 && type != DHL_SYM_V4)) |
|---|
| 2317 | continue; |
|---|
| 2318 | |
|---|
| 2319 | // read current option values. |
|---|
| 2320 | if (type == DHL_SYM_V1) |
|---|
| 2321 | val = *(UINT8 *)ptr; |
|---|
| 2322 | else if (type == DHL_SYM_V2) |
|---|
| 2323 | val = *(UINT16 *)ptr; |
|---|
| 2324 | else |
|---|
| 2325 | val = *(UINT32 *)ptr; |
|---|
| 2326 | |
|---|
| 2327 | if (k == 0 && choice == i) // ù¹øÂ° loop¿¡¼´Â value º¯°æ. |
|---|
| 2328 | { |
|---|
| 2329 | if (bIncrease) { |
|---|
| 2330 | // change to next value, wrap-around |
|---|
| 2331 | if (val == OpList[i].maxval) |
|---|
| 2332 | val = OpList[i].minval; |
|---|
| 2333 | else |
|---|
| 2334 | val = (val+OpList[i].step) > OpList[i].maxval ? OpList[i].maxval : (val+OpList[i].step); |
|---|
| 2335 | } |
|---|
| 2336 | else { |
|---|
| 2337 | if (val == OpList[i].minval) |
|---|
| 2338 | val = OpList[i].maxval; |
|---|
| 2339 | else |
|---|
| 2340 | val = ((int)val-OpList[i].step) < OpList[i].minval ? OpList[i].minval : (val-OpList[i].step); |
|---|
| 2341 | } |
|---|
| 2342 | |
|---|
| 2343 | if (type == DHL_SYM_V1) |
|---|
| 2344 | *(UINT8 *)ptr = val; |
|---|
| 2345 | else if (type == DHL_SYM_V2) |
|---|
| 2346 | *(UINT16 *)ptr = val; |
|---|
| 2347 | else |
|---|
| 2348 | *(UINT32 *)ptr = val; |
|---|
| 2349 | } |
|---|
| 2350 | } |
|---|
| 2351 | else // function option |
|---|
| 2352 | { |
|---|
| 2353 | if (OpList[i].read_fn == NULL || OpList[i].write_fn == NULL) |
|---|
| 2354 | continue; |
|---|
| 2355 | |
|---|
| 2356 | val = (OpList[i].read_fn)(); |
|---|
| 2357 | |
|---|
| 2358 | if (k == 0 && choice == i) |
|---|
| 2359 | { |
|---|
| 2360 | if (bIncrease) { |
|---|
| 2361 | // change to next value, wrap-around |
|---|
| 2362 | if (val == OpList[i].maxval) |
|---|
| 2363 | val = OpList[i].minval; |
|---|
| 2364 | else |
|---|
| 2365 | val = (val+OpList[i].step) > OpList[i].maxval ? OpList[i].maxval : (val+OpList[i].step); |
|---|
| 2366 | } |
|---|
| 2367 | else { |
|---|
| 2368 | if (val == OpList[i].minval) |
|---|
| 2369 | val = OpList[i].maxval; |
|---|
| 2370 | else |
|---|
| 2371 | val = ((int)val-OpList[i].step) < OpList[i].minval ? OpList[i].minval : (val-OpList[i].step); |
|---|
| 2372 | } |
|---|
| 2373 | |
|---|
| 2374 | (OpList[i].write_fn)(val); |
|---|
| 2375 | } |
|---|
| 2376 | } |
|---|
| 2377 | |
|---|
| 2378 | if (k == 1) |
|---|
| 2379 | sm_printf(buf_d, i, OpList[i].desc, val); |
|---|
| 2380 | |
|---|
| 2381 | if (sm_cur_pos_y >= SM_SEL_WIN_Y + SM_SEL_WIN_H) |
|---|
| 2382 | break; |
|---|
| 2383 | } |
|---|
| 2384 | } |
|---|
| 2385 | |
|---|
| 2386 | } |
|---|
| 2387 | |
|---|
| 2388 | int sm_proc_debug_option(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 2389 | { |
|---|
| 2390 | int k; |
|---|
| 2391 | int page = 0; |
|---|
| 2392 | BOOL bIncrease = 1; |
|---|
| 2393 | |
|---|
| 2394 | label_begin: |
|---|
| 2395 | sm_show_change_debug_option(page, -1, bIncrease); |
|---|
| 2396 | sm_show_help(SM_KEY_DIGIT | SM_KEY_BACK); |
|---|
| 2397 | |
|---|
| 2398 | while(1) |
|---|
| 2399 | { |
|---|
| 2400 | k = sm_get_key(); |
|---|
| 2401 | |
|---|
| 2402 | switch (k) |
|---|
| 2403 | { |
|---|
| 2404 | case G2H_POWER_OFF: |
|---|
| 2405 | return SM_EXIT_POWER; |
|---|
| 2406 | |
|---|
| 2407 | case G2H_BACK: |
|---|
| 2408 | case G2H_MENU: |
|---|
| 2409 | return SM_EXIT_BACK; |
|---|
| 2410 | |
|---|
| 2411 | case G2H_LEFT: |
|---|
| 2412 | if (page > 0) page--; |
|---|
| 2413 | goto label_begin; |
|---|
| 2414 | |
|---|
| 2415 | case G2H_RIGHT: |
|---|
| 2416 | if (page < NUM_DEBUG_OPTION_PAGE-1) page++; |
|---|
| 2417 | goto label_begin; |
|---|
| 2418 | |
|---|
| 2419 | case G2H_SELECT: |
|---|
| 2420 | case G2H_UP: // OK ۰¡ ¾ø´Â ½Ã½ºÅÛÀ» À§ÇÑ °í·Á. |
|---|
| 2421 | case G2H_DOWN: |
|---|
| 2422 | bIncrease = bIncrease ? 0 : 1; |
|---|
| 2423 | goto label_begin; |
|---|
| 2424 | |
|---|
| 2425 | case G2H_0: |
|---|
| 2426 | case G2H_1: |
|---|
| 2427 | case G2H_2: |
|---|
| 2428 | case G2H_3: |
|---|
| 2429 | case G2H_4: |
|---|
| 2430 | case G2H_5: |
|---|
| 2431 | case G2H_6: |
|---|
| 2432 | case G2H_7: |
|---|
| 2433 | case G2H_8: |
|---|
| 2434 | case G2H_9: |
|---|
| 2435 | sm_show_change_debug_option(page, k-G2H_0, bIncrease); |
|---|
| 2436 | break; |
|---|
| 2437 | |
|---|
| 2438 | default: |
|---|
| 2439 | sm_process_default_key(k); |
|---|
| 2440 | break; |
|---|
| 2441 | } |
|---|
| 2442 | } |
|---|
| 2443 | } |
|---|
| 2444 | |
|---|
| 2445 | #endif |
|---|
| 2446 | |
|---|
| 2447 | |
|---|
| 2448 | |
|---|
| 2449 | #if COMMENT |
|---|
| 2450 | ____video____(){} |
|---|
| 2451 | #endif |
|---|
| 2452 | |
|---|
| 2453 | #if 0 |
|---|
| 2454 | |
|---|
| 2455 | #define SM_ADJ_RNG(a,mn,mx) ((a)<(mn) ? (mn) : (a)>(mx) ? (mx) : (a)) |
|---|
| 2456 | |
|---|
| 2457 | void sm_set_color_param(SM_VIDEO_CAL_PARAM param, int value) |
|---|
| 2458 | { |
|---|
| 2459 | SINT16 data; // À̸§Àº SINT16 ÀÌÁö¸¸ ½ÇÁ¦·Î °Ç³×ÁÙ µ¥ÀÌÅÍ´Â unsigned ÀÌ´Ù. |
|---|
| 2460 | |
|---|
| 2461 | // À¯È¿ÇÑ rangeÀÎÁö üũÇÑ ÈÄ¿¡ unsigned data·Î º¯È¯ÇÏ¿© ¼³Á¤. |
|---|
| 2462 | |
|---|
| 2463 | if (param == VDP_VB_TYPE_HUE) { |
|---|
| 2464 | // 6 bit signed, -32 ~ 31 [0] |
|---|
| 2465 | value = SM_ADJ_RNG(value, -32, 31); |
|---|
| 2466 | data = 0x3f & (UINT32)(value); |
|---|
| 2467 | } |
|---|
| 2468 | else if (param == VDP_VB_TYPE_CONTRAST) { |
|---|
| 2469 | // 8 bit unsigned, 0 ~ 255 [128] |
|---|
| 2470 | value = SM_ADJ_RNG(value, 0, 255); |
|---|
| 2471 | data = 0xff & (UINT32)(value); |
|---|
| 2472 | } |
|---|
| 2473 | else if (param == VDP_VB_TYPE_BRIGHTNESS) { |
|---|
| 2474 | // 8 bit signed, -128 ~ 127 [0] |
|---|
| 2475 | value = SM_ADJ_RNG(value, -128, 127); |
|---|
| 2476 | data = 0xff & (UINT32)(value); |
|---|
| 2477 | } |
|---|
| 2478 | else |
|---|
| 2479 | return; |
|---|
| 2480 | |
|---|
| 2481 | OS_DbgPrintf(" -- value %d --> %u, 0x%x\n", value, data, data); |
|---|
| 2482 | VDP_SetPicParam(param, data); |
|---|
| 2483 | } |
|---|
| 2484 | |
|---|
| 2485 | int sm_get_color_param(SM_VIDEO_CAL_PARAM param) |
|---|
| 2486 | { |
|---|
| 2487 | int value = 0; |
|---|
| 2488 | UINT32 data = VDP_GetPicParam(param); |
|---|
| 2489 | |
|---|
| 2490 | if (param == VDP_VB_TYPE_HUE) { |
|---|
| 2491 | // sign bit extension. |
|---|
| 2492 | // 6 bit. bit[5] is sign bit. |
|---|
| 2493 | value = (data & 0x20) ? (int)((data & 0x3f) | 0xffffffc0) : (data & 0x1f); |
|---|
| 2494 | } |
|---|
| 2495 | else if (param == VDP_VB_TYPE_CONTRAST) { |
|---|
| 2496 | value = (data & 0xff); |
|---|
| 2497 | } |
|---|
| 2498 | else if (param == VDP_VB_TYPE_BRIGHTNESS) { |
|---|
| 2499 | // sign bit extension. |
|---|
| 2500 | // 8 bit. |
|---|
| 2501 | value = (int)(signed char)(data & 0xff); |
|---|
| 2502 | } |
|---|
| 2503 | return value; |
|---|
| 2504 | } |
|---|
| 2505 | |
|---|
| 2506 | char *sm_color_param_str(SM_VIDEO_CAL_PARAM param) |
|---|
| 2507 | { |
|---|
| 2508 | return |
|---|
| 2509 | param == VDP_VB_TYPE_HUE ? "Hue" : |
|---|
| 2510 | param == VDP_VB_TYPE_CONTRAST ? "Contrast" : |
|---|
| 2511 | param == VDP_VB_TYPE_BRIGHTNESS ? "Brightness" : |
|---|
| 2512 | "?"; |
|---|
| 2513 | } |
|---|
| 2514 | |
|---|
| 2515 | /* |
|---|
| 2516 | color paramter¸¦ Àû¿ëÇÏ´Â ºÎºÐ.. |
|---|
| 2517 | |
|---|
| 2518 | µðÆúÆ® ó¸® ·çƾÀÌ ¾øÀ¸¹Ç·Î ÁöÁ¤ÇÑ Å° À̿ܿ¡´Â µ¿ÀÛÇÏÁö ¾ÊÀ½. |
|---|
| 2519 | |
|---|
| 2520 | Á¿ì Ű·Î color parameter Á¶Á¤. |
|---|
| 2521 | »óÇÏ Å°·Î ±ÛÀÚ Ãâ·Â À§Ä¡ Á¶Á¤. (À§ ¾Æ·¡¸¸) |
|---|
| 2522 | */ |
|---|
| 2523 | int sm_apply_color_param(SM_VIDEO_CAL_PARAM param) |
|---|
| 2524 | { |
|---|
| 2525 | int pos_x = 10, pos_y = SM_VERT/2; |
|---|
| 2526 | int k; |
|---|
| 2527 | int value, org_value; |
|---|
| 2528 | char *guide_msg = "[OK] to set, [BACK] to cancel"; |
|---|
| 2529 | |
|---|
| 2530 | org_value = sm_get_color_param(param); |
|---|
| 2531 | |
|---|
| 2532 | label_begin: |
|---|
| 2533 | |
|---|
| 2534 | sm_clrscr(); |
|---|
| 2535 | sm_clrbox(pos_x, pos_y, 60, 1); |
|---|
| 2536 | sm_gotoxy(pos_x, pos_y); |
|---|
| 2537 | sm_printf(" %s : %d %s ", |
|---|
| 2538 | sm_color_param_str(param), value = sm_get_color_param(param), |
|---|
| 2539 | guide_msg); |
|---|
| 2540 | |
|---|
| 2541 | while(1) |
|---|
| 2542 | { |
|---|
| 2543 | k = sm_get_key(); |
|---|
| 2544 | |
|---|
| 2545 | switch (k) |
|---|
| 2546 | { |
|---|
| 2547 | case G2H_POWER_OFF: |
|---|
| 2548 | return SM_EXIT_POWER; |
|---|
| 2549 | |
|---|
| 2550 | case G2H_BACK: |
|---|
| 2551 | case G2H_MENU: |
|---|
| 2552 | sm_set_color_param(param, org_value); |
|---|
| 2553 | return SM_EXIT_BACK; |
|---|
| 2554 | |
|---|
| 2555 | case G2H_SELECT: |
|---|
| 2556 | case G2H_0: // OK ۰¡ ¾ø´Â ½Ã½ºÅÛÀ» À§ÇÑ °í·Á. |
|---|
| 2557 | return SM_EXIT_BACK; |
|---|
| 2558 | |
|---|
| 2559 | case G2H_LEFT: |
|---|
| 2560 | //case G2H_LEFT_CONT: |
|---|
| 2561 | sm_set_color_param(param, --value); |
|---|
| 2562 | goto label_begin; |
|---|
| 2563 | |
|---|
| 2564 | case G2H_RIGHT: |
|---|
| 2565 | //case G2H_RIGHT_CONT: |
|---|
| 2566 | sm_set_color_param(param, ++value); |
|---|
| 2567 | goto label_begin; |
|---|
| 2568 | |
|---|
| 2569 | case G2H_UP: |
|---|
| 2570 | //case G2H_UP_CONT: |
|---|
| 2571 | if (pos_y > 0) |
|---|
| 2572 | pos_y--; |
|---|
| 2573 | goto label_begin; |
|---|
| 2574 | |
|---|
| 2575 | case G2H_DOWN: |
|---|
| 2576 | //case G2H_DOWN_CONT: |
|---|
| 2577 | if (pos_y < SM_VERT-1) |
|---|
| 2578 | pos_y++; |
|---|
| 2579 | goto label_begin; |
|---|
| 2580 | } |
|---|
| 2581 | } |
|---|
| 2582 | } |
|---|
| 2583 | |
|---|
| 2584 | |
|---|
| 2585 | |
|---|
| 2586 | |
|---|
| 2587 | #define NUM_COLOR_PARAM_PAGE 1 |
|---|
| 2588 | |
|---|
| 2589 | static |
|---|
| 2590 | struct { |
|---|
| 2591 | int n_param; |
|---|
| 2592 | SM_VIDEO_CAL_PARAM paramList[10]; |
|---|
| 2593 | } paramTable[NUM_COLOR_PARAM_PAGE] = |
|---|
| 2594 | { |
|---|
| 2595 | // page 0 |
|---|
| 2596 | 3, { |
|---|
| 2597 | VDP_VB_TYPE_HUE, |
|---|
| 2598 | VDP_VB_TYPE_CONTRAST, |
|---|
| 2599 | VDP_VB_TYPE_BRIGHTNESS, |
|---|
| 2600 | }, |
|---|
| 2601 | |
|---|
| 2602 | }; |
|---|
| 2603 | |
|---|
| 2604 | int sm_show_change_color_param(UINT32 page, int index) |
|---|
| 2605 | { |
|---|
| 2606 | // index°¡ À½¼öÀÌ¸é ±×³É ÇöÀç ¸Þ´º¸¦ º¸¿©ÁØ´Ù. |
|---|
| 2607 | |
|---|
| 2608 | int i, rval; |
|---|
| 2609 | |
|---|
| 2610 | page = page % NUM_COLOR_PARAM_PAGE; |
|---|
| 2611 | |
|---|
| 2612 | if (index >= 0 && index < paramTable[page].n_param) |
|---|
| 2613 | { |
|---|
| 2614 | // apply mode!! |
|---|
| 2615 | rval = sm_apply_color_param(paramTable[page].paramList[index]); |
|---|
| 2616 | return rval; |
|---|
| 2617 | } |
|---|
| 2618 | |
|---|
| 2619 | // show menu.. |
|---|
| 2620 | |
|---|
| 2621 | //sm_show_help(SM_KEY_BACK | SM_KEY_DIGIT | SM_KEY_SEL); |
|---|
| 2622 | |
|---|
| 2623 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 2624 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 2625 | |
|---|
| 2626 | #if 0 |
|---|
| 2627 | sm_printf("\n Calibration target: %s\n", |
|---|
| 2628 | g_sm_target_cscsel == CSCSel_Video ? "Video" : |
|---|
| 2629 | g_sm_target_cscsel == CSCSel_GfxRGB ? "GfxRGB" : |
|---|
| 2630 | g_sm_target_cscsel == CSCSel_GfxYCbCr ? "GfxYCbCr" : "?"); |
|---|
| 2631 | #endif |
|---|
| 2632 | |
|---|
| 2633 | sm_printf("\n Video PQ parameter setting, page %d of %d\n\n", page+1, NUM_COLOR_PARAM_PAGE); |
|---|
| 2634 | |
|---|
| 2635 | for (i=0; i<paramTable[page].n_param; i++) |
|---|
| 2636 | sm_printf(" %d. %s: %d\n", i, |
|---|
| 2637 | sm_color_param_str(paramTable[page].paramList[i]), |
|---|
| 2638 | sm_get_color_param(paramTable[page].paramList[i])); |
|---|
| 2639 | |
|---|
| 2640 | return SM_EXIT_BACK; |
|---|
| 2641 | } |
|---|
| 2642 | |
|---|
| 2643 | |
|---|
| 2644 | int sm_proc_video_color(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 2645 | { |
|---|
| 2646 | int rval; |
|---|
| 2647 | int k; |
|---|
| 2648 | int page = 0; |
|---|
| 2649 | |
|---|
| 2650 | label_begin: |
|---|
| 2651 | |
|---|
| 2652 | sm_show_change_color_param(page, -1); |
|---|
| 2653 | sm_show_help(SM_KEY_DIGIT | SM_KEY_BACK | SM_KEY_LFRG | SM_KEY_SEL); |
|---|
| 2654 | |
|---|
| 2655 | while(1) |
|---|
| 2656 | { |
|---|
| 2657 | k = sm_get_key(); |
|---|
| 2658 | |
|---|
| 2659 | switch (k) |
|---|
| 2660 | { |
|---|
| 2661 | case G2H_POWER_OFF: |
|---|
| 2662 | return SM_EXIT_POWER; |
|---|
| 2663 | |
|---|
| 2664 | case G2H_BACK: |
|---|
| 2665 | case G2H_MENU: |
|---|
| 2666 | return SM_EXIT_BACK; |
|---|
| 2667 | |
|---|
| 2668 | case G2H_LEFT: |
|---|
| 2669 | if (page > 0) page--; |
|---|
| 2670 | goto label_begin; |
|---|
| 2671 | |
|---|
| 2672 | case G2H_RIGHT: |
|---|
| 2673 | if (page < NUM_COLOR_PARAM_PAGE-1) page++; |
|---|
| 2674 | goto label_begin; |
|---|
| 2675 | |
|---|
| 2676 | #if 0 |
|---|
| 2677 | case G2H_SELECT: |
|---|
| 2678 | case G2H_UP: // OK ۰¡ ¾ø´Â ½Ã½ºÅÛÀ» À§ÇÑ °í·Á. |
|---|
| 2679 | case G2H_DOWN: |
|---|
| 2680 | sm_change_csc_target(); |
|---|
| 2681 | goto label_begin; |
|---|
| 2682 | #endif |
|---|
| 2683 | |
|---|
| 2684 | case G2H_0: |
|---|
| 2685 | case G2H_1: |
|---|
| 2686 | case G2H_2: |
|---|
| 2687 | case G2H_3: |
|---|
| 2688 | case G2H_4: |
|---|
| 2689 | case G2H_5: |
|---|
| 2690 | case G2H_6: |
|---|
| 2691 | case G2H_7: |
|---|
| 2692 | case G2H_8: |
|---|
| 2693 | case G2H_9: |
|---|
| 2694 | rval = sm_show_change_color_param(page, k-G2H_0); |
|---|
| 2695 | if (rval == SM_EXIT_POWER) |
|---|
| 2696 | return rval; |
|---|
| 2697 | sm_show_status(SM_STAT_MASK_ALL); |
|---|
| 2698 | goto label_begin; |
|---|
| 2699 | |
|---|
| 2700 | default: |
|---|
| 2701 | sm_process_default_key(k); |
|---|
| 2702 | break; |
|---|
| 2703 | } |
|---|
| 2704 | } |
|---|
| 2705 | } |
|---|
| 2706 | |
|---|
| 2707 | |
|---|
| 2708 | |
|---|
| 2709 | enum SM_CHK_COORD { |
|---|
| 2710 | eSM_CHK_COORD_LT = 0, |
|---|
| 2711 | eSM_CHK_COORD_RB = 1, |
|---|
| 2712 | }; |
|---|
| 2713 | |
|---|
| 2714 | int sm_cursor_w = 80; |
|---|
| 2715 | int sm_cursor_h = 80; |
|---|
| 2716 | |
|---|
| 2717 | static void sm_draw_coord_cursor(int x, int y, enum SM_CHK_COORD mode) |
|---|
| 2718 | { |
|---|
| 2719 | if (mode == eSM_CHK_COORD_LT) { |
|---|
| 2720 | sm_drawbox(x, y, sm_cursor_w, sm_cursor_h, sm_cur_bcolor); |
|---|
| 2721 | sm_drawbox(x, y, sm_cursor_w, 1, sm_cur_fcolor); // °¡·ÎÁÙ. |
|---|
| 2722 | sm_drawbox(x, y, 1, sm_cursor_h, sm_cur_fcolor); // ¼¼·ÎÁÙ. |
|---|
| 2723 | } |
|---|
| 2724 | else { |
|---|
| 2725 | sm_drawbox(x-sm_cursor_w, y-sm_cursor_h, sm_cursor_w, sm_cursor_h, sm_cur_bcolor); |
|---|
| 2726 | sm_drawbox(x-sm_cursor_w, y, sm_cursor_w, 1, sm_cur_fcolor); |
|---|
| 2727 | sm_drawbox(x, y-sm_cursor_h, 1, sm_cursor_h, sm_cur_fcolor); |
|---|
| 2728 | } |
|---|
| 2729 | } |
|---|
| 2730 | |
|---|
| 2731 | /* |
|---|
| 2732 | ¹æÇâ Ű ÀÔ·ÂÀ» ¹Þ¾Æ¼ Ä¿¼ Ç¥½Ã¸¦ ÇÏ¿© »ç¿ëÀÚ°¡ °¡½Ã¿µ¿ª ÁÂÇ¥¸¦ ÃøÁ¤ÇÏ´Â ¸Þ´º. |
|---|
| 2733 | |
|---|
| 2734 | */ |
|---|
| 2735 | int sm_proc_check_coord(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 2736 | { |
|---|
| 2737 | int k; |
|---|
| 2738 | char *guide_msg = "[UP/DN/LF/RG], [OK] next, [BACK]"; |
|---|
| 2739 | |
|---|
| 2740 | int pos_x, pos_y; |
|---|
| 2741 | enum SM_CHK_COORD mode; |
|---|
| 2742 | |
|---|
| 2743 | struct { |
|---|
| 2744 | int x; int y; |
|---|
| 2745 | } pos_backup[2]; |
|---|
| 2746 | |
|---|
| 2747 | char buf[100]; |
|---|
| 2748 | int scr_w = sm_cv->w, scr_h = sm_cv->h; |
|---|
| 2749 | |
|---|
| 2750 | // Ãʱ⠰ªÀº 10% overscan °¡Á¤. |
|---|
| 2751 | pos_backup[eSM_CHK_COORD_LT].x = scr_w/10; |
|---|
| 2752 | pos_backup[eSM_CHK_COORD_LT].y = scr_h/10; |
|---|
| 2753 | pos_backup[eSM_CHK_COORD_RB].x = scr_w - scr_w/10; |
|---|
| 2754 | pos_backup[eSM_CHK_COORD_RB].y = scr_h - scr_h/10; |
|---|
| 2755 | |
|---|
| 2756 | // left top ¸ÕÀú, right bottom ³ªÁß¿¡.. |
|---|
| 2757 | mode = eSM_CHK_COORD_LT; |
|---|
| 2758 | pos_x = pos_backup[mode].x; |
|---|
| 2759 | pos_y = pos_backup[mode].y; |
|---|
| 2760 | |
|---|
| 2761 | label_begin: |
|---|
| 2762 | |
|---|
| 2763 | sm_clrscr(); |
|---|
| 2764 | sm_draw_coord_cursor(pos_x, pos_y, mode); |
|---|
| 2765 | |
|---|
| 2766 | #if 1 |
|---|
| 2767 | if (mode == eSM_CHK_COORD_LT) |
|---|
| 2768 | sprintf(buf, " LT (%d, %d) ", |
|---|
| 2769 | pos_x, pos_y); |
|---|
| 2770 | else |
|---|
| 2771 | sprintf(buf, " RB (%d, %d) [%d, %d]", |
|---|
| 2772 | pos_x, pos_y, scr_w - pos_x, scr_h - pos_y); |
|---|
| 2773 | |
|---|
| 2774 | sm_gotoxy(SM_HORZ/2 - strlen(buf)/2, SM_VERT/2); |
|---|
| 2775 | sm_clrbox(sm_cur_pos_x, sm_cur_pos_y, strlen(buf), 1); |
|---|
| 2776 | sm_printf(buf); |
|---|
| 2777 | |
|---|
| 2778 | sprintf(buf, " %s ", guide_msg); |
|---|
| 2779 | sm_gotoxy(SM_HORZ/2 - strlen(buf)/2, SM_VERT/2+1); |
|---|
| 2780 | sm_clrbox(sm_cur_pos_x, sm_cur_pos_y, strlen(buf), 1); |
|---|
| 2781 | sm_printf(buf); |
|---|
| 2782 | #else |
|---|
| 2783 | sprintf(buf, " %s (%d, %d) %s ", |
|---|
| 2784 | mode == eSM_CHK_COORD_LT ? "LT" : "RB", |
|---|
| 2785 | pos_x, pos_y, guide_msg); |
|---|
| 2786 | // cursor¿Í Áߺ¹µÇÁö ¾Êµµ·Ï À§Ä¡ ¼±Á¤. |
|---|
| 2787 | if (mode == eSM_CHK_COORD_LT) |
|---|
| 2788 | sm_gotoxy(SM_HORZ/2, SM_VERT/2); // Áß¾ÓÀÇ ¿ìÇÏ´Ü¿¡ Ç¥½Ã. |
|---|
| 2789 | else |
|---|
| 2790 | sm_gotoxy(SM_HORZ/2-5, SM_VERT/2); // Áß¾ÓÀÇ Á»ó´Ü¿¡ Ç¥½Ã. |
|---|
| 2791 | sm_printf(buf); |
|---|
| 2792 | #endif |
|---|
| 2793 | |
|---|
| 2794 | while (1) |
|---|
| 2795 | { |
|---|
| 2796 | k = sm_get_key(); |
|---|
| 2797 | |
|---|
| 2798 | switch (k) |
|---|
| 2799 | { |
|---|
| 2800 | case G2H_POWER_OFF: |
|---|
| 2801 | return SM_EXIT_POWER; |
|---|
| 2802 | |
|---|
| 2803 | case G2H_BACK: |
|---|
| 2804 | case G2H_MENU: |
|---|
| 2805 | return SM_EXIT_BACK; |
|---|
| 2806 | |
|---|
| 2807 | case G2H_SELECT: |
|---|
| 2808 | case G2H_0: // OK ۰¡ ¾ø´Â ½Ã½ºÅÛÀ» À§ÇÑ °í·Á. |
|---|
| 2809 | pos_backup[mode].x = pos_x; |
|---|
| 2810 | pos_backup[mode].y = pos_y; |
|---|
| 2811 | // change to next mode |
|---|
| 2812 | mode = mode == eSM_CHK_COORD_LT ? eSM_CHK_COORD_RB : eSM_CHK_COORD_LT; |
|---|
| 2813 | pos_x = pos_backup[mode].x; |
|---|
| 2814 | pos_y = pos_backup[mode].y; |
|---|
| 2815 | goto label_begin; |
|---|
| 2816 | |
|---|
| 2817 | case G2H_4: |
|---|
| 2818 | pos_x -= 3; |
|---|
| 2819 | case G2H_LEFT: |
|---|
| 2820 | //case G2H_LEFT_CONT: |
|---|
| 2821 | // Á»ó´Ü ¸ðµå¿¡¼´Â 0 ~ scr_w/2 ·Î Á¦ÇÑ. |
|---|
| 2822 | // ¿ìÇÏ´Ü ¸ðµå¿¡¼´Â scr_w/2 ~ scr_w-1 ·Î Á¦ÇÑ. |
|---|
| 2823 | pos_x--; |
|---|
| 2824 | if (mode == eSM_CHK_COORD_LT) |
|---|
| 2825 | SM_ADJUST(pos_x, 0, scr_w/2-sm_cursor_w); |
|---|
| 2826 | else |
|---|
| 2827 | SM_ADJUST(pos_x, scr_w/2+sm_cursor_w, scr_w-1); |
|---|
| 2828 | goto label_begin; |
|---|
| 2829 | |
|---|
| 2830 | case G2H_6: |
|---|
| 2831 | pos_x += 3; |
|---|
| 2832 | case G2H_RIGHT: |
|---|
| 2833 | //case G2H_RIGHT_CONT: |
|---|
| 2834 | pos_x++; |
|---|
| 2835 | if (mode == eSM_CHK_COORD_LT) |
|---|
| 2836 | SM_ADJUST(pos_x, 0, scr_w/2-sm_cursor_w); |
|---|
| 2837 | else |
|---|
| 2838 | SM_ADJUST(pos_x, scr_w/2+sm_cursor_w, scr_w-1); |
|---|
| 2839 | goto label_begin; |
|---|
| 2840 | |
|---|
| 2841 | case G2H_2: |
|---|
| 2842 | pos_y -= 3; |
|---|
| 2843 | case G2H_UP: |
|---|
| 2844 | //case G2H_UP_CONT: |
|---|
| 2845 | pos_y--; |
|---|
| 2846 | if (mode == eSM_CHK_COORD_LT) |
|---|
| 2847 | SM_ADJUST(pos_y, 0, scr_h/2-sm_cursor_h); |
|---|
| 2848 | else |
|---|
| 2849 | SM_ADJUST(pos_y, scr_h/2+sm_cursor_h, scr_h-1); |
|---|
| 2850 | goto label_begin; |
|---|
| 2851 | |
|---|
| 2852 | case G2H_8: |
|---|
| 2853 | pos_y += 3; |
|---|
| 2854 | case G2H_DOWN: |
|---|
| 2855 | //case G2H_DOWN_CONT: |
|---|
| 2856 | pos_y++; |
|---|
| 2857 | if (mode == eSM_CHK_COORD_LT) |
|---|
| 2858 | SM_ADJUST(pos_y, 0, scr_h/2-sm_cursor_h); |
|---|
| 2859 | else |
|---|
| 2860 | SM_ADJUST(pos_y, scr_h/2+sm_cursor_h, scr_h-1); |
|---|
| 2861 | goto label_begin; |
|---|
| 2862 | } |
|---|
| 2863 | } |
|---|
| 2864 | } |
|---|
| 2865 | |
|---|
| 2866 | int sm_proc_video(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 2867 | { |
|---|
| 2868 | int rval; |
|---|
| 2869 | int k; |
|---|
| 2870 | |
|---|
| 2871 | label_begin: |
|---|
| 2872 | |
|---|
| 2873 | sm_show_help(SM_KEY_BACK | SM_KEY_DIGIT); |
|---|
| 2874 | |
|---|
| 2875 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 2876 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 2877 | |
|---|
| 2878 | sm_printf("\n **** video info/setting ****\n\n"); |
|---|
| 2879 | sm_printf(" 1: video color control\n"); |
|---|
| 2880 | sm_printf(" 2: screen coord check\n"); |
|---|
| 2881 | sm_printf("\n"); |
|---|
| 2882 | |
|---|
| 2883 | while (1) |
|---|
| 2884 | { |
|---|
| 2885 | k = sm_get_key(); |
|---|
| 2886 | |
|---|
| 2887 | switch (k) |
|---|
| 2888 | { |
|---|
| 2889 | case G2H_POWER_OFF: |
|---|
| 2890 | return SM_EXIT_POWER; |
|---|
| 2891 | |
|---|
| 2892 | case G2H_1: |
|---|
| 2893 | rval = sm_proc_video_color(); |
|---|
| 2894 | if (rval == SM_EXIT_POWER) |
|---|
| 2895 | return SM_EXIT_POWER; |
|---|
| 2896 | sm_show_status(SM_STAT_MASK_ALL); |
|---|
| 2897 | goto label_begin; |
|---|
| 2898 | |
|---|
| 2899 | case G2H_2: |
|---|
| 2900 | rval = sm_proc_check_coord(); |
|---|
| 2901 | sm_clrscr(); |
|---|
| 2902 | if (rval == SM_EXIT_POWER) |
|---|
| 2903 | return SM_EXIT_POWER; |
|---|
| 2904 | sm_show_status(SM_STAT_MASK_ALL); |
|---|
| 2905 | goto label_begin; |
|---|
| 2906 | |
|---|
| 2907 | case G2H_BACK: |
|---|
| 2908 | case G2H_MENU: |
|---|
| 2909 | sm_show_status(SM_STAT_MASK_ALL); |
|---|
| 2910 | return SM_EXIT_BACK; |
|---|
| 2911 | |
|---|
| 2912 | default: |
|---|
| 2913 | sm_process_default_key(k); |
|---|
| 2914 | break; |
|---|
| 2915 | } |
|---|
| 2916 | } |
|---|
| 2917 | } |
|---|
| 2918 | |
|---|
| 2919 | #endif |
|---|
| 2920 | |
|---|
| 2921 | |
|---|
| 2922 | #if COMMENT |
|---|
| 2923 | ____system____(){} |
|---|
| 2924 | #endif |
|---|
| 2925 | |
|---|
| 2926 | |
|---|
| 2927 | typedef struct { |
|---|
| 2928 | // input |
|---|
| 2929 | char *message; |
|---|
| 2930 | int max_num_digit; |
|---|
| 2931 | int min_value, max_value; |
|---|
| 2932 | int *poutput_value; |
|---|
| 2933 | |
|---|
| 2934 | // operation |
|---|
| 2935 | //char input[10]; |
|---|
| 2936 | int input_idx; |
|---|
| 2937 | |
|---|
| 2938 | // output |
|---|
| 2939 | UINT32 result_value; |
|---|
| 2940 | } SM_DIGIT_INPUT_SETTING; |
|---|
| 2941 | |
|---|
| 2942 | SM_DIGIT_INPUT_SETTING s_sm_digit_input_setting; |
|---|
| 2943 | |
|---|
| 2944 | int sm_proc_input_digit(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 2945 | { |
|---|
| 2946 | BOOL bRet = TRUE; // ¸ðµç command¸¦ ´Ù ¸·¾Æ ¹ö¸®ÀÚ. |
|---|
| 2947 | SM_DIGIT_INPUT_SETTING *s = &s_sm_digit_input_setting; |
|---|
| 2948 | |
|---|
| 2949 | switch(cmd) |
|---|
| 2950 | { |
|---|
| 2951 | case eDMG_CMD_ON_MENU_UPDATE : |
|---|
| 2952 | s->result_value = 0; |
|---|
| 2953 | s->input_idx = 0; |
|---|
| 2954 | sm_clrbox(0, sm_cur_pos_y, SM_HORZ, 1); |
|---|
| 2955 | sm_printf("\r %s (%u~%u): ", s->message, s->min_value, s->max_value); |
|---|
| 2956 | sm_refresh(); |
|---|
| 2957 | break; |
|---|
| 2958 | |
|---|
| 2959 | case eDMG_CMD_ON_KEY : |
|---|
| 2960 | switch (param2) |
|---|
| 2961 | { |
|---|
| 2962 | case APP_VK_POWER_OFF: // power off ۸¸ Á¦¿Ü.. |
|---|
| 2963 | bRet = FALSE; |
|---|
| 2964 | break; |
|---|
| 2965 | |
|---|
| 2966 | case APP_VK_BACK: |
|---|
| 2967 | case APP_VK_MENU: |
|---|
| 2968 | s_sm_menu_id = SM_MENU_SYSTEM; |
|---|
| 2969 | sm_send_msg(0); // let parent to update his screen |
|---|
| 2970 | break; |
|---|
| 2971 | |
|---|
| 2972 | case APP_VK_0: |
|---|
| 2973 | case APP_VK_1: |
|---|
| 2974 | case APP_VK_2: |
|---|
| 2975 | case APP_VK_3: |
|---|
| 2976 | case APP_VK_4: |
|---|
| 2977 | case APP_VK_5: |
|---|
| 2978 | case APP_VK_6: |
|---|
| 2979 | case APP_VK_7: |
|---|
| 2980 | case APP_VK_8: |
|---|
| 2981 | case APP_VK_9: |
|---|
| 2982 | if (s->input_idx < s->max_num_digit) { |
|---|
| 2983 | int digit = param2 - APP_VK_0; |
|---|
| 2984 | //s->input[s->input_idx] = digit; |
|---|
| 2985 | sm_printf("%d", digit); |
|---|
| 2986 | s->result_value = s->result_value*10 + digit; |
|---|
| 2987 | s->input_idx++; |
|---|
| 2988 | } |
|---|
| 2989 | break; |
|---|
| 2990 | |
|---|
| 2991 | case APP_VK_SELECT: |
|---|
| 2992 | if (s->result_value >= s->min_value && s->result_value <= s->max_value) { |
|---|
| 2993 | *(s->poutput_value) = s->result_value; |
|---|
| 2994 | s_sm_menu_id = SM_MENU_SYSTEM; |
|---|
| 2995 | } |
|---|
| 2996 | else { |
|---|
| 2997 | sm_clrbox(0, sm_cur_pos_y, SM_HORZ, 1); |
|---|
| 2998 | sm_printf("\r !! value %u out of range !", s->result_value); |
|---|
| 2999 | sm_refresh(); |
|---|
| 3000 | DHL_OS_Delay(1000); |
|---|
| 3001 | } |
|---|
| 3002 | sm_send_msg(0); |
|---|
| 3003 | break; |
|---|
| 3004 | } |
|---|
| 3005 | } |
|---|
| 3006 | |
|---|
| 3007 | return bRet; |
|---|
| 3008 | } |
|---|
| 3009 | |
|---|
| 3010 | typedef struct |
|---|
| 3011 | { |
|---|
| 3012 | int chtype; |
|---|
| 3013 | int rf; |
|---|
| 3014 | int pid; |
|---|
| 3015 | } SM_RFUPDATE_SETTING; |
|---|
| 3016 | |
|---|
| 3017 | static SM_RFUPDATE_SETTING s_sm_rfupdate_setting; |
|---|
| 3018 | |
|---|
| 3019 | int sm_proc_system_rfupdate(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 3020 | { |
|---|
| 3021 | BOOL bRet = TRUE; |
|---|
| 3022 | SM_RFUPDATE_SETTING *s = &s_sm_rfupdate_setting; |
|---|
| 3023 | char str[40]; |
|---|
| 3024 | APP_SDDS_SHORT_INFO info; |
|---|
| 3025 | DHL_RESULT dhr; |
|---|
| 3026 | tDHL_Demod demod; |
|---|
| 3027 | BOOL bLock = FALSE; |
|---|
| 3028 | int i; |
|---|
| 3029 | |
|---|
| 3030 | switch(cmd) |
|---|
| 3031 | { |
|---|
| 3032 | case eDMG_CMD_ON_MENU_UPDATE : |
|---|
| 3033 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 3034 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 3035 | |
|---|
| 3036 | sm_printf("\n **** Software Update by RF ****\n\n"); |
|---|
| 3037 | App_ChTuneStopTV(); |
|---|
| 3038 | |
|---|
| 3039 | // tuner setup |
|---|
| 3040 | sm_printf(" tuning to rf %d (chtype %d)..\n", s->rf, s->chtype); |
|---|
| 3041 | sm_refresh(); |
|---|
| 3042 | dhr = DHL_FE_Start(0, |
|---|
| 3043 | DHL_FE_ChannelToFrequency(s->rf, (tDHL_FreqStd)s->chtype), |
|---|
| 3044 | eDHL_DEMOD_8VSB, NULL); |
|---|
| 3045 | if(dhr != DHL_OK) { |
|---|
| 3046 | sm_printf("!! channel tuning error\n"); |
|---|
| 3047 | sm_refresh(); |
|---|
| 3048 | DHL_OS_Delay(1000); |
|---|
| 3049 | s_sm_menu_id = SM_MENU_SYSTEM; |
|---|
| 3050 | sm_send_msg(0); |
|---|
| 3051 | break; |
|---|
| 3052 | } |
|---|
| 3053 | for (i=0; i<20; i++) { |
|---|
| 3054 | DHL_OS_Delay(100); |
|---|
| 3055 | dhr = DHL_FE_GetLockStatus(0, &bLock, &demod); |
|---|
| 3056 | if (dhr == DHL_OK && bLock) |
|---|
| 3057 | break; |
|---|
| 3058 | } |
|---|
| 3059 | if (!bLock) { |
|---|
| 3060 | sm_printf("!! tuner not locked\n"); |
|---|
| 3061 | sm_refresh(); |
|---|
| 3062 | DHL_OS_Delay(1000); |
|---|
| 3063 | s_sm_menu_id = SM_MENU_SYSTEM; |
|---|
| 3064 | sm_send_msg(0); |
|---|
| 3065 | break; |
|---|
| 3066 | } |
|---|
| 3067 | //RF Update start |
|---|
| 3068 | sm_printf(" start update with pid 0x%x..\n", s->pid); |
|---|
| 3069 | sm_refresh(); |
|---|
| 3070 | App_SddsStart(s->pid, 1); |
|---|
| 3071 | break; |
|---|
| 3072 | |
|---|
| 3073 | case eDMG_CMD_ON_TIME : |
|---|
| 3074 | sm_clrbox(0, sm_cur_pos_y, SM_HORZ, 1); |
|---|
| 3075 | App_SddsGetInfo(&info); |
|---|
| 3076 | if (info.state == eSDDS_STATE_DOWNLOADING) { |
|---|
| 3077 | sm_printf("\r downloding %d..", info.download_progress); |
|---|
| 3078 | } |
|---|
| 3079 | else if (info.state == eSDDS_STATE_FLASHING) { |
|---|
| 3080 | sm_printf("\r flashing %d..", info.update_progress); |
|---|
| 3081 | } |
|---|
| 3082 | else if (info.state == eSDDS_STATE_COMPELTED) { |
|---|
| 3083 | sm_printf("\r update completed. reboot!"); |
|---|
| 3084 | } |
|---|
| 3085 | sm_refresh(); |
|---|
| 3086 | break; |
|---|
| 3087 | |
|---|
| 3088 | case eDMG_CMD_ON_KEY : |
|---|
| 3089 | switch (param2) |
|---|
| 3090 | { |
|---|
| 3091 | case APP_VK_POWER_OFF: // do not allow power off!! |
|---|
| 3092 | break; |
|---|
| 3093 | case APP_VK_BACK: |
|---|
| 3094 | case APP_VK_MENU: |
|---|
| 3095 | //s_sm_menu_id = SM_MENU_SYSTEM; |
|---|
| 3096 | //sm_send_msg(0); // let parent to update his screen |
|---|
| 3097 | break; |
|---|
| 3098 | } |
|---|
| 3099 | } |
|---|
| 3100 | |
|---|
| 3101 | return bRet; |
|---|
| 3102 | } |
|---|
| 3103 | |
|---|
| 3104 | |
|---|
| 3105 | #define SM_MENU_SYSTEM_DIGIT 0x8500 |
|---|
| 3106 | #define SM_MENU_SYSTEM_RFUPDATE 0x8600 |
|---|
| 3107 | |
|---|
| 3108 | typedef struct |
|---|
| 3109 | { |
|---|
| 3110 | int rfupdate_chtype; |
|---|
| 3111 | int rfupdate_rf; |
|---|
| 3112 | char *last_status; |
|---|
| 3113 | |
|---|
| 3114 | } SM_SYSTEM_PARAM; |
|---|
| 3115 | |
|---|
| 3116 | static SM_SYSTEM_PARAM s_sm_system = |
|---|
| 3117 | { |
|---|
| 3118 | ChannelType_Air, 18, "---", |
|---|
| 3119 | }; |
|---|
| 3120 | |
|---|
| 3121 | void sm_show_system_commands(void) |
|---|
| 3122 | { |
|---|
| 3123 | APP_SDDS_SHORT_INFO si; |
|---|
| 3124 | SM_SYSTEM_PARAM *s = &s_sm_system; |
|---|
| 3125 | |
|---|
| 3126 | App_SddsGetInfo(&si); |
|---|
| 3127 | sm_clrbox(SM_SEL_WIN_X, SM_SEL_WIN_Y, SM_SEL_WIN_W, SM_SEL_WIN_H); |
|---|
| 3128 | sm_gotoxy(SM_SEL_WIN_X, SM_SEL_WIN_Y); |
|---|
| 3129 | |
|---|
| 3130 | sm_printf("\n **** System Reset & Format ****\n\n"); |
|---|
| 3131 | |
|---|
| 3132 | sm_printf(" Last operation: %s \n", s->last_status); |
|---|
| 3133 | //sm_printf(" 1: reset reboot count (current count: %d)\n", g_App_RebootCount); |
|---|
| 3134 | sm_printf(" 2: clear current (%s) UCM in NVRAM\n", |
|---|
| 3135 | g_CurChannelType == ChannelType_Air ? "Air" : "Cable"); |
|---|
| 3136 | sm_printf(" 3: format system (EEPROM, NVRAM)\n"); |
|---|
| 3137 | |
|---|
| 3138 | sm_printf(" 4: RF update config: Channel type '%s'\n", |
|---|
| 3139 | s->rfupdate_chtype == ChannelType_Air ? "Antenna" : "Cable"); |
|---|
| 3140 | sm_printf(" 5: RF update config: RF %d\n", s->rfupdate_rf); |
|---|
| 3141 | sm_printf(" 6: start RF update using above param\n"); |
|---|
| 3142 | //sm_printf(" 7: select cable active/inactive current: %s\n", |
|---|
| 3143 | // App_GetActiveCable()==0? "Inactive":"Active"); |
|---|
| 3144 | sm_printf(" **** sdds service status (rf %d, pid 0x%x)\n", si.rf, si.pid); |
|---|
| 3145 | if (si.rf && si.pid) |
|---|
| 3146 | sm_printf(" 8: start SDDS update\n"); |
|---|
| 3147 | sm_printf("\n"); |
|---|
| 3148 | sm_refresh(); |
|---|
| 3149 | } |
|---|
| 3150 | |
|---|
| 3151 | int sm_proc_system(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 3152 | { |
|---|
| 3153 | BOOL bRet = FALSE; |
|---|
| 3154 | APP_SDDS_SHORT_INFO si; |
|---|
| 3155 | SM_SYSTEM_PARAM *s = &s_sm_system; |
|---|
| 3156 | |
|---|
| 3157 | bRet = FALSE; |
|---|
| 3158 | if (s_sm_menu_id == SM_MENU_SYSTEM_DIGIT) { |
|---|
| 3159 | bRet = sm_proc_input_digit(cmd, opt, param1, param2); |
|---|
| 3160 | } |
|---|
| 3161 | else if (s_sm_menu_id == SM_MENU_SYSTEM_RFUPDATE) { |
|---|
| 3162 | bRet = sm_proc_system_rfupdate(cmd, opt, param1, param2); |
|---|
| 3163 | } |
|---|
| 3164 | |
|---|
| 3165 | if (bRet == TRUE) { |
|---|
| 3166 | return TRUE; |
|---|
| 3167 | } |
|---|
| 3168 | bRet = TRUE; |
|---|
| 3169 | switch(cmd) |
|---|
| 3170 | { |
|---|
| 3171 | case eDMG_CMD_ON_MENU_UPDATE : |
|---|
| 3172 | sm_show_help(SM_KEY_BACK | SM_KEY_DIGIT); |
|---|
| 3173 | sm_show_system_commands(); |
|---|
| 3174 | break; |
|---|
| 3175 | |
|---|
| 3176 | case eDMG_CMD_ON_TIME : |
|---|
| 3177 | sm_show_system_commands(); |
|---|
| 3178 | break; |
|---|
| 3179 | |
|---|
| 3180 | case eDMG_CMD_ON_KEY : |
|---|
| 3181 | switch (param2) |
|---|
| 3182 | { |
|---|
| 3183 | case APP_VK_BACK: |
|---|
| 3184 | case APP_VK_MENU: |
|---|
| 3185 | s_sm_menu_id = SM_MENU_HOME; |
|---|
| 3186 | sm_send_msg(0); // let parent to update his screen |
|---|
| 3187 | break; |
|---|
| 3188 | #if 0 |
|---|
| 3189 | case APP_VK_1: |
|---|
| 3190 | App_ResetRebootCount(); |
|---|
| 3191 | sm_printf(" Reboot count reset to zero\n"); |
|---|
| 3192 | DHL_OS_Delay(1000); |
|---|
| 3193 | sm_send_msg(0); |
|---|
| 3194 | break; |
|---|
| 3195 | #endif |
|---|
| 3196 | case APP_VK_2: |
|---|
| 3197 | App_NVM_EraseUcm(); |
|---|
| 3198 | sm_printf(" resetting NvRam UCM...\n"); |
|---|
| 3199 | sm_refresh(); |
|---|
| 3200 | DMW_CDB_WaitForNvRamSyncDone(); |
|---|
| 3201 | s->last_status = "NvRam UCM cleared"; |
|---|
| 3202 | sm_printf(" %s\n", s->last_status); |
|---|
| 3203 | sm_refresh(); |
|---|
| 3204 | DHL_OS_Delay(1000); |
|---|
| 3205 | sm_send_msg(0); |
|---|
| 3206 | break; |
|---|
| 3207 | |
|---|
| 3208 | case APP_VK_3: |
|---|
| 3209 | sm_printf(" System formatting...\n"); |
|---|
| 3210 | sm_refresh(); |
|---|
| 3211 | App_NVM_FormatNvParam(TRUE); // wait for complete |
|---|
| 3212 | s->last_status = "System format completed"; |
|---|
| 3213 | sm_printf(" %s\n", s->last_status); |
|---|
| 3214 | sm_refresh(); |
|---|
| 3215 | DHL_OS_Delay(1000); |
|---|
| 3216 | sm_send_msg(0); |
|---|
| 3217 | break; |
|---|
| 3218 | |
|---|
| 3219 | case APP_VK_4: |
|---|
| 3220 | s->rfupdate_chtype = |
|---|
| 3221 | s->rfupdate_chtype == ChannelType_Air ? ChannelType_Cable : ChannelType_Air; |
|---|
| 3222 | sm_printf(" Change chtype to %s\n", ChannelTypeString(s->rfupdate_chtype)); |
|---|
| 3223 | sm_refresh(); |
|---|
| 3224 | DHL_OS_Delay(1000); |
|---|
| 3225 | sm_send_msg(0); |
|---|
| 3226 | break; |
|---|
| 3227 | |
|---|
| 3228 | case APP_VK_5: |
|---|
| 3229 | s_sm_digit_input_setting.message = "Enter RF number "; |
|---|
| 3230 | s_sm_digit_input_setting.max_num_digit = 3; |
|---|
| 3231 | if (s->rfupdate_chtype == ChannelType_Air) { |
|---|
| 3232 | s_sm_digit_input_setting.min_value = 2; |
|---|
| 3233 | s_sm_digit_input_setting.max_value = 69; |
|---|
| 3234 | } |
|---|
| 3235 | else { |
|---|
| 3236 | s_sm_digit_input_setting.min_value = 1; |
|---|
| 3237 | s_sm_digit_input_setting.max_value = 135; |
|---|
| 3238 | } |
|---|
| 3239 | s_sm_digit_input_setting.poutput_value = &s->rfupdate_rf; |
|---|
| 3240 | s_sm_menu_id = SM_MENU_SYSTEM_DIGIT; |
|---|
| 3241 | sm_send_msg(0); |
|---|
| 3242 | break; |
|---|
| 3243 | |
|---|
| 3244 | case APP_VK_6: |
|---|
| 3245 | s_sm_rfupdate_setting.chtype = s->rfupdate_chtype; |
|---|
| 3246 | s_sm_rfupdate_setting.rf = s->rfupdate_rf; |
|---|
| 3247 | s_sm_rfupdate_setting.pid = 0x1200; |
|---|
| 3248 | s_sm_menu_id = SM_MENU_SYSTEM_RFUPDATE; |
|---|
| 3249 | sm_send_msg(0); |
|---|
| 3250 | break; |
|---|
| 3251 | |
|---|
| 3252 | case APP_VK_8: |
|---|
| 3253 | App_SddsGetInfo(&si); |
|---|
| 3254 | if (si.rf && si.pid) { |
|---|
| 3255 | s_sm_rfupdate_setting.chtype = si.chtype; |
|---|
| 3256 | s_sm_rfupdate_setting.rf = si.rf; |
|---|
| 3257 | s_sm_rfupdate_setting.pid = si.pid; |
|---|
| 3258 | s_sm_menu_id = SM_MENU_SYSTEM_RFUPDATE; |
|---|
| 3259 | } |
|---|
| 3260 | else { |
|---|
| 3261 | sm_printf("\n !! sdds service not found\n"); |
|---|
| 3262 | sm_refresh(); |
|---|
| 3263 | DHL_OS_Delay(1000); |
|---|
| 3264 | } |
|---|
| 3265 | sm_send_msg(0); |
|---|
| 3266 | break; |
|---|
| 3267 | |
|---|
| 3268 | default: |
|---|
| 3269 | bRet = FALSE; |
|---|
| 3270 | break; |
|---|
| 3271 | } |
|---|
| 3272 | if (sm_is_digitkey(param2)) bRet = TRUE; |
|---|
| 3273 | break; |
|---|
| 3274 | |
|---|
| 3275 | default: |
|---|
| 3276 | bRet = FALSE; // cannot process this command. |
|---|
| 3277 | break; |
|---|
| 3278 | } |
|---|
| 3279 | |
|---|
| 3280 | return bRet; |
|---|
| 3281 | } |
|---|
| 3282 | |
|---|
| 3283 | |
|---|
| 3284 | |
|---|
| 3285 | |
|---|
| 3286 | |
|---|
| 3287 | #if COMMENT |
|---|
| 3288 | ____APIs____(){} |
|---|
| 3289 | #endif |
|---|
| 3290 | |
|---|
| 3291 | |
|---|
| 3292 | |
|---|
| 3293 | |
|---|
| 3294 | |
|---|
| 3295 | //int AppSM_StartServiceMenu(void) |
|---|
| 3296 | BOOL App_Proc_ServiceMenu(tDMG_CMD cmd, UINT32 opt, UINT32 param1, UINT32 param2) |
|---|
| 3297 | { |
|---|
| 3298 | BOOL bRet = TRUE; // default action: we treat all command. |
|---|
| 3299 | |
|---|
| 3300 | int k, counter = 0; |
|---|
| 3301 | |
|---|
| 3302 | if (cmd == eDMG_CMD_ON_MENU_ACTIVE) |
|---|
| 3303 | { |
|---|
| 3304 | printf("Start ServiceMenu\n"); |
|---|
| 3305 | sm_open_graphic(); |
|---|
| 3306 | s_sm_menu_id = SM_MENU_HOME; |
|---|
| 3307 | sm_send_msg(0); |
|---|
| 3308 | //DMG_SetTimer(TIMER_ID_L1, 1000, 0); // BG_1SEC ŸÀ̸Ӱ¡ ÀÖÀ¸´Ï ±×°É »ç¿ë.. |
|---|
| 3309 | return TRUE; |
|---|
| 3310 | } |
|---|
| 3311 | else if (cmd == eDMG_CMD_ON_MENU_EXIT) |
|---|
| 3312 | { |
|---|
| 3313 | printf("close service menu\n"); |
|---|
| 3314 | sm_close_graphic(); |
|---|
| 3315 | s_sm_menu_id = SM_MENU_HOME; |
|---|
| 3316 | return TRUE; |
|---|
| 3317 | } |
|---|
| 3318 | |
|---|
| 3319 | // ÀÚ²Ù ¼³Á¤Çß´ø ÆùÆ® ¼Ó¼ºÀÌ ¹Ù²ñ.. i don't know why.. |
|---|
| 3320 | // ¸Å¹ø font ¼³Á¤ ´Ù½Ã ÇØ ³õÀ½.. |
|---|
| 3321 | sm_setfont(sm_fa_style, sm_fa_size, sm_fa_size); |
|---|
| 3322 | |
|---|
| 3323 | // top (home) ¸Þ´º°¡ ¾Æ´Ñ °æ¿ìºÎÅÍ Ã³¸®. |
|---|
| 3324 | bRet = FALSE; |
|---|
| 3325 | switch (s_sm_menu_id & 0xF000) |
|---|
| 3326 | { |
|---|
| 3327 | case SM_MENU_VERSION: |
|---|
| 3328 | bRet = sm_proc_version(cmd, opt, param1, param2); |
|---|
| 3329 | break; |
|---|
| 3330 | //case SM_MENU_CHANNEL: |
|---|
| 3331 | // return sm_proc_channel(cmd, opt, param1, param2); |
|---|
| 3332 | //case SM_MENU_VIDEO: |
|---|
| 3333 | // return sm_proc_video(cmd, opt, param1, param2); |
|---|
| 3334 | case SM_MENU_AUDIO: |
|---|
| 3335 | bRet = sm_proc_audio(cmd, opt, param1, param2); |
|---|
| 3336 | break; |
|---|
| 3337 | //case SM_MENU_GUI: |
|---|
| 3338 | // return sm_proc_gui(cmd, opt, param1, param2); |
|---|
| 3339 | //case SM_MENU_EPG: |
|---|
| 3340 | // return sm_proc_epg_rating(cmd, opt, param1, param2); |
|---|
| 3341 | //case SM_MENU_DEBUG: |
|---|
| 3342 | // return sm_proc_debug_option(cmd, opt, param1, param2); |
|---|
| 3343 | case SM_MENU_SYSTEM: |
|---|
| 3344 | bRet = sm_proc_system(cmd, opt, param1, param2); |
|---|
| 3345 | break; |
|---|
| 3346 | default: // invalid menu!! |
|---|
| 3347 | s_sm_menu_id = SM_MENU_HOME; |
|---|
| 3348 | break; |
|---|
| 3349 | } |
|---|
| 3350 | |
|---|
| 3351 | if (bRet == TRUE) // bRet°¡ TRUEÀÌ¸é ´õ ÀÌ»ó ÇÒ ÀÏ ¾øÀ½. |
|---|
| 3352 | return TRUE; |
|---|
| 3353 | |
|---|
| 3354 | bRet = TRUE; // µðÆúÆ®·Î, ¸ðµç command´Â ¹«½ÃÇϵµ·Ï Çϰí ÀϺΠcmd¸¸ µ¿ÀÛÇϵµ·Ï ÇÔ. |
|---|
| 3355 | |
|---|
| 3356 | switch(cmd) |
|---|
| 3357 | { |
|---|
| 3358 | case eDMG_CMD_ON_MENU_UPDATE : |
|---|
| 3359 | sm_clrscr(); |
|---|
| 3360 | sm_show_commands(); |
|---|
| 3361 | sm_show_help(SM_KEY_DIGIT | SM_KEY_MENU); |
|---|
| 3362 | sm_show_status(SM_STAT_MASK_ALL); |
|---|
| 3363 | sm_refresh(); |
|---|
| 3364 | break; |
|---|
| 3365 | |
|---|
| 3366 | case eDMG_CMD_ON_TIME : |
|---|
| 3367 | |
|---|
| 3368 | if(param1==TIMER_ID_BG_1SEC) { |
|---|
| 3369 | counter++; |
|---|
| 3370 | sm_show_status(SM_STAT_MASK_FE | SM_STAT_MASK_MEM); |
|---|
| 3371 | if (counter % sm_period_stat_info == 0) |
|---|
| 3372 | sm_show_status(SM_STAT_MASK_CH | SM_STAT_MASK_AV | |
|---|
| 3373 | SM_STAT_MASK_RA | SM_STAT_MASK_MEM | SM_STAT_MASK_AGE); |
|---|
| 3374 | sm_refresh(); |
|---|
| 3375 | } |
|---|
| 3376 | else if(param1==TIMER_ID_CHK_UART) { |
|---|
| 3377 | App_Proc_Idle(cmd, opt, param1, param2); |
|---|
| 3378 | } |
|---|
| 3379 | break; |
|---|
| 3380 | |
|---|
| 3381 | case eDMG_CMD_ON_KEY : |
|---|
| 3382 | switch (param2) |
|---|
| 3383 | { |
|---|
| 3384 | //case APP_VK_BACK: // cafrii backÀ¸·Î´Â menu exit ¸øÇÏ°Ô ÇÏÀÚ. |
|---|
| 3385 | case APP_VK_MENU: |
|---|
| 3386 | sm_menu_exit(); |
|---|
| 3387 | break; |
|---|
| 3388 | |
|---|
| 3389 | case APP_VK_1: |
|---|
| 3390 | case APP_VK_2: |
|---|
| 3391 | case APP_VK_3: |
|---|
| 3392 | case APP_VK_4: |
|---|
| 3393 | case APP_VK_5: |
|---|
| 3394 | case APP_VK_6: |
|---|
| 3395 | case APP_VK_7: |
|---|
| 3396 | case APP_VK_8: |
|---|
| 3397 | s_sm_menu_id = (param2 - APP_VK_0) * 0x1000; |
|---|
| 3398 | sm_send_msg(0); |
|---|
| 3399 | break; |
|---|
| 3400 | |
|---|
| 3401 | case APP_VK_POWER_OFF: |
|---|
| 3402 | case APP_VK_VOL_UP: |
|---|
| 3403 | case APP_VK_VOL_DOWN: |
|---|
| 3404 | case APP_VK_CH_UP: |
|---|
| 3405 | case APP_VK_CH_DOWN: |
|---|
| 3406 | case APP_VK_MUTE: |
|---|
| 3407 | case APP_VK_STILL: |
|---|
| 3408 | case APP_VK_ALANG: |
|---|
| 3409 | case APP_VK_DMODE: |
|---|
| 3410 | case APP_VK_PREV_CH: |
|---|
| 3411 | case APP_VK_FAV: |
|---|
| 3412 | bRet = FALSE; // let idle proc process key.. |
|---|
| 3413 | break; |
|---|
| 3414 | |
|---|
| 3415 | default: |
|---|
| 3416 | bRet = TRUE; |
|---|
| 3417 | break; |
|---|
| 3418 | } |
|---|
| 3419 | break; |
|---|
| 3420 | |
|---|
| 3421 | default: // unknown command.. |
|---|
| 3422 | bRet = FALSE; |
|---|
| 3423 | break; |
|---|
| 3424 | } |
|---|
| 3425 | return bRet; |
|---|
| 3426 | } |
|---|
| 3427 | |
|---|
| 3428 | |
|---|
| 3429 | |
|---|
| 3430 | |
|---|