| 1 | /*************************************************************************** |
|---|
| 2 | * Copyright (c) 2008, Broadcom Corporation |
|---|
| 3 | * All Rights Reserved |
|---|
| 4 | * Confidential Property of Broadcom Corporation |
|---|
| 5 | * |
|---|
| 6 | * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE |
|---|
| 7 | * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR |
|---|
| 8 | * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. |
|---|
| 9 | * |
|---|
| 10 | * $brcm_Workfile: $ |
|---|
| 11 | * $brcm_Revision: $ |
|---|
| 12 | * $brcm_Date: $ |
|---|
| 13 | * |
|---|
| 14 | * Module Description: |
|---|
| 15 | * |
|---|
| 16 | * Revision History: |
|---|
| 17 | * |
|---|
| 18 | * $brcm_Log: $ |
|---|
| 19 | * |
|---|
| 20 | ***************************************************************************/ |
|---|
| 21 | |
|---|
| 22 | #include "bapp.h" |
|---|
| 23 | #include "bstd.h" |
|---|
| 24 | #include "bapp_util.h" |
|---|
| 25 | #include "bgfx.h" |
|---|
| 26 | #include "chan_mgr.h" |
|---|
| 27 | #include "bchp_hifidac_ctrl0.h" |
|---|
| 28 | #include "bchp_sun_top_ctrl.h" |
|---|
| 29 | #include "bchp_hifidac_rm0.h" |
|---|
| 30 | #include "bapp_tools.h" |
|---|
| 31 | |
|---|
| 32 | #include "ts_psi.h" |
|---|
| 33 | #include "ts_scte_18.h" |
|---|
| 34 | #include "str_table.h" |
|---|
| 35 | #include "ministd.h" |
|---|
| 36 | |
|---|
| 37 | BDBG_MODULE(bscreen_eas_text_scrolling); /* Register software module with debug interface */ |
|---|
| 38 | |
|---|
| 39 | #define MAX_TSTR_LEN 128 |
|---|
| 40 | |
|---|
| 41 | typedef enum eas_text_scrolling_layout_t |
|---|
| 42 | { |
|---|
| 43 | eEAS_TEXT_X = eSCREEN_ACTION_SAFE_X + 110, |
|---|
| 44 | eEAS_TEXT_Y = eSCREEN_ACTION_SAFE_Y + 120, |
|---|
| 45 | eEAS_TEXT_WIDTH = eSCREEN_ACTION_SAFE_WIDTH - eEAS_TEXT_X, |
|---|
| 46 | eEAS_TEXT_HEIGHT = eSCREEN_ACTION_SAFE_HEIGHT - eEAS_TEXT_Y - 60, |
|---|
| 47 | eEAS_ROW_HEIGHT = 25, |
|---|
| 48 | } eas_text_scrolling_layout_t; |
|---|
| 49 | |
|---|
| 50 | /* currently assume 3 lines */ |
|---|
| 51 | typedef enum eas_text_scrolling_t |
|---|
| 52 | { |
|---|
| 53 | eEAS_TEXT_LINE_0, |
|---|
| 54 | eEAS_TEXT_LINE_1, |
|---|
| 55 | eEAS_TEXT_LINE_2, |
|---|
| 56 | eEAS_TEXT_LINE_3, |
|---|
| 57 | eEAS_TEXT_LINE_MAX, |
|---|
| 58 | } eas_text_scrolling_t; |
|---|
| 59 | |
|---|
| 60 | #define EAS_TEXT_SCROLLING_PAGES eEAS_TEXT_LINE_MAX |
|---|
| 61 | |
|---|
| 62 | #define MAX_EAS_TEXT MAX_TSTR_LEN |
|---|
| 63 | |
|---|
| 64 | typedef struct eas_pkt_info_t |
|---|
| 65 | { |
|---|
| 66 | unsigned char *p_eas; /* pointer to eas packet buffer */ |
|---|
| 67 | unsigned char eas_text[MAX_EAS_TEXT]; /* pinter to eas text to display */ |
|---|
| 68 | unsigned int eas_text_len; /* eas test lenght */ |
|---|
| 69 | unsigned int eas_current; /* current offset to display */ |
|---|
| 70 | TS_SCTE_18_header header; /* header structure */ |
|---|
| 71 | } eas_pkt_into_t; |
|---|
| 72 | |
|---|
| 73 | typedef struct eas_text_scrolling_info_t |
|---|
| 74 | { |
|---|
| 75 | eas_text_scrolling_t state; |
|---|
| 76 | unsigned int code; |
|---|
| 77 | eas_pkt_into_t eas; |
|---|
| 78 | } eas_text_scrolling_info_t; |
|---|
| 79 | |
|---|
| 80 | static eas_text_scrolling_info_t s_eas_text_scrolling_info = { eEAS_TEXT_LINE_0, 0, { NULL, { 0 }, 0, 0 } }; |
|---|
| 81 | |
|---|
| 82 | /* |
|---|
| 83 | Summary: |
|---|
| 84 | process the MSS string |
|---|
| 85 | Returns non-zero on failure. |
|---|
| 86 | */ |
|---|
| 87 | int eas_process_mss(bapp_t *p_app, /* [in] pointer to p_app */ |
|---|
| 88 | PSIP_MSS_string p_mss, /* [in] Pointer to MSS */ |
|---|
| 89 | unsigned char *mss_buf, /* [out] string buffer */ |
|---|
| 90 | unsigned int mss_len) /* [out] string buffer length */ |
|---|
| 91 | { |
|---|
| 92 | int str_idx,lsize; |
|---|
| 93 | char *p_code; |
|---|
| 94 | BERR_Code retcode; |
|---|
| 95 | int num_str; |
|---|
| 96 | |
|---|
| 97 | if (!p_mss || !mss_buf || !mss_len) |
|---|
| 98 | return BERR_INVALID_PARAMETER; |
|---|
| 99 | |
|---|
| 100 | num_str = PSIP_MSS_getNumStrings(p_mss); |
|---|
| 101 | memset(mss_buf,0,mss_len); |
|---|
| 102 | for (str_idx = 0; str_idx < num_str; ++str_idx) |
|---|
| 103 | { |
|---|
| 104 | if ((retcode = PSIP_MSS_getCode(p_mss,str_idx, &p_code)) != BERR_SUCCESS) |
|---|
| 105 | { |
|---|
| 106 | BDBG_WRN(("PSIP_MSS_getCode:%d failed %d",__LINE__,retcode)); |
|---|
| 107 | memset(mss_buf,0,mss_len); |
|---|
| 108 | continue; |
|---|
| 109 | } |
|---|
| 110 | /* to match language of string, TODO handle other language */ |
|---|
| 111 | if (eLANG_ENGLISH == p_app->lang && (*p_code == 'e' && *(p_code + 1) == 'n')) |
|---|
| 112 | goto LANG_CHECKED; |
|---|
| 113 | if (eLANG_FRENCH == p_app->lang && (*p_code == 'f' && *(p_code + 1) == 'r')) |
|---|
| 114 | goto LANG_CHECKED; |
|---|
| 115 | if (eLANG_SPANISH == p_app->lang && |
|---|
| 116 | ((*p_code == 'e' && *(p_code + 1) == 's') || (*p_code == 'e' && *(p_code + 1) == 'p'))) |
|---|
| 117 | goto LANG_CHECKED; |
|---|
| 118 | else { |
|---|
| 119 | memset(mss_buf,0,mss_len); |
|---|
| 120 | continue; |
|---|
| 121 | } |
|---|
| 122 | |
|---|
| 123 | LANG_CHECKED: |
|---|
| 124 | lsize = mss_len; |
|---|
| 125 | if ((retcode = PSIP_MSS_getString(p_mss,str_idx,&lsize,mss_buf)) != BERR_SUCCESS) |
|---|
| 126 | { |
|---|
| 127 | BDBG_ERR(("MSS invalid %d",retcode)); |
|---|
| 128 | return retcode; |
|---|
| 129 | } |
|---|
| 130 | BDBG_MSG(("%s:%d idx = %d, %d/%d-%s",__FUNCTION__,__LINE__,str_idx,lsize,mss_len,mss_buf)); |
|---|
| 131 | return 0; |
|---|
| 132 | } |
|---|
| 133 | |
|---|
| 134 | /* in case no valid language exists just use first string */ |
|---|
| 135 | if (num_str > 0) |
|---|
| 136 | { |
|---|
| 137 | lsize = mss_len; |
|---|
| 138 | if ((retcode = PSIP_MSS_getString(p_mss,0,&lsize, mss_buf)) == BERR_SUCCESS) |
|---|
| 139 | { |
|---|
| 140 | BDBG_WRN(("No language match using default")); |
|---|
| 141 | return 0; |
|---|
| 142 | } |
|---|
| 143 | else |
|---|
| 144 | { |
|---|
| 145 | BDBG_WRN(("PSIP_MSS_getString failed %d",retcode)); |
|---|
| 146 | } |
|---|
| 147 | |
|---|
| 148 | } |
|---|
| 149 | BDBG_WRN(("%s:%d no valid string found, num_str = %d",__FUNCTION__,__LINE__,num_str)); |
|---|
| 150 | return BERR_NOT_SUPPORTED; |
|---|
| 151 | } |
|---|
| 152 | |
|---|
| 153 | /* |
|---|
| 154 | Summary: |
|---|
| 155 | set EAS packet information |
|---|
| 156 | Return: |
|---|
| 157 | 0 if sucess |
|---|
| 158 | error code if failed |
|---|
| 159 | */ |
|---|
| 160 | int bscreen_eas_text_scrolling_info(bapp_t *p_app, unsigned char *eas_pkt, unsigned int size) |
|---|
| 161 | { |
|---|
| 162 | s_eas_text_scrolling_info.state = eEAS_TEXT_LINE_0; |
|---|
| 163 | if (!eas_pkt) { |
|---|
| 164 | BDBG_WRN(("%s NULL pkt pointer",__FUNCTION__)); |
|---|
| 165 | return BERR_INVALID_PARAMETER; |
|---|
| 166 | } |
|---|
| 167 | else { |
|---|
| 168 | unsigned char *p_mss = NULL; |
|---|
| 169 | unsigned int len; |
|---|
| 170 | |
|---|
| 171 | if (TS_SCTE_18_getSectionHeader(eas_pkt, size, &s_eas_text_scrolling_info.eas.header) != 0) |
|---|
| 172 | { |
|---|
| 173 | goto FAILED; |
|---|
| 174 | } |
|---|
| 175 | if (s_eas_text_scrolling_info.eas.header.alert_text_length) { |
|---|
| 176 | p_mss = TS_SCTE_18_getAlrtTextOffset((const char *)eas_pkt, &len); |
|---|
| 177 | } |
|---|
| 178 | if (!p_mss) { |
|---|
| 179 | goto FAILED; |
|---|
| 180 | } |
|---|
| 181 | /* we get EAS text if we are here */ |
|---|
| 182 | if (eas_process_mss(p_app, p_mss, s_eas_text_scrolling_info.eas.eas_text, len)) { |
|---|
| 183 | goto FAILED; |
|---|
| 184 | } |
|---|
| 185 | s_eas_text_scrolling_info.eas.p_eas = eas_pkt; |
|---|
| 186 | s_eas_text_scrolling_info.eas.eas_current = 0; /* set EAS Alert Text read pointer to beginning */ |
|---|
| 187 | s_eas_text_scrolling_info.eas.eas_text_len = strlen(s_eas_text_scrolling_info.eas.eas_text); |
|---|
| 188 | BDBG_MSG(("Text size=%d, %s ",s_eas_text_scrolling_info.eas.eas_text_len, s_eas_text_scrolling_info.eas.eas_text)); |
|---|
| 189 | return BERR_SUCCESS; |
|---|
| 190 | } |
|---|
| 191 | |
|---|
| 192 | FAILED: |
|---|
| 193 | s_eas_text_scrolling_info.eas.p_eas = NULL; |
|---|
| 194 | s_eas_text_scrolling_info.eas.eas_text_len = 0; |
|---|
| 195 | BDBG_ERR(("#### get EAS Alert Text failed ####")); |
|---|
| 196 | return BERR_INVALID_PARAMETER; |
|---|
| 197 | } |
|---|
| 198 | |
|---|
| 199 | static const unsigned char *s_page_0_str[] = |
|---|
| 200 | { |
|---|
| 201 | "Event", /* not used */ |
|---|
| 202 | " ", |
|---|
| 203 | " ", |
|---|
| 204 | " ", |
|---|
| 205 | "\0" |
|---|
| 206 | }; |
|---|
| 207 | |
|---|
| 208 | static const unsigned char **s_eas_text_scrolling_info_str[] = |
|---|
| 209 | { |
|---|
| 210 | s_page_0_str |
|---|
| 211 | }; |
|---|
| 212 | |
|---|
| 213 | #define MAX_TSTR_LINE 40 /* letters per line */ |
|---|
| 214 | |
|---|
| 215 | static const unsigned char *get_eas_text_line(void) |
|---|
| 216 | { |
|---|
| 217 | static char ts_str[MAX_TSTR_LINE + 1]; |
|---|
| 218 | |
|---|
| 219 | if (!s_eas_text_scrolling_info.eas.p_eas || |
|---|
| 220 | s_eas_text_scrolling_info.eas.eas_current >= s_eas_text_scrolling_info.eas.eas_text_len) { |
|---|
| 221 | /* empty or no more text */ |
|---|
| 222 | ts_str[0] = '\0'; |
|---|
| 223 | } |
|---|
| 224 | else { |
|---|
| 225 | int i, cur; |
|---|
| 226 | |
|---|
| 227 | cur = s_eas_text_scrolling_info.eas.eas_current; |
|---|
| 228 | if ((cur + MAX_TSTR_LINE) < s_eas_text_scrolling_info.eas.eas_text_len) { |
|---|
| 229 | memcpy(ts_str, &s_eas_text_scrolling_info.eas.eas_text[cur], MAX_TSTR_LINE); |
|---|
| 230 | ts_str[MAX_TSTR_LINE] = '\0'; |
|---|
| 231 | /* now back scan to find a place with white space, TODO unicode handling */ |
|---|
| 232 | for (i = strlen(ts_str); i > 0; i--) { |
|---|
| 233 | if ((0x20 == ts_str[i] || '\t' == ts_str[i])) { |
|---|
| 234 | ts_str[i] = '\0'; |
|---|
| 235 | break; |
|---|
| 236 | } |
|---|
| 237 | } |
|---|
| 238 | } |
|---|
| 239 | else { |
|---|
| 240 | memcpy(ts_str, &s_eas_text_scrolling_info.eas.eas_text[cur], |
|---|
| 241 | s_eas_text_scrolling_info.eas.eas_text_len - cur); |
|---|
| 242 | ts_str[s_eas_text_scrolling_info.eas.eas_text_len - cur] = '\0'; |
|---|
| 243 | } |
|---|
| 244 | s_eas_text_scrolling_info.eas.eas_current += strlen(ts_str); |
|---|
| 245 | } |
|---|
| 246 | return ts_str; |
|---|
| 247 | } |
|---|
| 248 | |
|---|
| 249 | static void get_page_0_str(bapp_t *p_app, |
|---|
| 250 | int text_id, /* Text id */ |
|---|
| 251 | unsigned int *p_uni_str, /* Buffer to put UNI string into */ |
|---|
| 252 | unsigned int *str_len) /* On input the max length in words on output the actual size in characters. */ |
|---|
| 253 | { |
|---|
| 254 | static char ts_str[MAX_TSTR_LEN + 1]; |
|---|
| 255 | //static int offset = 0; |
|---|
| 256 | |
|---|
| 257 | if (!s_eas_text_scrolling_info.eas.p_eas) { |
|---|
| 258 | return; |
|---|
| 259 | } |
|---|
| 260 | |
|---|
| 261 | switch (text_id) |
|---|
| 262 | { |
|---|
| 263 | case 0: |
|---|
| 264 | *str_len = 0; break; |
|---|
| 265 | break; |
|---|
| 266 | |
|---|
| 267 | case 1: |
|---|
| 268 | *str_len = snprintf(ts_str,MAX_TSTR_LEN," "); break; |
|---|
| 269 | case 2: |
|---|
| 270 | *str_len = snprintf(ts_str,MAX_TSTR_LEN,"%s", get_eas_text_line()); |
|---|
| 271 | break; |
|---|
| 272 | case 3: |
|---|
| 273 | /* scrolling position */ |
|---|
| 274 | //offset = s_eas_text_scrolling_info.eas.eas_current; |
|---|
| 275 | *str_len = snprintf(ts_str,MAX_TSTR_LEN,"%s", get_eas_text_line()); |
|---|
| 276 | // if line by line scrolling up |
|---|
| 277 | //if (offset) |
|---|
| 278 | // s_eas_text_scrolling_info.eas.eas_current = offset; |
|---|
| 279 | break; |
|---|
| 280 | } |
|---|
| 281 | |
|---|
| 282 | if (*str_len) |
|---|
| 283 | { |
|---|
| 284 | *str_len = c_to_uni_str(ts_str,p_uni_str,*str_len); |
|---|
| 285 | } |
|---|
| 286 | } |
|---|
| 287 | |
|---|
| 288 | /* |
|---|
| 289 | Summary: |
|---|
| 290 | Use the this function to get a UNI string. |
|---|
| 291 | */ |
|---|
| 292 | static void get_eas_text_scrolling_info_str(bapp_t *p_app, |
|---|
| 293 | int text_id, /* Text id */ |
|---|
| 294 | unsigned int *p_uni_str, /* Buffer to put UNI string into */ |
|---|
| 295 | unsigned int *str_len, /* On input the max length in words on output the actual size in characters. */ |
|---|
| 296 | int page) /* page index */ |
|---|
| 297 | { |
|---|
| 298 | switch (page) |
|---|
| 299 | { |
|---|
| 300 | default: |
|---|
| 301 | case 0: get_page_0_str(p_app,text_id,p_uni_str,str_len); break; |
|---|
| 302 | } |
|---|
| 303 | } |
|---|
| 304 | |
|---|
| 305 | /* |
|---|
| 306 | Summary: |
|---|
| 307 | Status screen drawing function. |
|---|
| 308 | */ |
|---|
| 309 | void bscreen_eas_text_scrolling_info_draw(void *v_app, void *v_screen) |
|---|
| 310 | { |
|---|
| 311 | bapp_t *p_app = (bapp_t*)v_app; |
|---|
| 312 | bscreen_t *p_screen = (bscreen_t*)v_screen; |
|---|
| 313 | uint16_t x,y,y_off; |
|---|
| 314 | unsigned int num_chars = 0; |
|---|
| 315 | int i = 0,page,size; |
|---|
| 316 | |
|---|
| 317 | page = p_screen->local_state; |
|---|
| 318 | x = eEAS_TEXT_X; |
|---|
| 319 | y = eEAS_TEXT_Y; |
|---|
| 320 | |
|---|
| 321 | bgfx_fill_rect(&p_app->surf,x,y,eEAS_TEXT_WIDTH,eEAS_TEXT_HEIGHT,eCOLOR_BLACK_65); |
|---|
| 322 | y += eEAS_ROW_HEIGHT; |
|---|
| 323 | |
|---|
| 324 | while (*(s_eas_text_scrolling_info_str[page][i]) != '\0') |
|---|
| 325 | { |
|---|
| 326 | y_off = y + (i * eEAS_ROW_HEIGHT); |
|---|
| 327 | if ((y_off + eEAS_ROW_HEIGHT) >= eHEIGHT) |
|---|
| 328 | { |
|---|
| 329 | BDBG_WRN(("%s too many rows %d, y = %d",__FUNCTION__,i,y_off)); |
|---|
| 330 | break; |
|---|
| 331 | } |
|---|
| 332 | bgfx_fill_rect(&p_app->surf,x,y_off,eEAS_TEXT_WIDTH,eEAS_ROW_HEIGHT,eCOLOR_BLACK_65); |
|---|
| 333 | num_chars = SCREEN_MAX_STR_WIDTH; |
|---|
| 334 | if (0 == i) { |
|---|
| 335 | char *p = NULL, event[30]; |
|---|
| 336 | |
|---|
| 337 | if (s_eas_text_scrolling_info.eas.header.nature_of_activation_text_length) { |
|---|
| 338 | p = TS_SCTE_18_getActivationTextOffset((const char *)s_eas_text_scrolling_info.eas.p_eas, &size); |
|---|
| 339 | if (p) { |
|---|
| 340 | if (eas_process_mss(p_app, p, event, sizeof(event) - 1)) { |
|---|
| 341 | p = NULL; |
|---|
| 342 | } |
|---|
| 343 | } |
|---|
| 344 | else { |
|---|
| 345 | BDBG_WRN(("TS_SCTE_18_getActivationTextOffset failed")); |
|---|
| 346 | } |
|---|
| 347 | } |
|---|
| 348 | if (!p) { |
|---|
| 349 | strcpy(event, "EAS Alert\n"); |
|---|
| 350 | } |
|---|
| 351 | num_chars = c_to_uni_str(event, p_app->tmp_str, strlen(event)); |
|---|
| 352 | text_box(&p_app->surf, p_app->p_font[eLANG_ENGLISH][eFONT_SIZE_SMALL], |
|---|
| 353 | x + 10, y_off, eEAS_TEXT_WIDTH - 10, eEAS_ROW_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_LT_YELLOW, 0); |
|---|
| 354 | } |
|---|
| 355 | else { |
|---|
| 356 | num_chars = SCREEN_MAX_STR_WIDTH; |
|---|
| 357 | get_eas_text_scrolling_info_str(p_app,i,p_app->tmp_str, &num_chars,page); |
|---|
| 358 | if (num_chars) { |
|---|
| 359 | text_box(&p_app->surf, p_app->p_font[eLANG_ENGLISH][eFONT_SIZE_SMALL], |
|---|
| 360 | x + 10, y_off, eEAS_TEXT_WIDTH - 10, eEAS_ROW_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,0); |
|---|
| 361 | } |
|---|
| 362 | } |
|---|
| 363 | i++; |
|---|
| 364 | } |
|---|
| 365 | } |
|---|
| 366 | |
|---|
| 367 | int bscreen_eas_text_scrolling_info_event(void *v_app, void *v_screen, bscreen_event_t *p_event) |
|---|
| 368 | { |
|---|
| 369 | bapp_t *p_app = (bapp_t*)v_app; |
|---|
| 370 | bscreen_t *p_screen = (bscreen_t*)v_screen; |
|---|
| 371 | int result = 0; |
|---|
| 372 | |
|---|
| 373 | static int cnt = 0; |
|---|
| 374 | |
|---|
| 375 | switch (p_event->type) |
|---|
| 376 | { |
|---|
| 377 | case eS_EVENT_SETUP: |
|---|
| 378 | screen_null_draw(v_app, v_screen); |
|---|
| 379 | p_screen->local_state = 0; |
|---|
| 380 | s_eas_text_scrolling_info.state = eEAS_TEXT_LINE_0; |
|---|
| 381 | bapp_enable_cc(p_app, 0); |
|---|
| 382 | break; |
|---|
| 383 | |
|---|
| 384 | case eS_EVENT_IDLE: |
|---|
| 385 | { |
|---|
| 386 | if (cnt++ == 50) |
|---|
| 387 | { |
|---|
| 388 | cnt = 0; |
|---|
| 389 | /* if no more text to draw, redraw from beginning */ |
|---|
| 390 | if (s_eas_text_scrolling_info.eas.eas_current >= s_eas_text_scrolling_info.eas.eas_text_len) |
|---|
| 391 | s_eas_text_scrolling_info.eas.eas_current = 0; |
|---|
| 392 | bapp_sync(p_app); |
|---|
| 393 | bscreen_eas_text_scrolling_info_draw(v_app,v_screen); |
|---|
| 394 | bapp_flush_screen(p_app); |
|---|
| 395 | } |
|---|
| 396 | } |
|---|
| 397 | break; |
|---|
| 398 | |
|---|
| 399 | case eS_EVENT_IR: |
|---|
| 400 | { |
|---|
| 401 | switch (p_event->id) |
|---|
| 402 | { |
|---|
| 403 | #ifdef BCM_DEBUG |
|---|
| 404 | case eIR_CH_UP: |
|---|
| 405 | case eIR_UP: |
|---|
| 406 | if (p_app->state == eAPP_STATE_NORMAL) |
|---|
| 407 | { |
|---|
| 408 | bapp_change_channel(p_app,1,1); |
|---|
| 409 | result = 1; |
|---|
| 410 | } |
|---|
| 411 | break; |
|---|
| 412 | case eIR_CH_DOWN: |
|---|
| 413 | case eIR_DOWN: |
|---|
| 414 | if (p_app->state == eAPP_STATE_NORMAL) |
|---|
| 415 | { |
|---|
| 416 | bapp_change_channel(p_app,0,1); |
|---|
| 417 | result = 1; |
|---|
| 418 | } |
|---|
| 419 | break; |
|---|
| 420 | #endif |
|---|
| 421 | |
|---|
| 422 | /* for test */ |
|---|
| 423 | case eIR_INFO: |
|---|
| 424 | bapp_set_current_screen(p_app, eSCREEN_BANNER, eSCREEN_MAX); |
|---|
| 425 | result = 1; |
|---|
| 426 | break; |
|---|
| 427 | #ifdef BCM_DEBUG |
|---|
| 428 | case eIR_MENU: |
|---|
| 429 | bapp_reset_settings(p_app); |
|---|
| 430 | WriteReg32(SCRATCH_CMD_BASE,eIR_SCAN); |
|---|
| 431 | break; |
|---|
| 432 | case eIR_GUIDE: |
|---|
| 433 | bapp_reset_settings(p_app); |
|---|
| 434 | WriteReg32(SCRATCH_CMD_BASE,eIR_SETUP); |
|---|
| 435 | break; |
|---|
| 436 | #endif |
|---|
| 437 | |
|---|
| 438 | default: |
|---|
| 439 | break; |
|---|
| 440 | } |
|---|
| 441 | break; |
|---|
| 442 | } |
|---|
| 443 | break; |
|---|
| 444 | default: |
|---|
| 445 | result = bscreen_default_event(v_app,v_screen,p_event); |
|---|
| 446 | break; |
|---|
| 447 | } |
|---|
| 448 | return result; /* always handle event */ |
|---|
| 449 | } |
|---|
| 450 | |
|---|