Ejemplo n.º 1
0
static PRESULT win_zoom_callback(POBJECT_HEAD pObj, VEVENT event, UINT32 param1, UINT32 param2)
{
	PRESULT proc_result = PROC_PASS;
	VACTION unact;
    struct Rect tv_src_rect,tv_dest_rect;
	struct OSDRect osd_src_rect;     


	get_tv_osd_src(&tv_src_rect,&osd_src_rect);

	switch(event)
 	{
 	case EVN_PRE_OPEN:
        api_inc_wnd_count();
	    zoom_times = 0;
	    osd_center_pos.uX = TV_R_W/2;
	    osd_center_pos.uY = TV_R_H/2;		
		break;
	case EVN_POST_OPEN:
		break;
	case EVN_PRE_CLOSE:
		break;
	case EVN_POST_CLOSE:
        tv_src_rect.uStartX = TV_FULL_SRC_L;
        tv_src_rect.uStartY = TV_FULL_SRC_T;
        tv_src_rect.uWidth  = TV_FULL_SRC_W;
        tv_src_rect.uHeight = TV_FULL_SRC_H;

        tv_dest_rect.uStartX    = TV_FULL_DEST_L;//TV_DEST_L;
        tv_dest_rect.uStartY    = TV_FULL_DEST_T;//TV_DEST_T;
        tv_dest_rect.uWidth     = TV_FULL_DEST_W;//TV_DEST_W;
        tv_dest_rect.uHeight    = TV_FULL_DEST_H;//TV_DEST_H;
        vpo_zoom(g_vpo_dev,&tv_src_rect,&tv_dest_rect);
#ifdef DUAL_VIDEO_OUTPUT
		vpo_zoom(g_sd_vpo_dev,&tv_src_rect,&tv_dest_rect);
#endif		
        api_dec_wnd_count();		
		break;
	case EVN_PRE_DRAW:
		//win_zoom_draw_tv_zoom_rect();
		//proc_result = PROC_LOOP;
		break;
	case EVN_POST_DRAW:
		win_zoom_draw_tv_zoom_rect();
		break;
	case EVN_UNKNOWN_ACTION:
		unact = (VACTION)(param1>>16);		
		proc_result = win_zoom_proc(unact);
		break;
		
 	}

	return proc_result;		
}
Ejemplo n.º 2
0
void exit_zoom_win(void)
{
	 struct Rect tv_src_rect,tv_dest_rect;
	 struct OSDRect osd_src_rect;     

	 get_tv_osd_src(&tv_src_rect,&osd_src_rect);
        tv_src_rect.uStartX = TV_FULL_SRC_L;
        tv_src_rect.uStartY = TV_FULL_SRC_T;
        tv_src_rect.uWidth  = TV_FULL_SRC_W;
        tv_src_rect.uHeight = TV_FULL_SRC_H;

        tv_dest_rect.uStartX    = TV_FULL_DEST_L;//TV_DEST_L;
        tv_dest_rect.uStartY    = TV_FULL_DEST_T;//TV_DEST_T;
        tv_dest_rect.uWidth     = TV_FULL_DEST_W;//TV_DEST_W;
        tv_dest_rect.uHeight    = TV_FULL_DEST_H;//TV_DEST_H;
        vpo_zoom(g_vpo_dev,&tv_src_rect,&tv_dest_rect);
#ifdef DUAL_VIDEO_OUTPUT
		vpo_zoom(g_sd_vpo_dev,&tv_src_rect,&tv_dest_rect);
#endif	
        api_dec_wnd_count();
}
Ejemplo n.º 3
0
static PRESULT win_zoom_proc(VACTION act)
{
    PRESULT proc_result = PROC_LOOP;
    struct OSDRect osd_src_rect;     
    struct Rect tv_src_rect;
    int step;
    
    get_tv_osd_src(&tv_src_rect,&osd_src_rect);

    switch(act)
    {
    case VACT_MOVE_STEP:        
        zoom_times ++;
        zoom_times %= ZOOM_MAX_TIMES;
		if(zoom_times == 0)
		{
			proc_result = PROC_LEAVE;
		}
        break;
    case VACT_MOVE_LEFT:
        step = osd_src_rect.uLeft - TV_R_L;
        if(step>0)
        {
            if(step>MAX_STEP_PIXS)
                step = MAX_STEP_PIXS;
            osd_center_pos.uX -= step;
        }
        break;
    case VACT_MOVE_UP:
        step = osd_src_rect.uTop - TV_R_T;
        if(step>0)
        {
            if(step>MAX_STEP_PIXS)
                step = MAX_STEP_PIXS;
            osd_center_pos.uY -= step;
        }
            
        break;
    case VACT_MOVE_RIGHT:
        step = ( TV_R_L + TV_R_W ) - (osd_src_rect.uLeft + osd_src_rect.uWidth);
        if(step>0)
        {                
            if(step>MAX_STEP_PIXS)
                step = MAX_STEP_PIXS;
            osd_center_pos.uX += step;
        }
        break;
    case VACT_MOVE_DOWN:
        step = ( TV_R_T + TV_R_H ) - (osd_src_rect.uTop + osd_src_rect.uHeight);
        if(step>0)
        {
            if(step>MAX_STEP_PIXS)
                step = MAX_STEP_PIXS;
            osd_center_pos.uY += step;
        }
        break;
    } 

   	//win_zoom_draw_tv_zoom_rect();
   	OSD_DrawObject((POBJECT_HEAD)&g_win_zoom, C_DRAW_SIGN_EVN_FLG |C_UPDATE_ALL);

    return proc_result;
}
Ejemplo n.º 4
0
static void win_zoom_draw_tv_zoom_rect(void)
{
    struct Rect tv_src_rect,tv_dest_rect;
    char str[30];
    int n;
    POBJECT_HEAD obj;
    
    struct OSDRect osd_dest_rect,osd_src_rect;    
    VSCR vscr;
    CONTAINER* win;

    win = &g_win_zoom;

	obj = (POBJECT_HEAD)(&g_win_zoom);	
    //OSD_DrawObjectFrame(&obj->frame,ZOOM_WIN_SH_IDX);
    //OSD_DrawObject(obj, C_UPDATE_ALL);


    get_tv_osd_src(&tv_src_rect,&osd_src_rect);   


	sprintf(str,"ZOOM   X%02d",zoom_int_scales[zoom_times]);
    OSD_SetTextFieldContent(&win_zoom_title,STRING_ANSI,(UINT32)str);
    OSD_DrawObject( (POBJECT_HEAD)&win_zoom_title, C_UPDATE_ALL);

#if 1

    OSD_SetRect(&osd_dest_rect, TV_R_L, TV_R_T, TV_R_W, TV_R_H);
	OSD_DrawObjectFrame(&osd_dest_rect,ZOOM_BIGRECT_SH_IDX);
	 

    if(osd_src_rect.uLeft>TV_R_L)
        OSD_DrawObject((POBJECT_HEAD)&win_zoom_larrow, C_UPDATE_ALL);
	
    if(osd_src_rect.uTop>TV_R_T)
        OSD_DrawObject((POBJECT_HEAD)&win_zoom_tarrow, C_UPDATE_ALL);
	
    if( (osd_src_rect.uLeft + osd_src_rect.uWidth)< (TV_R_L + TV_R_W) )
        OSD_DrawObject((POBJECT_HEAD)&win_zoom_rarrow, C_UPDATE_ALL);
	
    if( (osd_src_rect.uTop + osd_src_rect.uHeight) < (TV_R_T + TV_R_H) )
        OSD_DrawObject((POBJECT_HEAD)&win_zoom_darrow, C_UPDATE_ALL);

	OSD_DrawObjectFrame(&osd_src_rect,ZOOM_SMALLRECT_SH_IDX);
	
    obj = (POBJECT_HEAD)&win_zoom_bmp;
    OSD_SetRect(&obj->frame, TV_R_L + osd_center_pos.uX - ZOOM_BMP_W/2 , TV_R_T + osd_center_pos.uY - ZOOM_BMP_H/2, ZOOM_BMP_W, ZOOM_BMP_H);
    OSD_DrawObject(obj, C_UPDATE_ALL);

    
    tv_dest_rect.uStartX    = TV_DEST_L;
    tv_dest_rect.uStartY    = TV_DEST_T;
    tv_dest_rect.uWidth     = TV_DEST_W;
    tv_dest_rect.uHeight    = TV_DEST_H;
    
#if 0
    if(zoom_times==0)
    {
        tv_dest_rect.uStartX = TV_FULL_DEST_L;
        tv_dest_rect.uStartY = TV_FULL_DEST_T;
        tv_dest_rect.uWidth  = TV_FULL_DEST_W;
        tv_dest_rect.uHeight = TV_FULL_DEST_H;
    }

    if(zoom_times==0)
        //OSD_SetRect(&tv_dest_rect, TV_FULL_DEST_L,TV_FULL_DEST_T, TV_FULL_DEST_W, TV_FULL_DEST_H);
    {
        tv_src_rect.uStartX = TV_FULL_SRC_L;
        tv_src_rect.uStartY = TV_FULL_SRC_T;
        tv_src_rect.uWidth  = TV_FULL_SRC_W;
        tv_src_rect.uHeight = TV_FULL_SRC_H;
    }
#endif

    if (tv_src_rect.uStartX % 16)
	{
		tv_src_rect.uStartX &= 0xfff0;
	}
	if (tv_src_rect.uWidth % 16)
	{
		tv_src_rect.uWidth += 15;
		tv_src_rect.uWidth &= 0xfff0;
	}
    
    vpo_zoom(g_vpo_dev,&tv_src_rect,&tv_dest_rect);
#ifdef DUAL_VIDEO_OUTPUT    
	vpo_zoom(g_sd_vpo_dev,&tv_src_rect,&tv_dest_rect);
#endif
#endif	
        
}