changeset 1548:eee7951a23af

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
author atlka
date Thu, 16 Aug 2001 09:25:32 +0000
parents 4b0046db8e64
children 787c053b314c
files libvo/sub.c mplayer.c
diffstat 2 files changed, 17 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/sub.c	Thu Aug 16 01:04:28 2001 +0000
+++ b/libvo/sub.c	Thu Aug 16 09:25:32 2001 +0000
@@ -38,10 +38,15 @@
         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 @@
               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 @@
 			  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 @@
 			  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 @@
               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;
--- a/mplayer.c	Thu Aug 16 01:04:28 2001 +0000
+++ b/mplayer.c	Thu Aug 16 09:25:32 2001 +0000
@@ -1560,7 +1560,7 @@
         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 @@
     		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 @@
     		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 @@
     		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 @@
     		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
 	}