mirror of https://github.com/mpv-player/mpv
changes according to proper subfont bar positioning and char spaceing - sub.c
changes to scale from 0.100 to 0..255 for proper OSD displaying - mplayer.c git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@1549 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
parent
4b0e21e356
commit
aad3a2ec86
19
libvo/sub.c
19
libvo/sub.c
|
@ -38,10 +38,15 @@ inline static void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x
|
|||
int y=(dys-vo_font->height)/2;
|
||||
int x;
|
||||
int c,font;
|
||||
int width=(dxs*2/3-vo_font->width[0x10]-vo_font->width[0x12]);
|
||||
int elems=width/vo_font->width[0x11];
|
||||
int charw=vo_font->width[OSD_PB_0]+vo_font->charspace;
|
||||
int delimw=vo_font->width[OSD_PB_START]
|
||||
+vo_font->width[OSD_PB_END]
|
||||
+vo_font->charspace;
|
||||
int width=(2*dxs-3*delimw)/3;
|
||||
int elems=width/charw;
|
||||
int mark=(vo_osd_progbar_value*(elems+1))>>8;
|
||||
x=(dxs-width)/2;
|
||||
x=(dxs-elems*charw-delimw)/2;
|
||||
|
||||
// printf("osd.progbar width=%d xpos=%d\n",width,x);
|
||||
|
||||
c=vo_osd_progbar_type;
|
||||
|
@ -61,7 +66,7 @@ inline static void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x
|
|||
vo_font->pic_b[font]->bmp+vo_font->start[c],
|
||||
vo_font->pic_a[font]->bmp+vo_font->start[c],
|
||||
vo_font->pic_a[font]->w);
|
||||
x+=vo_font->width[c];
|
||||
x+=vo_font->width[c]+vo_font->charspace;
|
||||
|
||||
c=OSD_PB_0;
|
||||
if ((font=vo_font->font[c])>=0)
|
||||
|
@ -72,7 +77,7 @@ inline static void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x
|
|||
vo_font->pic_b[font]->bmp+vo_font->start[c],
|
||||
vo_font->pic_a[font]->bmp+vo_font->start[c],
|
||||
vo_font->pic_a[font]->w);
|
||||
x+=vo_font->width[c];
|
||||
x+=charw;
|
||||
}
|
||||
|
||||
c=OSD_PB_1;
|
||||
|
@ -84,7 +89,7 @@ inline static void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x
|
|||
vo_font->pic_b[font]->bmp+vo_font->start[c],
|
||||
vo_font->pic_a[font]->bmp+vo_font->start[c],
|
||||
vo_font->pic_a[font]->w);
|
||||
x+=vo_font->width[c];
|
||||
x+=charw;
|
||||
}
|
||||
|
||||
c=OSD_PB_END;
|
||||
|
@ -95,7 +100,7 @@ inline static void vo_draw_text_progbar(int dxs,int dys,void (*draw_alpha)(int x
|
|||
vo_font->pic_b[font]->bmp+vo_font->start[c],
|
||||
vo_font->pic_a[font]->bmp+vo_font->start[c],
|
||||
vo_font->pic_a[font]->w);
|
||||
// x+=vo_font->width[c];
|
||||
// x+=vo_font->width[c]+vo_font->charspace;
|
||||
|
||||
|
||||
// vo_osd_progbar_value=(vo_osd_progbar_value+1)&0xFF;
|
||||
|
|
10
mplayer.c
10
mplayer.c
|
@ -1560,7 +1560,7 @@ _jump1:
|
|||
if(osd_level){
|
||||
osd_visible=sh_video->fps; // 1 sec
|
||||
vo_osd_progbar_type=OSD_VOLUME;
|
||||
vo_osd_progbar_value=(mixer_l+mixer_r)*5/4;
|
||||
vo_osd_progbar_value=(mixer_l+mixer_r)*255/200;
|
||||
//printf("volume: %d\n",vo_osd_progbar_value);
|
||||
}
|
||||
#endif
|
||||
|
@ -1583,7 +1583,7 @@ _jump1:
|
|||
if(osd_level){
|
||||
osd_visible=sh_video->fps; // 1 sec
|
||||
vo_osd_progbar_type=OSD_CONTRAST;
|
||||
vo_osd_progbar_value=(v_cont)*10/4;
|
||||
vo_osd_progbar_value=(v_cont)*255/100;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1602,7 +1602,7 @@ _jump1:
|
|||
if(osd_level){
|
||||
osd_visible=sh_video->fps; // 1 sec
|
||||
vo_osd_progbar_type=OSD_BRIGHTNESS;
|
||||
vo_osd_progbar_value=(v_bright)*10/4;
|
||||
vo_osd_progbar_value=(v_bright)*255/100;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1621,7 +1621,7 @@ _jump1:
|
|||
if(osd_level){
|
||||
osd_visible=sh_video->fps; // 1 sec
|
||||
vo_osd_progbar_type=OSD_HUE;
|
||||
vo_osd_progbar_value=(v_hue)*10/4;
|
||||
vo_osd_progbar_value=(v_hue)*255/100;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -1640,7 +1640,7 @@ _jump1:
|
|||
if(osd_level){
|
||||
osd_visible=sh_video->fps; // 1 sec
|
||||
vo_osd_progbar_type=OSD_SATURATION;
|
||||
vo_osd_progbar_value=(v_saturation)*10/4;
|
||||
vo_osd_progbar_value=(v_saturation)*255/100;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue