fix help (ctrl+H) for camera projection setup, cmdline -D

git-svn-id: svn://code.dyne.org/veejay/trunk@972 eb8d1916-c9e9-0310-b8de-cf0c9472ead5
This commit is contained in:
Niels Elburg
2007-06-30 14:42:43 +00:00
parent 7f5f380cdb
commit 14bbebb50b
3 changed files with 59 additions and 10 deletions

View File

@@ -1469,7 +1469,9 @@ void vj_font_customize_osd( void *font,void *uc, int type, int vp, int wp )
default:
f->time = type;
if( f->add )
{
free(f->add );
}
f->add = NULL;
return;
break;
@@ -1477,7 +1479,9 @@ void vj_font_customize_osd( void *font,void *uc, int type, int vp, int wp )
if(f->add)
{
free(f->add);
}
f->add = strdup( buf );
f->time = type;
}

View File

@@ -2656,9 +2656,6 @@ static void vj_perform_render_osd( veejay_t *info, video_playback_setup *setting
frame->ssm = 1;
}
//@ Viewport is not enabled, do not set osd_extra
//
//
if( info->which_vp == 0 )
{
if( viewport_active( info->viewport ) == 1 )
@@ -2668,12 +2665,22 @@ static void vj_perform_render_osd( veejay_t *info, video_playback_setup *setting
}
else
{
info->uc->osd_extra = NULL;
if( info->which_vp == 1 )
{
info->uc->osd_extra = viewport_get_my_help( info->composite );
}
else
info->uc->osd_extra = NULL;
}
vj_font_customize_osd(info->osd, info, info->use_osd, info->use_vp,info->which_vp );
vj_font_render( info->osd, frame , settings->current_frame_num,info->uc->osd_extra );
if(info->which_vp )
{
if(info->uc->osd_extra) free(info->uc->osd_extra);
info->uc->osd_extra = NULL;
}
}
static void vj_perform_finish_chain( veejay_t *info )

View File

@@ -411,11 +411,11 @@ static void viewport_update_context_help(viewport_t *v)
if( v->user_ui )
{
sprintf(tmp, "Mouse Left = Select point\nMouse Left + SHIFT = Snap to grid\nMouse Right = %s\nMouse Middle = %s\nMouse Middle + SHIFT = Grid/Line Color\nMouse Wheel = Grid resolution (%dx%d)\nCTRL + h = Hide/Show this Help",
reverse_mode, render_mode , v->grid_size,v->grid_size);
sprintf(tmp, "Mouse Left: Find center of blob\nMouse Left + SHIFT: Set point\nMouse Left + ALTGr: Set projection quad\nMouse Right: %s\nMouse Middle: %s\nMouse Middle + SHIFT: Line Color\nMouse Wheel: Marker size\nMouse Wheel + ALTGr: Scale projection quad\nMouse Wheel + CTRL: Scale camera and projection quad\nCTRL + h:Hide/Show this Help",
reverse_mode, render_mode);
}
else
sprintf(tmp, "Mouse Right = %s\nMouse Middle = %s\nCTRL + h = Hide/Show this Help", reverse_mode, render_mode );
sprintf(tmp, "Mouse Right = %s\nMouse Middle = %s\nCTRL + h = Hide/Show this Help\nMouse Wheel + CTRL = Scale quads\nMouse Wheel + ALTGr = Scale projection area", reverse_mode, render_mode );
if(v->mode == 0 )
{
@@ -430,11 +430,11 @@ static void viewport_update_context_help(viewport_t *v)
else
{
if(v->user_ui )
sprintf(hlp, "Projection calibration\n%s\n(1) %.2fx%.2f Pos: %.2fx%.2f\n(2) %.2fx%.2f\n(3) %.2fx%.2f\n(4) %.2fx%.2f\n",
sprintf(hlp, "Interactive Camera/Projection setup\n%s\n(1) %.2fx%.2f Pos: %.2fx%.2f\n(2) %.2fx%.2f\n(3) %.2fx%.2f\n(4) %.2fx%.2f\n",
tmp,v->x1,v->y1, v->usermouse[0],v->usermouse[1],
v->x2,v->y2,v->x3,v->y3,v->x4,v->y4 );
else
sprintf(hlp, "Projection calibration\nPerspective Transform %s\n%s", reverse_mode, tmp );
sprintf(hlp, "Interactive Camera/Projection\nPerspective Transform %s\n%s", reverse_mode, tmp );
}
@@ -443,6 +443,44 @@ static void viewport_update_context_help(viewport_t *v)
v->help = strdup( hlp );
}
char *viewport_get_my_help(viewport_t *v)
{
char render_mode[32];
sprintf(render_mode, "%s", ( v->user_ui == 0 ? "Grid Mode" : "Render Mode" ) );
char reverse_mode[32];
sprintf(reverse_mode, "%s", ( v->user_reverse ? "Forward" : "Reverse" ) );
char tmp[1024];
char hlp[1024];
if( v->user_ui )
{
sprintf(tmp, "Mouse Left: Find center of blob\nMouse Left + SHIFT: Set point\nMouse Left + ALTGr: Set projection quad\nMouse Right: %s\nMouse Middle: %s\nMouse Middle + SHIFT: Line Color\nMouse Wheel: Marker size (%dx%d)\nMouse Wheel + ALTGr:Scale projection quad\nMouse Wheel + CTRL: Scale camera and projection quad\nCTRL + h:Hide/Show this Help",
reverse_mode, render_mode , v->marker_size,v->marker_size);
}
else
sprintf(tmp, "Mouse Right = %s\nMouse Middle = %s\nCTRL + h = Hide/Show this Help\nMouse Wheel + CTRL = Scale quads\nMouse Wheel + ALTGr = Scale projection area", reverse_mode, render_mode );
if(v->mode == 0 )
{
if( v->user_ui )
sprintf(hlp, "Viewport\nPerspective Transform\n%s\n",tmp );
else
sprintf(hlp, "Viewport\nPerspective Transform %s\n%s",
reverse_mode, tmp );
}
else
{
if(v->user_ui )
sprintf(hlp, "Interactive Camera/Projection setup\n%s",tmp );
else
sprintf(hlp, "Interactive Camera/Projection\nPerspective Transform %s\n%s", reverse_mode, tmp );
}
return strdup( hlp );
}
static matrix_t *viewport_matrix(void)
{
matrix_t *M = (matrix_t*) vj_malloc(sizeof(matrix_t));