[MPlayer-dev-eng] Allow progress bar osd to be moved to bottom of window

ironyman13 at gmail.com ironyman13 at gmail.com
Wed Feb 22 00:57:28 CET 2012


This patch adds the option bottomprogbar which moves the progress bar
to the bottom of the window if enabled. Comments?


Index: cfg-mplayer.h
===================================================================
--- cfg-mplayer.h	(revision 34753)
+++ cfg-mplayer.h	(working copy)
@@ -351,6 +351,7 @@
      {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},

      {"vd", vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL},
+    {"bottomprogbar", &bottom_progbar, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
      {NULL, NULL, 0, 0, 0, 0, NULL}
  };

Index: sub/sub.c
===================================================================
--- sub/sub.c	(revision 34753)
+++ sub/sub.c	(working copy)
@@ -528,6 +528,7 @@

  int vo_osd_progbar_type=-1;
  int vo_osd_progbar_value=100;   // 0..256
+int bottom_progbar;

  // if we have n=256 bars then OSD progbar looks like below
  //
@@ -537,6 +538,7 @@
  //
  //  the above schema is rescalled to n=elems bars

+
  static inline void vo_update_text_progbar(mp_osd_obj_t *obj, int dxs, int dys)
  {

@@ -573,10 +575,16 @@
  	    delta = (x-delta > 0) ? delta : x;
  	    h=get_height(vo_osd_progbar_type,h);
  	}
+
+	int progbar_dy = 0;
+	if(bottom_progbar){
+	    progbar_dy = -y + vo_image_height-get_height(OSD_PB_START,h);
+	}
+
  	obj->bbox.x1=obj->x=x;
-	obj->bbox.y1=obj->y=y;
+	obj->bbox.y1=obj->y=y+progbar_dy;
  	obj->bbox.x2=x+width+delimw;
-	obj->bbox.y2=y+h; //vo_font->height;
+	obj->bbox.y2=y+h+progbar_dy; //vo_font->height;
  	obj->flags|=OSDFLAG_BBOX;
  	obj->params.progbar.elems=elems;
  	obj->bbox.x1-=delta; // space for an icon
Index: mplayer.h
===================================================================
--- mplayer.h	(revision 34753)
+++ mplayer.h	(working copy)
@@ -33,6 +33,7 @@
  extern int slave_mode;
  extern int player_idle_mode;
  extern int use_menu;
+extern int bottom_progbar;

  extern float  audio_delay;
  extern double start_pts;


More information about the MPlayer-dev-eng mailing list