[MPlayer-cvslog] r31028 - in trunk: 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

cehoyos subversion at mplayerhq.hu
Fri Apr 9 21:20:52 CEST 2010


Author: cehoyos
Date: Fri Apr  9 21:20:52 2010
New Revision: 31028

Log:
Add osd_show_progression: Show progress bar and elapsed/total time.

Patch by Hugo Chargois, hugo D chargois A free fr

Modified:
   trunk/DOCS/tech/slave.txt
   trunk/command.c
   trunk/etc/input.conf
   trunk/input/input.c
   trunk/input/input.h

Changes in other areas also in this revision:
Modified:
   trunk/DOCS/man/de/mplayer.1
   trunk/DOCS/man/en/mplayer.1
   trunk/DOCS/man/fr/mplayer.1

Modified: trunk/DOCS/tech/slave.txt
==============================================================================
--- trunk/DOCS/tech/slave.txt	Wed Apr  7 21:36:23 2010	(r31027)
+++ trunk/DOCS/tech/slave.txt	Fri Apr  9 21:20:52 2010	(r31028)
@@ -201,6 +201,10 @@ mute [value]
 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

Modified: trunk/command.c
==============================================================================
--- trunk/command.c	Wed Apr  7 21:36:23 2010	(r31027)
+++ trunk/command.c	Fri Apr  9 21:20:52 2010	(r31028)
@@ -2763,6 +2763,17 @@ int run_command(MPContext * mpctx, mp_cm
 	    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) {

Modified: trunk/etc/input.conf
==============================================================================
--- trunk/etc/input.conf	Wed Apr  7 21:36:23 2010	(r31027)
+++ trunk/etc/input.conf	Fri Apr  9 21:20:52 2010	(r31028)
@@ -41,6 +41,7 @@ INS alt_src_step 1
 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

Modified: trunk/input/input.c
==============================================================================
--- trunk/input/input.c	Wed Apr  7 21:36:23 2010	(r31027)
+++ trunk/input/input.c	Fri Apr  9 21:20:52 2010	(r31028)
@@ -94,6 +94,7 @@ static const mp_cmd_t mp_cmds[] = {
   { 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 @@ static const mp_cmd_bind_t def_cmd_binds
   { { 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" },

Modified: trunk/input/input.h
==============================================================================
--- trunk/input/input.h	Wed Apr  7 21:36:23 2010	(r31027)
+++ trunk/input/input.h	Fri Apr  9 21:20:52 2010	(r31028)
@@ -94,6 +94,7 @@ typedef enum {
   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,


More information about the MPlayer-cvslog mailing list