[MPlayer-dev-eng] [PATCH] show filename in OSD

Alan Curry pacman at theworld.com
Fri Apr 21 00:32:32 CEST 2006


This patch, to display the filename of the movie being viewed when "I"
pressed, has been offered by someone named "veal" on irc.

I've tested it and I think it could be useful sometimes. Anyone else?

-------------- next part --------------
diff -bBur mplayer-1.0.20060415/DOCS/man/de/mplayer.1 mplayer-1.0.20060415a/DOCS/man/de/mplayer.1
--- mplayer-1.0.20060415/DOCS/man/de/mplayer.1	2006-04-15 00:32:08.000000000 +0200
+++ mplayer-1.0.20060415a/DOCS/man/de/mplayer.1	2006-04-20 23:47:43.000000000 +0200
@@ -315,6 +315,10 @@
 Bewegt die Untertitel nach oben/unten.
 .IPs i\ \ \ \ 
 Setze EDL-Markierung.
+.IPs "s (screenshot Filter muss geladen sein)"
+Speichert einen Schnappschuss.
+.IPs "I"
+Zeigt den Dateinamen in der OSD-Anzeige f?r kurze Zeit an.
 .RE
 .PD 1
 .PP
@@ -6414,7 +6418,7 @@
 abgelegt, NNNN entspricht hierbei der ersten verf?gbaren Nummer \- keine Datei
 wird ?berschrieben.
 Der Filter f?hrt zu keiner Mehrbelastung, solange er nicht benutzt wird und
-aktzeptiert beliebige Farbr?ume, es ist also ungef?hrlich ihn in die
+akzeptiert beliebige Farbr?ume, es ist also ungef?hrlich ihn in die
 Konfigurationsdatei mit aufzunehmen.
 .RE
 .
diff -bBur mplayer-1.0.20060415/DOCS/man/en/mplayer.1 mplayer-1.0.20060415a/DOCS/man/en/mplayer.1
--- mplayer-1.0.20060415/DOCS/man/en/mplayer.1	2006-04-15 00:32:08.000000000 +0200
+++ mplayer-1.0.20060415a/DOCS/man/en/mplayer.1	2006-04-20 23:54:15.000000000 +0200
@@ -307,6 +307,8 @@
 Set EDL mark.
 .IPs "s (screenshot filter must be loaded)"
 Take a screenshot.
+.IPs "I"
+Show filename on the OSD.
 .RE
 .PD 1
 .PP
diff -bBur mplayer-1.0.20060415/DOCS/tech/slave.txt mplayer-1.0.20060415a/DOCS/tech/slave.txt
--- mplayer-1.0.20060415/DOCS/tech/slave.txt	2006-04-11 02:39:55.000000000 +0200
+++ mplayer-1.0.20060415a/DOCS/tech/slave.txt	2006-04-20 23:49:39.000000000 +0200
@@ -140,6 +140,9 @@
 osd_show_text <string>
     Show <string> on the OSD.
 
+osd_show_filename [duration]
+    Shows the filename on the OSD for [duration] seconds.
+
 panscan <-1.0 - 1.0> | <0.0 - 1.0> <abs>
     Increase or decrease the pan-and-scan range by <value>, 1.0 is the maximum.
     Negative values decrease the pan-and-scan range.
diff -bBur mplayer-1.0.20060415/input/input.c mplayer-1.0.20060415a/input/input.c
--- mplayer-1.0.20060415/input/input.c	2006-04-11 02:40:43.000000000 +0200
+++ mplayer-1.0.20060415a/input/input.c	2006-04-20 23:14:15.000000000 +0200
@@ -66,6 +66,7 @@
   { MP_CMD_SUB_STEP, "sub_step",1,  { { MP_CMD_ARG_INT,{0} }, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   { 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}}, {-1,{0}} } },
+  { MP_CMD_OSD_SHOW_FILENAME, "osd_show_filename",0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
   { MP_CMD_VOLUME, "volume", 1, { { MP_CMD_ARG_FLOAT,{0} }, {MP_CMD_ARG_INT,{0}}, {-1,{0}} } },
   { MP_CMD_MIXER_USEMASTER, "use_master", 0, { {-1,{0}} } },
   { MP_CMD_MUTE, "mute", 0, { {MP_CMD_ARG_INT,{-1}}, {-1,{0}} } },
@@ -327,6 +328,7 @@
   { { KEY_DEL, 0 }, "alt_src_step -1" },
   { { 'o', 0 }, "osd" },
   { { 'O', 0 }, "osd" },
+  { { 'I', 0 }, "osd_show_filename" },
   { { 'z', 0 }, "sub_delay -0.1" },
   { { 'x', 0 }, "sub_delay +0.1" },
   { { 'g', 0 }, "sub_step -1" },
diff -bBur mplayer-1.0.20060415/input/input.h mplayer-1.0.20060415a/input/input.h
--- mplayer-1.0.20060415/input/input.h	2006-04-11 02:40:42.000000000 +0200
+++ mplayer-1.0.20060415a/input/input.h	2006-04-20 22:34:28.000000000 +0200
@@ -71,6 +71,7 @@
 #define MP_CMD_VO_BORDER 67
 #define MP_CMD_SET_PROPERTY 68
 #define MP_CMD_GET_PROPERTY 69
+#define MP_CMD_OSD_SHOW_FILENAME 70
 
 #define MP_CMD_GUI_EVENTS       5000
 #define MP_CMD_GUI_LOADFILE     5001
diff -bBur mplayer-1.0.20060415/mplayer.c mplayer-1.0.20060415a/mplayer.c
--- mplayer-1.0.20060415/mplayer.c	2006-04-15 00:32:07.000000000 +0200
+++ mplayer-1.0.20060415a/mplayer.c	2006-04-20 23:29:14.000000000 +0200
@@ -1062,6 +1062,7 @@
 #define OSD_MSG_OSD_STATUS              4
 #define OSD_MSG_BAR                     5
 #define OSD_MSG_PAUSE                   6
+#define OSD_MSG_FILENAME                7
 // Base id for the messages generated from the commmand to property bridge
 #define OSD_MSG_PROPERTY                0x100
 
@@ -4148,6 +4149,10 @@
 	log_sub();
 #endif
     } break;
+    case MP_CMD_OSD_SHOW_FILENAME : {
+        /* if no argument supplied take default osd_duration, otherwise <arg> seconds. */
+        set_osd_msg( OSD_MSG_FILENAME, 0, (-1==cmd->args[0].v.i ? osd_duration : (1000*cmd->args[0].v.i)), mp_basename(filename) );
+    } break;
     case MP_CMD_OSD :  {
 	int v = cmd->args[0].v.i;
 	int max = use_term_osd ? MAX_TERM_OSD_LEVEL : MAX_OSD_LEVEL;


More information about the MPlayer-dev-eng mailing list