changeset 30986:2186c040f9e0

Add osd_show_progression: Show progress bar and elapsed/total time. Patch by Hugo Chargois, hugo D chargois A free fr
author cehoyos
date Fri, 09 Apr 2010 19:20:52 +0000
parents 76e1dd50dccf
children e1483ae3d93c
files DOCS/man/de/mplayer.1 DOCS/man/en/mplayer.1 DOCS/man/fr/mplayer.1 DOCS/tech/slave.txt command.c etc/input.conf input/input.c input/input.h
diffstat 8 files changed, 25 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/de/mplayer.1	Wed Apr 07 19:36:23 2010 +0000
+++ b/DOCS/man/de/mplayer.1	Fri Apr 09 19:20:52 2010 +0000
@@ -297,6 +297,8 @@
 Beginne/beende die Aufnahme von Schnappschüssen.
 .IPs "I\ \ \ \ "
 Zeige den Dateinamen im OSD.
+.IPs "P\ \ \ \ "
+Zeige den Fortschrittsbalken, die abgelaufene Zeit und die Gesamtzeit im OSD.
 .IPs "! und @"
 Spult zum Anfang des vorigen/nächsten Kapitels.
 .IPs "D (nur bei \-vo xvmc, \-vf yadif, \-vf kerndeint)"
--- a/DOCS/man/en/mplayer.1	Wed Apr 07 19:36:23 2010 +0000
+++ b/DOCS/man/en/mplayer.1	Fri Apr 09 19:20:52 2010 +0000
@@ -286,6 +286,8 @@
 Start/stop taking screenshots.
 .IPs "I\ \ \ \ "
 Show filename on the OSD.
+.IPs "P\ \ \ \ "
+Show progression bar, elapsed time and total duration on the OSD.
 .IPs "! and @"
 Seek to the beginning of the previous/next chapter.
 .IPs "D (\-vo xvmc, \-vo vdpau, \-vf yadif, \-vf kerndeint only)"
--- a/DOCS/man/fr/mplayer.1	Wed Apr 07 19:36:23 2010 +0000
+++ b/DOCS/man/fr/mplayer.1	Fri Apr 09 19:20:52 2010 +0000
@@ -303,6 +303,8 @@
 Amorce/arrête la capture d'écran.
 .IPs "I\ \ \ \ "
 Affiche le nom de fichier dans l'OSD.
+.IPs "P\ \ \ \ "
+Affiche la barre d'avancement, le temps écoulé et la durée totale sur l'OSD.
 .IPs "! and @"
 Saute au début du chapitre précédent/suivant.
 .IPs "D (\-vo xvmc, \-vo vdpau, \-vf yadif et \-vf kerndeint uniquement)"
--- a/DOCS/tech/slave.txt	Wed Apr 07 19:36:23 2010 +0000
+++ b/DOCS/tech/slave.txt	Fri Apr 09 19:20:52 2010 +0000
@@ -201,6 +201,10 @@
 osd [level]
     Toggle OSD mode or set it to [level] when [level] >= 0.
 
+osd_show_progression
+    Show the progression bar, the elapsed time and the total duration of the
+    movie on the OSD.
+
 osd_show_property_text <string> [duration] [level]
     Show an expanded property string on the OSD, see -playing-msg for a
     description of the available expansions. If [duration] is >= 0 the text
--- a/command.c	Wed Apr 07 19:36:23 2010 +0000
+++ b/command.c	Fri Apr 09 19:20:52 2010 +0000
@@ -2763,6 +2763,17 @@
 	    brk_cmd = 1;
 	    break;
 
+	case MP_CMD_OSD_SHOW_PROGRESSION:{
+		int len = demuxer_get_time_length(mpctx->demuxer);
+		int pts = demuxer_get_current_time(mpctx->demuxer);
+		set_osd_bar(0, "Position", 0, 100, demuxer_get_percent_pos(mpctx->demuxer));
+		set_osd_msg(OSD_MSG_TEXT, 1, osd_duration,
+			    "%c %02d:%02d:%02d / %02d:%02d:%02d",
+			    mpctx->osd_function, pts/3600, (pts/60)%60, pts%60,
+			    len/3600, (len/60)%60, len%60);
+	    }
+	    break;
+
 #ifdef CONFIG_RADIO
 	case MP_CMD_RADIO_STEP_CHANNEL:
 	    if (mpctx->demuxer->stream->type == STREAMTYPE_RADIO) {
--- a/etc/input.conf	Wed Apr 07 19:36:23 2010 +0000
+++ b/etc/input.conf	Fri Apr 09 19:20:52 2010 +0000
@@ -41,6 +41,7 @@
 DEL alt_src_step -1
 o osd
 I osd_show_property_text "${filename}"     # display filename in osd
+P osd_show_progression
 z sub_delay -0.1        # subtract 100 ms delay from subs
 x sub_delay +0.1        # add
 9 volume -1
--- a/input/input.c	Wed Apr 07 19:36:23 2010 +0000
+++ b/input/input.c	Fri Apr 09 19:20:52 2010 +0000
@@ -94,6 +94,7 @@
   { MP_CMD_OSD, "osd",0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
   { MP_CMD_OSD_SHOW_TEXT, "osd_show_text", 1, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_INT,{-1}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   { MP_CMD_OSD_SHOW_PROPERTY_TEXT, "osd_show_property_text",1, { {MP_CMD_ARG_STRING, {0}}, {MP_CMD_ARG_INT,{-1}}, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
+  { MP_CMD_OSD_SHOW_PROGRESSION, "osd_show_progression", 0, { {-1,{0}} } },
   { MP_CMD_VOLUME, "volume", 1, { { MP_CMD_ARG_FLOAT,{0} }, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   { MP_CMD_BALANCE, "balance", 1, { { MP_CMD_ARG_FLOAT,{0} }, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   { MP_CMD_MIXER_USEMASTER, "use_master", 0, { {-1,{0}} } },
@@ -400,6 +401,7 @@
   { { KEY_DEL, 0 }, "alt_src_step -1" },
   { { 'o', 0 }, "osd" },
   { { 'I', 0 }, "osd_show_property_text \"${filename}\"" },
+  { { 'P', 0 }, "osd_show_progression" },
   { { 'z', 0 }, "sub_delay -0.1" },
   { { 'x', 0 }, "sub_delay +0.1" },
   { { 'g', 0 }, "sub_step -1" },
--- a/input/input.h	Wed Apr 07 19:36:23 2010 +0000
+++ b/input/input.h	Fri Apr 09 19:20:52 2010 +0000
@@ -94,6 +94,7 @@
   MP_CMD_SET_PROPERTY,
   MP_CMD_GET_PROPERTY,
   MP_CMD_OSD_SHOW_PROPERTY_TEXT,
+  MP_CMD_OSD_SHOW_PROGRESSION,
   MP_CMD_SEEK_CHAPTER,
   MP_CMD_FILE_FILTER,
   MP_CMD_GET_FILENAME,