/*************************************************************************** * Copyright (c) 2003-2006, Broadcom Corporation * All Rights Reserved * Confidential Property of Broadcom Corporation * * THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE * AGREEMENT BETWEEN THE USER AND BROADCOM. YOU HAVE NO RIGHT TO USE OR * EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT. * * $brcm_Workfile: $ * $brcm_Revision: $ * $brcm_Date: $ * * Module Description: * * Revision History: * * $brcm_Log: $ * ***************************************************************************/ #include "bapp.h" #include "bstd.h" #include "bapp_util.h" #include "bgfx.h" #include "chan_mgr.h" #include "psip_rrt.h" #include "ts_scte_18.h" #define CONFIRM_TIMEOUT_TICKS MS_TO_TICKS(8 * 1000) BDBG_MODULE(bscreen); /* Register software module with debug interface */ static bsettop_display_format_t s_temp_format; static bool s_confirm_change = false; /* move it here so that AR button handle can use it */ static bdisplay_settings g_display_settings; //#define TEST_RRT /* local function declarations */ void screen_null_draw(void *v_app, void *v_screen); void banner_null_draw(void *v_app, void *v_screen); void popup_null_draw(void *v_app, void *v_screen); void bscreen_popup_draw(void *v_app, void *v_screen, btext_id_t title, btext_id_t desc); static void adjust_button_orientation(void *v_app, bbutton_t *p_button); void bscreen_eas_text_scrolling_info_draw(void *v_app, void *v_screen); #define SCREEN_MIN(a,b) ((a)<(b) ? (a) : (b)) /* min macro */ /* this table is used to select an language order */ const static unsigned int iso_lang_priority[] = { 0, /* eLANG_ENGLISH */ 1, /* eLANG_SPANISH */ 8, /* OTHER */ }; #define EAS_TEXT_X (eSCREEN_ACTION_SAFE_X) #define EAS_TEXT_Y (eSCREEN_ACTION_SAFE_Y) #define EAS_TEXT_WIDTH (eSCREEN_ACTION_SAFE_WIDTH) #define EAS_TEXT_Y_OFF 4 #define EAS_TEXT_X_SAFE_EDGE 4 #define EAS_SCROLL_STEP 2 #define EAS_ROW_HEIGHT 28 /* * Summary: * process the MSS string * Returns non-zero on failure. */ int eas_process_mss(bapp_t *p_app, /* [in] pointer to p_app */ PSIP_MSS_string p_mss, /* [in] Pointer to MSS */ unsigned char *mss_buf, /* [out] string buffer */ unsigned int mss_len) /* [out] string buffer length */ { int str_idx,lsize; char *p_code; BERR_Code retcode; int num_str; unsigned int max_priority = 0xffff; unsigned int max_index = 0; bapp_lang_t lang; if (!p_mss || !mss_buf || !mss_len) return BERR_INVALID_PARAMETER; num_str = PSIP_MSS_getNumStrings(p_mss); memset(mss_buf,0,mss_len); for (str_idx = 0; str_idx < num_str; ++str_idx) { if ((retcode = PSIP_MSS_getCode(p_mss,str_idx, &p_code)) != BERR_SUCCESS) { BDBG_WRN(("PSIP_MSS_getCode:%d failed %d",__LINE__,retcode)); memset(mss_buf,0,mss_len); continue; } lang = iso_639_to_lang(p_code); if (lang == eLANG_MAX) { BDBG_WRN(("unsupported eas text lang code : %c%c%c", *p_code,*(p_code+1),*(p_code+2))); continue; } if (lang == p_app->lang) { max_index = str_idx; max_priority = 0; break; } /* if we did not find language check priority of the language we found */ if (iso_lang_priority[lang] < max_priority) { max_priority = iso_lang_priority[lang]; max_index = str_idx; } } if (max_priority < 0xffff) { lsize = mss_len; if ((retcode = PSIP_MSS_getString(p_mss,max_index,&lsize,(char*)mss_buf)) != BERR_SUCCESS) { BDBG_ERR(("MSS invalid %d",retcode)); return retcode; } BDBG_MSG(("%s:%d idx = %d, %d/%d-%s",__FUNCTION__,__LINE__,str_idx,lsize,mss_len,mss_buf)); return 0; } BDBG_WRN(("%s:%d no valid string found, num_str = %d",__FUNCTION__,__LINE__,num_str)); return BERR_NOT_SUPPORTED; } screensaver_state_t g_screensaver_state = { 0 }; banner_state_t g_banner_state = { { 0, 0, 0}, { 0, 0, 0}, 0, 0, false, false, eLS_BANNER_OFF, { eS_EVENT_MAX, 0, 0}, 0, 0, 0, 0, 0, 0 }; /* Summary: screen button arrays. */ bbutton_t g_buttons_main[] = { {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 0 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_GUIDE_BUTTON,eTEXT_GUIDE_INFO,eSCREEN_GUIDE, eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 1 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_AV_BUTTON,eTEXT_AV_INFO,eSCREEN_AV, eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #ifndef NO_VCHIP {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 2 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RATINGS_BUTTON,eTEXT_RATINGS_INFO,eSCREEN_PIN_VERIFY_RATINGS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #ifdef CONFIG_EIA_708 {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 3 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_BUTTON,eTEXT_CAPTIONS_INFO,eSCREEN_CAPTIONS_ADVANCED,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 4 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SETUP_BUTTON,eTEXT_SETUP_INFO,eSCREEN_SETUP,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #else {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 3 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SETUP_BUTTON,eTEXT_SETUP_INFO,eSCREEN_SETUP,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 4 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RESET_BUTTON,eTEXT_RESET_INFO,eSCREEN_PIN_VERIFY_RESET,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #endif #else #ifdef CONFIG_EIA_708 {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 2 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_BUTTON,eTEXT_CAPTIONS_INFO,eSCREEN_CAPTIONS_ADVANCED,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 3 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SETUP_BUTTON,eTEXT_SETUP_INFO,eSCREEN_SETUP,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #else {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 2 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SETUP_BUTTON,eTEXT_SETUP_INFO,eSCREEN_SETUP,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_FIRST_BUTTON_X,eMENU_FIRST_BUTTON_Y + 3 * eMENU_BUTTON_INC_Y,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RESET_BUTTON,eTEXT_RESET_INFO,eSCREEN_PIN_VERIFY_RESET,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #endif #endif }; bbutton_t g_buttons_picture[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_PICTURES_FIRST_BUTTON_X,eMENU_PICTURES_FIRST_BUTTON_Y,eMENU_PICTURES_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_WIDESCREEN_BUTTON,eTEXT_WIDESCREEN_INFO,eSCREEN_PICTURE,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_PICTURES_FIRST_BUTTON_X,eMENU_PICTURES_FIRST_BUTTON_Y + eMENU_PICTURES_BUTTON_INC_Y,eMENU_PICTURES_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_FULLSCREEN_BUTTON,eTEXT_FULLSCREEN_INFO,eSCREEN_PICTURE,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_timezone[] = { #ifdef ACB612 /* NOTE that the auto zone configuration is removed from ACB613 product since there is no reliable TSID available for Mexico market */ {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_CENTRAL_BUTTON,eTEXT_TIMEZONE_CENTRAL_BUTTON_INFO,eSCREEN_TIMEZONE,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 1 * eMENU_TIMEZONE_BUTTON_INC_Y,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_MOUNTAIN_BUTTON,eTEXT_TIMEZONE_MOUNTAIN_BUTTON_INFO,eSCREEN_TIMEZONE,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 2 * eMENU_TIMEZONE_BUTTON_INC_Y,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_PACIFIC_BUTTON,eTEXT_TIMEZONE_PACIFIC_BUTTON_INFO,eSCREEN_TIMEZONE,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 3 * eMENU_TIMEZONE_BUTTON_INC_Y,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_DST_BUTTON,eTEXT_TIMEZONE_DST_BUTTON_INFO,eSCREEN_TIMEZONE,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, #else {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y - 5,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_AUTO_BUTTON,eTEXT_TIMEZONE_AUTO_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 1 * eMENU_TIMEZONE_BUTTON_INC_Y + 5,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_EAST_BUTTON,eTEXT_TIMEZONE_EAST_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 2 * eMENU_TIMEZONE_BUTTON_INC_Y-6,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_CENTRAL_BUTTON,eTEXT_TIMEZONE_CENTRAL_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 3 * eMENU_TIMEZONE_BUTTON_INC_Y-6,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_MOUNTAIN_BUTTON,eTEXT_TIMEZONE_MOUNTAIN_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 4 * eMENU_TIMEZONE_BUTTON_INC_Y-6,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_PACIFIC_BUTTON,eTEXT_TIMEZONE_PACIFIC_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK,eMENU_TIMEZONE_FIRST_BUTTON_X,eMENU_TIMEZONE_FIRST_BUTTON_Y + 5 * eMENU_TIMEZONE_BUTTON_INC_Y-6,eMENU_TIMEZONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TIMEZONE_DST_BUTTON,eTEXT_TIMEZONE_DST_BUTTON_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, #endif }; bbutton_t g_buttons_sound[] = { {eBUTTON_RADIO|eBUTTON_MENU, eMENU_SOUND_FIRST_BUTTON_X, eMENU_SOUND_FIRST_BUTTON_Y, eMENU_SOUND_BUTTON_WIDTH, eBUTTON_HEIGHT,eTEXT_STEREO_BUTTON, eTEXT_STEREO_INFO , eSCREEN_SOUND, eSCREEN_MAIN, 1, eCOLOR_MED_BLUE }, {eBUTTON_RADIO|eBUTTON_MENU, eMENU_SOUND_FIRST_BUTTON_X, eMENU_SOUND_FIRST_BUTTON_Y + 1 * eMENU_SOUND_BUTTON_INC_Y, eMENU_SOUND_BUTTON_WIDTH, eBUTTON_HEIGHT,eTEXT_SAP_BUTTON, eTEXT_SAP_INFO, eSCREEN_SOUND, eSCREEN_MAIN, 1, eCOLOR_MED_BLUE }, }; bbutton_t g_buttons_av[] = { {eBUTTON_MENU,eMENU_AV_FIRST_BUTTON_X,eMENU_AV_FIRST_BUTTON_Y + eMENU_AV_BUTTON_INC_Y,eMENU_AV_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SOUND_BUTTON,eTEXT_SOUND_INFO,eSCREEN_SOUND,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_AV_FIRST_BUTTON_X,eMENU_AV_FIRST_BUTTON_Y + 2 * eMENU_AV_BUTTON_INC_Y,eMENU_AV_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SD_CONFIG_OPTIONS_BUTTON,eTEXT_SD_CONFIG_OPTIONS,eSCREEN_PICTURE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_AV_FIRST_BUTTON_X,eMENU_AV_FIRST_BUTTON_Y + 3 * eMENU_AV_BUTTON_INC_Y,eMENU_AV_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RFM_CONFIG_OPTIONS_BUTTON,eTEXT_RFM_CONFIG_OPTIONS_DESC,eSCREEN_RFM,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_rfm[] = { {eBUTTON_RADIO|eBUTTON_MENU, eMENU_PICTURES_FIRST_BUTTON_X, eMENU_PICTURES_FIRST_BUTTON_Y, eMENU_PICTURES_BUTTON_WIDTH, eBUTTON_HEIGHT, eTEXT_RFM_CONFIG_OPTIONS_BUTTON_CH3, eTEXT_RFM_CONFIG_OPTIONS_CH3, eSCREEN_RFM, eSCREEN_MAIN, 1, eCOLOR_MED_BLUE }, {eBUTTON_RADIO|eBUTTON_MENU, eMENU_PICTURES_FIRST_BUTTON_X, eMENU_PICTURES_FIRST_BUTTON_Y + eMENU_PICTURES_BUTTON_INC_Y, eMENU_PICTURES_BUTTON_WIDTH, eBUTTON_HEIGHT, eTEXT_RFM_CONFIG_OPTIONS_BUTTON_CH4, eTEXT_RFM_CONFIG_OPTIONS_CH4, eSCREEN_RFM, eSCREEN_MAIN, 1, eCOLOR_MED_BLUE }, }; bbutton_t g_buttons_language[] = { #ifdef ACB612 /*janzy@20120823,change SPANISH and ENGLISH place*/ {eBUTTON_RADIO|eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y, eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SPANISH_BUTTON,eTEXT_SPANISH_INFO,eSCREEN_LANGUAGE,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y+ eMENU_LANGUAGE_BUTTON_INC_Y, eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ENGLISH_BUTTON,eTEXT_ENGLISH_INFO ,eSCREEN_LANGUAGE,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, #else {eBUTTON_RADIO|eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ENGLISH_BUTTON,eTEXT_ENGLISH_INFO ,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y + eMENU_LANGUAGE_BUTTON_INC_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SPANISH_BUTTON,eTEXT_SPANISH_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y + 2 * eMENU_LANGUAGE_BUTTON_INC_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_FRENCH_BUTTON,eTEXT_FRENCH_INFO,eSCREEN_SETUP,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, #endif }; bbutton_t g_buttons_captions_advanced[] = { {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,(eMENU_CAPTIONS_FIRST_BUTTON_Y),eMENU_CAPTIONS_ADVANCED_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_OPTIONS_BUTTON,eTEXT_CAPTIONS_FONT_OPTIONS_INFO,eSCREEN_CAPTIONS_FONT_OPTIONS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,(eMENU_CAPTIONS_FIRST_BUTTON_Y + eMENU_CAPTIONS_BUTTON_INC_Y - 12),eMENU_CAPTIONS_ADVANCED_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_BACK_OPTIONS_BUTTON,eTEXT_CAPTIONS_BACK_OPTIONS_INFO,eSCREEN_CAPTIONS_BACK_OPTIONS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU, eMENU_CAPTIONS_FIRST_BUTTON_X, eMENU_CAPTIONS_FIRST_BUTTON_Y + 2 * (eMENU_CAPTIONS_BUTTON_INC_Y - 12), eMENU_CAPTIONS_ADVANCED_BUTTON_WIDTH, eBUTTON_HEIGHT, eTEXT_CAPTIONS_DEFAULT_BUTTON, eTEXT_CAPTIONS_DEFAULT_INFO, eSCREEN_CAPTIONS_RESET, eSCREEN_MAX, 1, eCOLOR_MED_BLUE }, {eBUTTON_MENU, eMENU_CAPTIONS_FIRST_BUTTON_X, eMENU_CAPTIONS_FIRST_BUTTON_Y + 3 * (eMENU_CAPTIONS_BUTTON_INC_Y - 12), eMENU_CAPTIONS_ADVANCED_BUTTON_WIDTH, eBUTTON_HEIGHT, eTEXT_CAPTIONS_DIGITAL_BUTTON, eTEXT_CAPTIONS_DIGITAL_DESC, eSCREEN_DIGITAL, eSCREEN_MAX, 1, eCOLOR_MED_BLUE }, }; bbutton_t g_buttons_captions_font_options[] = { {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_OPTIONS_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_BUTTON,eTEXT_CAPTIONS_FONT_INFO,eSCREEN_CAPTIONS_FONT,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_OPTIONS_FIRST_BUTTON_Y + eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_SIZE_BUTTON,eTEXT_CAPTIONS_FONT_SIZE_INFO,eSCREEN_CAPTIONS_FONT_SIZE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_OPTIONS_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_STYLE_BUTTON,eTEXT_CAPTIONS_FONT_STYLE_INFO,eSCREEN_CAPTIONS_FONT_STYLE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_OPTIONS_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_COLOR_BUTTON,eTEXT_CAPTIONS_FONT_COLOR_INFO,eSCREEN_CAPTIONS_FONT_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_OPTIONS_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_OPACITY_BUTTON,eTEXT_CAPTIONS_FONT_OPACITY_INFO,eSCREEN_CAPTIONS_FONT_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_back_options[] = { {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_BACK_OPTIONS_FIRST_BUTTON_Y,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_EDGE_COLOR_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_INFO,eSCREEN_CAPTIONS_EDGE_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_BACK_OPTIONS_FIRST_BUTTON_Y + eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_EDGE_TYPE_BUTTON,eTEXT_CAPTIONS_EDGE_TYPE_INFO,eSCREEN_CAPTIONS_EDGE_TYPE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_BACK_OPTIONS_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_BACKGROUND_COLOR_BUTTON,eTEXT_CAPTIONS_BACKGROUND_COLOR_INFO,eSCREEN_CAPTIONS_BACK_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_BACK_OPTIONS_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_WIDTH,eMENU_CAPTIONS_BACK_OPTIONS_BUTTON_HEIGHT,eTEXT_CAPTIONS_BACKGROUND_OPACITY_BUTTON,eTEXT_CAPTIONS_BACKGROUND_OPACITY_INFO,eSCREEN_CAPTIONS_BACK_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_font[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_FONT_DEFAULT_INFO,eSCREEN_CAPTIONS_FONT,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_MONO_SERIF_BUTTON,eTEXT_CAPTIONS_FONT_MONO_SERIF_INFO,eSCREEN_CAPTIONS_FONT,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_PROP_SERIF_BUTTON,eTEXT_CAPTIONS_FONT_PROP_SERIF_INFO,eSCREEN_CAPTIONS_FONT,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_MONOSPACE_BUTTON,eTEXT_CAPTIONS_FONT_MONOSPACE_INFO,eSCREEN_CAPTIONS_FONT,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_PROPORTIONAL_BUTTON,eTEXT_CAPTIONS_FONT_PROPORTIONAL_INFO,eSCREEN_CAPTIONS_FONT,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 5 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_CASUAL_BUTTON,eTEXT_CAPTIONS_FONT_CASUAL_INFO,eSCREEN_CAPTIONS_FONT,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 6 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_CURSIVE_BUTTON,eTEXT_CAPTIONS_FONT_CURSIVE_INFO,eSCREEN_CAPTIONS_FONT,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 7 * eMENU_CAPTIONS_FONT_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_SMALL_CAPS_BUTTON,eTEXT_CAPTIONS_FONT_SMALL_CAPS_INFO,eSCREEN_CAPTIONS_FONT,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_font_size[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_SIZE_BUTTON_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_FONT_DEFAULT_SIZE_INFO ,eSCREEN_CAPTIONS_FONT_SIZE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_SIZE_BUTTON_Y + 1 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_SMALL_BUTTON,eTEXT_CAPTIONS_FONT_SMALL_INFO ,eSCREEN_CAPTIONS_FONT_SIZE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_SIZE_BUTTON_Y + 2 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_STANDARD_BUTTON,eTEXT_CAPTIONS_FONT_STANDARD_INFO,eSCREEN_CAPTIONS_FONT_SIZE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_SIZE_BUTTON_Y + 3 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_LARGE_BUTTON,eTEXT_CAPTIONS_FONT_LARGE_INFO,eSCREEN_CAPTIONS_FONT_SIZE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_font_style[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_STYLE_BUTTON_Y + 0 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_NORMAL_BUTTON,eTEXT_CAPTIONS_FONT_NORMAL_INFO ,eSCREEN_CAPTIONS_FONT_STYLE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_STYLE_BUTTON_Y + 1 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_ITALIC_BUTTON,eTEXT_CAPTIONS_FONT_ITALIC_INFO,eSCREEN_CAPTIONS_FONT_STYLE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_STYLE_BUTTON_Y + 2 * eMENU_CAPTIONS_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_STYLE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_UNDERLINE_BUTTON,eTEXT_CAPTIONS_FONT_UNDERLINE_INFO,eSCREEN_CAPTIONS_FONT_STYLE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_font_color[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_COLOR_DEFAULT_INFO,eSCREEN_CAPTIONS_FONT_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_WHITE_BUTTON,eTEXT_CAPTIONS_COLOR_WHITE_INFO,eSCREEN_CAPTIONS_FONT_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLACK_BUTTON,eTEXT_CAPTIONS_COLOR_BLACK_INFO,eSCREEN_CAPTIONS_FONT_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_RED_BUTTON,eTEXT_CAPTIONS_COLOR_RED_INFO,eSCREEN_CAPTIONS_FONT_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_GREEN_BUTTON,eTEXT_CAPTIONS_COLOR_GREEN_INFO,eSCREEN_CAPTIONS_FONT_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 5 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLUE_BUTTON,eTEXT_CAPTIONS_COLOR_BLUE_INFO,eSCREEN_CAPTIONS_FONT_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 6 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_YELLOW_BUTTON,eTEXT_CAPTIONS_COLOR_YELLOW_INFO,eSCREEN_CAPTIONS_FONT_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 7 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_MAGENTA_BUTTON,eTEXT_CAPTIONS_COLOR_MAGENTA_INFO,eSCREEN_CAPTIONS_FONT_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 8 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_CYAN_BUTTON,eTEXT_CAPTIONS_COLOR_CYAN_INFO,eSCREEN_CAPTIONS_FONT_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_edge_color[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_DEFAULT_INFO,eSCREEN_CAPTIONS_EDGE_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_WHITE_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_WHITE_INFO,eSCREEN_CAPTIONS_EDGE_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLACK_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_BLACK_INFO,eSCREEN_CAPTIONS_EDGE_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_RED_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_RED_INFO,eSCREEN_CAPTIONS_EDGE_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_GREEN_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_GREEN_INFO,eSCREEN_CAPTIONS_EDGE_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 5 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLUE_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_BLUE_INFO,eSCREEN_CAPTIONS_EDGE_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 6 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_YELLOW_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_YELLOW_INFO,eSCREEN_CAPTIONS_EDGE_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 7 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_MAGENTA_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_MAGENTA_INFO,eSCREEN_CAPTIONS_EDGE_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 8 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_CYAN_BUTTON,eTEXT_CAPTIONS_EDGE_COLOR_CYAN_INFO,eSCREEN_CAPTIONS_EDGE_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_color[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_DEFAULT_INFO,eSCREEN_CAPTIONS_BACK_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_WHITE_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_WHITE_INFO,eSCREEN_CAPTIONS_BACK_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLACK_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_BLACK_INFO,eSCREEN_CAPTIONS_BACK_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_RED_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_RED_INFO,eSCREEN_CAPTIONS_BACK_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_GREEN_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_GREEN_INFO,eSCREEN_CAPTIONS_BACK_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 5 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_BLUE_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_BLUE_INFO,eSCREEN_CAPTIONS_BACK_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 6 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_YELLOW_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_YELLOW_INFO,eSCREEN_CAPTIONS_BACK_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 7 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_MAGENTA_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_MAGENTA_INFO,eSCREEN_CAPTIONS_BACK_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_FONT_FIRST_BUTTON_Y + 8 * eMENU_CAPTIONS_FONT_COLOR_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_BUTTON_WIDTH,eMENU_CAPTIONS_FONT_COLOR_BUTTON_HEIGHT,eTEXT_CAPTIONS_COLOR_CYAN_BUTTON,eTEXT_CAPTIONS_BACK_COLOR_CYAN_INFO,eSCREEN_CAPTIONS_BACK_COLOR,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_font_opacity[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_FONT_OPACITY_DEFAULT_INFO,eSCREEN_CAPTIONS_FONT_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_TRANSPARENT_BUTTON,eTEXT_CAPTIONS_FONT_TRANSPARENT_INFO,eSCREEN_CAPTIONS_FONT_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_TRANSLUCENT_BUTTON,eTEXT_CAPTIONS_FONT_TRANSLUCENT_INFO,eSCREEN_CAPTIONS_FONT_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_SOLID_BUTTON,eTEXT_CAPTIONS_FONT_SOLID_INFO,eSCREEN_CAPTIONS_FONT_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #ifndef ACB612/*janzy@20121106,remove Text is a solid flashing color*/ {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FLASHING_BUTTON,eTEXT_CAPTIONS_FONT_FLASHING_INFO,eSCREEN_CAPTIONS_FONT_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #endif }; bbutton_t g_buttons_captions_back_opacity[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_FONT_OPACITY_DEFAULT_INFO,eSCREEN_CAPTIONS_BACK_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_TRANSPARENT_BUTTON,eTEXT_CAPTIONS_BACK_TRANSPARENT_INFO,eSCREEN_CAPTIONS_BACK_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_TRANSLUCENT_BUTTON,eTEXT_CAPTIONS_BACK_TRANSLUCENT_INFO,eSCREEN_CAPTIONS_BACK_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_SOLID_BUTTON,eTEXT_CAPTIONS_BACK_SOLID_INFO,eSCREEN_CAPTIONS_BACK_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #ifndef ACB612/*janzy@20121106,remove Text is a solid flashing color*/ {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_OPACITY_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_OPACITY_BUTTON_INC_Y,eMENU_CAPTIONS_FONT_OPACITY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FLASHING_BUTTON,eTEXT_CAPTIONS_BACK_FLASHING_INFO,eSCREEN_CAPTIONS_BACK_OPACITY,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #endif }; bbutton_t g_buttons_captions_edge_type[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_FONT_DEFAULT_BUTTON,eTEXT_CAPTIONS_EDGE_TYPE_DEFAULT_INFO,eSCREEN_CAPTIONS_EDGE_TYPE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y + eMENU_CAPTIONS_EDGE_TYPE_BUTTON_INC_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_RAISED_BUTTON,eTEXT_CAPTIONS_RAISED_INFO,eSCREEN_CAPTIONS_EDGE_TYPE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y + 2 * eMENU_CAPTIONS_EDGE_TYPE_BUTTON_INC_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_DEPRESSED_BUTTON,eTEXT_CAPTIONS_DEPRESSED_INFO,eSCREEN_CAPTIONS_EDGE_TYPE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y + 3 * eMENU_CAPTIONS_EDGE_TYPE_BUTTON_INC_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_UNIFORM_BUTTON,eTEXT_CAPTIONS_UNIFORM_INFO,eSCREEN_CAPTIONS_EDGE_TYPE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y + 4 * eMENU_CAPTIONS_EDGE_TYPE_BUTTON_INC_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_SHADOW_LEFT_BUTTON,eTEXT_CAPTIONS_SHADOW_LEFT_INFO,eSCREEN_CAPTIONS_EDGE_TYPE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_CAPTIONS_FIRST_BUTTON_X,eMENU_CAPTIONS_EDGE_TYPE_FIRST_BUTTON_Y + 5 * eMENU_CAPTIONS_EDGE_TYPE_BUTTON_INC_Y,eMENU_CAPTIONS_EDGE_TYPE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CAPTIONS_SHADOW_RIGHT_BUTTON,eTEXT_CAPTIONS_SHADOW_RIGHT_INFO,eSCREEN_CAPTIONS_EDGE_TYPE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_reset[] = { {eBUTTON_MENU,eMENU_RESET_FIRST_BUTTON_X,eMENU_CAPTIONS_RESET_FIRST_BUTTON_Y,eMENU_RESET_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO ,eSCREEN_SETUP,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RESET_FIRST_BUTTON_X,eMENU_CAPTIONS_RESET_FIRST_BUTTON_Y + eMENU_RESET_BUTTON_INC_Y,eMENU_RESET_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RESET_CONFIRM_BUTTON,eTEXT_RESET_CAPTIONS_CONFIRM_INFO,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_setup[] = { {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CH_SCAN_BUTTON,eTEXT_CH_SCAN_INFO ,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y + eMENU_SETUP_BUTTON_INC_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_LANGUAGE_BUTTON,eTEXT_LANGUAGE_INFO,eSCREEN_LANGUAGE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y + 2 * eMENU_SETUP_BUTTON_INC_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_AUTO_POWER_BUTTON,eTEXT_AUTO_POWER_INFO,eSCREEN_AUTO_POWER,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y + 3 * eMENU_SETUP_BUTTON_INC_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ANTENNA_BUTTON,eTEXT_ANTENNA_INFO,eSCREEN_ANTENNA,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y + 4 * eMENU_SETUP_BUTTON_INC_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SETTINGS_TIMEZONE_BUTTON,eTEXT_SETTINGS_TIMEZONE_INFO,eSCREEN_TIMEZONE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #ifdef CONFIG_EIA_708 {eBUTTON_MENU,eMENU_SETUP_FIRST_BUTTON_X,eMENU_SETUP_FIRST_BUTTON_Y + 5 * eMENU_SETUP_BUTTON_INC_Y,eMENU_SETUP_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RESET_BUTTON,eTEXT_RESET_INFO,eSCREEN_PIN_VERIFY_RESET,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #endif }; bbutton_t g_buttons_ch_scan[] = { {eBUTTON_MENU,eMENU_CH_SCAN_FIRST_BUTTON_X,eMENU_CH_SCAN_FIRST_BUTTON_Y,eMENU_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_BEGIN_BUTTON,eTEXT_BEGIN_SCAN_INFO ,eSCREEN_CH_SCAN_PROGRESS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_CH_SCAN_FIRST_BUTTON_X,eMENU_CH_SCAN_FIRST_BUTTON_Y + eMENU_CH_SCAN_BUTTON_INC_Y,eMENU_WIZ_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO,eSCREEN_SETUP,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_reset[] = { {eBUTTON_MENU,eMENU_RESET_FIRST_BUTTON_X,eMENU_RESET_FIRST_BUTTON_Y,eMENU_RESET_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO ,eSCREEN_SETUP,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RESET_FIRST_BUTTON_X,eMENU_RESET_FIRST_BUTTON_Y + eMENU_RESET_BUTTON_INC_Y,eMENU_RESET_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RESET_CONFIRM_BUTTON,eTEXT_RESET_CONFIRM_INFO,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wiz_welcome[] = { {eBUTTON_MENU,eMENU_WIZ_WELCOME_FIRST_BUTTON_X,eMENU_WIZ_WELCOME_FIRST_BUTTON_Y,eMENU_WIZ_WELCOME_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_BEGIN_BUTTON,eTEXT_BEGIN_INFO ,eSCREEN_WIZ_LANGUAGE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wiz_language[] = { #ifdef ACB612/*janzy@20120823,change SPANISH and ENGLISH place*/ {eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SPANISH_BUTTON,eTEXT_SPANISH_INFO,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y+ eMENU_LANGUAGE_BUTTON_INC_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ENGLISH_BUTTON,eTEXT_ENGLISH_INFO ,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #else {eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ENGLISH_BUTTON,eTEXT_ENGLISH_INFO ,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y + eMENU_LANGUAGE_BUTTON_INC_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SPANISH_BUTTON,eTEXT_SPANISH_INFO,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_LANGUAGE_FIRST_BUTTON_X,eMENU_LANGUAGE_FIRST_BUTTON_Y + 2 * eMENU_LANGUAGE_BUTTON_INC_Y,eMENU_LANGUAGE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_FRENCH_BUTTON,eTEXT_FRENCH_INFO,eSCREEN_NULL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, #endif }; bbutton_t g_buttons_wiz_ch_scan[] = { {eBUTTON_MENU,eMENU_WIZ_CH_SCAN_FIRST_BUTTON_X,eMENU_WIZ_CH_SCAN_FIRST_BUTTON_Y,eMENU_WIZ_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_BEGIN_BUTTON,eTEXT_BEGIN_SCAN_INFO ,eSCREEN_CH_SCAN_PROGRESS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_WIZ_CH_SCAN_FIRST_BUTTON_X,eMENU_WIZ_CH_SCAN_FIRST_BUTTON_Y + eMENU_WIZ_CH_SCAN_BUTTON_INC_Y,eMENU_WIZ_CH_SCAN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_DONE_BUTTON,eTEXT_DONE_INFO,eSCREEN_ANTENNA,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_auto_power[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_AUTO_POWER_FIRST_BUTTON_X,eMENU_AUTO_POWER_FIRST_BUTTON_Y,eMENU_AUTO_POWER_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_AUTO_POWER_ON_BUTTON_4H,eTEXT_AUTO_POWER_ON_INFO_4H ,eSCREEN_AUTO_POWER,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_AUTO_POWER_FIRST_BUTTON_X,eMENU_AUTO_POWER_FIRST_BUTTON_Y + eMENU_AUTO_POWER_BUTTON_INC_Y,eMENU_AUTO_POWER_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_AUTO_POWER_ON_BUTTON_8H,eTEXT_AUTO_POWER_ON_INFO_8H,eSCREEN_AUTO_POWER,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_AUTO_POWER_FIRST_BUTTON_X,eMENU_AUTO_POWER_FIRST_BUTTON_Y + 2 * eMENU_AUTO_POWER_BUTTON_INC_Y,eMENU_AUTO_POWER_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_PROGRAM_END,eTEXT_PROGRAM_END_DESC,eSCREEN_AUTO_POWER,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_AUTO_POWER_FIRST_BUTTON_X,eMENU_AUTO_POWER_FIRST_BUTTON_Y + 3 * eMENU_AUTO_POWER_BUTTON_INC_Y,eMENU_AUTO_POWER_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_OFF_BUTTON,eTEXT_AUTO_POWER_OFF_INFO,eSCREEN_AUTO_POWER,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wiz_mismatched_pins[] = { {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y,eMENU_RETRY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RETRY_BUTTON,eTEXT_RETRY_INFO,eSCREEN_WIZ_PIN_NEW,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wiz_done[] = { {eBUTTON_MENU,eMENU_WIZ_DONE_FIRST_BUTTON_X,eMENU_WIZ_DONE_FIRST_BUTTON_Y,eMENU_WIZ_DONE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_FINISH_BUTTON,eTEXT_FINISH_INFO ,eSCREEN_NULL,eSCREEN_NULL, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings[] = { {eBUTTON_MENU,eMENU_RATINGS_FIRST_BUTTON_X,eMENU_RATINGS_FIRST_BUTTON_Y,eMENU_RATINGS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_LOCK_UNLOCK_BUTTON,eTEXT_LOCK_UNLOCK_INFO ,eSCREEN_RATINGS_LOCK,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_FIRST_BUTTON_X,eMENU_RATINGS_FIRST_BUTTON_Y + eMENU_RATINGS_BUTTON_INC_Y,eMENU_RATINGS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_LIMITS_BUTTON,eTEXT_LIMITS_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_FIRST_BUTTON_X,eMENU_RATINGS_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_BUTTON_INC_Y,eMENU_RATINGS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CHANGE_PIN_BUTTON,eTEXT_CHANGE_PIN_INFO,eSCREEN_PIN_NEW,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings_lock[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_RATINGS_LOCK_FIRST_BUTTON_X,eMENU_RATINGS_LOCK_FIRST_BUTTON_Y + 0 * eMENU_RATINGS_LOCK_BUTTON_INC_Y,eMENU_RATINGS_LOCK_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_OFF_BUTTON,eTEXT_OFF_INFO,eSCREEN_RATINGS_LOCK,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_RATINGS_LOCK_FIRST_BUTTON_X,eMENU_RATINGS_LOCK_FIRST_BUTTON_Y + 1 * eMENU_RATINGS_LOCK_BUTTON_INC_Y,eMENU_RATINGS_LOCK_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ON_BUTTON,eTEXT_ON_INFO,eSCREEN_RATINGS_LOCK,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_RATINGS_LOCK_FIRST_BUTTON_X,eMENU_RATINGS_LOCK_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_LOCK_BUTTON_INC_Y,eMENU_RATINGS_LOCK_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_ON_RRT_BUTTON,eTEXT_ON_RRT_INFO,eSCREEN_RATINGS_LOCK,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings_limits[] = { {eBUTTON_MENU,eMENU_RATINGS_LIMITS_FIRST_BUTTON_X,eMENU_RATINGS_LIMITS_FIRST_BUTTON_Y,eMENU_RATINGS_LIMITS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_TV_SHOWS_BUTTON,eTEXT_TV_SHOWS_INFO ,eSCREEN_RATINGS_TV,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_LIMITS_FIRST_BUTTON_X,eMENU_RATINGS_LIMITS_FIRST_BUTTON_Y + eMENU_RATINGS_LIMITS_BUTTON_INC_Y,eMENU_RATINGS_LIMITS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_MOVIES_BUTTON,eTEXT_MOVIES_INFO,eSCREEN_RATINGS_MOVIES,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_LIMITS_FIRST_BUTTON_X,eMENU_RATINGS_LIMITS_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_LIMITS_BUTTON_INC_Y,eMENU_RATINGS_LIMITS_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RRT_DIM_BUTTON,eTEXT_RRT_DIM_INFO,eSCREEN_RATINGS_RRT_DIM,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings_tv[] = { {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 0 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_Y_BUTTON,eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X ,eMENU_RATINGS_TV_FIRST_BUTTON_Y + 1 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_Y7_BUTTON,eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 5 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 1 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_FV_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X ,eMENU_RATINGS_TV_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_G_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X ,eMENU_RATINGS_TV_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_PG_BUTTON,eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 1 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_D_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 2 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_L_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 3 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_S_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 4 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_V_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X ,eMENU_RATINGS_TV_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_14_BUTTON,eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 1 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_D_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 2 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_L_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 3 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_S_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 4 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_V_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_FIRST_BUTTON_X ,eMENU_RATINGS_TV_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_GRID_BUTTON_WIDTH, eBUTTON_HEIGHT_RATINGS,eTEXT_TV_MA_BUTTON,eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 2 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_L_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 3 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_S_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_TV_DLSV_FIRST_BUTTON_X + 4 * eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH, eMENU_RATINGS_TV_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_TV_BUTTON_INC_Y,eMENU_RATINGS_TV_DLSV_GRID_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_V_BUTTON, eTEXT_MAX, eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 0, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings_movies[] = { {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_G_BUTTON,eTEXT_G_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_PG_BUTTON,eTEXT_PG_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_PG_13_BUTTON,eTEXT_PG_13_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_R_BUTTON,eTEXT_R_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_NC_17_BUTTON,eTEXT_NC_17_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_X_BUTTON,eTEXT_X_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_MOVIES_FIRST_BUTTON_X,eMENU_RATINGS_MOVIES_FIRST_BUTTON_Y + 6 * eMENU_RATINGS_MOVIES_BUTTON_INC_Y,eMENU_RATINGS_MOVIES_BUTTON_WIDTH,eBUTTON_HEIGHT_RATINGS,eTEXT_NOT_RATED_BUTTON,eTEXT_NOT_RATED_INFO,eSCREEN_RATINGS_LIMITS,eSCREEN_RATINGS, 1, eCOLOR_MED_BLUE}, }; /* this button array changes dynamically based on received RRT dimension data */ bbutton_t g_buttons_ratings_rrt_dim[] = { {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 1 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 6 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 7 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X,eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + 8 * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y,eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH,eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_RRT_VAL,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; /* this button array changes dynamically based on received RRT value data */ bbutton_t g_buttons_ratings_rrt_val[] = { {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 1 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 2 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 3 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 4 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 5 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 6 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 7 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_CHECK|eBUTTON_CHECK_LOCK,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_X,eMENU_RATINGS_RRT_VAL_FIRST_BUTTON_Y + 8 * eMENU_RATINGS_RRT_VAL_BUTTON_INC_Y,eMENU_RATINGS_RRT_VAL_BUTTON_WIDTH,eMENU_RATINGS_RRT_VAL_BUTTON_HEIGHT,eTEXT_MAX,eTEXT_MAX ,eSCREEN_RATINGS_LIMITS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_ratings_rrt_update[] = { {eBUTTON_MENU,eMENU_RATINGS_RRT_UPDATE_FIRST_BUTTON_X,eMENU_RATINGS_RRT_UPDATE_FIRST_BUTTON_Y,eMENU_RATINGS_RRT_UPDATE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_LIMITS_BUTTON,eTEXT_LIMITS_INFO,eSCREEN_PIN_VERIFY_RATINGS,eSCREEN_MAIN, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_RATINGS_RRT_UPDATE_FIRST_BUTTON_X,eMENU_RATINGS_RRT_UPDATE_FIRST_BUTTON_Y + eMENU_RATINGS_RRT_UPDATE_BUTTON_INC_Y,eMENU_RATINGS_RRT_UPDATE_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO,eSCREEN_MAX,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wrong_pin_live[] = { {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y,eMENU_WRONG_PIN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RETRY_BUTTON,eTEXT_RETRY_INFO ,eSCREEN_PIN_VERIFY_LIVE,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wrong_pin_ratings[] = { {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y,eMENU_WRONG_PIN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO ,eSCREEN_MAIN,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y + eMENU_WRONG_PIN_BUTTON_INC_Y,eMENU_RETRY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RETRY_BUTTON,eTEXT_RETRY_INFO,eSCREEN_PIN_VERIFY_RATINGS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_wrong_pin_reset[] = { {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y,eMENU_WRONG_PIN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO ,eSCREEN_MAIN,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y + eMENU_WRONG_PIN_BUTTON_INC_Y,eMENU_RETRY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RETRY_BUTTON,eTEXT_RETRY_INFO,eSCREEN_PIN_VERIFY_RESET,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_mismatched_pins[] = { {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y,eMENU_WRONG_PIN_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_CANCEL_BUTTON,eTEXT_CANCEL_INFO ,eSCREEN_RATINGS,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, {eBUTTON_MENU,eMENU_WRONG_PIN_FIRST_BUTTON_X,eMENU_WRONG_PIN_FIRST_BUTTON_Y + eMENU_WRONG_PIN_BUTTON_INC_Y,eMENU_RETRY_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_RETRY_BUTTON,eTEXT_RETRY_INFO,eSCREEN_PIN_NEW,eSCREEN_MAX, 1, eCOLOR_MED_BLUE}, }; // HD display configuration bbutton_t g_buttons_sd_output_options_config[] = { {eBUTTON_RADIO|eBUTTON_MENU,eMENU_PICTURES_FIRST_BUTTON_X,eMENU_PICTURES_FIRST_BUTTON_Y - 20,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SD_CONFIG_OPTIONS_WIDESCREEN_BUTTON,eTEXT_SD_CONFIG_OPTIONS_WIDESCREEN,eSCREEN_PICTURE,eSCREEN_MAX,1,eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_PICTURES_FIRST_BUTTON_X,(eMENU_PICTURES_FIRST_BUTTON_Y)+ eMENU_BUTTON_INC_Y - 10,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SD_CONFIG_OPTIONS_FULL_BUTTON,eTEXT_SD_CONFIG_OPTIONS_FULL,eSCREEN_PICTURE,eSCREEN_MAX,1,eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_PICTURES_FIRST_BUTTON_X,eMENU_PICTURES_FIRST_BUTTON_Y + 2 * eMENU_BUTTON_INC_Y + 10,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SD_CONFIG_OPTIONS_AUTO_BUTTON,eTEXT_SD_CONFIG_OPTIONS_AUTO,eSCREEN_PICTURE,eSCREEN_MAX,1,eCOLOR_MED_BLUE}, {eBUTTON_RADIO|eBUTTON_MENU,eMENU_PICTURES_FIRST_BUTTON_X,eMENU_PICTURES_FIRST_BUTTON_Y + 3 * eMENU_BUTTON_INC_Y + 10,eMENU_BUTTON_WIDTH,eBUTTON_HEIGHT,eTEXT_SD_CONFIG_OPTION_ZOOM_BUTTON,eTEXT_SD_CONFIG_OPTION_ZOOM_DESC,eSCREEN_PICTURE,eSCREEN_MAX,1,eCOLOR_MED_BLUE}, }; bbutton_t g_buttons_captions_digital[] = { {eBUTTON_MENU, eMENU_PICTURES_FIRST_BUTTON_X, eMENU_PICTURES_FIRST_BUTTON_Y, eMENU_PICTURES_BUTTON_WIDTH, eBUTTON_HEIGHT, eTEXT_CAPTIONS_DIGITAL_DIGITAL, eTEXT_CAPTIONS_CS1_BUTTON, /* default CS1, will be changed dynamically based on user's selection */ eSCREEN_DIGITAL, eSCREEN_MAX, 1, eCOLOR_MED_BLUE }, {eBUTTON_MENU, eMENU_PICTURES_FIRST_BUTTON_X, eMENU_PICTURES_FIRST_BUTTON_Y + eMENU_PICTURES_BUTTON_INC_Y, eMENU_PICTURES_BUTTON_WIDTH, eBUTTON_HEIGHT, eTEXT_CAPTIONS_DIGITAL_ANALOG, eTEXT_CAPTIONS_DIGITAL_ANALOG_DESC_CC1, /* default CC1, will be changed dynamically based on user's selection */ eSCREEN_DIGITAL, eSCREEN_MAX, 1, eCOLOR_MED_BLUE }, }; /* Summary: show/hide banner Description: if mode is eLS_BANNER_MAX then the last banner mode used when it lasted timed out is displayed returns 1 if banner mode changed, 0 otherwise */ static int set_banner(bscreen_t *p_screen, banner_mode_t mode, bool save_last_mode) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; static banner_mode_t last_mode = eLS_BANNER_SMALL; bapp_t *p_app = (bapp_t*)bapp_get_app_instance(); if ((save_last_mode) && ((p_bs->mode == eLS_BANNER_SMALL) || (p_bs->mode == eLS_BANNER_BIG) || (p_bs->mode == eLS_BANNER_EAS_TEXT_SCROLLING))) last_mode = p_bs->mode; if (mode == eLS_BANNER_MAX) mode = last_mode; if (mode == p_bs->mode) return 0; p_bs->mode = mode; /* we can only check the mode to disable CC, but not enable since some function need to set eLS_BANNER_OFF first to reset timeout */ if (p_app) { if (mode > eLS_BANNER_OFF) { #ifdef CONFIG_EIA_708 if (p_app->cc_enabled) { bapp_enable_cc(p_app, false); } #endif } } return 1; } /* Summary: copy string and remove spaces. . */ void strncpy_no_spaces(char* dst_str, char* src_str,int len) { int idx = 0; int dst_idx = 0; while (src_str[idx] && (idx < len)) { if (src_str[idx] != ' ') { dst_str[dst_idx++] = src_str[idx]; } idx++; } dst_str[dst_idx] = 0; } /* Summary: If a button is selected set the next screen_id. Description: If a button is selected set the next screen_id. Return non- zero on sucess and 0 when no selection exists */ static int select_button( void *v_app, /* Opaque app reference */ void *v_screen /* Opaque screen reference */ ) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int retval = 1; if (p_screen->p_button_array[p_screen->button_selection].type & eBUTTON_RADIO) { if (p_screen->button_checked == p_screen->button_selection) retval = 0; else { int prev_checked; prev_checked = p_screen->button_checked; p_screen->button_checked = p_screen->button_selection; retval = 1; } } else if (p_screen->p_button_array[p_screen->button_selection].type & eBUTTON_CHECK) { bscreen_event_t event; int checked = 0; event.id = p_screen->button_selection; event.type = eS_EVENT_CHECKED; checked = p_screen->handle_event(p_app,p_screen,&event); p_screen->button_checked = p_screen->button_selection; retval = 1; } if (p_screen->p_button_array[p_screen->button_selection].type & eBUTTON_MENU) { /* need to update current epg index accordingly */ if (eSCREEN_GUIDE == p_screen->p_button_array[p_screen->button_selection].next_screen_id) { p_app->chm.cur_epg_ch_num = p_app->cur_ch_num; } bapp_set_current_screen(p_app, p_screen->p_button_array[p_screen->button_selection].next_screen_id, p_screen->p_button_array[p_screen->button_selection].next_screen_back_id); retval = 1; } return retval; } /* Summary: Move highlight from one button to another Description: Unfocus the current button and focus the next one. Return non- zero on sucess and 0 when no focus exists */ static int focus_button( void *v_app, /* Opaque app reference */ void *v_screen, /* Opaque screen reference */ int button_idx /* Index into g_buttons_XXX[] to set focus to */ ) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int prev_button = p_screen->button_selection; int checked; bscreen_event_t event; p_screen->button_selection = button_idx; if (prev_button != p_screen->button_selection) { event.id = prev_button; event.type = eS_EVENT_CHECKED; checked = p_screen->handle_event(p_app,p_screen,&event); event.id = p_screen->button_selection; event.type = eS_EVENT_CHECKED; checked = p_screen->handle_event(p_app,p_screen,&event); return 1; } return 1; } /* Summary: Unselect the current button and select the next one. Description: Unselect the current button and select the next one. Return non- zero on sucess and 0 when no selection exists */ static int next_button( void *v_app, /* Opaque app reference */ void *v_screen, /* Opaque screen reference */ int dir /* 0 - down, 1 - up */ ) { bscreen_t *p_screen = (bscreen_t*)v_screen; int next_button = p_screen->button_selection; if (dir) { if (p_screen->button_selection == 0) next_button = p_screen->num_buttons - 1; else next_button--; } else { if (p_screen->button_selection == (p_screen->num_buttons - 1)) next_button = 0; else next_button++; } return focus_button(v_app,v_screen,next_button); } /* Summary: Use the this function to get a UNI string. */ void bscreen_get_string( bapp_lang_t e_lang, /* Language enum */ btext_id_t e_text_id, /* Text enum */ unsigned int *p_uni_str, /* Buffer to put UNI string into */ unsigned int *str_len /* On input the max length in words on output the actual size in characters. */ ) { bapp_str_get(e_lang,e_text_id,p_uni_str,str_len); } /* Summary: Draw the screen background. Description: Draw the screen background. */ void bscreen_draw_background(void *v_app, bgfx_surf_t *p_surf, uint16_t title_area_height) { bapp_t *p_app = (bapp_t*)v_app; int i = 0; int offset = 4; /* adjust title_area_height based on language choice */ if (p_app->lang == eLANG_SPANISH) { switch (p_app->screen_id) { case eSCREEN_PIN_VERIFY_LIVE: case eSCREEN_PIN_VERIFY_RATINGS: case eSCREEN_PIN_VERIFY_RESET: case eSCREEN_MISMATCHED_PINS: case eSCREEN_RATINGS_LOCK: case eSCREEN_RATINGS_LIMITS: case eSCREEN_RATINGS_TV: case eSCREEN_RATINGS_RRT_DIM: case eSCREEN_RATINGS_RRT_UPDATE: case eSCREEN_ANTENNA: case eSCREEN_AUTO_POWER: case eSCREEN_WIZ_PIN_NEW: case eSCREEN_WIZ_MISMATCHED_PINS: case eSCREEN_CH_SCAN: case eSCREEN_WIZ_CH_SCAN: case eSCREEN_CAPTIONS_RESET: case eSCREEN_CAPTIONS_FONT_STYLE: case eSCREEN_CAPTIONS_FONT_SIZE: case eSCREEN_RFM: case eSCREEN_TIMEZONE: title_area_height += (eMENU_TITLE_AREA_HEIGHT_1_LINE - eMENU_TITLE_AREA_HEIGHT_0_LINE); break; default: break; } } else if (p_app->lang == eLANG_FRENCH) { switch (p_app->screen_id) { //case eSCREEN_PICTURE: case eSCREEN_PIN_VERIFY_LIVE: case eSCREEN_PIN_VERIFY_RATINGS: case eSCREEN_PIN_VERIFY_RESET: case eSCREEN_MISMATCHED_PINS: case eSCREEN_RATINGS_LIMITS: case eSCREEN_RATINGS_TV: case eSCREEN_RATINGS_MOVIES: case eSCREEN_RATINGS_RRT_DIM: case eSCREEN_RATINGS_RRT_VAL: case eSCREEN_AUTO_POWER: case eSCREEN_ANTENNA: case eSCREEN_WIZ_MISMATCHED_PINS: case eSCREEN_CAPTIONS_FONT_STYLE: case eSCREEN_CAPTIONS_BACK_OPTIONS: case eSCREEN_CAPTIONS_FONT_OPTIONS: case eSCREEN_CAPTIONS_FONT_SIZE: case eSCREEN_CAPTIONS_RESET: title_area_height += (eMENU_TITLE_AREA_HEIGHT_1_LINE - eMENU_TITLE_AREA_HEIGHT_0_LINE); break; case eSCREEN_CAPTIONS_BACK_COLOR: title_area_height += (eMENU_TITLE_AREA_HEIGHT_1_LINE - eMENU_TITLE_AREA_HEIGHT_0_LINE - 8); break; case eSCREEN_CAPTIONS_FONT: title_area_height -= 18; break; default: break; } } /* TODO: do we need to do this since video is muted anyways? */ bgfx_fill_rect(p_surf,0,0,eWIDTH,eHEIGHT,eCOLOR_BLACK); /* draw 3 window fields */ bgfx_fill_rect(p_surf,eSCREEN_ACTION_SAFE_X+offset,eSCREEN_ACTION_SAFE_Y+offset,eSCREEN_ACTION_SAFE_WIDTH-(2*offset),title_area_height-offset,eCOLOR_LT_BLUE); bgfx_fill_rect(p_surf,eSCREEN_ACTION_SAFE_X+offset,eSCREEN_ACTION_SAFE_Y+offset + title_area_height-offset,eSCREEN_ACTION_SAFE_WIDTH-(2*offset),eSCREEN_ACTION_SAFE_HEIGHT - eINFO_AREA_HEIGHT - title_area_height,eCOLOR_MED_BLUE); bgfx_fill_rect(p_surf,eSCREEN_ACTION_SAFE_X+offset,eINFO_AREA_Y,eSCREEN_ACTION_SAFE_WIDTH-(2*offset),eINFO_AREA_HEIGHT-offset,eCOLOR_DRK_BLUE); /* draw border */ for (i = 3; i < 7; i++) { bgfx_h_draw_line(p_surf,eSCREEN_ACTION_SAFE_X-i+1,eSCREEN_ACTION_SAFE_X+eSCREEN_ACTION_SAFE_WIDTH+i+1,eSCREEN_ACTION_SAFE_Y-i,eCOLOR_WHITE); bgfx_h_draw_line(p_surf,eSCREEN_ACTION_SAFE_X-i+1,eSCREEN_ACTION_SAFE_X+eSCREEN_ACTION_SAFE_WIDTH+i+1,eSCREEN_ACTION_SAFE_Y+eSCREEN_ACTION_SAFE_HEIGHT+i,eCOLOR_WHITE); bgfx_v_draw_line(p_surf,eSCREEN_ACTION_SAFE_X-i,eSCREEN_ACTION_SAFE_Y-i,eSCREEN_ACTION_SAFE_Y+eSCREEN_ACTION_SAFE_HEIGHT+i,eCOLOR_WHITE); bgfx_v_draw_line(p_surf,eSCREEN_ACTION_SAFE_X+eSCREEN_ACTION_SAFE_WIDTH+i,eSCREEN_ACTION_SAFE_Y-i,eSCREEN_ACTION_SAFE_Y+eSCREEN_ACTION_SAFE_HEIGHT+i,eCOLOR_WHITE); } } /* Summary: Picture screen event handler Description: Picture screen event handler. . */ int screen_picture_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int cur_pic; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); cur_pic = p_app->settings.picture; p_screen->button_checked = p_app->settings.picture; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); cur_pic = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: if (cur_pic != p_app->settings.picture) { p_app->settings.picture = cur_pic; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Timezone setting screen event handler Description: Timezone setting screen event handler. . */ extern const char g_tz_map[]; int bscreen_timezone_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int dst, time_zone; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.time_zone; dst = p_app->settings.dst; time_zone = p_app->settings.time_zone; BDBG_MSG(("time_zone = %d\n",p_app->settings.time_zone)); result = 1; /* always handle event */ p_screen->button_selection = time_zone; } else if (p_event->type == eS_EVENT_CHECKED) { if (p_event->id == 3) { result = (dst) ? 1 : 0; } else { if (time_zone == p_event->id) return 1; else result = 0; } } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (p_screen->button_selection == 3) { dst = dst ? 0 : 1; } else { result = select_button(v_app,v_screen); time_zone = p_screen->button_selection; } result = 1; break; case eIR_LEFT: case eIR_MENU: if (dst != p_app->settings.dst) { p_app->settings.dst = dst; p_app->settings_dirty |= DIRTY_SCREEN; p_app->chm.local_dst_obs = p_app->settings.dst; } if (time_zone != p_app->settings.time_zone) { p_app->settings.time_zone = time_zone; p_app->chm.local_time_source = eTS_FIXED; p_app->chm.local_offset = 0 - (int)g_tz_map[p_app->settings.time_zone]; p_app->chm.local_offset *= 3600; p_app->chm.local_dst_obs = p_app->settings.dst; BDBG_ERR(("### Local time %d Fixed(%d) dst %d ###\n",p_app->chm.local_offset,p_app->settings.time_zone,p_app->settings.dst)); p_app->settings_dirty |= DIRTY_SCREEN; } if (p_app->settings_dirty) bapp_save_settings(p_app); result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Sound screen event handler Description: Sound screen event handler. . */ int screen_sound_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int sound; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); sound = p_app->settings.sound; p_screen->button_checked = sound; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_SELECT: case eIR_RIGHT: result = select_button(v_app,v_screen); sound = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: if (sound != p_app->settings.sound) { p_app->settings.sound = sound; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Setup screen event handler Description: Setup screen event handler. . */ int screen_setup_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (p_screen->button_selection) { result = select_button(v_app,v_screen); } else { p_app->chm_cmd.cmd_id = eCHM_CANCEL; chm_cmd(&p_app->chm, &p_app->chm_cmd); bos_sleep(50); /* decide what type of channel scan to do (quick or full) we cannot blindly call select_button() here since we need to go to different scan screens depending on the type of antenna attached */ /* since we now support customer frequencies, so if tune from within the UI, it should be full ATSC */ #ifdef CONFIG_ISDB p_app->chm.fe_type = eFREQ_TABLE_ISDB; #else p_app->chm.fe_type = eFREQ_TABLE_NTIA_VSB; #endif bapp_set_current_screen( p_app, eSCREEN_CH_SCAN, p_screen->p_button_array[p_screen->button_selection].next_screen_back_id); } result = 1; break; case eIR_LEFT: case eIR_MENU: result = 1; /* we set the eSCREEN_CH_SCAN, so can't use bapp_goto_last_screen function to return main menu */ bapp_set_current_screen(p_app, eSCREEN_MAIN, eSCREEN_MAX); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ch Scan screen event handler Description: Ch Scan screen event handler. . */ int screen_ch_scan_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ p_screen->button_checked = 0; p_screen->local_state = 0; /* clear it so the UI will not draw current tuned screen if any */ p_app->chm.last_freq_hz = 0; } else if (p_event->type == eS_EVENT_CHECKED) { result = (p_screen->local_state) ? 1 : 0; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; /* if re-tune is set, that mean the user quit from GUIDE using MENU button */ if (p_app->re_tune && ((p_app->settings.num_channels > 0) && (0 == p_app->cur_ch_num))) { bapp_tune(p_app); p_app->re_tune = false; } bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Antenna screen event handler Description: Antenna screen event handler. . */ int screen_antenna_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; //bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { p_app->tmp_value = 0; /* progress set at 0% */ result = 1; /* always handle event */ p_app->chm_cmd.cmd_id = eCHM_CHECK_SIGNAL; chm_cmd(&p_app->chm,&p_app->chm_cmd); p_app->check_signal = true; #ifdef CONFIG_EIA_708 //if (eSCREEN_CH_SCAN_PROGRESS == p_screen->last_screen_id) { bapp_enable_cc(p_app, false); //} #endif } else if (p_event->type == eS_EVENT_PROGRESS) { #if 0 //bapp_audio_mute(p_app, 0); baudio_decode_get_config(p_app->audio, &config); config.tone = p_event->id; baudio_decode_set_config(p_app->audio, &config); #endif result = 1; p_app->tmp_value = p_app->power_level; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: #if 0 //bapp_audio_mute(p_app,1); baudio_decode_get_config(p_app->audio, &config); config.tone = 0xFFFFFFFF; baudio_decode_set_config(p_app->audio, &config); #endif p_app->check_signal = false; p_app->chm.force_tune = true; p_app->chm.last_freq_hz = 0; bapp_tune(p_app); /* in setup wizard */ result = 1; if (!p_app->settings.wiz_completed) bapp_set_current_screen(p_app, eSCREEN_WIZ_DONE, eSCREEN_MAX); else bapp_goto_last_screen(p_app); break; case eIR_LEFT: case eIR_MENU: result = 1; #if 0 //bapp_audio_mute(p_app, 1); baudio_decode_get_config(p_app->audio, &config); config.tone = 0xFFFFFFFF; baudio_decode_set_config(p_app->audio, &config); #endif bapp_goto_last_screen(p_app); p_app->check_signal = false; /* disable check signal after quit from antenna screen */ p_app->chm_cmd.cmd_id = eCHM_CANCEL; chm_cmd(&p_app->chm,&p_app->chm_cmd); break; } } else if ((p_event->type != eS_EVENT_SELECTED) && (p_event->type != eS_EVENT_CHECKED)) { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions screen event handler Description: Advanced captions screen event handler. . */ int screen_captions_advanced_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); result = 1; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: font options captions screen event handler Description: font options captions screen event handler. . */ int screen_captions_font_options_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: background options captions screen event handler Description: background options captions screen event handler. . */ int screen_captions_back_options_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions font screen event handler Description: Advanced captions font screen event handler. . */ int screen_captions_font_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int font; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.dcc.captions_font; result = 1; /* always handle event */ p_screen->button_selection = p_app->settings.dcc.captions_font; font = p_app->settings.dcc.captions_font; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); font = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: if (font != p_app->settings.dcc.captions_font) { p_app->settings.dcc.captions_font = font; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions font size screen event handler Description: Advanced captions font size screen event handler. . */ int screen_captions_font_size_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int font_size; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.dcc.captions_font_size; result = 1; /* always handle event */ font_size = p_app->settings.dcc.captions_font_size; p_screen->button_selection = p_app->settings.dcc.captions_font_size; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); font_size = p_screen->button_selection; break; case eIR_LEFT: case eIR_MENU: if (font_size != p_app->settings.dcc.captions_font_size) { p_app->settings.dcc.captions_font_size = font_size; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions font style screen event handler Description: Advanced captions font style screen event handler. . */ int screen_captions_font_style_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int style; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); /* 0 for auto, 1 for normal, 2 for italic and 3 for underline */ style = p_app->settings.dcc.captions_font_style; if (style > 0) style--; p_screen->button_checked = style; result = 1; /* always handle event */ p_screen->button_selection = style; p_screen->button_checked = style; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); style = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: if ((style + 1) != p_app->settings.dcc.captions_font_style) { p_app->settings.dcc.captions_font_style = style + 1; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions font color screen event handler Description: Advanced captions font color screen event handler. . */ int screen_captions_font_color_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int font_color; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.dcc.captions_font_color; result = 1; /* always handle event */ font_color = p_app->settings.dcc.captions_font_color; p_screen->button_selection = font_color; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); font_color = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: if (font_color != p_app->settings.dcc.captions_font_color) { p_app->settings.dcc.captions_font_color = font_color; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions font opacity screen event handler Description: Advanced captions font opacity screen event handler. . */ int screen_captions_font_opacity_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int font_opacity; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.dcc.captions_font_opacity; result = 1; /* always handle event */ font_opacity = p_app->settings.dcc.captions_font_opacity; p_screen->button_selection = font_opacity; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); font_opacity = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: if (font_opacity != p_app->settings.dcc.captions_font_opacity) { p_app->settings.dcc.captions_font_opacity = font_opacity; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions background color screen event handler Description: Advanced captions background color screen event handler. . */ int screen_captions_back_color_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int back_color; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.dcc.captions_back_color; result = 1; /* always handle event */ back_color = p_app->settings.dcc.captions_back_color; p_screen->button_selection = back_color; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); back_color = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: if (back_color != p_app->settings.dcc.captions_back_color) { p_app->settings.dcc.captions_back_color = back_color; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions background opacity screen event handler Description: Advanced captions background opacity screen event handler. . */ int screen_captions_back_opacity_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int back_opacity; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.dcc.captions_back_opacity; result = 1; /* always handle event */ back_opacity = p_app->settings.dcc.captions_back_opacity; p_screen->button_selection = back_opacity; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); back_opacity = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: if (back_opacity != p_app->settings.dcc.captions_back_opacity) { p_app->settings.dcc.captions_back_opacity = back_opacity; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: background edge color screen event handler Description: background edge color screen event handler . */ int screen_captions_edge_color_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int edge_color; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.dcc.captions_edge_color; result = 1; /* always handle event */ edge_color = p_app->settings.dcc.captions_edge_color; p_screen->button_selection = edge_color; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); edge_color = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: if (edge_color != p_app->settings.dcc.captions_edge_color) { p_app->settings.dcc.captions_edge_color = edge_color; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: background edge type screen event handler Description: background edge type screen event handler . */ int screen_captions_edge_type_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int edge_type; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.dcc.captions_edge_type; result = 1; /* always handle event */ edge_type = p_app->settings.dcc.captions_edge_type; p_screen->button_selection = edge_type; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); edge_type = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: if (edge_type != p_app->settings.dcc.captions_edge_type) { p_app->settings.dcc.captions_edge_type = edge_type; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Advanced captions reset screen event handler Description: Advanced captions reset screen event handler . */ int screen_captions_reset_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (p_screen->p_button_array[p_screen->button_selection].desc_text_id == eTEXT_CANCEL_INFO) { result = 1; /* cannot call select_button() in this case since we do not want to save button history * this is unique for the eTEXT_CANCEL button since the button duplicates the 'back' functionality */ bapp_goto_last_screen(p_app); //bapp_set_current_screen(p_app, p_screen->p_button_array[p_screen->button_selection].next_screen_id, eSCREEN_NULL); } else { bapp_reset_cc_config_settings(p_app); bapp_goto_last_screen(p_app); result = 1; } break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ch scan progress screen event handler Description: Ch scan progress screen event handler. . */ int screen_ch_scan_progress_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { p_app->tmp_value = p_app->tmp_cnt = 0; /* progress set at 0% */ //p_app->settings_dirty |= DIRTY_SCREEN; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_SETUP_DONE) { result = 1; /* always handle event */ BDBG_MSG(("Doing FULL scan\n")); bapp_channel_scan(p_app); } else if (p_event->type == eS_EVENT_PROGRESS) { /* reset screensaver timeout since we are making progress */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); #endif p_app->tmp_value = p_event->id; p_app->tmp_cnt = *((unsigned int *)p_event->data); if (p_event->id >= 100) { /*janzy@20121106,Cancel Enter PIN*/ { if (!p_app->settings.wiz_completed) { p_app->settings.wiz_completed = true; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); #ifdef CONFIG_EIA_708 /* first screen so always disable CC and audio */ bapp_enable_cc(p_app, false); #endif bapp_audio_do_mute(p_app, false); bapp_audio_mute(p_app, false); } } if (p_app->settings.wiz_completed) { /* decide what type of channel scan to do (quick or full) the channel selected in the GUIDE screen, we need to set it here first since the detailed EPG screen may change it on the fly */ p_app->chm.cur_epg_ch_num = p_app->cur_ch_num; /* since we now support customer frequencies, so if tune from within the UI, it should be full ATSC */ #ifdef CONFIG_ISDB p_app->chm.fe_type = eFREQ_TABLE_ISDB; #else p_app->chm.fe_type = eFREQ_TABLE_NTIA_VSB; #endif bapp_set_current_screen(p_app, eSCREEN_GUIDE, eSCREEN_CH_SCAN); } else { /* in setup wizard mode, go to antenna screen */ bapp_set_current_screen(p_app, eSCREEN_ANTENNA, eSCREEN_MAX); } } result = 1; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_LEFT: case eIR_MENU: result = 1; /* cancel the scanning and go back to CH_SCAN screen */ p_app->scan_in_progress = false; p_app->chm_cmd.cmd_id = eCHM_CANCEL; chm_cmd(&p_app->chm, &p_app->chm_cmd); bapp_goto_last_screen(p_app); break; } } else if ((p_event->type != eS_EVENT_SELECTED) && (p_event->type != eS_EVENT_CHECKED)) { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Language screen event handler Description: Language screen event handler. . */ int screen_language_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.language; #ifdef ACB612/*janzy@20120823,change SPANISH and ENGLISH place*/ if(p_app->settings.language == eLANG_ENGLISH) p_screen->button_checked = 1; else if(p_app->settings.language == eLANG_SPANISH) p_screen->button_checked = 0; else p_screen->button_checked = 0; #else p_screen->button_checked = p_app->settings.language; #endif result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); result = 1; break; case eIR_LEFT: case eIR_MENU: #ifdef ACB612/*janzy@20120823,change SPANISH and ENGLISH place*/ if(p_screen->button_checked == 0) { p_app->settings.language = eLANG_SPANISH; p_app->lang = eLANG_SPANISH; } else if(p_screen->button_checked == 1) { p_app->settings.language = eLANG_ENGLISH; p_app->lang = eLANG_ENGLISH; } else { p_app->settings.language = eLANG_ENGLISH; p_app->lang = eLANG_ENGLISH; } #else p_app->settings.language = p_screen->button_checked; p_app->lang = p_screen->button_checked; #endif p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Reset screen event handler Description: Reset screen event handler. . */ int screen_reset_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; baudio_decode_config config; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (p_screen->p_button_array[p_screen->button_selection].desc_text_id == eTEXT_CANCEL_INFO) { result = 1; /* cannot call select_button() in this case since we do not want to save button history * this is unique for the eTEXT_CANCEL button since the button duplicates the 'back' functionality */ bapp_set_current_screen(p_app, p_screen->p_button_array[p_screen->button_selection].next_screen_id, eSCREEN_NULL); } else { /* setup wizard need graphics update. */ /* don't call bapp_av_mute since it will flash screen with background AV */ //bapp_av_mute(p_app, 2); bapp_audio_mute(p_app,true); bapp_video_mute(p_app,true); p_app->settings.av_mute = true; p_app->chm_cmd.cmd_id = eCHM_CANCEL; chm_cmd(&p_app->chm,&p_app->chm_cmd); bapp_reset_settings(p_app); baudio_decode_get_config(p_app->audio, &config); config.left_volume = config.right_volume = 32; baudio_decode_set_config(p_app->audio, &config); p_app->audio_vol = 32; p_app->settings_dirty |= DIRTY_CHANNEL;/*janzy@20121101,save and apply audio_volume*/ p_app->settings.num_channels = 0; p_app->cur_ch_num = 0; p_app->settings_dirty = DIRTY_CHANNEL|DIRTY_MISC|DIRTY_EAS| DIRTY_CHANNEL_MAP|DIRTY_SCREEN; bapp_save_settings(p_app); bapp_set_current_screen(p_app, eSCREEN_WIZ_WELCOME, eSCREEN_NULL); p_app->re_tune = true; /* need to re-tune if the user exit from MENU intsead of from GUIDE selection */ result = 1; } break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Wiz welcome screen event handler Description: Wiz welcome screen event handler. . */ int screen_wiz_welcome_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_app->settings_dirty |= DIRTY_SCREEN; p_app->settings.wiz_completed = false; result = 1; /* always handle event */ //p_app->audio_mute = !p_app->audio_mute; //bapp_audio_mute(p_app, p_app->audio_mute); bapp_audio_do_mute(p_app, true); } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: /*result = 1;*/ /*bapp_goto_last_screen(p_app);*/ break; case eIR_CH_DOWN: result = next_button(v_app,v_screen,0); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Wiz Language screen event handler Description: Wiz Language screen event handler. . */ int screen_wiz_language_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: /* we cannot blindly call select_button() here since we need to go to different scan screens depending on the type of antenna attached */ bapp_set_current_screen( p_app, eSCREEN_WIZ_TIMEZONE, p_screen->p_button_array[p_screen->button_selection].next_screen_back_id); #ifdef ACB612/*janzy@20120823,change SPANISH and ENGLISH place*/ if(p_screen->button_selection == 0) { p_app->settings.language = eLANG_SPANISH; p_app->lang = eLANG_SPANISH; } else if(p_screen->button_selection == 1) { p_app->settings.language = eLANG_ENGLISH; p_app->lang = eLANG_ENGLISH; } else { p_app->settings.language = eLANG_ENGLISH; p_app->lang = eLANG_ENGLISH; } #else p_app->settings.language = p_screen->button_selection; p_app->lang = p_screen->button_selection; #endif p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); result = 1; break; case eIR_CH_DOWN: result = next_button(v_app,v_screen,0); break; case eIR_LEFT: case eIR_MENU: /* do nothing since language screen is the 1st screen in thomson's wizard */ break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Wiz ch scan screen event handler Description: Wiz ch scan screen event handler. . */ int screen_wiz_ch_scan_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_CH_DOWN: result = next_button(v_app,v_screen,0); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Wiz done screen event handler Description: Wiz done screen event handler. . */ int screen_wiz_done_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); p_app->settings.wiz_completed = true; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); /* select exits to live tv so we must clear all the button selection history for all screens */ screen_null_draw(v_app, v_screen); #ifdef CONFIG_EIA_708 /* first screen so always disable CC and audio */ bapp_enable_cc(p_app, false); #endif bapp_audio_do_mute(p_app, false); bapp_audio_mute(p_app, false); break; case eIR_CH_DOWN: result = next_button(v_app,v_screen,0); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: auto power off screen event handler Description: auto power off screen event handler. . */ int screen_auto_power_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int auto_power; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.auto_power; result = 1; /* always handle event */ auto_power = p_app->settings.auto_power; p_screen->button_selection = auto_power; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); auto_power = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: if (auto_power != p_app->settings.auto_power) { p_app->settings_dirty |= DIRTY_SCREEN; p_app->settings.auto_power = auto_power; if (p_app->settings.auto_power_off) { p_app->settings.auto_power_off = 0; /* set it to off first */ //bapp_save_settings(p_app); //bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); } bapp_save_settings(p_app); } result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings screen event handler Description: Ratings screen event handler. . */ int screen_ratings_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings Lock screen event handler Description: Ratings Lock screen event handler. . */ int screen_ratings_lock_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int lock; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); lock = p_app->settings.ratings.ratings_lock; p_screen->button_selection = lock; p_screen->button_checked = lock; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); result = 1; /* don't quit from this screen */ break; case eIR_LEFT: case eIR_MENU: result = 1; if (lock != p_screen->button_selection) { p_app->settings.ratings.ratings_lock = p_screen->button_selection; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings limits screen event handler Description: Ratings limits screen event handler. . */ int screen_ratings_limits_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { /* remove rrt ratings button if unavailable */ if (p_app->settings.ratings.ratings_lock != 2) p_screen->num_buttons = g_buttons_ratings_limits_num - 1; else p_screen->num_buttons = g_buttons_ratings_limits_num; bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Convert from button position to RRT TV ratings dimension Description: Convert from button position to RRT TV ratings dimension */ const int screen_ratings_tv_pos2dim(int button_position) { const int pos2dim[g_buttons_ratings_tv_num] = { /* rat D L S V FV */ /* tv-y */ 5, /* tv-y7 */ 5, 6, /* tv-g */ 0, /* tv-pg */ 0, 1, 2, 3, 4, /* tv-14 */ 0, 1, 2, 3, 4, /* tv-ma */ 0, 2, 3, 4 }; if ((button_position < 0) || (button_position > sizeof(pos2dim))) return -1; return(pos2dim[button_position]); } /* Summary: Convert from button position to RRT TV ratings value Description: Convert from button position to RRT TV ratings value */ const int screen_ratings_tv_pos2value(int button_position) { const int pos2value[g_buttons_ratings_tv_num] = { /* rat D L S V FV */ /* tv-y */ 1, /* tv-y7 */ 2, 1, /* tv-g */ 2, /* tv-pg */ 3, 1, 1, 1, 1, /* tv-14 */ 4, 1, 1, 1, 1, /* tv-ma */ 5, 1, 1, 1 }; if ((button_position < 0) || (button_position > sizeof(pos2value))) return -1; return(pos2value[button_position]); } /* Summary: Convert xds tv ratings to psip grid position Description: Convert xds tv ratings to psip grid position */ const int screen_ratings_tv_xds2pos(int xds_tv_rating) { const int tv_xds2pos[8] = { /* none */ -1, /* tv-y */ ePOS_TV_Y, /* tv-y7 */ ePOS_TV_Y7, /* tv-g */ ePOS_TV_G, /* tv-pg */ ePOS_TV_PG, /* tv-14 */ ePOS_TV_14, /* tv-ma */ ePOS_TV_MA, /* none */ -1 }; if ((xds_tv_rating < 0) || (xds_tv_rating > sizeof(tv_xds2pos))) return -1; return(tv_xds2pos[xds_tv_rating]); } /* Summary: Convert xds movie ratings to psip grid position Description: Convert xds movie ratings to psip grid position */ const int screen_ratings_movie_xds2pos(int xds_movie_rating) { const int movie_xds2pos[8] = { /* none */ -1, /* G */ 0, /* PG */ 1, /* PG-13 */ 2, /* R */ 3, /* NC-17 */ 4, /* X */ 5, /* NR */ 6 }; if ((xds_movie_rating < 0) || (xds_movie_rating > sizeof(movie_xds2pos))) return -1; return(movie_xds2pos[xds_movie_rating]); } /* Summary: Ratings TV screen event handler Description: Ratings TV screen event handler. . */ int screen_ratings_tv_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { /* button layout is fixed for US tv ratings. button position is used in the following tables for navigation and auto block/unblock. this is what the button numbering looks like: rat D L S V FV tv-y 0 tv-y7 1 2 tv-g 3 tv-pg 4 5 6 7 8 tv-14 9 10 11 12 13 tv-ma 14 15 16 17 */ /* define button navigation in up direction */ const int up[g_buttons_ratings_tv_num] = { /* rat D L S V FV */ /* tv-y */ 14, /* tv-y7 */ 0, 0, /* tv-g */ 1, /* tv-pg */ 3, 3, 3, 2, 2, /* tv-14 */ 4, 5, 6, 7, 8, /* tv-ma */ 9, 11, 12, 13 }; /* define button navigation in down direction */ const int down[g_buttons_ratings_tv_num] = { /* rat D L S V FV */ /* tv-y */ 1, /* tv-y7 */ 3, 8, /* tv-g */ 4, /* tv-pg */ 9, 10, 11, 12, 13, /* tv-14 */ 14, 14, 15, 16, 17, /* tv-ma */ 0, 0, 0, 0 }; /* define auto block for each button */ const int block[g_buttons_ratings_tv_num][g_buttons_ratings_tv_num + 1] = { /* rat D L S V FV */ /* tv-y */ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, /* tv-y7 */ {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, {2, -1}, /* tv-g */ {3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, /* tv-pg */ {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, {5, 10, -1}, {6, 11, 15, -1},{7, 12, 16, -1},{8, 13, 17, -1}, /* tv-14 */ {9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, {10, -1}, {11, 15, -1}, {12, 16, -1}, {13, 17, -1}, /* tv-ma */ {14, 15, 16, 17, -1}, {15, -1}, {16, -1}, {17, -1} }; /* define auto unblock for each button */ const int unblock[g_buttons_ratings_tv_num][g_buttons_ratings_tv_num + 1] = { /* rat D L S V FV */ /* tv-y */ {0, -1}, /* tv-y7 */ {0, 1, 2, -1}, {0, 1, 2, -1}, /* tv-g */ {0, 1, 2, 3, -1}, /* tv-pg */ {0, 1, 2, 3, 4, 5, 6, 7, 8, -1}, {0, 1, 3, 4, 5, -1}, {0, 1, 3, 4, 6, -1}, {0, 1, 3, 4, 7, -1}, {0, 1, 3, 4, 8, -1}, /* tv-14 */ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, -1}, {0, 1, 3, 4, 5, 9, 10, -1}, {0, 1, 3, 4, 6, 9, 11, -1}, {0, 1, 3, 4, 7, 9, 12, -1}, {0, 1, 3, 4, 8, 9, 13, -1}, /* tv-ma */ {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, -1}, {0, 1, 3, 4, 6, 9, 11, 14, 15, -1}, {0, 1, 3, 4, 7, 9, 12, 14, 16, -1}, {0, 1, 3, 4, 8, 9, 13, 14, 17, -1} }; switch (p_event->id) { case eIR_SELECT: { int i = 0; if (p_app->settings.ratings.ratings_tv & ((0 | (0x1) << p_screen->button_selection))) { /* selected rating already blocked so unblock it */ for (i = 0; unblock[p_screen->button_selection][i] >= 0; i++) { p_app->settings.ratings.ratings_tv &= ~(0 | (0x1) << unblock[p_screen->button_selection][i]); } } else { /* selected rating unblocked so block it */ for (i = 0; block[p_screen->button_selection][i] >= 0; i++) { p_app->settings.ratings.ratings_tv |= (0 | (0x1) << block[p_screen->button_selection][i]); } } p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); result = select_button(v_app,v_screen); p_app->ratings_override = false; /* reset so ratings will be re-evaluated when returned to full tv */ p_app->last_rating_block_status = -1; /* assume psip unblock */ p_app->last_psip_rating_block_status = 0; } break; case eIR_RIGHT: result = next_button(v_app,v_screen,0); break; case eIR_LEFT: result = next_button(v_app,v_screen,1); break; case eIR_UP: result = focus_button(v_app,v_screen,up[p_screen->button_selection]); break; case eIR_DOWN: result = focus_button(v_app,v_screen,down[p_screen->button_selection]); break; case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; case eIR_0: case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: result = 0; break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else if (p_event->type == eS_EVENT_CHECKED) { result = ((p_app->settings.ratings.ratings_tv >> p_event->id) & (0 | (0x1))); BDBG_MSG(("checked status button#: %d checked:%d", p_event->id, result)); } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings TV screen event handler Description: Ratings TV screen event handler. . */ int screen_ratings_movies_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: { int i = 0; if (p_app->settings.ratings.ratings_movies & ((0 | (0x1) << p_screen->button_selection))) { /* selected rating already blocked so unblock it */ for (i = p_screen->button_selection; i >= 0; i--) { p_app->settings.ratings.ratings_movies &= ~(0 | (0x1) << i); } } else { /* selected rating unblocked so block it */ for (i = p_screen->button_selection; i < g_buttons_ratings_movies_num; i++) { p_app->settings.ratings.ratings_movies |= (0 | (0x1) << i); } } } p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); result = select_button(v_app,v_screen); /* ratings changed so invalidate current rating */ p_app->last_cad = 0; p_app->last_rating_tick = 0; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else if (p_event->type == eS_EVENT_CHECKED) { result = ((p_app->settings.ratings.ratings_movies >> p_event->id) & (0 | (0x1))); } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings RRT dimension screen event handler Description: Ratings RRT dimension screen event handler. . */ int screen_ratings_rrt_dim_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; PSIP_RRT_header header; int num_buttons; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); #ifdef TEST_RRT header.dimensions_defined = MAX_RRT_DIM; #else PSIP_RRT_getHeader(p_app->settings.rrt_settings.rrt, &header); #endif num_buttons = SCREEN_MIN(p_screen->num_buttons,header.dimensions_defined); if ((p_screen->local_state + MAX_RRT_DIM_BUTTONS) >= header.dimensions_defined) { p_screen->local_state = 0; } if (p_screen->button_selection >= num_buttons) { p_screen->button_selection = 0; } result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; case eIR_UP: { unsigned int next_button = p_screen->button_selection; if (p_screen->button_selection == 0) { if (p_screen->local_state > 0) { p_screen->local_state--; } } else next_button--; p_screen->button_selection = next_button; result = 1; } break; case eIR_DOWN: { unsigned int next_button = p_screen->button_selection; #ifdef TEST_RRT header.dimensions_defined = MAX_RRT_DIM; #else PSIP_RRT_getHeader(p_app->settings.rrt_settings.rrt, &header); #endif num_buttons = SCREEN_MIN(p_screen->num_buttons,header.dimensions_defined); if (p_screen->button_selection == (num_buttons - 1)) { #ifdef TEST_RRT if ((p_screen->local_state + MAX_RRT_DIM_BUTTONS) < MAX_RRT_DIM) p_screen->local_state++; #else PSIP_RRT_getHeader(p_app->settings.rrt_settings.rrt, &header); if ((p_screen->local_state + MAX_RRT_DIM_BUTTONS) < header.dimensions_defined) p_screen->local_state++; #endif } else next_button++; p_screen->button_selection = next_button; result = 1; } break; case eIR_0: case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: result = 0; break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Ratings RRT value screen event handler Description: Ratings RRT value screen event handler. buttons for the rrt value screen are dynamically created - so we cannot use the typical navigation functions other "event" functions use. . */ int screen_ratings_rrt_val_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t * p_app = (bapp_t*)v_app; bscreen_t * p_screen = (bscreen_t*)v_screen; int dim_idx = p_app->p_screens[eSCREEN_RATINGS_RRT_DIM].button_selection + p_app->p_screens[eSCREEN_RATINGS_RRT_DIM].local_state; int result = 0; PSIP_RRT_dimension dim; int i = 0; int grad = 0; unsigned int num_buttons = 0; if (p_event->type != eS_EVENT_IDLE) { #ifdef TEST_RRT dim.values_defined = MAX_RRT_VAL; if (dim_idx & 1) grad = 0 ; else grad = 1; #else if (PSIP_RRT_getDimension(p_app->settings.rrt_settings.rrt, dim_idx,&dim) != BERR_SUCCESS) { dim.values_defined = 0; } else { grad = dim.graduated_scale; } #endif num_buttons = SCREEN_MIN(p_screen->num_buttons,dim.values_defined); } if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); if ((p_screen->local_state + MAX_RRT_VAL_BUTTONS) >= dim.values_defined) { p_screen->local_state = 0; } if (p_screen->button_selection >= num_buttons) { p_screen->button_selection = 0; } result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: { BDBG_MSG(("rating dimension graduated_scale:%d\n", grad)); if (p_app->settings.rrt_settings.ratings_rrt[dim_idx] & (1 << (p_screen->local_state + p_screen->button_selection))) { /* selected rating already blocked so unblock it */ if (grad) { for (i = (p_screen->local_state + p_screen->button_selection); i >= 0; i--) { p_app->settings.rrt_settings.ratings_rrt[dim_idx] &= ~(1 << i); } } else { p_app->settings.rrt_settings.ratings_rrt[dim_idx] &= ~(1 << (p_screen->local_state + p_screen->button_selection)); } } else { /* selected rating unblocked so block it */ if (grad) { for (i = (p_screen->local_state + p_screen->button_selection); i < dim.values_defined; i++) { p_app->settings.rrt_settings.ratings_rrt[dim_idx] |= (1 << i); } } else { p_app->settings.rrt_settings.ratings_rrt[dim_idx] |= (1 << (p_screen->local_state + p_screen->button_selection)); } } p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); //result = select_button(v_app,v_screen); { bscreen_event_t event; int checked = 0; event.id = p_screen->button_selection; event.type = eS_EVENT_CHECKED; checked = p_screen->handle_event(p_app,p_screen,&event); p_screen->button_checked = p_screen->button_selection; } p_app->ratings_override = false; /* reset so ratings will be re-evaluated when returned to full tv */ p_app->last_rating_block_status = -1; /* assume psip unblock */ p_app->last_psip_rating_block_status = 0; result = 1; /* always handle event */ } break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; case eIR_UP: { unsigned int next_button = p_screen->button_selection; if (p_screen->button_selection == 0) { if (p_screen->local_state > 0) { p_screen->local_state--; } } else next_button--; p_screen->button_selection = next_button; result = 1; } break; case eIR_DOWN: { unsigned int next_button = p_screen->button_selection; if (p_screen->button_selection == (num_buttons - 1)) { #ifdef TEST_RRT if ((p_screen->local_state + MAX_RRT_VAL_BUTTONS) < MAX_RRT_VAL) p_screen->local_state++; #else PSIP_RRT_dimension dim; if (PSIP_RRT_getDimension(p_app->settings.rrt_settings.rrt,dim_idx,&dim) != BERR_SUCCESS) dim.values_defined = 0; if ((p_screen->local_state + MAX_RRT_VAL_BUTTONS) < dim.values_defined) p_screen->local_state++; #endif } else next_button++; p_screen->button_selection = next_button; result = 1; } break; case eIR_0: case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: result = 0; break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else if (p_event->type == eS_EVENT_CHECKED) { result = (p_app->settings.rrt_settings.ratings_rrt[dim_idx] & (1 << p_screen->button_selection)) ? 1 : 0; } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: RRT Ratings update screen event handler Description: RRT Ratings update screen event handler . */ int screen_ratings_rrt_update_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: pin entry screen event handler Description: pin entry screen event handler. . */ int screen_pin_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static unsigned int pin = 0; static unsigned int pin_pending = 0; static unsigned int pin_override = 0; if (p_event->type == eS_EVENT_SETUP) { /* this popup may display without a corresponding keypress so reset screensaver timeout value manually */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__func__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif p_app->tmp_value = 0; /* select first pin digit field */ result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_REDRAW) { result = 1; } else if (p_event->type == eS_EVENT_IR) { BDBG_MSG(("event ir id: %d\n", p_event->id)); switch (p_event->id) { case eIR_MENU: /* disable 'back' functionality for live pin verification */ if ((p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) || (p_app->screen_id == eSCREEN_WRONG_PIN_LIVE)) { bapp_set_current_screen(p_app, eSCREEN_MAIN, eSCREEN_NULL); } else { bapp_goto_last_screen(p_app); } result = 1; break; case eIR_CH_UP: if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { bapp_change_channel(p_app,1,1); bapp_set_current_screen(p_app, eSCREEN_NULL, eSCREEN_NULL); result = 1; } else if (p_app->screen_id == eSCREEN_WIZ_PIN_NEW) { /* + key will skip pin entry using 0000 as pin, this is to handle operation without remote on ACB335 per Aonvision request. */ bapp_set_current_screen(p_app, eSCREEN_WIZ_DONE, eSCREEN_PIN_NEW); p_app->settings.rrt_settings.pin = 0; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); result = 1; /* reset pin values */ pin = 0; p_app->tmp_value = 0; /* select first pin digit field */ } break; case eIR_CH_DOWN: if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { bapp_change_channel(p_app,0,1); bapp_set_current_screen(p_app, eSCREEN_NULL, eSCREEN_NULL); result = 1; } break; case eIR_ENTER: if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { /* channel jump - swap last and current channel numbers */ bapp_ch_t tmp_ch = p_app->cur_ch; p_app->cur_ch = p_app->prev_ch; p_app->prev_ch = tmp_ch; bapp_tune(p_app); bapp_set_current_screen(p_app, eSCREEN_NULL, eSCREEN_NULL); result = 1; } break; case eIR_LEFT: if (p_app->tmp_value > 0) { result = 1; (p_app->tmp_value)--; /* erase one entered pin digit */ pin &= ~(0 | (0xff)<<(p_app->tmp_value * 8)); } else { /* no pin digits entered so function as 'back' unless verifying pin live */ if ((p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) || (p_app->screen_id == eSCREEN_WRONG_PIN_LIVE)) { bapp_set_current_screen(p_app, eSCREEN_MAIN, eSCREEN_NULL); } else { bapp_goto_last_screen(p_app); } result = 1; } break; case eIR_0: case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: result = 1; pin |= (p_event->id)<<(p_app->tmp_value * 8); (p_app->tmp_value)++; break; } #ifdef NO_VCHIP /*janzy@20121106,Cancel Enter PIN*/ { pin = DEFAULT_PIN; p_app->tmp_value = 4; } #endif if (p_app->tmp_value == 4) { /* force drawing of last digit indicator */ /* any time we draw we need to sync first */ bscreen_draw_pin(v_app, ePIN_X, ePIN_Y+(p_screen->top_banner_height-eMENU_TITLE_AREA_HEIGHT_1_LINE)/2, ePIN_WIDTH, ePIN_HEIGHT, ePIN_INC_X, p_app->tmp_value, p_app->tmp_value - 1); /* handle all pin based screens */ switch (p_app->screen_id) { case eSCREEN_PIN_NEW: /* save entered pin and query user to confirm entry */ pin_pending = pin; BDBG_MSG(("saving new pin: %x\n", pin_pending)); /* force "last screen" to be identical to that of the eSCREEN_PIN_NEW */ bapp_set_current_screen(p_app, eSCREEN_PIN_CONFIRM, p_screen->last_screen_id); break; case eSCREEN_WIZ_PIN_NEW: /* save entered pin and query user to confirm entry */ pin_pending = pin; BDBG_MSG(("saving new pin: %x\n", pin_pending)); /* force "last screen" to be identical to that of the eSCREEN_PIN_NEW */ bapp_set_current_screen(p_app, eSCREEN_WIZ_PIN_CONFIRM, p_screen->last_screen_id); break; case eSCREEN_PIN_CONFIRM: BDBG_MSG(("comparing new/confirm pins: %x %x\n", pin_pending, pin)); /* verify against previously entered pin */ if (pin == pin_pending) { /* traditional screen flow was interrupted by pin new/confirm windows, so force "last screen" to be main menu screen. */ bapp_set_current_screen(p_app, eSCREEN_RATINGS, eSCREEN_MAIN); p_app->settings.rrt_settings.pin = pin; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } else { /* user entered pins do not match...start over */ bapp_set_current_screen(p_app, eSCREEN_MISMATCHED_PINS, p_screen->last_screen_id); } break; case eSCREEN_WIZ_PIN_CONFIRM: BDBG_MSG(("comparing new/confirm pins: %x %x\n", pin_pending, pin)); /* verify against previously entered pin */ if (pin == pin_pending) { /* still in wizard so continue to next step */ bapp_set_current_screen(p_app, eSCREEN_WIZ_DONE, eSCREEN_WIZ_PIN_NEW); p_app->settings.rrt_settings.pin = pin; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); } else { /* user entered pins do not match...start over */ bapp_set_current_screen(p_app, eSCREEN_WIZ_MISMATCHED_PINS, p_screen->last_screen_id); } break; case eSCREEN_PIN_VERIFY_LIVE: case eSCREEN_PIN_VERIFY_RATINGS: case eSCREEN_PIN_VERIFY_RESET: /* keep count of consecutive pin entries that equal backup pin (thomson = 3308) */ BDBG_ERR(("verify entered/stored pins: %x %x\n", pin, p_app->settings.rrt_settings.pin)); BDBG_ERR(("backup_pin: %x\n", DEFAULT_PIN)); if ((pin == DEFAULT_PIN) && (p_app->screen_id == eSCREEN_PIN_VERIFY_RATINGS)) pin_override = 3; else pin_override = 0; /* if user enters BRCM 3 times as the pin allow entry! */ if (pin_override == 3) pin = p_app->settings.rrt_settings.pin; BDBG_MSG(("verify entered/stored pins: %x %x\n", pin, p_app->settings.rrt_settings.pin)); /* verify against previously stored pin */ if (pin == p_app->settings.rrt_settings.pin) { if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { p_app->ratings_override = true; /* will be reset when changing channels */ p_app->ratings_override_set = true; bapp_set_current_screen(p_app, eSCREEN_NULL, eSCREEN_NULL); } else if (p_app->screen_id == eSCREEN_PIN_VERIFY_RATINGS) { bapp_set_current_screen(p_app, eSCREEN_RATINGS, eSCREEN_MAIN); } else if (p_app->screen_id == eSCREEN_PIN_VERIFY_RESET) { bapp_set_current_screen(p_app, eSCREEN_RESET, eSCREEN_SETUP); } } else { // This is not necessary JPF bos_sleep(3000); /* slow down possible brute force attack */ /* user entered pin is incorrect */ if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { bapp_set_current_screen(p_app, eSCREEN_WRONG_PIN_LIVE, eSCREEN_NULL); } else if (p_app->screen_id == eSCREEN_PIN_VERIFY_RATINGS) { bapp_set_current_screen(p_app, eSCREEN_WRONG_PIN_RATINGS, p_screen->last_screen_id); } else if (p_app->screen_id == eSCREEN_PIN_VERIFY_RESET) { bapp_set_current_screen(p_app, eSCREEN_WRONG_PIN_RESET, p_screen->last_screen_id); } } break; default: BDBG_ASSERT(0); } /* reset pin values */ pin = 0; p_app->tmp_value = 0; /* select first pin digit field */ result = 1; /* always handle event */ } } else if ((p_event->type != eS_EVENT_SELECTED) && (p_event->type != eS_EVENT_CHECKED)) { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Wrong PIN screen event handler Description: Wrong PIN screen event handler. . */ int screen_wrong_pin_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; if (p_event->type == eS_EVENT_SETUP) { /* this popup may display without a corresponding keypress so reset screensaver timeout value manually */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__func__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: if (p_screen->p_button_array[p_screen->button_selection].desc_text_id == eTEXT_CANCEL_INFO) { result = 1; /* cannot call select_button() in this case since we do not want to save button history * this is unique for the eTEXT_CANCEL button since the button duplicates the 'back' functionality */ bapp_goto_last_screen(p_app); } else /* retry */ { bapp_set_current_screen(p_app, p_screen->p_button_array[p_screen->button_selection].next_screen_id, p_screen->last_screen_id); result = 1; } break; case eIR_LEFT: case eIR_MENU: if (p_app->screen_id == eSCREEN_WIZ_MISMATCHED_PINS) { /* cancel option not available in wizard so retry */ bapp_set_current_screen(p_app, p_screen->p_button_array[p_screen->button_selection].next_screen_id, p_screen->last_screen_id); result = 1; } else /* disable 'back' functionality for live pin verification */ if (p_app->screen_id != eSCREEN_WRONG_PIN_LIVE) { result = 1; bapp_goto_last_screen(p_app); } break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } #if 0 /* Summary: Setup RRT ratings screen. . */ int bscreen_rrt_init(void *v_app) { bapp_t *p_app = (bapp_t*)v_app; /* setup rrt screen buttons */ PSIP_RRT_header header; PSIP_RRT_dimension dim; int dim_idx = 0; int num_rrt_dim = 0; PSIP_RRT_getHeader(p_app->settings.rrt_settings.rrt, &header); for (dim_idx = 0; dim_idx < header.dimensions_defined; dim_idx++) { if (PSIP_RRT_getDimension(p_app->settings.rrt_settings.rrt,dim_idx,&dim) == BERR_SUCCESS) { /* create button on rrt dimensions screen */ if (dim_idx < MAX_RRT_DIM_BUTTONS) { g_buttons_ratings_rrt_dim[dim_idx].type = eBUTTON_MENU; g_buttons_ratings_rrt_dim[dim_idx].x = eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_X; g_buttons_ratings_rrt_dim[dim_idx].y = eMENU_RATINGS_RRT_DIM_FIRST_BUTTON_Y + dim_idx * eMENU_RATINGS_RRT_DIM_BUTTON_INC_Y; g_buttons_ratings_rrt_dim[dim_idx].width = eMENU_RATINGS_RRT_DIM_BUTTON_WIDTH; g_buttons_ratings_rrt_dim[dim_idx].height = eMENU_RATINGS_RRT_DIM_BUTTON_HEIGHT; g_buttons_ratings_rrt_dim[dim_idx].text_id = eTEXT_MAX; g_buttons_ratings_rrt_dim[dim_idx].desc_text_id = eTEXT_MAX; g_buttons_ratings_rrt_dim[dim_idx].next_screen_id = eSCREEN_RATINGS_RRT_VAL; g_buttons_ratings_rrt_dim[dim_idx].next_screen_back_id = eSCREEN_MAX; g_buttons_ratings_rrt_dim[dim_idx].right_justify_text = 1; g_buttons_ratings_rrt_dim[dim_idx].background_color = eCOLOR_MED_BLUE; num_rrt_dim++; } } } return num_rrt_dim; } #endif /* Summary: check power saver time Description: check power saver time */ int bscreen_check_power_saver_time(bapp_t *p_app) { uint32_t current_tick = bos_getticks(); /* check for auto power off */ if ((p_app->screen_id != eSCREEN_POWER_OFF) && (p_app->settings.auto_power != 3)) { bool is_time = false; if (p_app->settings.auto_power < 2) { if (current_tick - p_app->power_saver_tick >= (AUTO_POWER_OFF_TIMEOUT * (1 + p_app->settings.auto_power))) { is_time = true; } } else { /* now use 2 for program end power saver instead of 12 hours */ if (chm_check_program_end_time(&p_app->chm)) { is_time = true; } else { /* no EIT or not time yet? we are safe to use this since current and next EIT can carry maximum 3 hours */ if (current_tick - p_app->power_saver_tick >= AUTO_POWER_OFF_TIMEOUT) { is_time = true; } } } if (is_time && !p_app->settings.auto_power_off) { p_app->chm_cmd.cmd_id = eCHM_CANCEL; chm_cmd(&p_app->chm, &p_app->chm_cmd); p_app->settings.auto_power_off = 1; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); bapp_power(p_app, false); } } return 0; } /* Summary: Default screen idle handler Description: Default screen idle handler. */ int bscreen_default_idle(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; uint32_t current_tick = bos_getticks(); bool show_screensaver = false; #ifdef CONFIG_SCREENSAVER bscreen_t *p_screen = (bscreen_t*)v_screen; #endif /* check for auto power off */ bscreen_check_power_saver_time(p_app); /* check for screen timeout when 'no signal' popup is displayed */ p_app->no_signal = !bapp_get_signal_status(p_app); if ((p_app->screen_id == eSCREEN_BANNER_SMALL) && p_app->no_signal && #ifndef CONFIG_SCREENSAVER (current_tick >= (p_app->last_keypress_tick + NO_SIGNAL_TIMEOUT))) #else (current_tick >= (p_app->last_keypress_tick + MS_TO_TICKS(SCREEN_DEFAULT_TIMEOUT)))) #endif { #ifndef CONFIG_SCREENSAVER /*power off when status is [no signal] continuous 15 minutes*/ p_app->chm_cmd.cmd_id = eCHM_CANCEL; chm_cmd(&p_app->chm, &p_app->chm_cmd); p_app->settings.auto_power_off = 2; /* indicator for No signal case */ p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); bapp_power(p_app, false); #else show_screensaver = true; #endif } else /* check for screen timeout when 'mute' popup is displayed */ if ((p_app->screen_id == eSCREEN_BANNER_SMALL) && (p_app->audio_mute) && (current_tick >= (p_app->last_keypress_tick + MS_TO_TICKS(SCREEN_DEFAULT_TIMEOUT)))) { show_screensaver = true; } else { /* check for screen timeout when a menu screen is displayed */ if ((p_app->screen_id != eSCREEN_SCREENSAVER) && (p_app->screen_id != eSCREEN_POWER_OFF) && (p_app->screen_id != eSCREEN_NULL) && (p_app->screen_id != eSCREEN_BANNER_SMALL) && /*RLQ*/ #ifndef CONFIG_SCREENSAVER (current_tick >= (p_app->last_keypress_tick + MS_TO_TICKS(MENU_TIMEOUT )))) #else (p_screen->idle_timeout > 0) && (current_tick >= (p_app->last_keypress_tick + MS_TO_TICKS(p_screen->idle_timeout)))) #endif { #ifndef CONFIG_SCREENSAVER /* if we are in channel scan screen or guide information screen, don't quit */ if ((eSCREEN_CH_SCAN_PROGRESS == p_app->screen_id) || (eSCREEN_GUIDE == p_app->screen_id)) { p_app->last_keypress_tick = current_tick; } else bapp_do_exit(); #else show_screensaver = true; #endif } #ifdef CONFIG_SCREENSAVER else { if (!p_app->no_signal && (eSCREEN_SCREENSAVER == p_app->screen_id) && (eSCREEN_BANNER_SMALL == p_screen->last_screen_id)) { /* reset screensaver timeout since we will show no signal popup */ p_app->last_keypress_tick = bos_getticks(); /* going from no signal to valid signal - hide popup */ set_banner(p_screen, eLS_BANNER_OFF, false); bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); screen_null_draw(p_app, NULL); bapp_flush_screen(p_app); } } #endif } #ifndef CONFIG_SCREENSAVER if (show_screensaver) { return 0; /* don't cause screen redraw */ } #else //#error "No screensaver mode for Thomson" if (show_screensaver) { bapp_set_current_screen(p_app, eSCREEN_SCREENSAVER, eSCREEN_MAX); p_app->last_keypress_tick = current_tick; printf("#### %s:%d 0x%08x ####\n",__func__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); return 1; /* cause screen redraw */ } #endif return 0; } static void reset_volume_timeout(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; if (p_bs->volume_dirty) p_bs->volume_timeout = bos_getticks() + MS_TO_TICKS(BANNER_VOLUME_TIMEOUT); else p_bs->volume_timeout = 0; } static void reset_SAP_timeout(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; if (p_bs->SAP_dirty) p_bs->SAP_timeout = bos_getticks() + MS_TO_TICKS(BANNER_SAP_TIMEOUT); else p_bs->SAP_timeout = 0; } #ifdef CONFIG_EIA_708 static void reset_CC_timeout(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; if (p_bs->CC_dirty) p_bs->CC_timeout = bos_getticks() + MS_TO_TICKS(BANNER_CC_TIMEOUT); else p_bs->CC_timeout = 0; } #endif /* to reset AspectRatio IR button timeout */ static void reset_AR_timeout(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; if (p_bs->AR_dirty) p_bs->AR_timeout = bos_getticks() + MS_TO_TICKS(BANNER_AR_TIMEOUT); else p_bs->AR_timeout = 0; } static void reset_auto_power_restart_timeout(bapp_t *p_app, bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; if (p_app->settings.auto_power_off) p_bs->auto_power_restart_timeout = bos_getticks() + MS_TO_TICKS(AUTO_POWER_OFF_RESTART_TIMEOUT); else p_bs->auto_power_restart_timeout = 0; } static void reset_10_key_timeout(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; if (p_bs->majorChIndex > 0) p_bs->ten_key_timeout = bos_getticks() + MS_TO_TICKS(BANNER_10_KEY_TIMEOUT); else p_bs->ten_key_timeout = 0; } static void reset_banner_timeout(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; /* reset banner timeout */ if (p_bs->mode == eLS_BANNER_SMALL) p_bs->timeout = bos_getticks() + MS_TO_TICKS(BANNER_SMALL_TIMEOUT); else if (p_bs->mode == eLS_BANNER_BIG) p_bs->timeout = bos_getticks() + MS_TO_TICKS(BANNER_BIG_TIMEOUT); else if (p_bs->mode == eLS_BANNER_EAS_TEXT_SCROLLING) p_bs->timeout = bos_getticks() + MS_TO_TICKS(SCREEN_DEFAULT_TIMEOUT); else p_bs->timeout = 0; } static void reset_10_key(bscreen_t *p_screen) { banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; BDBG_ASSERT(p_bs); memset(p_bs->majorCh, 0, sizeof(p_bs->majorCh)); memset(p_bs->minorCh, 0, sizeof(p_bs->minorCh)); p_bs->majorChIndex = 0; p_bs->minorChIndex = 0; p_bs->dot = false; p_bs->enter = false; reset_10_key_timeout(p_screen); } static int my_atoi(const char *s) { int i=0; while ((*s >= '0') && (*s <='9')) i = i*10 + *(s++) - '0'; return i; } /* Summary: Banner screen event handler Description: Banner screen event handler. . */ int screen_banner_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; banner_state_t *p_bs; int result = 0; p_bs = (banner_state_t*)p_screen->local_state; BDBG_ASSERT(p_bs); switch (p_event->type) { case eS_EVENT_REDRAW: break; case eS_EVENT_SETUP: { result = 1; /* always handle event */ #ifdef CONFIG_EIA_708 if (p_app->cc_enabled) bapp_enable_cc(p_app, false); #endif /* if showing banner because of 10key, do not reset value */ if (!((p_event->id >= eIR_0) && (p_event->id <= eIR_9))) reset_10_key(p_screen); if (p_app->screen_id != eSCREEN_BANNER_SMALL) set_banner(p_screen, eLS_BANNER_MAX, false); /* reset key repeat timeout */ p_bs->repeat_rate = 1; p_bs->repeat_timeout = DEFAULT_REPEAT_TIMEOUT/p_bs->repeat_rate; reset_banner_timeout(p_screen); reset_10_key_timeout(p_screen); screen_null_draw(v_app, v_screen); if (p_app->settings_dirty) { /* user settings have changed so update and retune */ bapp_save_settings(p_app); } } break; case eS_EVENT_SETUP_DONE: break; case eS_EVENT_IDLE: { uint32_t current_tick = bos_getticks(); bool timeout = false; if (!p_app->no_signal && (current_tick - p_app->power_saver_tick < (AUTO_POWER_OFF_TIMEOUT * (1 + p_app->settings.auto_power) - MS_TO_TICKS(1000 * 60)))) timeout = true; #ifndef CONFIG_SCREENSAVER if (p_app->no_signal && (current_tick - p_app->last_keypress_tick < (NO_SIGNAL_TIMEOUT - MS_TO_TICKS(1000 * 60)))) timeout = true; #endif if ((p_bs->auto_power_one_min_warning) && timeout) { /* auto power off cancelled */ p_bs->auto_power_one_min_warning = false; result = 1; } else { int hours = 1; /* four hours for end of program option if no EIT associated with current channel */ if (p_app->settings.auto_power < 2) hours = (1 + p_app->settings.auto_power); timeout = false; if (current_tick - p_app->power_saver_tick >= (AUTO_POWER_OFF_TIMEOUT * hours - MS_TO_TICKS(1000 * 60))) timeout = true; #ifndef CONFIG_SCREENSAVER if (!p_bs->auto_power_one_min_warning && p_app->no_signal && (current_tick - p_app->last_keypress_tick >= (NO_SIGNAL_TIMEOUT - MS_TO_TICKS(1000 * 60)))) timeout = true; #endif /* TODO do we need 1 minute warning for program end option? */ if (timeout && (p_app->settings.auto_power != 3 || (p_app->no_signal && !p_bs->auto_power_one_min_warning))) { if (!p_bs->auto_power_one_min_warning) { /* show one minute warning before auto power off */ p_bs->auto_power_one_min_warning = true; if (p_bs->mode != eLS_BANNER_OFF) { set_banner(p_screen, eLS_BANNER_OFF, false); reset_banner_timeout(p_screen); } bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); } result = 1; } else if (p_app->audio_mute) { if (p_app->screen_id != eSCREEN_BANNER_SMALL) { bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); result = 1; } } } /* Handle repeating when key is held down */ if (p_bs->repeat_timeout < current_tick) { //BDBG_MSG(("%s repeat id=%d",__func__,p_bs->event.id)); if (p_bs->event.type == eS_EVENT_IR) { switch (p_bs->event.id) { case eIR_CH_UP: bapp_change_channel(p_app,1,1); reset_banner_timeout(p_screen); result = 1; break; case eIR_CH_DOWN: bapp_change_channel(p_app,0,1); reset_banner_timeout(p_screen); result = 1; break; default: break; } } if (p_bs->repeat_rate < MAX_REPEAT_ACCEL) { p_bs->repeat_rate += REPEAT_INC; } p_bs->repeat_timeout = current_tick + (DEFAULT_REPEAT_TIMEOUT/p_bs->repeat_rate); } /* check signal level */ { static bool last_signal_status = true; bool current_signal_status = false; /* check for no signal - display/hide popup as necessary */ current_signal_status = bapp_get_signal_status(p_app); if ((!last_signal_status) && (current_signal_status)) { /* going from no signal to valid signal - hide popup */ set_banner(p_screen, eLS_BANNER_MAX, false); reset_banner_timeout(p_screen); /* no need to re-enable cc since we are displaying banner */ bapp_audio_mute(p_app, p_app->audio_mute); #ifdef CONFIG_SCREENSAVER /* reset screensaver timeout since we will show no signal popup */ p_app->last_keypress_tick = bos_getticks(); #endif result = 1; } else if ((last_signal_status) && (!current_signal_status)) { result = 1; bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); /* reset screensaver timeout since we will show no signal popup */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__func__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif } else if (!current_signal_status && (p_app->screen_id != eSCREEN_BANNER_SMALL)) { result = 1; bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); } last_signal_status = current_signal_status; } /* if eas alert is fired */ if ((p_app->eas_text || p_app->eas_activation_text) && p_app->eas_started && (eAPP_STATE_NORMAL == p_app->state)) { /* to bring up EAS text scrolling if not yet */ if (eLS_BANNER_EAS_TEXT_SCROLLING != p_bs->mode) { result = set_banner(p_screen, eLS_BANNER_EAS_TEXT_SCROLLING, false); reset_banner_timeout(p_screen); /* init for scrolling */ p_app->eas_dsp_x = EAS_TEXT_WIDTH - EAS_SCROLL_STEP; p_app->eas_src_start_idx = -1; p_app->eas_src_start_x = 0; p_app->eas_src_end_idx = 0; p_app->eas_src_end_x = p_app->eas_char_width[0]; result = 1; } bscreen_banner_draw(v_app, p_screen); bapp_flush_screen(p_app); } else { if (eLS_BANNER_EAS_TEXT_SCROLLING == p_bs->mode) p_bs->mode = eLS_BANNER_OFF; } #if(USERIO_ID != 5) /* ACB612 USERIO_ID=5 don't control volume in the box but the TV instead */ /* handle volume timeout */ if ((p_bs->volume_dirty) && (p_bs->volume_timeout) && (current_tick >= p_bs->volume_timeout)) { p_bs->volume_dirty = false; reset_volume_timeout(p_screen); bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); result = 1; } #endif /* handle SAP timeout */ if ((p_bs->SAP_dirty) && (p_bs->SAP_timeout) && (current_tick >= p_bs->SAP_timeout)) { p_bs->SAP_dirty = false; reset_SAP_timeout(p_screen); bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); bscreen_popup(v_app,v_screen); result = 1; } #ifdef CONFIG_EIA_708 /* handle CC timeout */ if ((p_bs->CC_dirty) && (p_bs->CC_timeout) && (current_tick >= p_bs->CC_timeout)) { bapp_set_captions_options(p_app); p_bs->CC_dirty = false; reset_CC_timeout(p_screen); bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); bscreen_popup(v_app,v_screen); result = 1; } #endif /* handle AR timeout */ if ((p_bs->AR_dirty) && (p_bs->AR_timeout) && (current_tick >= p_bs->AR_timeout)) { //bapp_set_ar_options(p_app); p_bs->AR_dirty = false; reset_AR_timeout(p_screen); bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); bscreen_popup(v_app,v_screen); result = 1; } /* handle auto power restart timeout */ if (p_app->settings.auto_power_off) { if (p_bs->auto_power_restart_timeout == 0) { reset_auto_power_restart_timeout(p_app, p_screen); bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); bscreen_popup(v_app,v_screen); result = 1; } else if (current_tick >= p_bs->auto_power_restart_timeout) { p_app->settings.auto_power_off = 0; p_app->settings_dirty |= DIRTY_SCREEN; bapp_save_settings(p_app); reset_auto_power_restart_timeout(p_app, p_screen); bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); bscreen_popup(v_app,v_screen); result = 1; } } /* handle 10key timeout */ if ((p_bs->ten_key_timeout) && (current_tick >= p_bs->ten_key_timeout)) { /* user has entered some 10key so attempt tune */ /* force drawing of last digit indicator */ p_bs->enter = true; if (p_bs->minorChIndex == 0) { p_bs->minorCh[0] = '1'; p_bs->minorChIndex = 1; } bapp_set_channel_by_major(p_app, my_atoi(p_bs->majorCh), my_atoi(p_bs->minorCh)); reset_10_key(p_screen); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; } /* handle timeout of banner */ if ((p_bs->timeout) && (current_tick >= p_bs->timeout)) { if (p_app->eas_text && p_app->eas_timeout) { set_banner(p_screen, eLS_BANNER_EAS_TEXT_SCROLLING, true); } else { set_banner(p_screen, eLS_BANNER_OFF, true); result = 1; #ifdef CONFIG_EIA_708 if (!p_app->cc_enabled) bapp_enable_cc(p_app, true); #endif } reset_banner_timeout(p_screen); } result |= bscreen_default_idle(v_app, v_screen); } break; case eS_EVENT_IR: { /* cancel auto power restart popup */ if ((p_app->settings.auto_power_off) && ((p_event->id & KEY_UP) == 0)) { p_app->settings.auto_power_off = 0; reset_auto_power_restart_timeout(p_app, p_screen); result = 1; } else if (bos_getticks() < (p_app->last_keypress_tick + AUTO_POWER_OFF_TIMEOUT * (1 + p_app->settings.auto_power))) { /* cancel auto power off popup */ result = 1; } /* cancel partial 10key entry if user presses any invalid key */ if ((p_bs->majorChIndex > 0) && ((p_event->id & KEY_UP) == 0)) { if ((p_event->id != eIR_0) && (p_event->id != eIR_1) && (p_event->id != eIR_2) && (p_event->id != eIR_3) && (p_event->id != eIR_4) && (p_event->id != eIR_5) && (p_event->id != eIR_6) && (p_event->id != eIR_7) && (p_event->id != eIR_8) && (p_event->id != eIR_9) && (p_event->id != eIR_DOT) && (p_event->id != eIR_SELECT) && (p_event->id != eIR_ENTER)) { reset_10_key(p_screen); result = 1; } } switch (p_event->id) { /*janzy@20121031,volume down/up when menu off*/ #if(USERIO_ID == 11 || USERIO_ID == 4 || USERIO_ID == 12) case eIR_RIGHT: #endif case eIR_VOL_UP: bapp_set_audio_volume(p_app, p_app->audio_vol + VOLUME_INCREMENT); p_bs->volume_dirty = true; reset_volume_timeout(p_screen); p_app->audio_mute = false; bapp_audio_mute(p_app,p_app->audio_mute); if (p_bs->mode != eLS_BANNER_OFF) { set_banner(p_screen, eLS_BANNER_OFF, false); reset_banner_timeout(p_screen); } bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); result = 1; break; /*janzy@20121031,volume down/up when menu off*/ #if(USERIO_ID == 11|| USERIO_ID == 4 || USERIO_ID == 12) case eIR_LEFT: #endif case eIR_VOL_DOWN: if (p_app->audio_vol > 0) bapp_set_audio_volume(p_app, p_app->audio_vol - VOLUME_INCREMENT); p_bs->volume_dirty = true; reset_volume_timeout(p_screen); p_app->audio_mute = false; bapp_audio_mute(p_app,p_app->audio_mute); if (p_bs->mode != eLS_BANNER_OFF) { set_banner(p_screen, eLS_BANNER_OFF, false); reset_banner_timeout(p_screen); } bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); result = 1; break; case eIR_MENU: result = 1; set_banner(p_screen, eLS_BANNER_OFF, true); reset_banner_timeout(p_screen); bapp_set_current_screen(p_app, eSCREEN_MAIN, eSCREEN_NULL); break; case eIR_INFO: if (p_bs->mode == eLS_BANNER_OFF) set_banner(p_screen, eLS_BANNER_SMALL, false); else if (p_bs->mode == eLS_BANNER_SMALL) set_banner(p_screen, eLS_BANNER_BIG, false); else { set_banner(p_screen, eLS_BANNER_OFF, false); #ifdef CONFIG_EIA_708 if (!p_app->cc_enabled) bapp_enable_cc(p_app, true); #endif } reset_banner_timeout(p_screen); result = 1; break; case eIR_GUIDE: result = 1; /* the channel selected in the GUIDE screen, we need to set it here first since the detailed EPG screen may change it on the fly */ p_app->chm.cur_epg_ch_num = p_app->cur_ch_num; bapp_set_current_screen(p_app, eSCREEN_GUIDE, eSCREEN_NULL); break; /* currently use UP/DOWN button for favarite */ case eIR_UP: bapp_change_channel_fav(p_app,1,1); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); break; case eIR_DOWN: bapp_change_channel_fav(p_app,0,1); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); break; case eIR_CH_UP: bapp_change_channel(p_app,1,1); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; break; case eIR_CH_DOWN: bapp_change_channel(p_app,0,1); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; break; case eIR_DOT: if (p_bs->majorChIndex > 0) { p_bs->dot = true; reset_banner_timeout(p_screen); reset_10_key_timeout(p_screen); result = 1; } /* disable dot (.) button if the IR remote has its own CC button */ #if(USERIO_ID != 12 && USERIO_ID != 11 && USERIO_ID != 10 && USERIO_ID != 4 && (USERIO_ID != 15)) #ifdef CONFIG_EIA_708 else { if (p_bs->CC_dirty) { p_app->captions_basic++; if (p_app->captions_basic > MAX_CC_SERVICES) { p_app->captions_basic = 0; } } p_bs->CC_dirty = true; bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); reset_CC_timeout(p_screen); /* reset screensaver timeout since we will show CC popup */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__func__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif result = 1; } #endif #endif break; #if(USERIO_ID == 12 || USERIO_ID == 11 || USERIO_ID == 10 || USERIO_ID == 4 || (15 == USERIO_ID))/*janzy@20120924,add remote MA-35K*/ case eIR_CC: #ifdef CONFIG_EIA_708 if (p_bs->CC_dirty) { p_app->captions_basic++; if (p_app->captions_basic > MAX_CC_SERVICES) { p_app->captions_basic = 0; } } p_bs->CC_dirty = true; bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); reset_CC_timeout(p_screen); /* reset screensaver timeout since we will show CC popup */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__func__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif result = 1; #endif break; #endif case eIR_AR: if (p_bs->AR_dirty) { /* currently have three video output foramts { AFD | Widescreen | Fullscreen | Zoom }, rotate */ p_app->sd_options = ++p_app->sd_options % bdisplay_sd_output_options_max; /* change output format immediately to show the effect */ bapp_set_ar_options(p_app); } else { /* initialize the local variable */ p_app->sd_options = p_app->settings.sd_options; p_bs->AR_dirty = true; } /* dismiss any screen so that the popup draw can take effect */ bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); reset_AR_timeout(p_screen); #ifdef CONFIG_SCREENSAVER /* reset screensaver timeout since we will show CC popup */ p_app->last_keypress_tick = bos_getticks(); #endif result = 1; break; case eIR_0: case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: if (p_bs->majorChIndex >= 2) { /* max number of major channel digits have been entered so skip to minor channel digit entry */ p_bs->dot = true; } if (!p_bs->dot) { /* major channel number digit entered */ p_bs->majorCh[p_bs->majorChIndex] = '0' + (p_event->id - eIR_0); p_bs->majorChIndex++; } else { /* minor channel number digit entered */ p_bs->minorCh[p_bs->minorChIndex] = '0' + (p_event->id - eIR_0); p_bs->minorChIndex++; if (p_bs->minorChIndex >= 2) { /* max number of minor channel digits have been entered so immediately tune */ /* force drawing of last digit indicator */ p_bs->enter = true; if (p_bs->minorChIndex == 0) { p_bs->minorCh[0] = '1'; p_bs->minorChIndex = 1; } bapp_set_channel_by_major(p_app, my_atoi(p_bs->majorCh), my_atoi(p_bs->minorCh)); reset_10_key(p_screen); } } set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); reset_10_key_timeout(p_screen); result = 1; break; case eIR_ENTER: if (p_bs->majorChIndex > 0) { /* force drawing of channel without '_' */ p_bs->enter = true; if (p_bs->minorChIndex == 0) { p_bs->minorCh[0] = '1'; p_bs->minorChIndex = 1; } bapp_set_channel_by_major(p_app, my_atoi(p_bs->majorCh), my_atoi(p_bs->minorCh)); reset_10_key(p_screen); } #ifndef ACB612 else { /* channel jump - swap last and current channel numbers */ bapp_ch_t tmp_ch = p_app->cur_ch; p_app->cur_ch = p_app->prev_ch; p_app->prev_ch = tmp_ch; bapp_tune(p_app); } #endif set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; break; case eIR_PRECH: { /* channel jump - swap last and current channel numbers */ #if 0/*janzy@20121106,fix PRE CH*/ bapp_ch_t tmp_ch = p_app->cur_ch; p_app->cur_ch = p_app->prev_ch; p_app->prev_ch = tmp_ch; #else int i; /* first time after boot up? */ if (0 == p_app->prev_ch.major && 0 == p_app->prev_ch.minor) { p_app->prev_ch = p_app->cur_ch; } for(i=0;i<=p_app->settings.num_channels;i++) { if( p_app->settings.ch[i].major == p_app->prev_ch.major && p_app->settings.ch[i].minor == p_app->prev_ch.minor && p_app->settings.ch[i].freq_idx == p_app->prev_ch.freq_idx && p_app->settings.ch[i].pcr_pid == p_app->prev_ch.pcr_pid && p_app->settings.ch[i].video_pid == p_app->prev_ch.video_pid) { p_app->cur_ch_num = i; } } #endif bapp_tune(p_app); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; } break; case eIR_MUTE: p_app->audio_mute = !p_app->audio_mute; bapp_audio_mute(p_app, p_app->audio_mute); p_bs->volume_dirty = false; /* override recent previous volume change */ reset_volume_timeout(p_screen); /* reset screensaver timeout if we will show mute popup */ #ifdef CONFIG_SCREENSAVER if (p_app->audio_mute) p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__func__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #endif bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); result = 1; break; case eIR_SELECT: if (p_bs->majorChIndex > 0) { /* force drawing of channel without '_' */ p_bs->enter = true; if (p_bs->minorChIndex == 0) { p_bs->minorCh[0] = '1'; p_bs->minorChIndex = 1; } bapp_set_channel_by_major(p_app, my_atoi(p_bs->majorCh), my_atoi(p_bs->minorCh)); reset_10_key(p_screen); set_banner(p_screen, eLS_BANNER_MAX, true); reset_banner_timeout(p_screen); result = 1; } else if (p_app->settings.sound == 1) { if (p_app->num_sap > 1) { if (p_bs->SAP_dirty) bapp_rotate_audio_sap(p_app); p_bs->SAP_dirty = true; reset_SAP_timeout(p_screen); bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_NULL); /* reset screensaver timeout since we will show SAP popup */ #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); #endif result = 1; } else result = 0; } break; } } p_bs->event = *p_event; /* reset key repeat timeout */ p_bs->repeat_rate = 1; p_bs->repeat_timeout = bos_getticks() + (DEFAULT_REPEAT_TIMEOUT/p_bs->repeat_rate); /* Since the tuning time can be greater than the repeat timeout increase it to handle these cases */ switch (p_event->id) { case eIR_UP: case eIR_CH_UP: case eIR_DOWN: case eIR_CH_DOWN: p_bs->repeat_timeout += (DEFAULT_REPEAT_TIMEOUT/p_bs->repeat_rate); break; default: break; } break; default: case eS_EVENT_SELECTED: case eS_EVENT_CHECKED: { result = bscreen_default_event(v_app,v_screen,p_event); } break; } return result; } /* Summary: screensaver screen event handler Description: screensaver screen event handler. . */ int screen_screensaver_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; screensaver_state_t *p_ss = (screensaver_state_t*)p_screen->local_state; BDBG_ASSERT(p_ss); switch (p_event->type) { case eS_EVENT_IDLE: if (bos_getticks() >= p_ss->image_swap_timeout) { /* redraw window */ result = 1; p_ss->image_swap_timeout = bos_getticks() + MS_TO_TICKS(SCREENSAVER_IMAGE_TIMEOUT); } if (!result) result = bscreen_default_idle(v_app, v_screen); break; case eS_EVENT_SETUP: { #ifdef CONFIG_EIA_708 if (p_app->cc_enabled) bapp_enable_cc(p_app, false); #endif p_ss->image_swap_timeout = bos_getticks() + MS_TO_TICKS(SCREENSAVER_IMAGE_TIMEOUT); if (p_app->logo) bapp_set_palette(p_app, ePALETTE_SCREENSAVER); } break; case eS_EVENT_IR: if ((p_event->id & KEY_UP) == 0) { if (p_app->logo) bapp_set_palette(p_app, ePALETTE_DEFAULT); /* recheck ratings block status which may have changed while in screensaver */ #if 0 /* JPF TODO */ bapp_handle_blocking(p_app); #endif bapp_goto_last_screen(p_app); result = 1; } break; default: break; } return result; /* always handle event */ } /* Summary: Power off screen event handler Description: Power off screen event handler. . */ int screen_power_off_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { #ifdef CONFIG_SCREENSAVER bapp_t *p_app = (bapp_t*)v_app; #endif int result = 0; switch (p_event->type) { case eS_EVENT_SETUP: #ifdef CONFIG_SCREENSAVER p_app->last_keypress_tick = bos_getticks(); printf("#### %s:%d 0x%08x ####\n",__func__,__LINE__,TICKS_TO_MS(p_app->last_keypress_tick)); #ifdef CONFIG_EIA_708 if (p_app->cc_enabled) bapp_enable_cc(p_app, false); #endif #endif result = 1; break; default: break; } return result; /* always handle event */ } /* Summary: Default screen event handler Description: Default screen event handler. . */ int bscreen_default_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; switch (p_event->type) { default: case eS_EVENT_IDLE: result = bscreen_default_idle(v_app,v_screen); break; case eS_EVENT_REDRAW: break; case eS_EVENT_SETUP: bscreen_default_setup(v_app,v_screen); if (!p_app->settings.wiz_completed) { p_app->settings_dirty |= DIRTY_SCREEN; p_app->settings.wiz_completed = 1; } #ifdef CONFIG_EIA_708 //if (p_app->cc_enabled) bapp_enable_cc(p_app, false); #endif if (!p_app->is_muted) { bapp_audio_do_mute(p_app, true); bapp_video_mute(p_app, true); } result = 1; break; case eS_EVENT_SELECTED: result = (p_screen->button_selection == p_event->id) ? 1 : 0; break; case eS_EVENT_CHECKED: result = (p_screen->button_checked == p_event->id) ? 1 : 0; break; case eS_EVENT_IR: switch (p_event->id) { case eIR_INFO: break; case eIR_LEFT: case eIR_MENU: result = 1; if (p_app->screen_id == eSCREEN_MAIN) { if (p_app->re_tune) { bapp_tune(p_app); p_app->re_tune = false; } bapp_set_current_screen(p_app, eSCREEN_NULL, eSCREEN_NULL); if (bapp_get_signal_status(p_app)) { bapp_audio_do_mute(p_app, false); bapp_video_mute(p_app, false); #ifdef CONFIG_EIA_708 //if (p_app->cc_enabled) bapp_enable_cc(p_app, true); #endif } } else bapp_goto_last_screen(p_app); break; case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); break; case eIR_UP: result = next_button(v_app,v_screen,1); break; case eIR_DOWN: result = next_button(v_app,v_screen,0); break; case eIR_1: case eIR_2: case eIR_3: case eIR_4: case eIR_5: case eIR_6: case eIR_7: case eIR_8: case eIR_9: if ((p_event->id - 1) < p_screen->num_buttons) { bscreen_event_t event; p_screen->button_selection = p_event->id - 1; event.id = eIR_SELECT; event.type = eS_EVENT_IR; result = p_screen->handle_event(p_app,p_screen,&event); } break; default: /* Do nothing */ break; } break; } return result; /* always handle event */ } /* Summary: NULL screen drawing function Description: NULL screen drawing function. . */ void screen_null_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bgfx_fill_rect(&p_app->surf,0,0,eWIDTH,eHEIGHT,eCOLOR_CLEAR); } /* Summary: NULL screen drawing function for banner Description: NULL screen drawing function for banner . */ void banner_null_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bgfx_fill_rect(&p_app->surf,eBANNER_X,eBANNER_Y, eBANNER_WIDTH,eBANNER_SMALL_HEIGHT+eBANNER_LARGE_HEIGHT,eCOLOR_CLEAR); } /* Summary: NULL screen drawing function for status popup Description: NULL screen drawing function for status popup . */ void popup_null_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; // bscreen_t *p_screen = (bscreen_t*)v_screen; bgfx_fill_rect(&p_app->surf,eBANNER_STATUS_X,eBANNER_STATUS_Y, eBANNER_STATUS_WIDTH,eBANNER_STATUS_HEIGHT,eCOLOR_CLEAR); } /* * Summary: * Draw nagigation hints in the bottom of the screen * Description: * Draw nagigation hints in the bottom of the screen */ static void draw_navigation_hints(void *v_app, void *v_screen) { bapp_t * p_app = (bapp_t*)v_app; bscreen_t * p_screen = (bscreen_t*)v_screen; unsigned int num_chars = SCREEN_MAX_STR_WIDTH; int w = 0; int h = 0; int i; bscreen_get_string(p_app->lang,p_screen->help_text_id, p_app->tmp_str, &num_chars); for (i = 0; i < num_chars; ++i) { if (p_app->tmp_str[i] == 0x00000031) { p_app->tmp_str[i] = 0x2593;/* up */ } else if (p_app->tmp_str[i] == 0x00000032) { p_app->tmp_str[i] = 0x2502;/* down */ } else if (p_app->tmp_str[i] == 0x00000033) { p_app->tmp_str[i] = 0x2591;/* left */ } else if (p_app->tmp_str[i] == 0x00000034) { p_app->tmp_str[i] = 0x2592;/* right */ } } bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], (const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ((eWIDTH/2)-(w/2)), eMENU_INFO_Y, w + 5, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); } /* Summary: Default screen setup function Description: Default screen setup function used to set initial state before drawing. */ void bscreen_default_setup(void *v_app, void *v_screen) { bscreen_t *p_screen = (bscreen_t*)v_screen; if ((p_screen->button_selection + 1) > p_screen->num_buttons) p_screen->button_selection = 0; p_screen->button_checked = 0; } /* Summary: Default screen drawing function Description: Default screen drawing function. . */ void bscreen_default_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; int yoff = 0; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); if ((p_app->lang == eLANG_FRENCH) && (p_app->screen_id == eSCREEN_CAPTIONS_FONT)) yoff += 7; /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y - yoff, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); if ((p_app->lang == eLANG_FRENCH) && (p_app->screen_id == eSCREEN_CAPTIONS_FONT)) yoff += 4; /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y - yoff, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bscreen_draw_buttons(v_app,v_screen); draw_navigation_hints(v_app, v_screen); } /* Summary: Antenna screen drawing function Description: Antenna screen drawing function. . */ void bscreen_antenna_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int w, h; unsigned int num_chars; char strPercent[5] = "100%"; static char version[128]; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw signal level meter label */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_SIGNAL_LEVEL, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X, eSIGNAL_LEVEL_Y - h - ePROGRESS_LABEL_SPACING, w + 1, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); if (p_app->power_level > 100) p_app->power_level = 100; /* draw signal level meter */ bscreen_draw_progress(v_app, ePROGRESS_X, eSIGNAL_LEVEL_Y, ePROGRESS_WIDTH, ePROGRESS_HEIGHT, eBUTTON_PROGRESS_BORDER, eCOLOR_WHITE, eCOLOR_DRK_BLUE, p_app->power_level, 100); /* draw signal level percent compete text */ num_chars = SCREEN_MAX_STR_WIDTH; snprintf(strPercent, strlen(strPercent), "%3d%%", p_app->power_level); strPercent[3] = '%'; strPercent[4] = 0; num_chars = c_to_uni_str(strPercent,p_app->tmp_str,num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_MED], ePROGRESS_X + ePROGRESS_WIDTH + ePROGRESS_LABEL_SPACING, eSIGNAL_LEVEL_Y + (ePROGRESS_HEIGHT / 2) - (h / 2), w + 10, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw signal quality meter label */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_SIGNAL_QUALITY, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X, eSIGNAL_QUALITY_Y - h - ePROGRESS_LABEL_SPACING, w + 1, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); if (p_app->signal_quality > 100) p_app->signal_quality = 100; /* draw signal quality meter */ bscreen_draw_progress(v_app, ePROGRESS_X, eSIGNAL_QUALITY_Y, ePROGRESS_WIDTH, ePROGRESS_HEIGHT, eBUTTON_PROGRESS_BORDER, eCOLOR_WHITE, eCOLOR_DRK_BLUE, p_app->signal_quality, 100); /* draw signal quality percent text */ num_chars = SCREEN_MAX_STR_WIDTH; snprintf(strPercent, strlen(strPercent), "%3d%%", p_app->signal_quality); strPercent[3] = '%'; strPercent[4] = 0; num_chars = c_to_uni_str(strPercent,p_app->tmp_str,num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_MED], ePROGRESS_X + ePROGRESS_WIDTH + ePROGRESS_LABEL_SPACING, eSIGNAL_QUALITY_Y + (ePROGRESS_HEIGHT / 2) - (h / 2), w + 10, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); num_chars = SCREEN_MAX_STR_WIDTH; #if(AOV_MODEL == ALCO) snprintf(version, 128, ""); #else snprintf(version, 128, "Version: %d.%d.%d, %s", MAJOR_VERSION,MINOR_VERSION,SUB_VERSION,__DATE__); #endif num_chars = c_to_uni_str(version,p_app->tmp_str,num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X, eMENU_INFO_Y - (2 * h), w, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); draw_navigation_hints(v_app, v_screen); } /* Summary: Ch scan progress screen drawing function Description: Ch scan progress screen drawing function. . */ void bscreen_ch_scan_progress_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int w, h; unsigned int num_chars; char strPercent[5] = "100%"; char strChFound[18]; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw progress meter label */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_CH_SCAN_COMPLETE_LEVEL, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X, ePROGRESS_Y - h - ePROGRESS_LABEL_SPACING, w + 1, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw frequency in scan */ if (p_app->chm.last_freq_hz) { num_chars = sizeof(strChFound); snprintf(strChFound, num_chars, "%3d MHz", (p_app->chm.last_freq_hz / 1000000)); num_chars = c_to_uni_str(strChFound,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X + w + 30, ePROGRESS_Y - h - ePROGRESS_LABEL_SPACING, 100, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); } /* draw progress meter */ bscreen_draw_progress(v_app, ePROGRESS_X, ePROGRESS_Y, ePROGRESS_WIDTH, ePROGRESS_HEIGHT, eBUTTON_PROGRESS_BORDER, eCOLOR_WHITE, eCOLOR_DRK_BLUE, p_app->tmp_value, 100); /* draw percent compete text */ num_chars = SCREEN_MAX_STR_WIDTH; if (p_app->tmp_value<0) p_app->tmp_value = 0; if (p_app->tmp_value>100) p_app->tmp_value = 100; snprintf(strPercent, strlen(strPercent), "%3d%%", p_app->tmp_value); strPercent[3] = '%'; strPercent[4] = 0; num_chars = c_to_uni_str(strPercent,p_app->tmp_str,num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_MED], ePROGRESS_X + ePROGRESS_WIDTH + ePROGRESS_LABEL_SPACING, ePROGRESS_Y + (ePROGRESS_HEIGHT / 2) - (h / 2), w + 10, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw number of channels found */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_CH_SCAN_FOUND, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X, ePROGRESS_Y + (ePROGRESS_HEIGHT * 2) , w + 1, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); snprintf(strChFound, 4, "%3d", p_app->tmp_cnt); num_chars = c_to_uni_str(strChFound,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X + w, ePROGRESS_Y + (ePROGRESS_HEIGHT * 2) , ePROGRESS_WIDTH - w - ePROGRESS_X, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); draw_navigation_hints(v_app, v_screen); } /* Summary: Wizard welcome screen drawing function Description: Wizard welcome screen drawing function. . */ void bscreen_wiz_welcome_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; #ifndef CONFIG_LOGO #else #error "No Logo" bin_read_t br; br.cnt = 0; br.data = (void*)g_p_dsp->ui_comp.logo; br.size = g_p_dsp->ui_comp.logo_size; #endif bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bscreen_draw_buttons(v_app,v_screen); /* TODO: draw logo */ #ifdef CONFIG_LOGO bgfx_render_file(&(p_app->surf), eLOGO_X, eLOGO_Y, &br, 0); #endif draw_navigation_hints(v_app, v_screen); } /* Summary: Wizard done screen drawing function Description: Wizard done screen drawing function. . */ void bscreen_wiz_done_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; #ifndef CONFIG_LOGO #else bin_read_t br; br.cnt = 0; br.data = (void*)g_p_dsp->ui_comp.logo; br.size = g_p_dsp->ui_comp.logo_size; #endif bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bscreen_draw_buttons(v_app,v_screen); /* TODO: draw logo */ #ifdef CONFIG_LOGO bgfx_render_file(&(p_app->surf), eLOGO_X, eLOGO_Y, &br, 0); #endif draw_navigation_hints(v_app, v_screen); } /* Summary: Wiz ch scan screen drawing function Description: Wiz ch scan screen drawing function. . */ void bscreen_wiz_ch_scan_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; int w, h; char strChFound[5]; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bscreen_draw_buttons(v_app,v_screen); /* draw number of channels found (text) */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_WIZ_CH_SCAN_NUM_CHANNELS, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X, eMENU_INFO_Y - ePROGRESS_HEIGHT + 8 , w + 1, h, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); /* draw number of channels found (number) */ num_chars = SCREEN_MAX_STR_WIDTH; snprintf(strChFound, 4, "%3d", p_app->settings.num_channels); num_chars = c_to_uni_str(strChFound,p_app->tmp_str,num_chars); bgfx_fill_rect(&p_app->surf,ePROGRESS_X + w, eMENU_INFO_Y - ePROGRESS_HEIGHT, 40, eMENU_TITLE_TEXT_HEIGHT,eCOLOR_MED_BLUE); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_X + w, eMENU_INFO_Y - ePROGRESS_HEIGHT + 8, 40, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); draw_navigation_hints(v_app, v_screen); } /* Summary: PIN screen drawing function Description: PIN screen drawing function. . */ void bscreen_pin_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars,w,h; unsigned int field = 0; static char tmp_prog[64]; #ifdef NO_VCHIP /*janzy@20121106,Cancel Enter PIN*/ { return; } #endif bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); if (p_app->screen_id == eSCREEN_PIN_VERIFY_LIVE) { /* draw ratings - show blocked rating, if no blocked ratings then show received xds or psip rating if corresponding rating string exists */ num_chars = SCREEN_MAX_STR_WIDTH; tmp_prog[0] = 0; bscreen_get_string(p_app->lang,eTEXT_RATINGS_BUTTON, p_app->tmp_str, &num_chars); p_app->tmp_str[num_chars++] = (unsigned int)':'; p_app->tmp_str[num_chars++] = (unsigned int)' '; p_app->tmp_str[num_chars++] = (unsigned int)' '; text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_MED], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y + 60, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); /* if has digital rating information, use it first */ if (p_app->psip_rating_str[0] != 0) { strncpy_no_spaces(tmp_prog,(char*)p_app->psip_rating_str,63); BDBG_WRN(("%s - digital: %s\n",__func__, tmp_prog)); } else { if (p_app->prog_rating_str[0] != 0) { strncpy_no_spaces(tmp_prog,(char*)p_app->prog_rating_str,63); BDBG_WRN(("%s - analog: %s\n",__func__, tmp_prog)); } } num_chars = strlen(tmp_prog); if (num_chars) { num_chars = c_to_uni_str(tmp_prog,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_MED], eMENU_TITLE_DESC_TEXT_X + w, eMENU_TITLE_DESC_TEXT_Y + 60, eMENU_TITLE_DESC_TEXT_WIDTH, eBANNER_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); } else { BDBG_WRN(("%s - rating string empty\n",__func__)); } } /* draw pin fields */ for (field = 0; field < 4; field++) { bscreen_draw_pin(v_app, ePIN_X, ePIN_Y+(p_screen->top_banner_height-eMENU_TITLE_AREA_HEIGHT_1_LINE)/2, ePIN_WIDTH, ePIN_HEIGHT, ePIN_INC_X, p_app->tmp_value, field); } draw_navigation_hints(v_app, v_screen); } /* Summary: Popup screen drawing function Description: Popup screen drawing function. If 'desc' is set to eTEXT_MAX then banner height is adjusted to show the title only. If 'title' is set to eTEXT_VOLUME_TITLE then volume slider is displayed next to title. If 'title' and 'desc' are set to eTEXT_MAX then popup is hidden. . */ #define TMP_BUF_CHAR_MAX 16 static char tmp_buf[TMP_BUF_CHAR_MAX]; void bscreen_popup_draw(void *v_app, void *v_screen, btext_id_t title, btext_id_t desc) { bapp_t *p_app = (bapp_t*)v_app; int i = 0; unsigned int progress_width = 0; int w = 0; int h = 0; unsigned int num_chars; unsigned int banner_height = eBANNER_STATUS_HEIGHT; unsigned int banner_y = eBANNER_STATUS_Y; unsigned int banner_title_y = eBANNER_POPUP_TITLE_Y; unsigned int title_newX = eBANNER_POPUP_TITLE_X; static unsigned int last_title = eTEXT_MAX; static bapp_lang_t last_lang = eLANG_MAX; if (p_app->screen_id != eSCREEN_BANNER_SMALL) return; if ((title == eTEXT_MAX) && (desc == eTEXT_MAX)) { popup_null_draw(v_app,v_screen); last_title = eTEXT_MAX; last_lang = eLANG_MAX; return; } if ((last_title != title) || (last_lang != p_app->lang)) popup_null_draw(v_app,v_screen); if (desc == eTEXT_MAX) { /* resize banner for title only display */ banner_y += eBANNER_STATUS_TITLE_ONLY_Y_OFFSET; banner_height = eBANNER_STATUS_TITLE_ONLY_HEIGHT; banner_title_y += eBANNER_STATUS_TITLE_ONLY_Y_OFFSET; } /* do not draw these parts if already shown */ /* JPF if ((last_title != title) || (last_lang != p_app->lang)) */ { /* draw popup with semi-transparent background */ bgfx_fill_rect(&p_app->surf,eBANNER_STATUS_X,banner_y, eBANNER_STATUS_WIDTH,banner_height,eCOLOR_BLACK_65); for (i = 0; i < 4; i++) { bgfx_h_draw_line(&p_app->surf,eBANNER_STATUS_X+i,eBANNER_STATUS_X+eBANNER_STATUS_WIDTH-i, banner_y+i,eCOLOR_BLACK); bgfx_h_draw_line(&p_app->surf,eBANNER_STATUS_X+i,eBANNER_STATUS_X+eBANNER_STATUS_WIDTH-i, banner_y+banner_height-1-i,eCOLOR_BLACK); } /* draw popup title */ if (title != eTEXT_MAX) { num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,title, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], title_newX, banner_title_y, eBANNER_POPUP_TITLE_WIDTH, eBANNER_POPUP_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); } /* draw popup description field */ if (desc != eTEXT_MAX) { static char strAutoPower[1024]; static char p_str[MAX_DESC_CHARS]; num_chars = MAX_DESC_CHARS; i = 0; if (desc == eTEXT_AUTO_POWER_RESTART_DESC) { bapp_c_str_get(p_app->lang,eTEXT_AUTO_POWER_RESTART_DESC,p_str,&num_chars); if (2 != p_app->settings.auto_power) snprintf(strAutoPower, 1024, p_str, (p_app->settings.auto_power + 1) * 4); else snprintf(strAutoPower, 1024, p_str, 4); /* TODO, need to use different text string for program end case */ num_chars = c_to_uni_str(strAutoPower, p_app->tmp_str, MAX_DESC_CHARS); i = 10; } else if (desc == eTEXT_AUTO_POWER_POPUP_DESC) { bapp_c_str_get(p_app->lang,eTEXT_AUTO_POWER_POPUP_DESC,p_str,&num_chars); if (2 != p_app->settings.auto_power) snprintf(strAutoPower, 1024, p_str, (p_app->settings.auto_power + 1) * 4); else snprintf(strAutoPower, 1024, p_str, 4); num_chars = c_to_uni_str(strAutoPower, p_app->tmp_str, MAX_DESC_CHARS); } else { bscreen_get_string(p_app->lang,desc, p_app->tmp_str, &num_chars); } text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_POPUP_DESC_X, (title == eTEXT_MAX ? banner_title_y : eBANNER_POPUP_DESC_Y), eBANNER_POPUP_DESC_WIDTH, (title == eTEXT_MAX ? eBANNER_POPUP_DESC_HEIGHT + i: eBANNER_POPUP_DESC_HEIGHT), p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW, 2); } } /* add SAP language if necessary */ if ((title == eTEXT_SAP_TITLE) || (title == eTEXT_VOLUME_TITLE)) { w = h = 0; /* move title_newX past title */ num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,title, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); title_newX += w; num_chars = MAX_TITLE_CHARS; if (p_app->settings.ch[p_app->cur_ch_num].has_lang & (1 << p_app->current_sap)) { switch (p_app->current_sap) { case eLANG_SPANISH: bscreen_get_string(p_app->current_sap,eTEXT_SPANISH_BUTTON, p_app->tmp_str, &num_chars); break; #ifndef ACB612 case eLANG_FRENCH: bscreen_get_string(p_app->current_sap,eTEXT_FRENCH_BUTTON, p_app->tmp_str, &num_chars); break; #endif case eLANG_ENGLISH: default: bscreen_get_string(p_app->current_sap,eTEXT_ENGLISH_BUTTON, p_app->tmp_str, &num_chars); break; } } else { memset(tmp_buf,0,TMP_BUF_CHAR_MAX); num_chars = TMP_BUF_CHAR_MAX - 1; snprintf(tmp_buf, num_chars, "Audio-%d", p_app->current_sap + 1); num_chars = c_to_uni_str(tmp_buf,p_app->tmp_str,MAX_TITLE_CHARS); } /* add ending parenthesis if volume popup */ if ((title == eTEXT_VOLUME_TITLE) && (num_chars < MAX_TITLE_CHARS)) { c_to_uni_str(")",&p_app->tmp_str[num_chars],2); num_chars++; } /* erase last language text */ bgfx_fill_rect(&p_app->surf,eBANNER_POPUP_TITLE_X + w,banner_title_y, eBANNER_POPUP_TITLE_WIDTH - w, eBANNER_POPUP_TITLE_HEIGHT, eCOLOR_BLACK_65); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], title_newX, banner_title_y, eBANNER_POPUP_TITLE_WIDTH - w, eBANNER_POPUP_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); } /* add CC language if necessary */ if (title == eTEXT_CC_TITLE) { w = h = 0; /* move title_newX past title */ num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,title, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); title_newX += w; num_chars = MAX_TITLE_CHARS; if (p_app->captions_basic > 0) { char strCC[16]; PSIP_CSD_service *cc_service = &(p_app->tmp_info.eit_info[EIT_CURRENT].cc_service[p_app->captions_basic - 1]); if (cc_service->cc_type) { snprintf(strCC, 15, "%d (%c%c%c)", p_app->captions_basic,cc_service->language[0],cc_service->language[1],cc_service->language[2]); } else snprintf(strCC, 15, "%d", p_app->captions_basic); num_chars = c_to_uni_str(strCC, p_app->tmp_str, MAX_TITLE_CHARS); } else { bscreen_get_string(p_app->lang,eTEXT_CAPTIONS_OFF, p_app->tmp_str, &num_chars); } /* erase last caption popup text */ bgfx_fill_rect(&p_app->surf,eBANNER_POPUP_TITLE_X + w,banner_title_y, eBANNER_POPUP_TITLE_WIDTH - w, eBANNER_POPUP_TITLE_HEIGHT, eCOLOR_BLACK_65); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], title_newX, banner_title_y, eBANNER_POPUP_TITLE_WIDTH - w, eBANNER_POPUP_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); } /* add AR support */ if (eTEXT_VIDEO_OUTPUT_TITLE == title) { int textId; w = h = 0; /* move title_newX past title */ num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,title, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); w += 8; title_newX += w; switch (p_app->sd_options) { case 0: /* AFD */ textId = eTEXT_SD_CONFIG_OPTIONS_AUTO; break; case 1: /* widescreen */ textId = eTEXT_WIDESCREEN_BUTTON; break; case 3: textId = eTEXT_SD_CONFIG_OPTION_ZOOM_BUTTON; break; case 2: default: textId = eTEXT_FULLSCREEN_BUTTON; break; } num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,textId, p_app->tmp_str, &num_chars); /* erase last AR popup text */ bgfx_fill_rect(&p_app->surf,eBANNER_POPUP_TITLE_X + w,banner_title_y, eBANNER_POPUP_TITLE_WIDTH - w, eBANNER_POPUP_TITLE_HEIGHT, eCOLOR_BLACK_65); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], title_newX, banner_title_y, eBANNER_POPUP_TITLE_WIDTH - w, eBANNER_POPUP_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); } /* draw volume slider if necessary */ if (title == eTEXT_VOLUME_TITLE) { uint32_t percent; w = h = 0; if (p_app->audio_vol >= 32) { p_app->audio_vol = 32; percent = 32; } else { percent = p_app->audio_vol; } bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); title_newX += w + 10; progress_width = eBANNER_STATUS_X + eBANNER_STATUS_WIDTH - title_newX - 75; bscreen_draw_progress(v_app, title_newX, banner_title_y-2, progress_width, ePROGRESS_VOLUME_HEIGHT, eBUTTON_VOL_PROGRESS_BORDER, eCOLOR_WHITE, eCOLOR_BLACK_65, p_app->audio_vol, 32); /* draw volume level text */ memset(tmp_buf,0,sizeof(TMP_BUF_CHAR_MAX)); num_chars = TMP_BUF_CHAR_MAX - 1; snprintf(tmp_buf, num_chars, "%3u", percent); num_chars = c_to_uni_str(tmp_buf,p_app->tmp_str,MAX_TITLE_CHARS); bgfx_fill_rect(&p_app->surf,ePROGRESS_VOLUME_X+ePROGRESS_VOLUME_WIDTH+10,banner_title_y, eBANNER_POPUP_VOL_TITLE_WIDTH,eBANNER_POPUP_TITLE_HEIGHT,eCOLOR_BLACK_65); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], ePROGRESS_VOLUME_X+ePROGRESS_VOLUME_WIDTH+10, banner_title_y, eBANNER_POPUP_VOL_TITLE_WIDTH, eBANNER_POPUP_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); } last_title = title; last_lang = p_app->lang; } /* Summary: RRT dimensions screen drawing function Description: RRT dimensions screen drawing function. . */ void bscreen_rrt_dim_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int idx,selected,checked, max_rrt_num; unsigned int num_chars; bbutton_t tmp_button; PSIP_RRT_dimension dim; PSIP_RRT_header rrt_header; char dim_str[64]; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); #ifdef TEST_RRT max_rrt_num = MAX_RRT_DIM; #else PSIP_RRT_getHeader(p_app->settings.rrt_settings.rrt,&rrt_header); max_rrt_num = SCREEN_MIN((p_screen->local_state + MAX_RRT_DIM_BUTTONS), rrt_header.dimensions_defined); #endif /* draw buttons (replace text with strings from the RRT) */ for (idx = p_screen->local_state; idx < max_rrt_num; idx++) { if ((idx - p_screen->local_state) >= MAX_RRT_DIM_BUTTONS) { BDBG_WRN(("%s invalid button index %d, %d, %d\n",__func__,idx,p_screen->local_state,max_rrt_num)); break; } tmp_button = p_screen->p_button_array[(idx - p_screen->local_state)]; #ifdef TEST_RRT snprintf(dim_str,64,"DIM-%d",idx); #else if (PSIP_RRT_getDimension(p_app->settings.rrt_settings.rrt,idx,&dim) == BERR_SUCCESS) { if (chm_process_mss(&p_app->chm,dim.p_dimension_name_text,dim_str,sizeof(dim_str)) != 0) dim_str[0] = 0; } else dim_str[0] = 0; #endif selected = (p_screen->button_selection == (idx - p_screen->local_state)); checked = 0; bscreen_draw_button_custom_text(p_app,&tmp_button,dim_str,NULL,selected,checked,(idx - p_screen->local_state)); } draw_navigation_hints(v_app, v_screen); } /* Summary: RRT values screen drawing function Description: RRT values screen drawing function. . */ void bscreen_rrt_val_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; int idx,max_val_num,selected,checked; PSIP_RRT_dimension dim; PSIP_RRT_value val; bbutton_t tmp_button; int dim_idx = p_app->p_screens[eSCREEN_RATINGS_RRT_DIM].button_selection + p_app->p_screens[eSCREEN_RATINGS_RRT_DIM].local_state; const int VAL_STR_LEN = 64; char val_str[VAL_STR_LEN]; char abbr_val_str[VAL_STR_LEN]; bscreen_draw_background(v_app, &p_app->surf, p_screen->top_banner_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); #ifdef TEST_RRT max_val_num = MAX_RRT_VAL; #else if (PSIP_RRT_getDimension(p_app->settings.rrt_settings.rrt,dim_idx,&dim) != BERR_SUCCESS) dim.values_defined = 0; max_val_num = SCREEN_MIN((p_screen->local_state + MAX_RRT_VAL_BUTTONS), dim.values_defined); #endif /* draw buttons (replace text with strings from the RRT) */ for (idx = p_screen->local_state; idx < max_val_num; idx++) { if ((idx - p_screen->local_state) >= MAX_RRT_VAL_BUTTONS) { BDBG_WRN(("%s invalid button index %d, %d, %d\n",__func__,idx,p_screen->local_state,max_val_num)); break; } tmp_button = p_screen->p_button_array[(idx - p_screen->local_state)]; #ifdef TEST_RRT snprintf(val_str,64,"VALUE-%d",idx); snprintf(abbr_val_str,64,"VAL-%d",idx); #else if (PSIP_RRT_getValue(p_app->settings.rrt_settings.rrt,dim_idx,idx,&val) == BERR_SUCCESS) { if (chm_process_mss(&p_app->chm,val.p_rating_value_text,val_str,VAL_STR_LEN) != 0) val_str[0] = 0; if (chm_process_mss(&p_app->chm,val.p_abbrev_rating_value_text,abbr_val_str,VAL_STR_LEN) != 0) abbr_val_str[0] = 0; } else { val_str[0] = 0; abbr_val_str[0] = 0; } #endif BDBG_MSG(("drawing RRT abbr_val_str:%s val_str:%s\n",abbr_val_str, val_str)); selected = (p_screen->button_selection == (idx - p_screen->local_state)); checked = (p_app->settings.rrt_settings.ratings_rrt[dim_idx] & (1 << idx)); bscreen_draw_button_custom_text(p_app,&p_screen->p_button_array[(idx - p_screen->local_state)],abbr_val_str,NULL,selected,checked,(idx - p_screen->local_state)); } draw_navigation_hints(v_app, v_screen); } void bscreen_popup(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; BDBG_ASSERT(p_bs); BDBG_MSG(("drawing screen_id=%d, p_bs->SAP_dirty=%d", p_app->screen_id, p_bs->SAP_dirty)); if (p_app->screen_id != eSCREEN_BANNER_SMALL) { if (eSCREEN_NULL == p_app->screen_id && eLS_BANNER_OFF == p_bs->mode) { //if (!p_app->cc_enabled) // bapp_enable_cc(p_app, true); //bapp_audio_do_mute(p_app, false); //bapp_audio_mute(p_app, false); } return; } #ifdef CONFIG_EIA_708 /* set CC state */ if ((p_bs->volume_dirty) || (p_app->audio_mute) || (p_bs->SAP_dirty) || (p_bs->CC_dirty) || (p_bs->AR_dirty) || (p_bs->auto_power_one_min_warning) || (p_app->settings.auto_power_off) || (p_bs->mode != eLS_BANNER_OFF)) { if (p_app->cc_enabled) bapp_enable_cc(p_app, false); } else { if (!p_app->cc_enabled) bapp_enable_cc(p_app, true); } #endif /* draw popup - order dictates priority */ if (p_bs->volume_dirty) { BDBG_MSG(("%s p_bs->volume_dirty %d\n",__func__,p_bs->volume_dirty)); /* draw 'volume' popup if necessary */ bscreen_popup_draw(v_app,v_screen,eTEXT_VOLUME_TITLE,eTEXT_MAX); } else if (p_bs->SAP_dirty) { BDBG_MSG(("%s p_bs->SAP_dirty %d\n",__func__,p_bs->SAP_dirty)); /* draw SAP popup if necessary */ bscreen_popup_draw(v_app,v_screen,eTEXT_SAP_TITLE,eTEXT_MAX); } else if (p_bs->CC_dirty) { BDBG_MSG(("%s p_bs->CC_dirty %d\n",__func__,p_bs->CC_dirty)); /* draw CC popup if necessary */ bscreen_popup_draw(v_app,v_screen,eTEXT_CC_TITLE,eTEXT_MAX); } else if (p_bs->AR_dirty) { BDBG_MSG(("%s p_bs->AR_dirty %d\n",__func__,p_bs->AR_dirty)); /* draw AR popup if necessary */ bscreen_popup_draw(v_app,v_screen,eTEXT_VIDEO_OUTPUT_TITLE,eTEXT_MAX); } else if (p_app->settings.auto_power_off) { /* show auto power off reason on startup */ BDBG_MSG(("%s p_app->settings.auto_power_off %d\n",__func__,p_app->settings.auto_power_off)); /* don't provide feedback for no signal case, but just power saving */ if (2 != p_app->settings.auto_power_off) bscreen_popup_draw(v_app,v_screen,eTEXT_MAX,eTEXT_AUTO_POWER_RESTART_DESC); } else if (p_bs->auto_power_one_min_warning && (p_app->settings.auto_power<3) && ((bos_getticks()- p_app->power_saver_tick >= (AUTO_POWER_OFF_TIMEOUT * (1 + p_app->settings.auto_power) - MS_TO_TICKS(1000 * 60))))) { /* one minute warning before auto power off */ bscreen_popup_draw(v_app,v_screen,eTEXT_AUTO_POWER_MENU,eTEXT_AUTO_POWER_POPUP_DESC); } #ifndef CONFIG_SCREENSAVER else if (p_bs->auto_power_one_min_warning && (p_app->no_signal && (bos_getticks() - p_app->last_keypress_tick >= (NO_SIGNAL_TIMEOUT - MS_TO_TICKS(1000 * 60))))) { /* one minute warning before auto power off */ bscreen_popup_draw(v_app,v_screen,eTEXT_AUTO_POWER_MENU,eTEXT_NO_SIGNAL_STANDBY_DESC); } #endif else if (!bapp_get_signal_status(p_app) && (p_app->settings.ch[p_app->cur_ch_num].freq_idx != 0x7F)) { /* draw 'no signal' popup if necessary */ bapp_audio_mute(p_app, 1); bscreen_popup_draw(v_app,v_screen,eTEXT_NO_SIGNAL_TITLE,eTEXT_NO_SIGNAL_DESC); } else if (p_app->audio_mute) { /* draw 'mute' popup if necessary */ bscreen_popup_draw(v_app,v_screen,eTEXT_MAX,eTEXT_MAX); bscreen_popup_draw(v_app,v_screen,eTEXT_MUTE_TITLE,eTEXT_MAX); } else { /* close the popup */ bscreen_popup_draw(v_app,v_screen,eTEXT_MAX,eTEXT_MAX); } } /* Summary: Banner screen drawing function Description: Banner screen drawing function. . */ void bscreen_banner_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; #ifndef NO_VCHIP unsigned int w,h; #endif unsigned char *p_str; bstream_mpeg mpeg; static char tbuf[16]; int i = 0; bool dst; unsigned utc_time; int offset; b_tm s_tm; banner_state_t *p_bs = (banner_state_t*)p_screen->local_state; BDBG_ASSERT(p_bs); static int last_mode = eLS_BANNER_OFF; #ifndef NO_VCHIP static char tmp_prog[MAX_RATING_STR_CHARS]; #endif /* draw dolby logo */ bin_read_t br; num_chars = 0; BDBG_MSG(("%s: mode = %d, last = %d",__func__,p_bs->mode,last_mode)); if (((last_mode == eLS_BANNER_BIG) && (p_bs->mode != eLS_BANNER_BIG)) || (p_bs->mode == eLS_BANNER_OFF)) banner_null_draw(v_app,v_screen); if (eLS_BANNER_EAS_TEXT_SCROLLING == p_bs->mode) { if (eLS_BANNER_EAS_TEXT_SCROLLING != last_mode) { bgfx_fill_rect(&p_app->surf,eBANNER_X-50,eBANNER_Y-30,eBANNER_WIDTH+90,eBANNER_SMALL_HEIGHT+eBANNER_LARGE_HEIGHT,eCOLOR_CLEAR); } /* if EAS event shown completed after given time */ if (!p_app->eas_text && !p_app->eas_activation_text){ // set_banner(p_screen, eLS_BANNER_OFF, true); set_banner(p_screen, eLS_BANNER_SMALL, false); last_mode = eLS_BANNER_OFF; } else { bscreen_eas_text_scrolling_info_draw(v_app,v_screen); last_mode = p_bs->mode; return; } } bscreen_popup(v_app, v_screen); /* get the current banner info */ chm_get_cur_ch_info(&p_app->chm,&p_app->tmp_info,&mpeg); /* don't redraw small banner if going from small -> large banner */ if (((last_mode != eLS_BANNER_SMALL) || (p_bs->mode != eLS_BANNER_BIG)) && (p_bs->mode != eLS_BANNER_OFF)) { /* resync before drawing small banner data */ /* draw small banner with semi-transparent background */ #if(AOV_MODEL == ALCO) bgfx_fill_rect(&p_app->surf,eBANNER_X,eBANNER_Y, eBANNER_WIDTH,eBANNER_SMALL_HEIGHT,eCOLOR_BLACK); #else bgfx_fill_rect(&p_app->surf,eBANNER_X,eBANNER_Y, eBANNER_WIDTH,eBANNER_SMALL_HEIGHT,eCOLOR_BLACK_65); #endif for (i = 0; i < 4; i++) { bgfx_h_draw_line(&p_app->surf,eBANNER_X+i,eBANNER_X+eBANNER_WIDTH-i, eBANNER_Y+i,eCOLOR_BLACK); bgfx_h_draw_line(&p_app->surf,eBANNER_X+i,eBANNER_X+eBANNER_WIDTH-i, eBANNER_Y+eBANNER_SMALL_HEIGHT-1-i,eCOLOR_BLACK); } #ifdef CONFIG_ORIG_SYNC /* resync before drawing small banner data */ bapp_flush_screen(p_app); #endif /* draw program title */ p_str = (unsigned char*)p_app->tmp_info.eit_info[EIT_CURRENT].prog_title; num_chars = c_to_uni_str(p_str,p_app->tmp_str,MAX_TITLE_CHARS); if (num_chars == 0) { num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,eTEXT_BANNER_PROGRAM_TITLE, p_app->tmp_str, &num_chars); } text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_TITLE_X, eBANNER_TITLE_Y, eBANNER_TITLE_WIDTH, eBANNER_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); /* draw channel num */ num_chars = SCREEN_MAX_STR_WIDTH; if (p_bs->enter) { /* user has finish 10keying in a new channel num */ snprintf(tbuf,6,"%s - %s",p_bs->majorCh,p_bs->minorCh); } else if (p_bs->majorChIndex > 0) { /* user is 10keying in new channel num */ if (p_bs->minorChIndex == 0) if (p_bs->dot) snprintf(tbuf,7,"%s - _", p_bs->majorCh); else snprintf(tbuf,4,"%s_", p_bs->majorCh); else snprintf(tbuf,9,"%s - %s_", p_bs->majorCh,p_bs->minorCh); } else { /* display current channel */ snprintf(tbuf,9,"%d - %d", p_app->settings.ch[p_app->cur_ch_num].major,p_app->settings.ch[p_app->cur_ch_num].minor); } num_chars = c_to_uni_str(tbuf,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_CH_NUM_X, eBANNER_CH_NUM_Y, eBANNER_CH_NUM_WIDTH, eBANNER_CH_NUM_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); /* draw next program title */ p_str = (unsigned char*)p_app->tmp_info.eit_info[EIT_NEXT].prog_title; num_chars = c_to_uni_str(p_str,p_app->tmp_str,MAX_TITLE_CHARS); if (num_chars > 0) { int w = 0; int h = 0; num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,eTEXT_BANNER_NEXT_PROGRAM_TITLE_PREFIX, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], (const unsigned long *)p_app->tmp_str,num_chars,&w,&h); w += 3; text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_TITLE_X, eBANNER_NEXT_TITLE_Y, w, eBANNER_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); p_str = (unsigned char*)p_app->tmp_info.eit_info[EIT_NEXT].prog_title; num_chars = c_to_uni_str(p_str,p_app->tmp_str,MAX_TITLE_CHARS); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_TITLE_X + w, eBANNER_NEXT_TITLE_Y, eBANNER_TITLE_WIDTH - w, eBANNER_TITLE_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,100); } /* draw call sign */ num_chars = MAX_CH_SHORT_NAME_CHARS; num_chars = utf16_to_uni_str(p_app->settings.ch[p_app->cur_ch_num].ch_name,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_CALLSIGN_X, eBANNER_CALLSIGN_Y, eBANNER_CALLSIGN_WIDTH, eBANNER_CALLSIGN_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); /* draw time */ num_chars = MAX_TIME_STR; p_app->prog_time_str[0] = 0; if (chm_get_time_info(&p_app->chm,&utc_time,&offset,&dst) == 0) { utc_time += offset; utctime(utc_time,&s_tm); if (s_tm.tm_hour >= 12) { if (s_tm.tm_hour > 12) s_tm.tm_hour -= 12; snprintf(p_app->prog_time_str,MAX_TIME_STR,"%d:%02dPM",s_tm.tm_hour,s_tm.tm_min); } else { if (s_tm.tm_hour == 0) s_tm.tm_hour = 12; snprintf(p_app->prog_time_str,MAX_TIME_STR,"%d:%02dAM",s_tm.tm_hour,s_tm.tm_min); } num_chars = c_to_uni_str(p_app->prog_time_str,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_TIME_X, eBANNER_TIME_Y, eBANNER_TIME_WIDTH, eBANNER_TIME_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); /* draw program start/end time if exists */ if ((p_app->tmp_info.eit_info[EIT_CURRENT].start_time > 0) && (p_app->tmp_info.eit_info[EIT_CURRENT].length > 0)) { unsigned char prog_time_str[MAX_TIME_STR * 2]; unsigned char prog_start_time_str[MAX_TIME_STR]; unsigned char prog_end_time_str[MAX_TIME_STR]; b_tm tm_start; b_tm tm_end; num_chars = MAX_TIME_STR; if (dst) { offset += 3600; /* utc_time is already offset for dst but offset is not */ } utctime(p_app->tmp_info.eit_info[EIT_CURRENT].start_time + offset, &tm_start); if (tm_start.tm_hour >= 12) { if (tm_start.tm_hour > 12) tm_start.tm_hour -= 12; snprintf(prog_start_time_str,MAX_TIME_STR,"%d:%02dPM",tm_start.tm_hour,tm_start.tm_min); } else { if (tm_start.tm_hour == 0) tm_start.tm_hour = 12; snprintf(prog_start_time_str,MAX_TIME_STR,"%d:%02dAM",tm_start.tm_hour,tm_start.tm_min); } num_chars = MAX_TIME_STR; utctime(p_app->tmp_info.eit_info[EIT_CURRENT].start_time + p_app->tmp_info.eit_info[EIT_CURRENT].length + offset, &tm_end); if (tm_end.tm_hour >= 12) { if (tm_end.tm_hour > 12) tm_end.tm_hour -= 12; snprintf(prog_end_time_str,MAX_TIME_STR,"%d:%02dPM",tm_end.tm_hour,tm_end.tm_min); } else { if (tm_end.tm_hour == 0) tm_end.tm_hour = 12; snprintf(prog_end_time_str,MAX_TIME_STR,"%d:%02dAM",tm_end.tm_hour,tm_end.tm_min); } snprintf(prog_time_str, (MAX_TIME_STR * 2), "%s-%s",prog_start_time_str,prog_end_time_str); num_chars = c_to_uni_str(prog_time_str,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_START_END_TIME_X, eBANNER_START_END_TIME_Y, eBANNER_START_END_TIME_WIDTH, eBANNER_START_END_TIME_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); } #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif } #ifndef NO_VCHIP /* draw rating information if any */ tmp_prog[0] = 0; /* draw psip rating information if any */ /* if has digital rating information, use it first */ if (p_app->tmp_info.psip_rating_str[0] != 0) { strncpy_no_spaces(tmp_prog,(char*)p_app->tmp_info.psip_rating_str,MAX_RATING_STR_CHARS); BDBG_WRN(("%s - digital: %s\n",__func__, tmp_prog)); } else { if (p_app->prog_rating_str[0] != 0) { strncpy_no_spaces(tmp_prog,(char*)p_app->prog_rating_str,MAX_RATING_STR_CHARS); BDBG_WRN(("%s - analog: %s\n",__func__, tmp_prog)); } } num_chars = strlen(tmp_prog); if (num_chars) { /* draw ratings - show blocked rating, if no blocked ratings then show received xds or psip rating if corresponding rating string exists */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_RATINGS_BUTTON, p_app->tmp_str, &num_chars); p_app->tmp_str[num_chars++] = (unsigned int)':'; p_app->tmp_str[num_chars++] = (unsigned int)' '; p_app->tmp_str[num_chars++] = (unsigned int)' '; text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_RATINGS_X, eBANNER_RATINGS_Y, eBANNER_RATINGS_WIDTH, eBANNER_RATINGS_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); num_chars = strlen(tmp_prog); num_chars = c_to_uni_str(tmp_prog,p_app->tmp_str,num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_RATINGS_X + w, eBANNER_RATINGS_Y, eBANNER_RATINGS_WIDTH, eBANNER_RATINGS_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); } else { BDBG_WRN(("%s - rating string empty\n",__func__)); } #endif /* draw sap indicator if necessary */ if ((p_app->num_sap) > 1 && (p_app->current_sap != p_app->lang)) { num_chars = MAX_TITLE_CHARS; bscreen_get_string(p_app->lang,eTEXT_BANNER_SAP, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_SAP_X, eBANNER_SAP_Y, eBANNER_SAP_WIDTH, eBANNER_SAP_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,0); } /* draw signal level */ bscreen_draw_banner_signal_level(p_app, p_app->power_level); /* draw dolby banner if audio is Dolby type */ if (p_app->dolby_logo && bapp_is_dolby_type(p_app)) { br.cnt = 0; br.data = (void*)p_app->dolby_logo; br.size = p_app->dolby_logo_size; bgfx_render_file(&p_app->surf, eBANNER_CALLSIGN_X+1, eBANNER_START_END_TIME_Y + 28, &br, 0); } #ifdef CONFIG_ORIG_SYNC /* resync before drawing signal level and large banner */ bapp_flush_screen(p_app); #endif } /* draw large banner if necessary */ if (p_bs->mode == eLS_BANNER_BIG) { /* resync before drawing signal level and large banner */ /* draw large banner with semi-transparent background */ #if(AOV_MODEL == ALCO) bgfx_fill_rect(&p_app->surf,eBANNER_X,eBANNER_Y+eBANNER_SMALL_HEIGHT,eBANNER_WIDTH,eBANNER_LARGE_HEIGHT,eCOLOR_BLACK); #else bgfx_fill_rect(&p_app->surf,eBANNER_X,eBANNER_Y+eBANNER_SMALL_HEIGHT,eBANNER_WIDTH,eBANNER_LARGE_HEIGHT,eCOLOR_BLACK_65); #endif for (i = 0; i < 4; i++) { bgfx_h_draw_line(&p_app->surf,eBANNER_X+i,eBANNER_X+eBANNER_WIDTH-i,eBANNER_Y+eBANNER_SMALL_HEIGHT-1+eBANNER_LARGE_HEIGHT-1-i,eCOLOR_BLACK); } /* draw program description */ num_chars = MAX_DESC_CHARS; p_str = (unsigned char*)p_app->tmp_info.eit_info[EIT_CURRENT].prog_desc; num_chars = c_to_uni_str(p_str,p_app->tmp_str,num_chars); if (strlen(p_str) == 0) { num_chars = MAX_DESC_CHARS; bscreen_get_string(p_app->lang,eTEXT_BANNER_PROGRAM_DESC, p_app->tmp_str, &num_chars); } else { if (num_chars > 236) { num_chars = 236; p_app->tmp_str[num_chars] = 0; } } text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eBANNER_DESC_X, eBANNER_DESC_Y, eBANNER_DESC_WIDTH, eBANNER_DESC_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eBANNER_DESC_LINE_SPACING); } #ifdef CONFIG_ORIG_SYNC bapp_flush_screen(p_app); #endif last_mode = p_bs->mode; } /* Summary: Screensaver screen drawing function Description: Screensaver screen drawing function. */ void bscreen_screensaver_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bin_read_t br; bcm_raw_8_t *p_header = (bcm_raw_8_t*)p_app->logo; bscreen_t *p_screen = (bscreen_t*)v_screen; if (p_header) { br.cnt = 0; br.data = (void*)p_app->logo; br.size = p_app->logo_size; /* clear screen only if no previous screen */ if (eSCREEN_MAX == p_screen->last_screen_id || eSCREEN_BANNER == p_screen->last_screen_id) screen_null_draw(v_app, v_screen); else bgfx_fill_rect(&p_app->surf,0,0,eWIDTH,eHEIGHT,eCOLOR_BLACK); bgfx_render_file(&p_app->surf, eSCREEN_ACTION_SAFE_X + RAND_INT(eSCREEN_ACTION_SAFE_WIDTH-p_header->width), eSCREEN_ACTION_SAFE_Y + RAND_INT(eSCREEN_ACTION_SAFE_HEIGHT-p_header->height), &br, 0); } else { unsigned int num_chars; int w,h; num_chars = SCREEN_MAX_STR_WIDTH; bgfx_fill_rect(&p_app->surf, 0, 0, eWIDTH, eHEIGHT, eCOLOR_BLACK); bapp_str_get(p_app->lang, eTEXT_VENDOR, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED], (const unsigned long *)p_app->tmp_str, num_chars, &w, &h); w += 16; text_box(&p_app->surf, p_app->p_font[eLANG_ENGLISH][eFONT_SIZE_MED], eSCREEN_ACTION_SAFE_X + RAND_INT(eSCREEN_ACTION_SAFE_WIDTH - w), eSCREEN_ACTION_SAFE_Y + RAND_INT(eSCREEN_ACTION_SAFE_HEIGHT - h), w, h, p_app->tmp_str, num_chars, eCOLOR_WHITE, 0); } } /* Summary: Power off screen drawing function Description: Power off screen drawing function. */ void bscreen_power_off_draw(void *v_app, void *v_screen) { screen_null_draw(v_app, v_screen); } /* Summary: Draw banner signal level Description: Draw banner signal level */ void bscreen_draw_banner_signal_level(void *v_app, unsigned int signal) { bapp_t *p_app = (bapp_t*)v_app; const uint32_t icon_center_x = eBANNER_SIGNAL_X + 5; const uint8_t icon_triangle = 4; const uint8_t icon_bars_x = icon_center_x; const uint8_t sig_level_x = eBANNER_SIGNAL_X + 25; int i = 0; bcolor_idx_t color = eCOLOR_WHITE; /* draw antenna symbol */ bgfx_v_draw_line(&p_app->surf, icon_center_x, eBANNER_SIGNAL_Y, eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT, color); bgfx_v_draw_line(&p_app->surf, icon_center_x-1, eBANNER_SIGNAL_Y, eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT, color); for (i = icon_triangle; i > 0; i--) { bgfx_h_draw_line(&p_app->surf, icon_center_x-i, icon_center_x+1+i, eBANNER_SIGNAL_Y+icon_triangle-i, color); } /* draw signal bars */ for (i = 1; i < 4; i++) { bgfx_v_draw_line(&p_app->surf,icon_bars_x+(i*4),eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT-(i*3), eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT,color); bgfx_v_draw_line(&p_app->surf,icon_bars_x+(i*4)+1,eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT-(i*3), eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT,color); } /* draw level control outline */ for (i = 0; i < 2; i++) { bgfx_h_draw_line(&p_app->surf,sig_level_x,sig_level_x+eBANNER_SIGNAL_WIDTH, eBANNER_SIGNAL_Y+i,eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,sig_level_x,sig_level_x+eBANNER_SIGNAL_WIDTH, eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT-1-i,eCOLOR_WHITE); bgfx_v_draw_line(&p_app->surf,sig_level_x-i,eBANNER_SIGNAL_Y, eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT-1,eCOLOR_WHITE); bgfx_v_draw_line(&p_app->surf,sig_level_x+eBANNER_SIGNAL_WIDTH-1-i,eBANNER_SIGNAL_Y, eBANNER_SIGNAL_Y+eBANNER_SIGNAL_HEIGHT-1,eCOLOR_WHITE); } /* draw signal level */ bgfx_fill_rect(&p_app->surf,sig_level_x+3,eBANNER_SIGNAL_Y+4,100*(eBANNER_SIGNAL_WIDTH-8)/100, eBANNER_SIGNAL_HEIGHT-8,eCOLOR_BLACK_65); if (signal > 100) signal = 100; bgfx_fill_rect(&p_app->surf,sig_level_x+3,eBANNER_SIGNAL_Y+4,signal*(eBANNER_SIGNAL_WIDTH-8)/100, eBANNER_SIGNAL_HEIGHT-8,eCOLOR_NEON_GREEN); } /* Summary: Draw a button. Description: Draw a button. */ void bscreen_draw_button_str(void *v_app, /* application structure */ const bbutton_t *p_button, /* button info structure */ int selected, /* Button selected when non-zero */ int checked, /* Button checked when non-zero */ unsigned int *p_str, /* button UNI string */ unsigned int num_chars, /* length of text string */ unsigned int *p_desc_str, /* description UNI string */ unsigned int num_desc_chars, /* length of description text string */ bapp_font_size_t font_size, /* button text font size */ int font_just /* button text justification, 0 - left, 1 - right */ ) { bapp_t *p_app = (bapp_t*)v_app; int w,h,margin,bulletw; uint16_t str_x,str_y,check_x,check_y; if (!p_button) return; if (selected) { int newY = p_button->y; /* draw black outline to minimize dot crawl on crappy tvs */ bgfx_fill_rect(&p_app->surf,p_button->x - 1,p_button->y - 1, p_button->width + 2,p_button->height + 2,eCOLOR_BLACK); /* draw top bevel */ bgfx_fill_rect(&p_app->surf,p_button->x,p_button->y, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_PALE_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; /* draw middle */ bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,p_button->height - (7 * eBUTTON_BEVEL_GRADIENT_STEP),eCOLOR_BRT_YELLOW); /* draw bottom bevel */ newY = p_button->y + p_button->height - eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,p_button->x,newY, p_button->width,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; } else { /* erase dot crawl reducing outline if not selected */ bgfx_fill_rect(&p_app->surf,p_button->x - 1,p_button->y - 1, p_button->width + 2,p_button->height + 2,p_button->background_color); } margin = eBUTTON_MARGIN_X; /* add space for check box */ if ((p_button->type & eBUTTON_RADIO) || (p_button->type & eBUTTON_CHECK)) { check_x = p_button->x + eBUTTON_RADIO_BOX_MARGIN_X; check_y = p_button->y + (p_button->height - eBUTTON_RADIO_BOX_WIDTH)/2; if (checked) { if (p_button->type & eBUTTON_CHECK_LOCK) { /* draw lock icon */ bgfx_h_draw_line(&p_app->surf,check_x + 7, check_x + 14, check_y + 2, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 6, check_x + 15, check_y + 3, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 5, check_x + 16, check_y + 4, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 5, check_x + 7, check_y + 5, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 5, check_x + 7, check_y + 6, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 5, check_x + 7, check_y + 7, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 5, check_x + 7, check_y + 8, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 14, check_x + 16, check_y + 5, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 14, check_x + 16, check_y + 6, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 14, check_x + 16, check_y + 7, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 14, check_x + 16, check_y + 8, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_h_draw_line(&p_app->surf,check_x + 3, check_x + 18, check_y + 9, selected ? eCOLOR_BLACK : eCOLOR_WHITE); bgfx_fill_rect(&p_app->surf,check_x + 1, check_y + 10, 18, 11, selected ? eCOLOR_BLACK : eCOLOR_LT_YELLOW); bgfx_h_draw_line(&p_app->surf,check_x + 6, check_x + 15, check_y + 12, selected ? eCOLOR_DK_YELLOW : eCOLOR_BLACK); bgfx_h_draw_line(&p_app->surf,check_x + 6, check_x + 15, check_y + 15, selected ? eCOLOR_DK_YELLOW : eCOLOR_BLACK); bgfx_h_draw_line(&p_app->surf,check_x + 6, check_x + 15, check_y + 18, selected ? eCOLOR_DK_YELLOW : eCOLOR_BLACK); } else { /* draw BLACK outline */ bgfx_fill_rect(&p_app->surf,check_x,check_y, eBUTTON_RADIO_BOX_WIDTH,eBUTTON_RADIO_BOX_WIDTH,eCOLOR_BLACK); /* draw GREEN checkbox background */ bgfx_fill_rect(&p_app->surf,check_x + eBUTTON_RADIO_BOX_BORDER,check_y + eBUTTON_RADIO_BOX_BORDER, eBUTTON_RADIO_BOX_WIDTH - (2 * eBUTTON_RADIO_BOX_BORDER), eBUTTON_RADIO_BOX_WIDTH - (2 * eBUTTON_RADIO_BOX_BORDER),eCOLOR_NEON_GREEN); /* draw dot in middle for colorblind users */ bgfx_fill_rect(&p_app->surf,check_x + (eBUTTON_RADIO_BOX_WIDTH / 2) - (eBUTTON_RADIO_BOX_DOT_WIDTH / 2), check_y + (eBUTTON_RADIO_BOX_WIDTH / 2) - (eBUTTON_RADIO_BOX_DOT_WIDTH / 2), eBUTTON_RADIO_BOX_DOT_WIDTH, eBUTTON_RADIO_BOX_DOT_WIDTH, eCOLOR_BLACK); } } else { /* draw BLACK outline */ bgfx_fill_rect(&p_app->surf,check_x,check_y, eBUTTON_RADIO_BOX_WIDTH,eBUTTON_RADIO_BOX_WIDTH,eCOLOR_BLACK); /* draw WHITE checkbox background */ bgfx_fill_rect(&p_app->surf,check_x + eBUTTON_RADIO_BOX_BORDER,check_y + eBUTTON_RADIO_BOX_BORDER, eBUTTON_RADIO_BOX_WIDTH - (2 * eBUTTON_RADIO_BOX_BORDER), eBUTTON_RADIO_BOX_WIDTH - (2 * eBUTTON_RADIO_BOX_BORDER),eCOLOR_WHITE); } } if (num_chars > 0) { bgfx_string_info(p_app->p_font[p_app->lang][font_size],(const unsigned long *)p_str,num_chars,&w,&h); if (((w + margin) > p_button->width) || (h > p_button->height)) { BDBG_MSG(("String too large for button. (%d,%d),(%d,%d)\n", w + margin, h, p_button->width, p_button->height)); /* Handled by text box draw */ } if (font_just) { str_x = p_button->x + p_button->width - w - margin; /* Right justify string */ } else { str_x = p_button->x + margin; /* Left justify string */ if ((p_button->type & eBUTTON_RADIO) || (p_button->type & eBUTTON_CHECK)) { str_x += eBUTTON_RADIO_BOX_MARGIN_X + eBUTTON_RADIO_BOX_WIDTH; /* adjust if check box is visible */ } } str_y = p_button->y + (p_button->height - h)/2; /* Center string verticaly */ if (selected) text_box(&p_app->surf, p_app->p_font[p_app->lang][font_size], str_x, str_y, p_button->width - margin, h, p_str, num_chars, eCOLOR_BLACK, 20); else text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][font_size], str_x, str_y, p_button->width - margin, h, p_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,20); } /* Draw description text */ if ((p_desc_str) && (num_desc_chars > 0)) { /* TODO: draw given description text string */ } else if (p_button->desc_text_id < eTEXT_MAX) { int y_desc_offset,addnl; int spacing = eMENU_INFO_LINE_SPACING; addnl = 0; //if ((p_app->screen_id == eSCREEN_SOUND) || (p_app->screen_id == eSCREEN_PICTURE) || (p_app->screen_id == eSCREEN_RATINGS_LOCK)) if ((p_app->screen_id == eSCREEN_SOUND) || (p_app->screen_id == eSCREEN_RATINGS_LOCK)) addnl += 60; /* draw description text string based on button's default description text id */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,eTEXT_BULLET, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&bulletw,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], p_button->x + p_button->width + eBUTTON_MARGIN_X, p_button->y + (p_button->height - h)/2, bulletw + 1, p_button->height, p_app->tmp_str, num_chars, eCOLOR_WHITE, eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_INFO_LINE_SPACING); num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_button->desc_text_id, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); w = eWIDTH - (p_button->x + p_button->width + eBUTTON_MARGIN_X + bulletw + eBUTTON_MARGIN_RIGHT + 15); y_desc_offset = p_button->y + (p_button->height - h)/2; if (num_chars > 65) { y_desc_offset -= 10; } if ((p_app->lang == eLANG_FRENCH) && (p_app->screen_id == eSCREEN_CAPTIONS_FONT) && (num_chars > 34)) { y_desc_offset -= 6; spacing = 0; } text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], p_button->x + p_button->width + eBUTTON_MARGIN_X + bulletw + 1, y_desc_offset, w, p_button->height + addnl, p_app->tmp_str, num_chars, eCOLOR_WHITE, eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,spacing); } } /* Summary: Adjust the given button orientation to account for given language Description: Adjust the given button orientation to account for given language Note that button orientation is designed assuming english is the default. This function simply modifies the button if a different language is specified. */ static void adjust_button_orientation(void *v_app, bbutton_t *p_button) { bapp_t *p_app = (bapp_t*)v_app; if (p_app->lang == eLANG_ENGLISH) { switch (p_app->screen_id) { case eSCREEN_MAIN: p_button->x += -18; p_button->width += 48; break; case eSCREEN_SOUND: p_button->x -= 20; p_button->width += 70; break; default: break; } } else if (p_app->lang == eLANG_SPANISH) { switch (p_app->screen_id) { case eSCREEN_AV: p_button->x -= 40; p_button->width += 50; break; case eSCREEN_CAPTIONS_BACK_OPTIONS: p_button->x -= 4; p_button->width += 24; break; case eSCREEN_CAPTIONS_BACK_OPACITY: case eSCREEN_CAPTIONS_FONT_OPACITY: p_button->width += 4; break; case eSCREEN_CAPTIONS_FONT_STYLE: p_button->width += 6; p_button->y += 20; break; case eSCREEN_CAPTIONS_EDGE_TYPE: p_button->x -= 6; p_button->width += 36; break; case eSCREEN_CAPTIONS_FONT_SIZE: p_button->y += 10; break; case eSCREEN_MAIN: p_button->x += -20; p_button->width += 62; p_button->height += 0; break; #if 0 case eSCREEN_PICTURE: p_button->y -= 20; p_button->width += 30; break; #endif case eSCREEN_SOUND: p_button->x -= 20; p_button->width += 40; break; case eSCREEN_WIZ_CH_SCAN: case eSCREEN_CH_SCAN: p_button->y -= 15; break; case eSCREEN_RESET: p_button->x += 25; p_button->width += 25; break; case eSCREEN_RATINGS: p_button->x += 5; p_button->y -= 15; p_button->width += 50; break; case eSCREEN_RATINGS_TV: p_button->y += 10; break; case eSCREEN_RATINGS_RRT_DIM: p_button->y += 14; break; case eSCREEN_RATINGS_RRT_UPDATE: p_button->width += 60; break; case eSCREEN_RATINGS_LOCK: p_button->width += -10; break; case eSCREEN_RATINGS_LIMITS: p_button->width += 20; break; case eSCREEN_AUTO_POWER: p_button->y += 15; p_button->width -= 20; break; case eSCREEN_SETUP: p_button->width -= 30; break; case eSCREEN_WRONG_PIN_LIVE: case eSCREEN_WRONG_PIN_RATINGS: case eSCREEN_WRONG_PIN_RESET: case eSCREEN_MISMATCHED_PINS: p_button->width += 140; p_button->y -= 20; break; case eSCREEN_WIZ_MISMATCHED_PINS: p_button->width += 140; break; case eSCREEN_CAPTIONS_ADVANCED: p_button->width += 70; break; #if 0 case eSCREEN_CAPTIONS_ON_OFF: p_button->width += 20; break; #endif case eSCREEN_CAPTIONS_RESET: p_button->width += 15; break; default: break; } } else #ifndef ACB621 if (p_app->lang == eLANG_FRENCH) { switch (p_app->screen_id) { case eSCREEN_AV: p_button->x -= 52; p_button->width += 36; break; case eSCREEN_SOUND: p_button->x -= 24; p_button->width += 110; break; case eSCREEN_CAPTIONS_ADVANCED: p_button->x -= 6; p_button->width += 120; break; case eSCREEN_CAPTIONS_RESET: p_button->x -= 8; p_button->width += 34; break; case eSCREEN_CAPTIONS_FONT_COLOR: case eSCREEN_CAPTIONS_EDGE_COLOR: break; case eSCREEN_CAPTIONS_BACK_COLOR: p_button->y += 6; p_button->x -= 16; break; case eSCREEN_CAPTIONS_FONT: p_button->y += -23; p_button->x -= 16; p_button->width -= 4; break; case eSCREEN_CAPTIONS_FONT_SIZE: p_button->x += 10; p_button->width += 12; p_button->y += 6; break; case eSCREEN_CAPTIONS_FONT_STYLE: p_button->width += 55; p_button->y += 20; break; case eSCREEN_CAPTIONS_FONT_OPACITY: case eSCREEN_CAPTIONS_BACK_OPACITY: p_button->x += -6; p_button->width += -8; break; case eSCREEN_CAPTIONS_FONT_OPTIONS: p_button->x -= 16; p_button->y += 8; p_button->width += 84; break; case eSCREEN_CAPTIONS_BACK_OPTIONS: p_button->x -= 16; p_button->y += -2; p_button->width += 140; break; case eSCREEN_CAPTIONS_EDGE_TYPE: p_button->x += -10; p_button->width += 26; break; case eSCREEN_MAIN: p_button->x += -20; p_button->width += 35; p_button->height += 0; break; case eSCREEN_RESET: p_button->x += 25; p_button->width += 30; break; case eSCREEN_RATINGS: p_button->x += 5; p_button->width += 40; break; case eSCREEN_RATINGS_LIMITS: p_button->width += 30; break; case eSCREEN_RATINGS_TV: p_button->y += 10; break; case eSCREEN_RATINGS_RRT_DIM: case eSCREEN_RATINGS_RRT_VAL: p_button->y += 10; break; case eSCREEN_RATINGS_MOVIES: p_button->y += 10; break; case eSCREEN_WRONG_PIN_LIVE: case eSCREEN_WRONG_PIN_RATINGS: case eSCREEN_MISMATCHED_PINS: case eSCREEN_WIZ_MISMATCHED_PINS: p_button->width += 110; break; case eSCREEN_WRONG_PIN_RESET: p_button->y -= 20; p_button->width += 110; break; case eSCREEN_AUTO_POWER: p_button->y += 5; break; default: break; } } #endif /* FRENCH */ #ifdef NUMBER_BUTTONS p_button->width += 20; #endif if (p_app->screen_id == eSCREEN_RATINGS_TV) p_button->width -= 10; } /* Summary: Draw a button. Description: Draw a button. */ void bscreen_draw_button(void *v_app, /* application structure */ const bbutton_t *p_button, /* button info structure */ int selected, /* Button selected when non-zero */ int checked, /* Button checked when non-zero */ int idx /* button index or -1 for non index button */ ) { bapp_t *p_app = (bapp_t*)v_app; bbutton_t tmp_button; unsigned int num_chars; static int nscreen_id = 0xFFFF; num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_button->text_id, p_app->tmp_str, &num_chars); bapp_font_size_t font_size = eFONT_SIZE_MED; #ifdef NUMBER_BUTTONS if (p_app->screen_id != eSCREEN_RATINGS_TV) { if (p_app->button_numbers && (idx >= 0)) { char cstr[16]; int clen; clen = snprintf(cstr,16," - %d",idx + 1); if ((clen + num_chars) < SCREEN_MAX_STR_WIDTH) { num_chars += c_to_uni_str(cstr,&p_app->tmp_str[num_chars],clen); } } } #endif /* adjust button size/position based on language choice */ tmp_button = *p_button; adjust_button_orientation(v_app, &tmp_button); if ((p_app->lang == eLANG_FRENCH) && (p_app->screen_id == eSCREEN_CAPTIONS_FONT)) { tmp_button.y += (idx * 4); } //if ((p_app->screen_id == eSCREEN_PICTURE) && (p_app->lang == eLANG_SPANISH)) if (p_app->lang == eLANG_SPANISH) { if(nscreen_id != p_app->screen_id) { //AOV_DBG_PRINT(("p_app->screen_id = %d",p_app->screen_id)); nscreen_id = p_app->screen_id; } #ifdef ACB612 switch(p_app->screen_id) { case eSCREEN_MAIN: tmp_button.y += (idx * 3); /* fine tune UI layout */ if (1 == idx || 3 == idx) tmp_button.y += 10; break; case eSCREEN_WIZ_CH_SCAN: tmp_button.y += (idx * 6); break; case eSCREEN_SETUP: font_size = eFONT_SIZE_SMALL; tmp_button.y += (idx * 3); break; case eSCREEN_CAPTIONS_FONT_OPTIONS: case eSCREEN_CAPTIONS_BACK_OPTIONS: case eSCREEN_CAPTIONS_FONT: case eSCREEN_CAPTIONS_FONT_SIZE: case eSCREEN_CAPTIONS_FONT_STYLE: case eSCREEN_CAPTIONS_FONT_COLOR: case eSCREEN_CAPTIONS_FONT_OPACITY: case eSCREEN_CAPTIONS_BACK_COLOR: case eSCREEN_CAPTIONS_BACK_OPACITY: case eSCREEN_CAPTIONS_EDGE_COLOR: case eSCREEN_CAPTIONS_EDGE_TYPE: tmp_button.y += (idx * 1); break; case eSCREEN_TIMEZONE: tmp_button.y += (idx * 8); /* fine tune UI layout */ if (1 == idx) tmp_button.y -= 2; if (2 == idx) tmp_button.y += 2; break; case eSCREEN_PIN_VERIFY_RATINGS: tmp_button.y += (idx * 8); break; case eSCREEN_AUTO_POWER: tmp_button.y += (idx * 1); if (3 == idx) tmp_button.y -= 2; break; /* fine tune UI layout */ case eSCREEN_PICTURE: tmp_button.y += (idx * 2); if (1 == idx) tmp_button.y += 12; break; case eSCREEN_AV: if (1 == idx) tmp_button.y -= 6; if (2 == idx) tmp_button.y += (idx * 8); break; case eSCREEN_CAPTIONS_ADVANCED: tmp_button.y += (idx * 4); break; default: tmp_button.y += (idx * 16); } #else tmp_button.y += (idx * 16); #endif } bscreen_draw_button_str(v_app,&tmp_button,selected,checked,p_app->tmp_str,num_chars,NULL,0,font_size,p_button->right_justify_text); } #if 1 /* Summary: Draw a button but override the p_button->text_id text with str_text. Description: Draw a button but override the p_button->text_id text with str_text. */ void bscreen_draw_button_custom_text(void *v_app, /* application structure */ const bbutton_t *p_button, /* button info structure */ char *str_text, /* button text to use (overrides p_button->text_id) */ char *str_desc_text, /* description text to use (overrides p_button->desc_text_id) */ int selected, /* Button selected when non-zero */ int checked, /* Button checked when non-zero */ int idx /* button index or -1 for non index button */ ) { bapp_t *p_app = (bapp_t*)v_app; bbutton_t tmp_button; unsigned int num_chars = 0; unsigned int num_desc_chars = 0; const int MAX_DESC_LEN = 64; unsigned int tmp_desc_str[MAX_DESC_LEN]; bapp_font_size_t font_size = eFONT_SIZE_MED; #ifdef RRT_BUTTON_NUM char cstr[16]; int clen = 0; #endif int margin = eBUTTON_MARGIN_X; int str_width = 0; int pixels_per_char = 0; int w = 0; int h = 0; if (!str_text) str_text = " "; if (strlen(str_text) == 0) str_text = " "; num_chars = strlen(str_text); #ifdef RRT_BUTTON_NUM clen = snprintf(cstr,16," - %d",idx + 1); #endif num_chars = c_to_uni_str(str_text,p_app->tmp_str, strlen(str_text)); bgfx_string_info(p_app->p_font[p_app->lang][font_size],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); /* calc width of entire string (includes index if necessary) in pixels */ pixels_per_char = ((w + margin) / num_chars); str_width = w + margin; #ifdef RRT_BUTTON_NUM if (p_app->button_numbers) str_width += (clen * pixels_per_char); #endif if (str_width > p_button->width) { /* trim string characters if too big for button */ int excess_pixels = (str_width - p_button->width); num_chars -= excess_pixels / pixels_per_char; bgfx_string_info(p_app->p_font[p_app->lang][font_size],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); #ifdef RRT_BUTTON_NUM /* copy string into p_app->tmp-str - index number will be copied later if necessary */ c_to_uni_str(str_text,p_app->tmp_str, num_chars - clen); #endif BDBG_MSG(("%s : too wide for button - adjusting from %d chars to %d chars\n", __func__,(num_chars + excess_pixels / pixels_per_char), num_chars)); } else { /* string fits in button - no trimming necesary */ /* copy string into p_app->tmp_str - index number will be copied later if necesary */ num_chars = c_to_uni_str(str_text,p_app->tmp_str, strlen(str_text)); } #ifdef RRT_BUTTON_NUM /* copy index number into tmp_str if necessary */ if (p_app->button_numbers && (idx >= 0)) num_chars += c_to_uni_str(cstr,&p_app->tmp_str[num_chars],clen); #endif if (str_desc_text) { num_desc_chars = SCREEN_MAX_STR_WIDTH; num_desc_chars = c_to_uni_str(str_desc_text,tmp_desc_str, MAX_DESC_LEN); } /* adjust button size/position based on language choice */ //tmp_button = *p_button; memcpy(&tmp_button, p_button, sizeof(tmp_button)); adjust_button_orientation(v_app, &tmp_button); bscreen_draw_button_str(v_app,&tmp_button,selected,checked,p_app->tmp_str,num_chars,tmp_desc_str,num_desc_chars,eFONT_SIZE_MED,tmp_button.right_justify_text); } #endif /* Summary: Draw the buttons for the screen. Description: Draw the buttons for the screen. */ void bscreen_draw_buttons( void *v_app, /* Opaque app reference */ void *v_screen /* Opaque screen reference */ ) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; bscreen_event_t event; int button_idx,selected,checked; for (button_idx = 0; button_idx < p_screen->num_buttons; button_idx++) { event.type = eS_EVENT_SELECTED; event.id = button_idx; selected = p_screen->handle_event(p_app,p_screen,&event); event.type = eS_EVENT_CHECKED; checked = p_screen->handle_event(p_app,p_screen,&event); bscreen_draw_button(p_app,&p_screen->p_button_array[button_idx], selected,checked,button_idx); } } /* Summary: Draw a progress meter for the screen. Description: Draw a progress meter for the screen. */ void bscreen_draw_progress(void * v_app, unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int border_width, unsigned int border_color, unsigned int background_color, unsigned int percent, unsigned int max_percent) { bapp_t *p_app = (bapp_t*)v_app; int newX = x; int newY = y; int newW = width; int newH = height; /* draw border */ //bgfx_fill_rect(&p_app->surf, newX, newY, newW, newH, border_color); bgfx_fill_rect(&p_app->surf,newX,newY,newW,border_width,eCOLOR_WHITE); bgfx_fill_rect(&p_app->surf,newX,newY+newH-border_width,newW+border_width,border_width,eCOLOR_WHITE); bgfx_fill_rect(&p_app->surf,newX,newY,border_width,newH,eCOLOR_WHITE); bgfx_fill_rect(&p_app->surf,newX+newW,newY,border_width,newH,eCOLOR_WHITE); /* draw progress background */ newX += border_width; newY += border_width; newW -= (2 * border_width); newH -= (2 * border_width); bgfx_fill_rect(&p_app->surf, newX, newY, newW, newH, background_color); /* draw thumb */ newX += border_width; newY += border_width; if (percent > max_percent) percent = max_percent; newW = (newW - (2 * border_width)) * percent / max_percent; newH -= (2 * border_width); if (newW) { /* draw top bevel */ bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_PALE_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; /* draw middle */ bgfx_fill_rect(&p_app->surf,newX,newY, newW,newH - (7 * eBUTTON_BEVEL_GRADIENT_STEP),eCOLOR_BRT_YELLOW); /* draw bottom bevel */ newY = y + height - (2 * border_width) - eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; } } /* Summary: Draw pin fields for the screen. Description: Draw pin fields for the screen. */ void bscreen_draw_pin(void * v_app, unsigned int x, unsigned int y, unsigned int width, unsigned int height, unsigned int inc_x, unsigned int selection, unsigned int field) { bapp_t *p_app = (bapp_t*)v_app; int newX = x; int newY = y; int newW = width; int newH = height; unsigned int i = field; unsigned int j = 0; for (j = 0; j < field; j++) { newX += width + inc_x; newY = y; newW = width; newH = height; } /* draw border */ bgfx_fill_rect(&p_app->surf, newX, newY, newW, newH, eCOLOR_WHITE); /* draw progress background */ newX += eBUTTON_PROGRESS_BORDER; newY += eBUTTON_PROGRESS_BORDER; newW -= (2 * eBUTTON_PROGRESS_BORDER); newH -= (2 * eBUTTON_PROGRESS_BORDER); bgfx_fill_rect(&p_app->surf, newX, newY, newW, newH, eCOLOR_DRK_BLUE); /* draw highlight */ if (i == selection) { newX += eBUTTON_PROGRESS_BORDER; newY += eBUTTON_PROGRESS_BORDER; newW = (newW - (2 * eBUTTON_PROGRESS_BORDER)); newH -= (2 * eBUTTON_PROGRESS_BORDER); /* draw top bevel */ bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_PALE_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY += eBUTTON_BEVEL_GRADIENT_STEP; /* draw middle */ bgfx_fill_rect(&p_app->surf,newX,newY, newW,newH - (7 * eBUTTON_BEVEL_GRADIENT_STEP),eCOLOR_BRT_YELLOW); /* draw bottom bevel */ newY = y + height - (2 * eBUTTON_PROGRESS_BORDER) - eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_DK_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_MED_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; bgfx_fill_rect(&p_app->surf,newX,newY, newW,eBUTTON_BEVEL_GRADIENT_STEP,eCOLOR_LT_YELLOW); newY -= eBUTTON_BEVEL_GRADIENT_STEP; } else if (i < selection) { /* draw hidden value indicator */ unsigned int num_chars = SCREEN_MAX_STR_WIDTH; int w = 0; int h = 0; bscreen_get_string(p_app->lang,eTEXT_HIDDEN_PIN_DIGIT, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL],(const unsigned long *)p_app->tmp_str,num_chars,&w,&h); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], newX + ((newW / 2) - (w / 2)) - 5, y + ((newH / 2) - (h / 2)), w, h, p_app->tmp_str, num_chars, eCOLOR_WHITE, eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_INFO_LINE_SPACING); } } /* Summary: Default screen drawing function Description: Default screen drawing function. . */ void bscreen_auto_power_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; unsigned int num_chars; uint16_t title_area_height = p_screen->top_banner_height; if (p_app->settings.auto_power) { //title_area_height += 32; } bscreen_draw_background(v_app, &p_app->surf, title_area_height); /* draw title */ num_chars = SCREEN_MAX_STR_WIDTH; bscreen_get_string(p_app->lang,p_screen->title_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_LARGE], eMENU_TITLE_TEXT_X, eMENU_TITLE_TEXT_Y, eMENU_TITLE_TEXT_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_DK_YELLOW,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_TEXT_HEIGHT); /* draw description */ num_chars = SCREEN_MAX_STR_WIDTH; if (p_app->settings.auto_power) bscreen_get_string(p_app->lang,eTEXT_AUTO_POWERED_OFF, p_app->tmp_str, &num_chars); else bscreen_get_string(p_app->lang,p_screen->desc_text_id, p_app->tmp_str, &num_chars); text_box_shadow(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], eMENU_TITLE_DESC_TEXT_X, eMENU_TITLE_DESC_TEXT_Y, eMENU_TITLE_DESC_TEXT_WIDTH, eMENU_TITLE_DESC_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_WHITE,eCOLOR_BLACK, eMENU_TEXT_DROPSHADOW ,eMENU_TITLE_DESC_TEXT_SPACING); bscreen_draw_buttons(v_app,v_screen); draw_navigation_hints(v_app, v_screen); } int bscreen_eas_text_scrolling_info(bapp_t *p_app, unsigned char *eas_pkt, unsigned int size) { TS_SCTE_18_header header; /* header structure */ int act_len = 0, alert_len = 0, act_width, i, num_chars; unsigned char *p_mss = NULL; unsigned int len; unsigned char eas_tmp_buf[MAX_EAS_TEXT]; if (!eas_pkt) { BDBG_WRN(("%s NULL pkt pointer",__FUNCTION__)); return BERR_INVALID_PARAMETER; } else { if (TS_SCTE_18_getSectionHeader(eas_pkt, size, &header) != 0) { goto FAILED; } if (header.nature_of_activation_text_length) { p_mss = TS_SCTE_18_getActivationTextOffset((const unsigned char *)eas_pkt, &len); if (p_mss) { memset(eas_tmp_buf, 0, MAX_EAS_TEXT); if (!eas_process_mss(p_app, p_mss, eas_tmp_buf, len)) { memcpy(p_app->eas_str, eas_tmp_buf, len); len -= 5; /* skip 5 bytes for language id */ p_app->eas_str[len] = 0; act_len = strlen((const char *)p_app->eas_str); p_app->eas_str[act_len] = ':'; p_app->eas_str[act_len+1] = ' '; act_len += 2; p_app->eas_activation_str_len = act_len; p_app->eas_activation_text = true; } } } if (act_len == 0) { strcpy(p_app->eas_str, "EAS Alert: "); p_app->eas_activation_str_len = strlen("EAS Alert: "); p_app->eas_activation_text = false; act_len = strlen((const char *)p_app->eas_str); } p_app->eas_one_iteration = false; p_app->eas_str[act_len] = 0; p_app->eas_str_len = 0; // TODO:: alert_len = 0; if (header.alert_text_length) { p_mss = TS_SCTE_18_getAlrtTextOffset((const unsigned char *)eas_pkt, &len); if (p_mss) { memset(eas_tmp_buf, 0, MAX_EAS_TEXT); /* we get EAS text if we are here */ if (!eas_process_mss(p_app, p_mss, eas_tmp_buf, len)) { alert_len = strlen(eas_tmp_buf); if ((alert_len+act_len) > MAX_EAS_TEXT) alert_len = MAX_EAS_TEXT-act_len-1; memcpy(p_app->eas_str+act_len, eas_tmp_buf, alert_len); p_app->eas_str[act_len + alert_len] = 0; p_app->eas_str_len = alert_len; p_app->eas_text = true; } } } num_chars = c_to_uni_str((unsigned char *)p_app->eas_str, p_app->tmp_str, act_len+alert_len); bgfx_scroll_info(p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], (unsigned long *)p_app->tmp_str, num_chars, p_app->eas_char_width); act_width = 0; for (i=0; ieas_char_width[i]; p_app->eas_activation_str_width = act_width; return BERR_SUCCESS; } FAILED: p_app->eas_text = false; BDBG_ERR(("#### get EAS Alert Text failed ####")); return BERR_INVALID_PARAMETER; } static void bapp_eas_text_draw(bapp_t *p_app, int x, int width, int idx, int len, bcolor_idx_t eClr) { char c; int num_chars; if (len>0) { c = p_app->eas_str[idx+len]; p_app->eas_str[idx+len] = '\0'; num_chars = c_to_uni_str((unsigned char *)(p_app->eas_str + idx), p_app->tmp_str, len); text_box(&p_app->surf, p_app->p_font[p_app->lang][eFONT_SIZE_SMALL], x, EAS_TEXT_Y+EAS_TEXT_Y_OFF, width + EAS_TEXT_X_SAFE_EDGE, EAS_ROW_HEIGHT, p_app->tmp_str, num_chars, eClr, 0); p_app->eas_str[idx+len] = c; } } /* Summary: EAS alert text drawing function. */ void bscreen_eas_text_scrolling_info_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; int dsp_x, width, act_width; int start_idx, len, act_len; p_app->eas_dsp_x -= EAS_SCROLL_STEP; if (p_app->eas_dsp_x < 0) { if (p_app->eas_src_start_x < (-p_app->eas_dsp_x)) { p_app->eas_src_start_idx += 1; p_app->eas_src_start_x += p_app->eas_char_width[p_app->eas_src_start_idx]; } dsp_x = EAS_TEXT_X + p_app->eas_src_start_x + p_app->eas_dsp_x; } else { dsp_x = EAS_TEXT_X + p_app->eas_dsp_x; } if ((p_app->eas_src_end_idx < (p_app->eas_activation_str_len + p_app->eas_str_len)) && (p_app->eas_src_end_x <= (EAS_TEXT_WIDTH - p_app->eas_dsp_x))) { p_app->eas_src_end_idx += 1; p_app->eas_src_end_x += p_app->eas_char_width[p_app->eas_src_end_idx]; } if ((p_app->eas_src_end_idx > 0) && ((p_app->eas_src_start_idx+1) < (p_app->eas_activation_str_len + p_app->eas_str_len))) { len = p_app->eas_src_end_idx - (p_app->eas_src_start_idx +1) ; width = (p_app->eas_src_end_x - p_app->eas_char_width[p_app->eas_src_end_idx]) - p_app->eas_src_start_x; start_idx = p_app->eas_src_start_idx + 1; if (dsp_x + width < EAS_TEXT_X + EAS_TEXT_WIDTH) { bgfx_fill_rect(&p_app->surf, dsp_x+width, EAS_TEXT_Y, EAS_ROW_HEIGHT, EAS_ROW_HEIGHT, eCOLOR_CLEAR); } bgfx_fill_rect(&p_app->surf, dsp_x - EAS_TEXT_X_SAFE_EDGE, EAS_TEXT_Y, width+2*EAS_TEXT_X_SAFE_EDGE,EAS_ROW_HEIGHT,eCOLOR_BLACK); if (p_app->eas_src_start_idx < p_app->eas_activation_str_len) { act_width = SCREEN_MIN(p_app->eas_activation_str_width - p_app->eas_src_start_x, width); act_len = SCREEN_MIN(p_app->eas_activation_str_len - start_idx, len); bapp_eas_text_draw(p_app, dsp_x, act_width, start_idx, act_len, eCOLOR_DK_YELLOW); dsp_x += act_width; width -= act_width; start_idx += act_len; len -= act_len; } /* draw the alert text part */ if (p_app->eas_src_end_idx > p_app->eas_activation_str_len) { bapp_eas_text_draw(p_app, dsp_x, width, start_idx, len, eCOLOR_WHITE); } } else if ((p_app->eas_src_start_idx + 1) >= (p_app->eas_activation_str_len + p_app->eas_str_len)) { /* REG-1143: eas_one_iteration completed */ BDBG_MSG(("eas eas_one_iteration -> true")); p_app->eas_one_iteration = true; /* init for next scroll if not timeout yet */ p_app->eas_dsp_x = EAS_TEXT_WIDTH - EAS_SCROLL_STEP; p_app->eas_src_start_idx = -1; p_app->eas_src_start_x = 0; p_app->eas_src_end_idx = 0; p_app->eas_src_end_x = p_app->eas_char_width[0]; /* this will clean the tail left by last bgfx_fill_rect */ bgfx_fill_rect(&p_app->surf,EAS_TEXT_X-EAS_TEXT_X_SAFE_EDGE,EAS_TEXT_Y,2*EAS_ROW_HEIGHT,EAS_ROW_HEIGHT,eCOLOR_CLEAR); } } /* Summary: HD display screen event handler Description: HD display screen event handler */ int screen_sd_output_options_config_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int cur; int temp_cur; if (p_event->type == eS_EVENT_SETUP) { int i; bscreen_default_setup(v_app,v_screen); bdisplay_get(p_app->display,&g_display_settings); /* note that the order of define are not match button order */ switch (g_display_settings.sd_options) { default: case bdisplay_sd_output_options_widescreen: i = 0; break; case bdisplay_sd_output_options_full: i = 1; break; case bdisplay_sd_output_options_auto: i = 2; break; case bdisplay_sd_output_options_zoom: i = 3; break; } p_screen->button_selection = i; p_screen->button_checked = i; cur = i; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); cur = p_screen->button_selection; result = 1; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); /*janzy@20121004,fix OSD (Video Output)*/ switch (g_display_settings.sd_options) { default: case bdisplay_sd_output_options_widescreen: temp_cur = 0; break; case bdisplay_sd_output_options_full: temp_cur = 1; break; case bdisplay_sd_output_options_auto: temp_cur = 2; break; case bdisplay_sd_output_options_zoom: temp_cur = 3; break; } /* if changed */ if (cur != temp_cur) { bdisplay_get(p_app->display,&g_display_settings); switch (p_screen->button_selection) { default: case 0: g_display_settings.sd_options = bdisplay_sd_output_options_widescreen; break; case 1: g_display_settings.sd_options = bdisplay_sd_output_options_full; break; case 2: g_display_settings.sd_options = bdisplay_sd_output_options_auto; break; case 3: g_display_settings.sd_options = bdisplay_sd_output_options_zoom; break; } bdisplay_set(p_app->display,&g_display_settings); p_app->settings.sd_options = g_display_settings.sd_options; p_app->settings_dirty |= DIRTY_MISC; bapp_save_settings(p_app); } break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } #ifdef HAS_HDMI /* Summary: HD view mode configration screen event handler Description: HD view mode configration screen event handler */ int screen_hd_output_options_config_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int cur; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); bdisplay_get(p_app->display,&g_display_settings); cur = g_display_settings.hd_options; p_screen->button_selection = cur; p_screen->button_checked = cur; result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); /* if changed */ if (cur != p_screen->button_selection) { bdisplay_get(p_app->display,&g_display_settings); p_app->settings.hd_config.hd_options = p_screen->button_selection; g_display_settings.hd_options = p_screen->button_selection; bdisplay_set(p_app->display,&g_display_settings); p_app->settings_dirty |= DIRTY_HD_CONFIG; bapp_save_settings(p_app); } break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Video format change confirmation change screen event handling function. */ int bscreen_confirm_change_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static unsigned int s_timeout_ticks; #if 0 switch (p_event->type) { case eS_EVENT_SETUP: bscreen_default_setup(v_app,v_screen); p_screen->button_selection = 0; /* default to NO */ p_screen->button_checked = 0; s_timeout_ticks = bos_getticks() + CONFIRM_TIMEOUT_TICKS; result = 1; break; case eS_EVENT_IDLE: { if (s_timeout_ticks < bos_getticks()) { /* if we are here, means that TV doesn't support the format to change, resume to previous format */ BDBG_WRN(("%s: CONFIRM_CHANGE TIMEOUT, resume to previous video output format",__func__)); bdisplay_get(p_app->display,&g_display_settings); g_display_settings.format = s_temp_format; p_app->settings.hd_config.output_format = s_temp_format; p_app->settings_dirty &= ~DIRTY_HD_CONFIG; bdisplay_set(p_app->display,&g_display_settings); s_confirm_change = false; p_screen->last_screen_id = eSCREEN_AV; bapp_set_current_screen(p_app, eSCREEN_VIDEO_FORMAT, eSCREEN_MAX); result = 1; } } break; case eS_EVENT_IR: { switch (p_event->id) { case eIR_SELECT: case eIR_ENTER: if (p_screen->button_selection) { s_confirm_change = true; p_app->settings_dirty |= DIRTY_HD_CONFIG; } else { bdisplay_get(p_app->display,&g_display_settings); g_display_settings.format = s_temp_format; p_app->settings.hd_config.output_format = s_temp_format; p_app->settings_dirty &= ~DIRTY_HD_CONFIG; bdisplay_set(p_app->display,&g_display_settings); } p_screen->last_screen_id = eSCREEN_AV; bapp_set_current_screen(p_app, eSCREEN_VIDEO_FORMAT, eSCREEN_MAX); result = 1; break; case eIR_LEFT: case eIR_MENU: p_screen->last_screen_id = eSCREEN_AV; bapp_set_current_screen(p_app, eSCREEN_VIDEO_FORMAT, eSCREEN_MAX); result = 1; break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; break; } } break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } #endif return result; /* always handle event */ } /* Summary: Video output format screen event handling function. */ int bscreen_video_format_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; unsigned int num_chars = SCREEN_MAX_STR_WIDTH; static int cur; #if 0 switch (p_event->type) { case eS_EVENT_SETUP: bscreen_default_setup(v_app,v_screen); bdisplay_get(p_app->display,&g_display_settings); s_confirm_change = false; cur = g_display_settings.format; p_screen->button_selection = cur; p_screen->button_checked = cur; result = 1; break; case eS_EVENT_IR: { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); /* if changed */ if (cur != p_screen->button_selection) { bdisplay_get(p_app->display,&g_display_settings); s_temp_format = g_display_settings.format; /* draw a screen instead of waiting a black screen before confirmation screen popped up */ bgfx_fill_rect(&p_app->surf,0,0,eWIDTH,eHEIGHT,eCOLOR_BLACK); bscreen_get_string(p_app->lang,eTEXT_VIDEO_OUTPUT_FORMAT_WAIT, p_app->tmp_str, &num_chars); text_box(&p_app->surf, p_app->p_font[eLANG_ENGLISH][eFONT_SIZE_SMALL], eMENU_TITLE_TEXT_X, (eHEIGHT >> 1), eSCREEN_ACTION_SAFE_WIDTH, eMENU_TITLE_TEXT_HEIGHT, p_app->tmp_str, num_chars, eCOLOR_MED_YELLOW,0); bapp_flush_screen(p_app); bos_sleep(800); g_display_settings.format = p_screen->button_selection; if (bdisplay_set(p_app->display,&g_display_settings) == b_ok) { p_screen->last_screen_id = eSCREEN_CONFIRM_CHANGE; bapp_set_current_screen(p_app, eSCREEN_CONFIRM_CHANGE, eSCREEN_MAX); } } result = 1; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_set_current_screen(p_app, eSCREEN_AV, eSCREEN_MAIN); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } #endif return result; /* always handle event */ } #endif /* Summary: RFM screen event handler Description: RFM screen event handler. */ int screen_rfm_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int rfm; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.rfm; result = 1; /* always handle event */ rfm = p_app->settings.rfm; p_screen->button_selection = rfm; } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: result = select_button(v_app,v_screen); rfm = p_screen->button_selection; #if(AOV_MODEL == ALCO) if ( rfm != p_app->settings.rfm) { p_app->settings.rfm = rfm; #ifdef ACB612 brfm_set_ch3(p_app->p_rfm, rfm); #endif p_app->settings_dirty |= DIRTY_CHANNEL; bapp_save_settings(p_app); } #endif result = 1; break; case eIR_LEFT: case eIR_MENU: #if(AOV_MODEL != ALCO) if (rfm != p_app->settings.rfm) { p_app->settings.rfm = rfm; #ifdef ACB612 brfm_set_ch3(p_app->p_rfm, rfm); #endif p_app->settings_dirty |= DIRTY_CHANNEL; bapp_save_settings(p_app); } #endif result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } /* Summary: Digital captioning selection screen event handler Description: Digital captioning selection screen event handler. */ int screen_digital_captioning_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int digital_option, analog_option, digital, analog; if (p_event->type == eS_EVENT_SETUP) { /* remember current settings */ digital = digital_option = p_app->settings.dcc.captions_basic; analog = analog_option = p_app->settings.dcc.captions_analog; /* set button description based on current settings */ if (digital < 1) { p_screen->p_button_array[0].desc_text_id = eTEXT_CAPTIONS_DIGITAL_DISABLE; } else { p_screen->p_button_array[0].desc_text_id = eTEXT_CAPTIONS_CS1_BUTTON + (digital - 1); } #ifdef ACB612 p_screen->p_button_array[1].desc_text_id = (analog == 0)?(eTEXT_CAPTIONS_DIGITAL_DISABLE + analog):(eTEXT_ON_RRT_BUTTON); #else p_screen->p_button_array[1].desc_text_id = eTEXT_CAPTIONS_DIGITAL_DISABLE + analog; #endif bscreen_default_setup(v_app,v_screen); result = 1; /* always handle event */ } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_DOWN: case eIR_UP: p_screen->button_selection++; p_screen->button_selection %= p_screen->num_buttons; result = select_button(v_app,v_screen); break; case eIR_SELECT: if (1 == p_screen->button_selection) { #ifdef ACB612 if(analog == 0) { analog = 1; p_screen->p_button_array[p_screen->button_selection].desc_text_id = eTEXT_ON_RRT_BUTTON; } else { analog = 0; p_screen->p_button_array[p_screen->button_selection].desc_text_id = eTEXT_CAPTIONS_DIGITAL_DISABLE + analog; } #else analog++; analog %= 9; p_screen->p_button_array[p_screen->button_selection].desc_text_id = eTEXT_CAPTIONS_DIGITAL_DISABLE + analog; #endif } else { digital++; digital %= 7; /* 1 + 6 */ if (0 == digital) { p_screen->p_button_array[p_screen->button_selection].desc_text_id = eTEXT_CAPTIONS_DIGITAL_DISABLE; } else { p_screen->p_button_array[p_screen->button_selection].desc_text_id = eTEXT_CAPTIONS_CS1_BUTTON + (digital - 1); } } p_app->p_screens[p_app->screen_id].draw(p_app,(void*)&(p_app->p_screens[p_app->screen_id])); bapp_flush_screen(p_app); result = 1; break; case eIR_LEFT: case eIR_MENU: if (analog != analog_option) { p_app->settings.dcc.captions_analog = analog; p_app->settings_dirty |= DIRTY_DCC; #ifdef CONFIG_EIA_708 bapp_eia708_set_cc_service(p_app->eia708, 0 , analog); #endif } if (digital != digital_option) { p_app->settings.dcc.captions_basic = digital; p_app->settings_dirty |= DIRTY_DCC; /* sync with cached variable */ p_app->captions_basic = digital; #ifdef CONFIG_EIA_708 bapp_eia708_set_cc_service(p_app->eia708, 1 , digital); #endif bapp_set_wide_aspect_ratio(p_app); } if (p_app->settings_dirty) bapp_save_settings(p_app); result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } #include "bguide.c" /* Summary: wiz timezone screen event handler Description: wiz timezone Picture screen event handler. */ int bscreen_wiz_timezone_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; bscreen_t *p_screen = (bscreen_t*)v_screen; int result = 0; static int dst, time_zone; if (p_event->type == eS_EVENT_SETUP) { bscreen_default_setup(v_app,v_screen); p_screen->button_checked = p_app->settings.time_zone; dst = p_app->settings.dst; time_zone = p_app->settings.time_zone; BDBG_MSG(("time_zone = %d\n",p_app->settings.time_zone)); result = 1; /* always handle event */ p_screen->button_selection = time_zone; } else if (p_event->type == eS_EVENT_CHECKED) { if (p_event->id == 3) { result = (dst) ? 1 : 0; } else { if (time_zone == p_event->id) return 1; else result = 0; } } else if (p_event->type == eS_EVENT_IR) { switch (p_event->id) { case eIR_RIGHT: case eIR_SELECT: /* don't move to next screen if just select DST */ if (p_screen->button_selection == 3) { dst = dst ? 0 : 1; } else { time_zone = p_screen->button_selection; if (dst != p_app->settings.dst) { p_app->settings.dst = dst; p_app->settings_dirty |= DIRTY_SCREEN; p_app->chm.local_dst_obs = p_app->settings.dst; } if (time_zone != p_app->settings.time_zone) { p_app->settings.time_zone = time_zone; p_app->chm.local_time_source = eTS_FIXED; p_app->chm.local_offset = 0 - (int)g_tz_map[p_app->settings.time_zone]; p_app->chm.local_offset *= 3600; p_app->chm.local_dst_obs = p_app->settings.dst; p_app->settings_dirty |= DIRTY_SCREEN; } /* we cannot blindly call select_button() here since we need to go to different scan screens depending on the type of antenna attached */ #ifdef CONFIG_ISDB p_app->chm.fe_type = eFREQ_TABLE_ISDB; #else p_app->chm.fe_type = eFREQ_TABLE_NTIA_VSB; #endif bapp_set_current_screen( p_app, eSCREEN_WIZ_CH_SCAN, eSCREEN_WIZ_TIMEZONE); } result = 1; break; case eIR_LEFT: case eIR_MENU: result = 1; bapp_goto_last_screen(p_app); break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } } else { result = bscreen_default_event(v_app,v_screen,p_event); } return result; } #define AUDIO_CHANNEL_TIMEOUT_TICKS MS_TO_TICKS(1 * 1000) /* Summary: Audio only channel screen drawing function Description: Audio only channel screen drawing function. */ void bscreen_audio_channel_draw(void *v_app, void *v_screen) { bapp_t *p_app = (bapp_t*)v_app; uint32_t color, i; unsigned int num_chars; int w,h; if (p_app->audio_channel_draw_timeout > bos_getticks()) return; p_app->audio_channel_draw_timeout = bos_getticks() + AUDIO_CHANNEL_TIMEOUT_TICKS; num_chars = SCREEN_MAX_STR_WIDTH; bgfx_fill_rect(&p_app->surf, 0, 0, eWIDTH, eHEIGHT, eCOLOR_BLACK); bapp_str_get(p_app->lang, eTEXT_AUDIO_CHANNEL, p_app->tmp_str, &num_chars); bgfx_string_info(p_app->p_font[p_app->lang][eFONT_SIZE_MED], (const unsigned long *)p_app->tmp_str, num_chars, &w, &h); w += 16; #if defined(CONFIG_GFX_ARGB32) color = 0xff000000; i = RAND_INT(256); if (color < 128) color += 128; color |= (i << 16); i = RAND_INT(256); if (color < 128) color += 128; color |= (i << 8); i = RAND_INT(256); if (color < 128) color += 128; color |= i; #else color = RAND_INT(eCOLOR_NEON_GREEN + 1); /* not transparent */ if (0 == color) color = 1; #endif text_box(&p_app->surf, p_app->p_font[eLANG_ENGLISH][eFONT_SIZE_MED], eSCREEN_ACTION_SAFE_X + RAND_INT(eSCREEN_ACTION_SAFE_WIDTH - w), eSCREEN_ACTION_SAFE_Y + RAND_INT(eSCREEN_ACTION_SAFE_HEIGHT - h), w, h, p_app->tmp_str, num_chars, color, 0); bapp_flush_screen(p_app); } /* Summary: Audio only Channel screen event handler Description: Audio only Channel screen event handler. */ int screen_audio_channel_event(void *v_app, void *v_screen, bscreen_event_t *p_event) { bapp_t *p_app = (bapp_t*)v_app; int result = 0; switch (p_event->type) { case eS_EVENT_IDLE: bscreen_check_power_saver_time(p_app); bscreen_audio_channel_draw(v_app, v_screen); break; case eS_EVENT_SETUP: { p_app->audio_channel_draw_timeout = bos_getticks() + AUDIO_CHANNEL_TIMEOUT_TICKS; GETTIMEOFDAY(&p_app->audio_channel_tm); result = 1; } break; case eS_EVENT_IR: if ((p_event->id & KEY_UP) == 0) { GETTIMEOFDAY(&p_app->audio_channel_tm); bapp_set_current_screen(p_app, eSCREEN_BANNER_SMALL, eSCREEN_MAX); //bapp_goto_last_screen(p_app); result = 1; } break; default: result = bscreen_default_event(v_app,v_screen,p_event); break; } return result; /* always handle event */ }