kb_machblue_client.h
上传用户:fy98168
上传日期:2015-06-26
资源大小:13771k
文件大小:15k
- //*****************************************************************************
- //FileName:kb_machblue_client.h
- //
- //Description:Machblue client.
- //
- //Author:steven
- //
- //Date: 2006.12.25
- //
- //Version: v1.0
- //*****************************************************************************
- #ifndef _KB_MACHBLUE_CLIENT_H_
- #define _KB_MACHBLUE_CLIENT_H_
- #ifdef __cplusplus
- extern "C" {
- #endif
- #include "gendef.h"
- #include "machblue_defines.h"
- #include "kb_dc.h"
- #include "kb_machblue_client_task.h"
- #include "kb_machblue_client_lc.h"
- #include "rckeymap.h"
- #define MB_PLAYER_1_2 0
- typedef enum
- {
- kb_movie_menu_main,
- kb_movie_menu_video_list,
- kb_movie_menu_nvod,//无
- kb_movie_menu_epg,
- kb_movie_menu_search,
- kb_movie_menu_searchAll,
- kb_movie_menu_mail,//无
- kb_movie_menu_mail_popup,//无
- kb_movie_menu_sys_info,
- kb_movie_menu_help,
- kb_movie_menu_pf,
- kb_movie_menu_volume,
- kb_movie_menu_volumeMute,
- kb_movie_menu_popup,//无
- kb_movie_menu_channle_no,//无
- kb_movie_menu_otahint,//无
- kb_movie_ca_inform,//无
- kb_movie_dbc_weather,
- kb_movie_dbc_gov,
- kb_movie_adve_logo,
- kb_movie_adve_logoSound,
- //not menu follows
- kb_movie_vote_voteMenu,
- kb_movie_adve_realtime,
- kb_movie_adve_alter,
- kb_movie_swfUpdatePrompt,
- kb_movie_last
- }kb_movie_name;
- typedef enum
- {
- kb_movie_sound_cocacola,
- kb_movie_sound_last
- }kb_movie_sound;
- typedef struct
- {
- kb_movie_sound type;
- unsigned char *pData;
- unsigned long size;
- }kb_movie_soundStruct;
- typedef enum
- {
- kb_movie_playing,
- kb_movie_closed,
- kb_movie_processing
- };
- //--------------add by shriek
- /**
- * define ota hint name
- */
- #define MOVIE_NAME_MENU_OTA_HINT "kb_ota_hint.swf" //SHIEK
- #define MOVIE_MENU_OTA_HINT_CONNECTION "_ota_connection"
- //define OTA type
- #define MOVIE_TYPE_MOVIE_OTA_QUERY "ota_yes_no_query"
- #define MOVIE_TYPE_MOVIE_OTA_HINT "ota_hint_only"
- #define EVENT_TYPE_MENU_OTA_HINT "hint_query"
- #define MOVIE_MENU_OTA_HINT_FUNCTION "_ota_receive"
- //--------------shriek end
- /**
- * define movie name
- */
- //menu
- #define MOVIE_NAME_MENU_GAME "menu_game"
- #define MOVIE_NAME_PGM_LIST_R "pgm_list_r.swf"
- #define MOVIE_NAME_MENU_MAIL "mail.swf"
- #define MOVIE_NAME_MENU_PROMPT "prompt.swf"
- #define MOVIE_NAME_MENU_NVOD "NVOD.swf"
- #define MOVIE_NAME_MENU_NAVIGATOR "navigator.swf"
- #define MOVIE_NAME_MENU_CHANNEL_INFO "channel_info.swf"
- #define MOVIE_NAME_MENU_CHANNEL_NO "channel_no.swf"
- #define MOVIE_NAME_LIST_KEY_TV "list_key_tv.swf"
- #define MOVIE_NAME_LIST_KEY_RADIO "list_key_radio.swf"
- //vote
- #define MOVIE_NAME_VOTE_SG "vote_supergirl"
- //advertisement
- #define MOVIE_NAME_ADVE_LOGO "adve_logo"
- #define MOVIE_NAME_ADVE_CHCARD "adve_christmascard"
- #define MOVIE_NAME_ADVE_SPCARD "adve_springcard"
- //data broadcast
- #define MOVIE_NAME_DBC_MAIN "dbc_main.swf"
- #define MOVIE_DBC_CONNECTION "_dbc_main"
- #define MOVIE_DBC_CON_FUNCTION "dbc_receive"
- #define MOVIE_DBC_WEATHER_EVENT "event_weather"
- //ca inform
- #define MOVIE_NAME_CA_INFORM "ca_inform.swf"
- #define MOVIE_CA_INFORM_CONNECTION "_ca_inform"
- #define MOVIE_CA_CON_INFORM_FUNCTION "ca_inform_receive"
- //game
- #define MOVIE_NAME_GAME_MAGNTRIX "game_magntrix"
- #define MOVIE_NAME_GAME_INVADE "game_invade"
- /**
- * define local connection
- */
- //local connection
- #define MOVIE_EPG_CONNECTION "_epgconnect"
- #define MOVIE_EPG_FUN_SELECTCH "get_epg_init_info"
- #define MOVIE_EPG_FUN_ORDER "get_order_init_info"
- #define MOVIE_EPG_FUN_ORDER_READ "get_order_init_info_read"
- #define MOVIE_MENU_PF_CONNECTION "_menupf_cur_service_id"
- #define MOVIE_MENU_PF_FUN_SERVICE_ID "get_cur_service_id"
- #define MOVIE_SOUND_CONNECTION "_sound_connection"
- #define MOVIE_SOUND_FUNCTION "sound_receive"
- #define MOVIE_MENU_PGM_LIST_CONNECTION "_pgm_connection"
- #define MOVIE_MENU_PGM_LIST_FUNCTION "_pgm_function"
- #define MOVIE_MENU_SEARCH_CONNECTION "_search_connection"
- #define MOVIE_MENU_SEARCH_FUNCTION "_search_result"
- #define MOVIE_MENU_MAIL_CONNECTION "_mail_connection"
- #define MOVIE_MENU_MAIL_FUNCTION "_mail_receive"
- #define MOVIE_MENU_PROMPT_CONNECTION "_prompt_connection"
- #define MOVIE_MENU_PROMPT_FUNCTION "_prompt_receive"
- #define MOVIE_NVOD_CONNECTION "_nvodconnect"
- #define MOVIE_NVOD_FUN_SELECTCH "nvod_init"
- #define MOVIE_CH_NO_CONNECTION "_ch_no_connect"
- #define MOVIE_CH_NO_FUNCTION "ch_no_receive"
- /**
- * define SYS_INFO_ type
- */
- #define MOVIE_MENU_SYS_INFO_CONNECTION "_sys_info_connection"
- #define MOVIE_MENU_SYS_INFO_FUNCTION "sys_info_receive"
- #define MOVIE_MENU_SYS_INFO_PASS_FUNCTION "sys_info_pass_receive"
- #define MOVIE_MENU_SYS_INFO_AUDIO_FUNCTION "sys_info_audio_receive"
- #define MOVIE_MENU_SYS_INFO_MENU_SET_FUNCTION "sys_info_menu_set_receive"
- #define MOVIE_MENU_SYS_INFO_POWER_ON_OFF_FUNCTION "sys_info_power_receive"
- #define EVENT_SYS_INFO_TYPE_CHANNEL_INFO "channel_info"
- #define EVENT_SYS_INFO_TYPE_STB_INFO "STB_info"
- #define EVENT_SYS_INFO_TYPE_LOADER_INFO "loader_info"
- #define EVENT_SYS_INFO_TYPE_FACTORY_RESET "factory_reset"
- #define EVENT_SYS_INFO_TYPE_PARENT_SET "parent_set"
- #define EVENT_SYS_INFO_TYPE_AUDIO_SET "audio_set"
- #define EVENT_SYS_INFO_TYPE_AUDIO_SET_R "audio_set_r"
- #define EVENT_SYS_INFO_TYPE_AUDIO_SET_W "audio_set_w"
- #define EVENT_SYS_INFO_TYPE_PASSWORD_SET "password_set"
- #define EVENT_SYS_INFO_TYPE_MENU_SET "menu_set"
- #define EVENT_SYS_INFO_TYPE_MENU_SET_R "menu_set_r"
- #define EVENT_SYS_INFO_TYPE_MENU_SET_W "menu_set_w"
- #define EVENT_SYS_INFO_TYPE_ON_OFF_SET "power_on_off"
- #define EVENT_SYS_INFO_TYPE_OTA_SET "ota_set"
- /**
- * define movie type
- */
- #define MOVIE_TYPE_MOVIE_ADVER "movie_adver"
- #define MOVIE_TYPE_MOVIE_GAME "movie_game"
- /**
- * define event type
- */
- #define EVENT_TYPE_QUERY "event_query"
- #define EVENT_TYPE_QUIT "event_quit"
- #define EVENT_TYPE_EPG "event_epg"
- #define EVENT_TYPE_SWITCH_CH "event_switchCh"
- #define EVENT_TYPE_SYS_RESET "factory_reset"
- #define EVENT_TYPE_PGM_LIST "pgm_list"
- #define EVENT_TYPE_SYS_INFO "sys_info"
- #define EVENT_TYPE_MAIL_MESSAGE "mail_message"
- #define EVENT_TYPE_MENU_PROMPT "event_prompt"
- #define EVENT_TYPE_NVOD "event_nvod"
- #define EVENT_TYPE_2_NVOD "nvod_2_movie"
- #define EVENT_TYPE_F_NVOD "nvod_F_movie"
- #define EVENT_TYPE_2_NVOD_S_F "nvod_2_movie_S_F"
- #define EVENT_TYPE_PLAY_NVOD "nvod_play"
- #define EVENT_TYPE_ORDER_NVOD "nvod_order"
- /**
- * define search type
- */
- #define EVENT_SEARCH_TYPE_MANUAL "manual"
- #define EVENT_SEARCH_TYPE_AUTO "auto"
- #define EVENT_SEARCH_TYPE_ALL "all"
- #define EVENT_SEARCH_TYPE_CHA_EDIT "channel_edit"
- #define EVENT_SEARCH_TYPE_PROGRESS "process"
- #define EVENT_SEARCH_TYPE_SIGNAL "signal"
- #define EVENT_SEARCH_TYPE_CLEAR_LIST "clear_list"
- #define EVENT_SEARCH_TYPE_RETURN_KEY "returnkey"
- /**
- * define EPG type
- */
- #define EVENT_EPG_TYPE_TV_EPG "tv_epg"
- #define EVENT_EPG_TYPE_RADIO_EPG "radio_epg"
- #define EVENT_EPG_TYPE_ADM_EPG_W "order_write"
- #define EVENT_EPG_TYPE_ADM_EPG_R "order_read"
- /**
- * define MAIL type
- */
- #define EVENT_MAIL_TYPE_LIST "mail_list"
- #define EVENT_MAIL_TYPE_READ "mail_read"
- #define EVENT_MAIL_TYPE_DELETE "mail_delete"
- /**
- * //about radio list and epg
- */
- #define MOVIE_MENU_R_CONNECTION "_radio_connection"
- #define MOVIE_MENU_R_FUNCTION "radio_receive"
- #define EVENT_TYPE_RADIO "event_radio"
- #define EVENT_TYPE_CH_NO "channel_no"
- //频道编辑事件宏
- #define EVENT_SEARCH_TYPE_CHA_EDIT_DEL "event_del"
- #define EVENT_SEARCH_TYPE_CHA_EDIT_Fav "event_favor"
- #define EVENT_SEARCH_TYPE_CHA_EDIT_MOVE "event_move"
- #define EVENT_SEARCH_TYPE_CHA_EDIT_LOCK "event_lock"
- #define EVENT_SEARCH_TYPE_CHA_EDIT_SAVE "event_save"
- #define EVENT_SEARCH_TYPE_CHA_EDIT_NONE "event_none"
- /***
- 新代码用到的宏
- ***/
- /****************************Local Connection 公用宏定义****************************/
- //Local Connection 名称2个,一个是常用,另一个为备用
- #define KB_DTV_LC_NAME "_local_connection" //默认本地连接名称
- #define KB_DTV_LC_NAME_BAK "_local_connection_bak" //备用本地连接名称
- //Local Connection 接收函数名称6 个,常用一个,其他备用
- #define KB_DTV_LC_FUNCTION "receive_fun" //默认本地连接的接收函数名称
- #define KB_DTV_LC_FUNCTION_1 "receive_1" //第二选择本地连接的接收函数名称
- #define KB_DTV_LC_FUNCTION_2 "receive_2" //第三选择本地连接的接收函数名称
- #define KB_DTV_LC_FUNCTION_3 "receive_3" //第四选择本地连接的接收函数名称
- #define KB_DTV_LC_FUNCTION_4 "receive_4" //第五选择本地连接的接收函数名称
- #define KB_DTV_LC_FUNCTION_5 "receive_5" //第六选择本地连接的接收函数名称
- //影片类型
- #define MOVIE_TYPE_MOVIE_MENU "movie_menu"
- #define MOVIE_TYPE_MOVIE_VOTE "movie_vote"
- #define MOVIE_TYPE_MOVIE_DBC "movie_dbc"
- #define MOVIE_TYPE_MOVIE_ADVER "movie_adver"
- /***
- 搜索
- ***/
- //影片名称
- #define MOVIE_NAME_MENU_SEARCH "menu_search"
- #define MOVIE_NAME_MENU_SEARCHALL "menu_searchAll"
- //搜索页面
- #define EVENT_TYPE_SEARCH "event_search"
- #define EVENT_SUB_TYPE_SEARCH_1 "search"
- #define EVENT_SUB_TYPE_SEARCH_2 "signalQuality"
- #define EVENT_SUB_TYPE_SEARCH_3 "progress"
- /***
- 投票
- ***/
- //影片名称
- #define MOVIE_NAME_MENU_VOTE "movie_vote"
- //投票页面
- #define EVENT_TYPE_VOTE "event_vote"
- #define EVENT_SUB_TYPE_VOTE_1 "event_voteInfo"
- #define EVENT_SUB_TYPE_VOTE_2 "event_vote2Server"
- #define EVENT_SUB_TYPE_VOTE_3 "event_voteQuery"
- /***
- 主菜单
- ***/
- //影片名称
- #define MOVIE_NAME_MENU_MAIN "menu_main"
- //主菜单页面
- #define EVENT_TYPE_MENU_SWITCH "menu_switch"
- /***
- 当前后续
- ***/
- //影片名称
- #define MOVIE_NAME_MENU_PF "menu_pf"
- //当前后续事件
- #define EVENT_TYPE_PF "event_pf"
- /***
- 系统设置
- ***/
- //影片名称
- #define MOVIE_NAME_SYS_INFO "sys_info.swf"
- #define MOVIE_NAME_SYS_INFO_HELP "sys_help.swf"
- //系统信息中的事件类型
- #define EVENT_SYS_INFO "event_sysInfo"
- /***
- 频道列表
- ***/
- //影片名称
- #define MOVIE_NAME_PGM_LIST "pgm_list.swf"
- /***
- 声音
- ***/
- #define MOVIE_NAME_SOUND "sound.swf"
- #define MOVIE_NAME_SOUND_MUTE "soundMute.swf"
- //声音事件
- #define EVENT_TYPE_MENU_SOUND "event_sound"
- #define EVENT_SOUND_SUBTYPE_1 "event_soundVolume"
- #define EVENT_SOUND_SUBTYPE_2 "event_soundMute"
- /***
- EPG影片
- ***/
- #define MOVIE_NAME_MENU_EPG "menu_epg"
- /***
- 帮助影片
- ***/
- #define MOVIE_NAME_MENU_HELP "menu_help"
- /***
- 数据广播
- ***/
- //天气预报
- //影片名称
- #define MOVIE_NAME_DBC_WEATHER "dbc_weather.swf"
- //天气预报影片的事件类型
- #define EVENT_TYPE_WEATHER "weatherForecast"
- #define EVENT_TYPE_WEATHER_INIT "0"
- #define EVENT_TYPE_WEATHER_CITY "1"
- //政府公告
- //影片名称
- #define MOVIE_NAME_DBC_GOV_BULLETIN "dbc_gov.swf"
- //政府公告影片的事件类型
- #define EVENT_TYPE_GOV "eventGov"
- #define EVENT_SUB_TYPE_GOV_CATALOG "eventGovCatalog"
- #define EVENT_SUB_TYPE_GOV_CONTENT "eventGovContent"
- //互动广告影片
- //影片名称
- #define MOVIE_NAME_AD1 "adv_alter_01.swf"
- #define MOVIE_NAME_AD2 "adv_alter_02.swf"
- /***
- 影片更新提示框
- ***/
- #define MOVIE_NAME_MENU_PROMPT "prompt.swf"
- #define EVENT_TYPE_MENU_PROMPT "event_prompt"
- /**
- * define mvie struction
-
- * movie < movie handle >
- * info < movie information >
- * valid < data valid flag >
-
- */
- typedef struct kb_movie_struct_s
- {
- mb_movie_t movie;
- kb_movie_info_t info;
- unsigned char *data;
- }kb_movie_struct_t;
- typedef struct kb_movie_data_s
- {
- unsigned char *data;
- unsigned long size;
- }kb_movie_data_t;
- typedef struct kb_movie_play_bak_s
- {
- BOOL flag;
- kb_movie_name name;
- }kb_movie_play_bak_t;
- /**
- * init machblue client used by keybridge.
- */
- extern void kb_machblue_client_init(void);
- /**
- * remoter event manager.
- * key < key pressed by remoter >
-
- * @return MB_SUCCESS, MB_FAILURE otherwise.
- */
- extern mb_error_t kb_machblue_key(rc_navKeyStroke_t key);
- /**
- * Get machblue client graphics context.
- * @return pointer of graphics context.
- */
- extern mb_gfx_ctx_t *kb_machblue_getGraphicsContext(void);
- /**
- * get current movie information.
- * @return None.
- */
- extern void kb_machblue_getCurMovieInfo(kb_movie_struct_t *current_movie);
- /**
- * init current movie data which will be played
- * movie_name < name of movie which will be initialised >
- *
- * @return MB_SUCCESS, MB_FAILURE otherwise.
- */
- /**
- * switch different menu movie
- * pAttribs < data of movie which will be switched >
- *
- * @return MB_SUCCESS, MB_FAILURE otherwise.
- */
- extern mb_error_t kb_machblue_switchMenuMovie(kb_lc_attributes_t *pAttribs);
- /**
- * movie manager which in ts stream
- * pInfo < information of movie which in ts stream >
-
- * @return TRUE, FALSE when failure.
- */
- extern bool kb_machblue_TSMovie2(KB_MovieInfoNode *pInfo);
-
- /**
- * get current movie status
- *
- * @return current movie status.
- */
- /**
- * set current movie status
- *
- * status < value to set as current movie status >
- *
- * @return MB_SUCCESS, MB_FAILURE otherwise.
- */
- /**
- * create movie by machblue lib
- * @return MB_SUCCESS, MB_FAILURE otherwise.
- */
- /**
- * attach movie by machblue lib
- * @return MB_SUCCESS, MB_FAILURE otherwise.
- */
- /**
- * activate movie by machblue lib
- * @return MB_SUCCESS, MB_FAILURE otherwise.
- */
- /**
- * suspend movie by machblue lib
- * @return MB_SUCCESS, MB_FAILURE otherwise.
- */
- /**
- * detach movie by machblue lib
- * @return MB_SUCCESS, MB_FAILURE otherwise.
- */
- /**
- * delete movie by machblue lib and reset movie information,clear screen
- * @return MB_SUCCESS, MB_FAILURE otherwise.
- */
- extern mb_error_t kb_machblue_movie_delete(BOOL Menu_Exit);
- extern void kb_movie_playStatusSet(unsigned char status);
- extern unsigned char kb_movie_playStatusGet(void);
- extern void kb_machblue_updatePlay(void);
- //for test
- extern void kb_machblue_create_schedule(unsigned long serviceID);
- //for test
- extern void kb_machblue_search_schedule(void);
- extern kb_movie_name kb_machblue_getMovieName(unsigned char *pName);
- extern kb_movie_struct_t *kb_machblue_getCurrentMovie(void);
- extern void kb_machblue_alterAdvPlay(unsigned char flag);
- //external func
- extern INT32 STB_StateSwitch(INT32 nApplet);
- extern INT32 KB_NVODGetEit(void);
- extern int mb_strcmp(mb_char_t *s0,mb_char_t *s1);
- extern void mb_surface_osd_clear(void);
- extern mb_error_t mb_surface_graphics_init(mb_gfx_ctx_t *p_gfx_ctx, void *client_data);
- extern void KB_MB_lc_2_movie_Post_Task(void);
- extern mb_error_t kb_machblue_movie_play(kb_movie_name movie_name);
- #ifdef __cplusplus
- }
- #endif
- #endif
- /* EOF... */