SIGNAL_HANDLER int youtube_play_keypress(const char* widgetname, void *usrdata)
{
	int ret = EVENT_TRANSFER_KEEPON;
	GUI_Event *event = NULL;
	GxMsgProperty_PlayerStop player_stop;
	
	event = (GUI_Event *)usrdata;
	switch(event->type)
	{
		case GUI_SERVICE_MSG:
			youtube_play_service(widgetname, usrdata);
			break;

		case GUI_MOUSEBUTTONDOWN:
			break;

		case GUI_KEYDOWN:
			switch(event->key.sym)
			{
				case STBK_EXIT:
					app_send_msg(GXMSG_PLAYER_STOP, PLAYER_FOR_IPTV);
					//app_player_close(PLAYER_FOR_IPTV);
					GUI_EndDialog("wnd_youtube_play");
					return EVENT_TRANSFER_STOP;
				case KEY_MUTE:
            		youtube_mute_exec();
            		youtube_mute_draw();
                    return EVENT_TRANSFER_STOP;
				case KEY_VOLUME_DOWN_1:
				case STBK_LEFT:
					event->key.sym = APPK_VOLDOWN;
					GUI_CreateDialog("win_volume");
					GUI_SendEvent("win_volume", event);
					return EVENT_TRANSFER_STOP;

				case KEY_VOLUME_UP_1:
				case STBK_RIGHT:
					event->key.sym = APPK_VOLUP;
					GUI_CreateDialog("win_volume");
					GUI_SendEvent("win_volume", event);
					return EVENT_TRANSFER_STOP;
				default:
					youtube_play_show_sliderbar(6000);
					break;
			}
			break;
		default:
			break;
	}

	return ret;
}
SIGNAL_HANDLER int win_gy_cas_ippv_buy_box_keypress(const char* widgetname, void *usrdata)
{
	GUI_Event *event = NULL;
	event = (GUI_Event *)usrdata;
	if(event == NULL)
	{
		return EVENT_TRANSFER_KEEPON;
	}
	if(event->type == GUI_KEYDOWN)
	{	
		switch(event->key.sym)
		{
			case KEY_UP:
			case KEY_DOWN:
			GUI_EndDialog("win_gy_cas_ippv_buy");		
			
			if(PROGRAM_TV_LIST_WIN == app_win_get_focus_video_window() ) 
			{
				GUI_SetFocusWidget("win_tv_prog_listview");
				GUI_SendEvent("win_tv_prog_listview", event);	
			}
			else if(WEEKLY_EPG_WIN == app_win_get_focus_video_window()) 
			{
				GUI_SetFocusWidget("win_epg_prog_list_listview");
				GUI_SendEvent("win_epg_prog_list_listview", event); 
			}
			else if(FAVORITE_LIST_WIN == app_win_get_focus_video_window()) 
			{
				GUI_SetFocusWidget("win_favorite_prog_listview");
				GUI_SendEvent("win_favorite_prog_listview", event); 
			}					
			else	if (FULL_SCREEN_WIN == app_win_get_focus_video_window())
			{
				if (TRUE == app_get_win_create_flag(PROGRAM_BAR_WIN))
				{
					/*
					* 信息条显示状态下,按键发送到信息条
					*/
					GUI_SendEvent("win_prog_bar", event);
				}
				else
				{
					GUI_SendEvent("win_full_screen", event);
				}
			}		
		}
	}
	return EVENT_TRANSFER_KEEPON;	
}
Example #3
0
/*++
功能:取消应急广播,切换回应急广播前用户观看的频道。
参数:无。
--*/
void DVTSTBCA_CancelUrgencyBroadcast( void )
{
#define KEY_RECALL          GUIK_BACKSPACE

	GUI_Event keyEvent = {0};
//	printf("------------CancelUrgencyBroadcast by application-------------\n");
	printf(" DVTSTBCA_CancelUrgencyBroadcast \n");  

	app_dvt_cas_api_set_lock_status(FALSE);
	GUI_SetProperty("full_screen_text_msg_5sec","state","hide");

	keyEvent.type = GUI_KEYDOWN;
	keyEvent.key.sym = KEY_RECALL;
	GUI_SendEvent(GUI_GetFocusWindow(),&keyEvent);	

	return;
}
Example #4
0
SIGNAL_HANDLER  int movie_subt_service(const char* widgetname, void *usrdata)
{
	GUI_Event *event = NULL;
	GxMessage * msg;
	event = (GUI_Event *)usrdata;
	GxMsgProperty_PlayerStatusReport* player_status = NULL;

	msg = (GxMessage*)event->msg.service_msg;
	switch(msg->msg_id)
	{
		case GXMSG_PLAYER_STATUS_REPORT:
			player_status = (GxMsgProperty_PlayerStatusReport*)GxBus_GetMsgPropertyPtr(msg,GxMsgProperty_PlayerStatusReport);
			if(PLAYER_STATUS_PLAY_END == player_status->status)
				GUI_EndDialog("win_movie_subt");
			break;
		default:
			break;
	}
	GUI_SendEvent(WIN_MOVIE_VIEW, event);
	
	return EVENT_TRANSFER_STOP;
}
Example #5
0
void event_to_pvr(uint8_t flag) //flag: 0 is rec; 1 is pvr;2 is stop;
{
	GUI_Event event = {0};

    event.type = GUI_KEYDOWN;
	 if(flag == 0)
	 {
		event.key.sym = KEY_RED;//rec
	 }
	 else if(flag == 1)
	 {
	 	event.key.sym = KEY_GREEN;//tms
	 }
	 else if(flag == 2)
	 {
	 	event.key.sym = KEY_YELLOW;//stop rec or tms
	 }
	GUI_EndDialog("win_program_info");
	GUI_CreateDialog("wnd_pvr_bar");
	GUI_SetProperty("wnd_pvr_bar", "draw_now", NULL);
	GUI_SendEvent("wnd_pvr_bar", &event);
}
static int _win_gba_disassembler_callback(SDL_Event * e)
{
    if(GBADisassemblerCreated == 0) return 1;

    int redraw = GUI_SendEvent(&gba_disassembler_window_gui,e);

    _cpu_t * cpu = GBA_CPUGet();
    int close_this = 0;

    if(GUI_InputWindowIsEnabled(&gui_iw_gba_disassembler) == 0)
    {
        if(e->type == SDL_MOUSEWHEEL)
        {
            if(  ((disassemble_mode == GBA_DISASM_CPU_AUTO) && (cpu->EXECUTION_MODE == EXEC_ARM))  ||
                        (disassemble_mode == GBA_DISASM_CPU_ARM)  ) //ARM
            {
                gba_disassembler_start_address -= e->wheel.y*3 * 4;
            }
            else //THUMB
            {
                gba_disassembler_start_address -= e->wheel.y*3 * 2;
            }
            redraw = 1;
        }
        else if( e->type == SDL_KEYDOWN)
        {
            switch( e->key.keysym.sym )
            {
                case SDLK_F7:
                    _win_gba_disassembler_step();
                    redraw = 1;
                    break;
                case SDLK_F8:
                    _win_gba_disassembler_goto();
                    redraw = 1;
                    break;

                case SDLK_DOWN:
                    if(  ((disassemble_mode == GBA_DISASM_CPU_AUTO) && (cpu->EXECUTION_MODE == EXEC_ARM))  ||
                        (disassemble_mode == GBA_DISASM_CPU_ARM)  ) //ARM
                    {
                        gba_disassembler_start_address += 4;
                    }
                    else //THUMB
                    {
                        gba_disassembler_start_address += 2;
                    }
                    redraw = 1;
                    break;

                case SDLK_UP:
                    if(  ((disassemble_mode == GBA_DISASM_CPU_AUTO) && (cpu->EXECUTION_MODE == EXEC_ARM))  ||
                        (disassemble_mode == GBA_DISASM_CPU_ARM)  ) //ARM
                    {
                        gba_disassembler_start_address -= 4;
                    }
                    else //THUMB
                    {
                        gba_disassembler_start_address -= 2;
                    }
                    redraw = 1;
                    break;
            }
        }
    }

    if(e->type == SDL_WINDOWEVENT)
    {
        if(e->window.event == SDL_WINDOWEVENT_FOCUS_GAINED)
        {
            redraw = 1;
        }
        else if(e->window.event == SDL_WINDOWEVENT_EXPOSED)
        {
            redraw = 1;
        }
        else if(e->window.event == SDL_WINDOWEVENT_CLOSE)
        {
            close_this = 1;
        }
    }
    else if( e->type == SDL_KEYDOWN)
    {
        if( e->key.keysym.sym == SDLK_ESCAPE )
        {
            if(GUI_InputWindowIsEnabled(&gui_iw_gba_disassembler))
                GUI_InputWindowClose(&gui_iw_gba_disassembler);
            else
                close_this = 1;
        }
    }

    if(close_this)
    {
        GBADisassemblerCreated = 0;
        if(GUI_InputWindowIsEnabled(&gui_iw_gba_disassembler))
            GUI_InputWindowClose(&gui_iw_gba_disassembler);
        WH_Close(WinIDGBADis);
        return 1;
    }

    if(redraw)
    {
        Win_GBADisassemblerUpdate();
        _win_gba_disassembler_render();
        return 1;
    }

    return 0;
}
Example #7
0
SIGNAL_HANDLER int pic_view_keypress(const char* widgetname, void *usrdata)
{
	GUI_Event *event = NULL;
	#if (RC_VERSION>=GOXCEED_v1_9_3_1)
	int box_sel;
	
	if(NULL == usrdata) return EVENT_TRANSFER_STOP;

	event = (GUI_Event *)usrdata;
	switch(find_virtualkey_ex(event->key.scancode,event->key.sym))
	{
/*		case VK_BOOK_TRIGGER:
			GUI_EndDialog("after win_full_screen");
			return EVENT_TRANSFER_STOP; */
		case APPK_BACK:
		case APPK_MENU:
			GUI_EndDialog(WIN_PIC_VIEW);
			return EVENT_TRANSFER_STOP;
			
		case APPK_VOLUP:
		case APPK_VOLDOWN:
                #if MINI_16_BITS_OSD_SUPPORT
  	         GUI_CreateDialog("win_volume");
               #else
			GUI_CreateDialog(WIN_VOLUME);
			GUI_SendEvent(WIN_VOLUME, event);
		#endif	
			return EVENT_TRANSFER_STOP;
			
		case APPK_OK:
			pic_box_show(NULL);
			return EVENT_TRANSFER_STOP;

		/*shortcut keys
*/
		case APPK_UP:
		case APPK_LEFT:
		case APPK_PREVIOUS:
			box_sel = PIC_BOX_BUTTON_PREVIOUS;
			GUI_SetProperty(BOX_PIC_CTROL, "select", &box_sel);
			pic_box_ctrol(PIC_BOX_BUTTON_PREVIOUS);
			return EVENT_TRANSFER_STOP;
		case APPK_PAUSE_PLAY:
			box_sel = PIC_BOX_BUTTON_PLAY_PAUSE;
			GUI_SetProperty(BOX_PIC_CTROL, "select", &box_sel);
			pic_box_ctrol(PIC_BOX_BUTTON_PLAY_PAUSE);
			return EVENT_TRANSFER_STOP;	
		case APPK_PAUSE:
			box_sel = PIC_BOX_BUTTON_PLAY_PAUSE;
			GUI_SetProperty(BOX_PIC_CTROL, "select", &box_sel);
			pic_box_ctrol(PIC_BOX_BUTTON_PAUSE);
			return EVENT_TRANSFER_STOP;	
		case APPK_PLAY:
			box_sel = PIC_BOX_BUTTON_PLAY_PAUSE;
			GUI_SetProperty(BOX_PIC_CTROL, "select", &box_sel);
			pic_box_ctrol(PIC_BOX_BUTTON_PLAY);
			return EVENT_TRANSFER_STOP;		
		case APPK_DOWN:
		case APPK_RIGHT:
		case APPK_NEXT:
			box_sel = PIC_BOX_BUTTON_NEXT;
			GUI_SetProperty(BOX_PIC_CTROL, "select", &box_sel);
			pic_box_ctrol(PIC_BOX_BUTTON_NEXT);
			return EVENT_TRANSFER_STOP;
		case APPK_STOP:
			event->key.sym = APPK_BACK;
			return EVENT_TRANSFER_KEEPON;
		/*case APPK_ROTATE:
			pic_box_ctrol(PIC_BOX_BUTTON_ROTATE);
			return EVENT_TRANSFER_STOP;	
		case APPK_ZOOM:
			pic_box_ctrol(PIC_BOX_BUTTON_ZOOM);
			return EVENT_TRANSFER_STOP;	*/
		case APPK_SET:
			pic_box_ctrol(PIC_BOX_BUTTON_SET);
			return EVENT_TRANSFER_STOP;	
					
		default:
			break;
	}
#else
	if(NULL == usrdata) return EVENT_TRANSFER_STOP;
	
	if(waitshow_Active==1)
		{
			return EVENT_TRANSFER_STOP;			
		}

	event = (GUI_Event *)usrdata;
	switch(find_virtualkey(event->key.sym))
	{
		case APPK_BACK:
		case APPK_MENU:
			GUI_EndDialog(WIN_PIC_VIEW);
			return EVENT_TRANSFER_STOP;
			
		case APPK_VOLUP:
		case APPK_VOLDOWN:
			GUI_CreateDialog(WIN_VOLUME);
			GUI_SendEvent(WIN_VOLUME, event);
			return EVENT_TRANSFER_STOP;
			
		case APPK_OK:
			pic_box_show(NULL);
			return EVENT_TRANSFER_STOP;

		/*shortcut keys
*/
		case APPK_UP:
		case APPK_LEFT:
		case APPK_PREVIOUS:
			pic_box_ctrol(PIC_BOX_BUTTON_PREVIOUS);
			return EVENT_TRANSFER_STOP;
		case APPK_PAUSE_PLAY:
			pic_box_ctrol(PIC_BOX_BUTTON_PLAY_PAUSE);
			return EVENT_TRANSFER_STOP;	
		case APPK_PAUSE:
			pic_box_ctrol(PIC_BOX_BUTTON_PAUSE);
			return EVENT_TRANSFER_STOP;	
		case APPK_PLAY:
			pic_box_ctrol(PIC_BOX_BUTTON_PLAY);
			return EVENT_TRANSFER_STOP;		
		case APPK_DOWN:
		case APPK_RIGHT:
		case APPK_NEXT:
			pic_box_ctrol(PIC_BOX_BUTTON_NEXT);
			return EVENT_TRANSFER_STOP;
		case APPK_STOP:
			event->key.sym = APPK_BACK;
			return EVENT_TRANSFER_KEEPON;
		/*case APPK_ROTATE:
			pic_box_ctrol(PIC_BOX_BUTTON_ROTATE);
			return EVENT_TRANSFER_STOP;	
		case APPK_ZOOM:
			pic_box_ctrol(PIC_BOX_BUTTON_ZOOM);
			return EVENT_TRANSFER_STOP;	*/
		case APPK_SET:
			pic_box_ctrol(PIC_BOX_BUTTON_SET);
			return EVENT_TRANSFER_STOP;	
					
		default:
			break;
	}

#endif
	
	return EVENT_TRANSFER_KEEPON;
}
SIGNAL_HANDLER  int win_gy_cas_ippv_buy_keypress(const char* widgetname, void *usrdata)
{
	GUI_Event *event = NULL;
	event = (GUI_Event *)usrdata;
	uint8_t newPassword1[6+1]={0};
	uint8_t newPasswordValue1[6+1]={0};
	uint8_t *value;
	popmsg_ret ret;
	u_int16_t ecmpid = 0x1fff;
	GYS32   rtn;
	uint32_t ratevalue;
	uint8_t i = 0;
	uint16_t  m_wPrice_tppvview=0;
	uint16_t  m_wPrice_tppvviewtapping=0;
	T_CA_IPPVPrice buyIPPVPrice = {0};

	 ecmpid = caippvbuy.wEcmPid;
	 
	if(event->type == GUI_KEYDOWN)
	{	
		switch(event->key.sym)
		{
			case KEY_EXIT:
				  GYCA_IPPVStopBuyDlg( FALSE,
                                        ecmpid,
                                        NULL,
                                        NULL );
				 GUI_EndDialog("win_gy_cas_ippv_buy");
				return EVENT_TRANSFER_STOP;	
			case KEY_RECALL:
				  GYCA_IPPVStopBuyDlg( FALSE,
                                        ecmpid,
                                        NULL,
                                        NULL );	
				 GUI_EndDialog("win_gy_cas_ippv_buy");
				 return EVENT_TRANSFER_STOP;	
			case KEY_OK:
				
				GUI_GetProperty("win_gy_cas_ippv_buy_purse_boxitem2_edit", "string", &value);
				memset(newPassword1, 0, 6+1);
				memcpy(newPassword1,(char*)value, 6);

				if(strlen((char*)newPassword1)!=6)
				{
					GUI_SetProperty("win_gy_cas_ippv_buy_purse_boxitem2_edit","clear",NULL);
					ret = app_popmsg(210,200,"Input new PIN",POPMSG_TYPE_OK);
					return EVENT_TRANSFER_STOP;	
				}

				rtn = GYCA_IPPVStopBuyDlg(TRUE,ecmpid,newPassword1, &buyIPPVPrice);
				
				switch(rtn)
				{
					case GYCA_OK:
						ret = app_popmsg(210,200,"购买成功",POPMSG_TYPE_OK);
						break;
					case GYCA_PIN_ERR:
						ret = app_popmsg(210,200,"密码错误",POPMSG_TYPE_OK);							
						break;
					case GYCA_ERR:
						ret = app_popmsg(210,200,"金额不足或卡出错",POPMSG_TYPE_OK);								
						break;
				}
				
				 GUI_EndDialog("win_gy_cas_ippv_buy");

				return EVENT_TRANSFER_STOP;	
			case KEY_UP:
			case KEY_DOWN:
				GUI_EndDialog("win_gy_cas_ippv_buy");		
				
				if(PROGRAM_TV_LIST_WIN == app_win_get_focus_video_window() ) 
				{
					GUI_SetFocusWidget("win_tv_prog_listview");
					GUI_SendEvent("win_tv_prog_listview", event);	
				}
				else if(WEEKLY_EPG_WIN == app_win_get_focus_video_window()) 
				{
					GUI_SetFocusWidget("win_epg_prog_list_listview");
					GUI_SendEvent("win_epg_prog_list_listview", event); 
				}
				else if(FAVORITE_LIST_WIN == app_win_get_focus_video_window()) 
				{
					GUI_SetFocusWidget("win_favorite_prog_listview");
					GUI_SendEvent("win_favorite_prog_listview", event); 
				}					
				else	if (FULL_SCREEN_WIN == app_win_get_focus_video_window())
				{
					if (TRUE == app_get_win_create_flag(PROGRAM_BAR_WIN))
					{
						/*
						* 信息条显示状态下,按键发送到信息条
						*/
						GUI_SendEvent("win_prog_bar", event);
					}
					else
					{
						GUI_SendEvent("win_full_screen", event);
					}
				}						
				return EVENT_TRANSFER_STOP; 	
			case KEY_POWER:
				return EVENT_TRANSFER_KEEPON;	
			default:
				return EVENT_TRANSFER_STOP;	
		}
	}
	
	return EVENT_TRANSFER_KEEPON;
}
/*
* 退出到指定界面后,响应对应的遥控器或创建指定的窗体
*/
void app_win_exist_to_win_widget(const char* widget_win_name)
{
	GUI_Event keyEvent = {0};
	int rtn = 1;
	if (TRUE == app_get_pop_msg_flag_status())
		return;

	if (NULL != widget_win_name)
	{
		char* focus_Window = (char*)GUI_GetFocusWindow();
		printf("%s %d app_win_exist_to_win_widget focus_Window=%s\n",__FILE__,__LINE__,focus_Window);
		if (NULL != focus_Window)
		{
			rtn = strcasecmp(widget_win_name, focus_Window);
			if (0 != rtn)
			{
				app_set_pop_msg_flag_status(TRUE);
			}
			else
			{
				app_set_pop_msg_flag_status(FALSE);
				return;
			}
			while(rtn != 0)
			{
				rtn = 1;
				focus_Window = (char*)GUI_GetFocusWindow();
				
				if (NULL != focus_Window)
				{
					printf("%s %d app_win_exist_to_win_widget widget_win_name=%s focus_Window=%s\n",__FILE__,__LINE__,widget_win_name,focus_Window);

					if ((0 == strcasecmp("win_full_screen" ,widget_win_name))&&
						((0 == strcasecmp("win_sys_set" ,focus_Window))||(0 == strcasecmp("win_media_centre" ,focus_Window)) || (0 == strcasecmp("win_main_menu" ,focus_Window))))
					{
						/*
						* 系统设置、网络多媒体退出时重新播放节目,直接关闭窗体
						* 避免退出到全屏前,播放上一节目
						*/
						GUI_EndDialog(focus_Window);
					}
					else if ((0 == strcasecmp("win_pic_view" ,focus_Window))
								||(0 == strcasecmp("win_music_view" ,focus_Window)) ||
								(0 == strcasecmp("win_epg_list", focus_Window)))
					{
						/*
						* 对于会引起死锁界面,直接GUI_EndDialog。
						*/
						GUI_EndDialog(focus_Window);												
					}
					else
					{
						rtn = strcasecmp(widget_win_name, focus_Window);
						if (0 != rtn)
						{
							keyEvent.type = GUI_KEYDOWN;
							keyEvent.key.sym = KEY_EXIT;	
							GUI_SendEvent(focus_Window,&keyEvent);
						}
					}
				}
//							GxCore_ThreadDelay(50);
				//GUI_LoopEvent();
			}
				app_set_pop_msg_flag_status(FALSE);
		}
	}

	printf("%s %d app_win_exist_to_win_widget end\n",__FILE__,__LINE__); 
	
	return ;
}
Example #10
0
//200ms 全屏定时器中轮训
int8_t app_book_query_play(void)
{
	uint32_t prog_id;
	int32_t ret_pop = FALSE; 
	int32_t ret; 
	int32_t pos;
	uint32_t i;
	uint8_t group_mode = 0;
	uint8_t stream_type =0;
	uint8_t fav_id = 0;
	//HotplugPartitionList* partition_list=NULL;
	GxBusPmDataProg  prog;
	GxBusPmViewInfo sysinfo;
	GxBookGet EpgBookGet;
	static uint8_t busy = 0;
	book_play book;
	book_play book1;

	int RetValue = 0;

	static uint8_t ubooking = 0;
	GxTime temp;

	if (1 == ubooking)
		{
			/*如果提示预约框状态,不响应新的预约*/
			return FALSE;
		}

	if (1 == app_play_get_popmsg_status())
	{
		return FALSE;
	}
	/* 为了在系统设置里面退出设置预约框后,判断事件是否过期*/
	if (0xffffffff != book_trigger_start.trigger_time_start)
	{
		memset(&temp, 0, sizeof(GxTime));
		GxCore_GetLocalTime(&temp);

		if (temp.seconds >= book_trigger_start.trigger_time_end)
		{
			app_book_delete(&book_trigger_start);
			book_trigger_start.trigger_time_start = 0xffffffff;

			printf("\n------------------->:BOOK:TIME OUT --TIME OUT--TIME OUT.\n");

			busy = 0;

			return FALSE;
		}
		/* 添加判断是否手动删除 #fy  43511 */
		extern int app_book_GetDelFlag(void);
		if (app_book_GetDelFlag())
		{
			if(-1 == app_book_check_exist(&EpgBookGet,BOOK_PROGRAM_PLAY|BOOK_TYPE_1,book_trigger_start.id))
			{
				busy = 0;
				book_trigger_start.trigger_time_start = 0xffffffff;
				return FALSE;
			}
		}
	}
    //执行预约任务
	if(book_trigger_start.trigger_time_start != 0xffffffff && busy == 0)
	{
		busy = 1;
		book_trigger_start.trigger_time_start = 0xffffffff;
		app_book_sync(&EpgBookGet,BOOK_PROGRAM_PLAY|BOOK_TYPE_1);
//		app_book_sync(&EpgBookGet,BOOK_PROGRAM_PLAY|BOOK_POWER_ON|BOOK_POWER_OFF|BOOK_TYPE_1);
		memcpy(&book1, book_trigger_start.struct_buf, sizeof(book_play));
		prog_id = book1.prog_id;
		
		GxBus_PmProgGetById(prog_id, &prog);
		ret = app_prog_find_by_id(prog_id,&pos,&group_mode,&stream_type,&fav_id);
		if(prog.skip_flag == 1)
		{
			ret = -1;
		}
		if(ret == -1)
		{
			/*节目类表中找不到预约的节目*/
			for(i=0;i<EpgBookGet.book_number;i++)
			{
				if(book_trigger_start.id == EpgBookGet.book[i].id)
				{
					app_book_delete(&EpgBookGet.book[i]);
				}
			}
			busy = 0;
			return FALSE;
		}
		if(book_trigger_start.book_type == BOOK_PROGRAM_PLAY)//预约播放
		{
			GxBusPmDataProg   prog = {0, };
			memcpy(&book, book_trigger_start.struct_buf, MAX_BOOK_STRUCT_LEN);
			RetValue = GxBus_PmProgGetById(book.prog_id, &prog);//根据节目号查找节目信息

			if(GXCORE_SUCCESS == RetValue)
			{
				ubooking = 1;	
				if (NULL != app_book_play_popmsg_callback)//确认是否播放
					{
						ret_pop = app_book_play_popmsg_callback(book,prog);
					}
				ubooking = 0;		
			}
			else
			{
				return FALSE;
			}
		}
		else  if(book_trigger_start.book_type == BOOK_TYPE_1) 
		{
			GxBusPmDataProg   prog = {0, };
			memcpy(&book, book_trigger_start.struct_buf, MAX_BOOK_STRUCT_LEN);
			RetValue = GxBus_PmProgGetById(book.prog_id, &prog);

			if(GXCORE_SUCCESS == RetValue)
			{
				ubooking = 1;	
				if (NULL != app_book_record_popmsg_callback)
					{
						ret_pop = app_book_record_popmsg_callback(book,prog);
					}
				ubooking = 0;		
			}
			else
			{
				return FALSE;
			}
		}
		else 
		{
			busy = 0;
			return FALSE;
		}
		

		if(ret_pop == TRUE)//确认播放
		{
			/* clear signal message */
			app_play_clear_msg_pop_type(MSG_POP_SIGNAL_BAD);

			for(i=0;i<EpgBookGet.book_number;i++)
			{
				if(book_trigger_start.id == EpgBookGet.book[i].id)
				{
					GxBus_PmViewInfoGet(&sysinfo);
					if(sysinfo.stream_type == GXBUS_PM_PROG_TV)
					{
						memcpy(&book1, EpgBookGet.book[i].struct_buf, sizeof(book_play));
						book1.prog_id_recall = sysinfo.tv_prog_cur;
						memcpy(EpgBookGet.book[i].struct_buf,&book1, sizeof(book_play));					
					}
					else
#if (1 == DVB_HD_LIST)
						if (sysinfo.stream_type == GXBUS_PM_PROG_HD_SERVICE)
							{
								memcpy(&book1, EpgBookGet.book[i].struct_buf, sizeof(book_play));
								book1.prog_id_recall = sysinfo.hd_prog_cur;
								memcpy(EpgBookGet.book[i].struct_buf,&book1, sizeof(book_play));					
							}
					else
#endif
					{
						memcpy(&book1, EpgBookGet.book[i].struct_buf, sizeof(book_play));
						book1.prog_id_recall = sysinfo.radio_prog_cur;
						memcpy(EpgBookGet.book[i].struct_buf,&book1, sizeof(book_play));						
					}
					app_book_modify(&EpgBookGet.book[i]);
				}
				else if(EpgBookGet.book[i].trigger_mode == BOOK_TRIG_ING)
				{
					app_book_delete(&EpgBookGet.book[i]);
				}
			}
/*			if(book_trigger_start.book_type == BOOK_TYPE_1) 
			{
				app_send_msg(GXMSG_PLAYER_RECORD, &pos);
			}*/
			app_play_switch_prog_clear_msg();

			/*
			* 切换到查找到对应节目的group_mode,stream_type,fav_id组
			*/
			if(prog.service_type == GXBUS_PM_PROG_NVOD)
			{
				app_nvod_set_full_screen_play_flag(TRUE);
				app_prog_change_group(group_mode, stream_type,fav_id);
				app_play_video_audio(pos);
				app_nvod_set_playing_pos(pos);

				if(book_trigger_start.book_type == BOOK_TYPE_1) 
				{
					GUI_Event event = {0};

					event.type = GUI_KEYDOWN;
					event.key.sym = APP_KEY_RED;
					GUI_SendEvent("win_full_screen", &event);				
				}
				busy = 0;
				return TRUE;
			}
			if(ret == 0)
			{
				/*当前节目类表中找到预约的节目*/
				app_prog_change_group(group_mode, stream_type,fav_id);
				app_prog_save_playing_pos_in_group(pos);
				app_play_reset_play_timer(0);

				if(book_trigger_start.book_type == BOOK_TYPE_1) 
				{
					GUI_Event event = {0};

					event.type = GUI_KEYDOWN;
					event.key.sym = APP_KEY_RED;
					GUI_SendEvent("win_full_screen", &event);
				}
				busy = 0;
				return TRUE;
			}
			else if(ret == 1)
			{
				/*由喜爱观看状态,切换到预约观看状态*/
				app_prog_change_group(group_mode, stream_type,fav_id);
				app_prog_save_playing_pos_in_group(pos);
				app_prog_record_playing_pos(pos);
				app_play_reset_play_timer(0);

				if(book_trigger_start.book_type == BOOK_TYPE_1) 
				{
					GUI_Event event = {0};

					event.type = GUI_KEYDOWN;
					event.key.sym = APP_KEY_RED;
					GUI_SendEvent("win_full_screen", &event);
				}
				busy = 0;
				return TRUE;

			}
			else if(ret == 2)
			{
				/*电视广播切换,播放预约观看节目*/
				app_prog_change_group(group_mode, stream_type,fav_id);
				app_prog_save_playing_pos_in_group(pos);
				app_prog_record_playing_pos(pos);
				app_play_reset_play_timer(0);

				if(book_trigger_start.book_type == BOOK_TYPE_1) 
				{
					GUI_Event event = {0};

					event.type = GUI_KEYDOWN;
					event.key.sym = APP_KEY_RED;
					GUI_SendEvent("win_full_screen", &event);
				}
				busy = 0;
				return TRUE;

			}	
			busy = 0;
			return FALSE;
			
		}
		else
		{
			for(i=0;i<EpgBookGet.book_number;i++)
			{
				if(EpgBookGet.book[i].trigger_mode == BOOK_TRIG_ING)
				{
					app_book_delete(&EpgBookGet.book[i]);
				}
			}	
			busy = 0;
			return FALSE;
		}
		busy = 0;
	}	
	else if(book_trigger_end.trigger_time_start != 0xffffffff && busy == 0)
	{
		busy = 1;
		book_trigger_end.trigger_time_start = 0xffffffff;

		memcpy(&book1, book_trigger_end.struct_buf, sizeof(book_play));
		prog_id = book1.prog_id_recall;		
		GxBus_PmProgGetById(prog_id, &prog);
		ret = app_prog_find_by_id(prog_id,&pos,&group_mode,&stream_type,&fav_id);
		if(ret == -1)
		{
			busy = 0;
			return FALSE;	
		}
		return FALSE;//zhuangzh note
	}
	busy = 0;
	return FALSE;
}
static int _win_gba_mem_viewer_callback(SDL_Event * e)
{
    if(GBAMemViewerCreated == 0) return 1;

    int redraw = GUI_SendEvent(&gba_memviewer_window_gui,e);

    int close_this = 0;

    if(GUI_InputWindowIsEnabled(&gui_iw_gba_memviewer) == 0)
    {
        if(e->type == SDL_MOUSEWHEEL)
        {
            gba_memviewer_start_address -= e->wheel.y*3 * GBA_MEMVIEWER_ADDRESS_JUMP_LINE;
            redraw = 1;
        }
        else if( e->type == SDL_KEYDOWN)
        {
            switch( e->key.keysym.sym )
            {
                case SDLK_F8:
                    _win_gba_mem_viewer_goto();
                    redraw = 1;
                    break;

                case SDLK_DOWN:
                    gba_memviewer_start_address += GBA_MEMVIEWER_ADDRESS_JUMP_LINE;
                    redraw = 1;
                    break;

                case SDLK_UP:
                    gba_memviewer_start_address -= GBA_MEMVIEWER_ADDRESS_JUMP_LINE;
                    redraw = 1;
                    break;
            }
        }
    }

    if(e->type == SDL_WINDOWEVENT)
    {
        if(e->window.event == SDL_WINDOWEVENT_FOCUS_GAINED)
        {
            redraw = 1;
        }
        else if(e->window.event == SDL_WINDOWEVENT_EXPOSED)
        {
            redraw = 1;
        }
        else if(e->window.event == SDL_WINDOWEVENT_CLOSE)
        {
            close_this = 1;
        }
    }
    else if( e->type == SDL_KEYDOWN)
    {
        if( e->key.keysym.sym == SDLK_ESCAPE )
        {
            if(GUI_InputWindowIsEnabled(&gui_iw_gba_memviewer))
                GUI_InputWindowClose(&gui_iw_gba_memviewer);
            else
                close_this = 1;
        }
    }

    if(close_this)
    {
        GBAMemViewerCreated = 0;
        if(GUI_InputWindowIsEnabled(&gui_iw_gba_memviewer))
            GUI_InputWindowClose(&gui_iw_gba_memviewer);
        WH_Close(WinIDGBAMemViewer);
        return 1;
    }

    if(redraw)
    {
        Win_GBAMemViewerUpdate();
        Win_GBAMemViewerRender();
        return 1;
    }

    return 0;
}