changeset 18222:8c35bd43135f

Add a new command: osd_show_property_text that show an expanded property string on the OSD. Based on a patch 'by someone named "veal" on irc' that showed the filename.
author albeu
date Sun, 23 Apr 2006 14:31:54 +0000
parents 8ea3b8660dd7
children cdf3cb516027
files DOCS/man/en/mplayer.1 DOCS/tech/slave.txt etc/input.conf input/input.c input/input.h mplayer.c
diffstat 6 files changed, 23 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/DOCS/man/en/mplayer.1	Sun Apr 23 12:53:29 2006 +0000
+++ b/DOCS/man/en/mplayer.1	Sun Apr 23 14:31:54 2006 +0000
@@ -307,6 +307,8 @@
 Set EDL mark.
 .IPs "s (\-vf screenshot only)"
 Take a screenshot.
+.IPs "I"
+Show filename on the OSD.
 .RE
 .PD 1
 .PP
--- a/DOCS/tech/slave.txt	Sun Apr 23 12:53:29 2006 +0000
+++ b/DOCS/tech/slave.txt	Sun Apr 23 14:31:54 2006 +0000
@@ -137,6 +137,12 @@
 osd [level]
     Toggle OSD mode or set it to [level] when [level] >= 0.
 
+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
+    is shown for [duration] ms. [level] set the minimum OSD level needed for
+    the message to be visible, default to 0 (always show).
+
 osd_show_text <string>
     Show <string> on the OSD.
 
--- a/etc/input.conf	Sun Apr 23 12:53:29 2006 +0000
+++ b/etc/input.conf	Sun Apr 23 14:31:54 2006 +0000
@@ -58,6 +58,8 @@
 w panscan -0.1
 e panscan +0.1
 
+I osd_show_property_text "${filename}"
+
 h tv_step_channel 1
 l tv_step_channel -1
 n tv_step_norm
--- a/input/input.c	Sun Apr 23 12:53:29 2006 +0000
+++ b/input/input.c	Sun Apr 23 14:31:54 2006 +0000
@@ -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_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_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_property_text \"${filename}\"" },
   { { 'z', 0 }, "sub_delay -0.1" },
   { { 'x', 0 }, "sub_delay +0.1" },
   { { 'g', 0 }, "sub_step -1" },
--- a/input/input.h	Sun Apr 23 12:53:29 2006 +0000
+++ b/input/input.h	Sun Apr 23 14:31:54 2006 +0000
@@ -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_PROPERTY_TEXT 70
 
 #define MP_CMD_GUI_EVENTS       5000
 #define MP_CMD_GUI_LOADFILE     5001
--- a/mplayer.c	Sun Apr 23 12:53:29 2006 +0000
+++ b/mplayer.c	Sun Apr 23 14:31:54 2006 +0000
@@ -4234,6 +4234,16 @@
     case MP_CMD_OSD_SHOW_TEXT :  {
       set_osd_msg(OSD_MSG_TEXT,1,osd_duration,"%-.63s",cmd->args[0].v.s);
     } break;
+    case MP_CMD_OSD_SHOW_PROPERTY_TEXT : {
+      char* txt = m_properties_expand_string(mp_properties,cmd->args[0].v.s);
+      /* if no argument supplied take default osd_duration, otherwise <arg> ms. */
+      if(txt) {
+        set_osd_msg(OSD_MSG_TEXT,cmd->args[2].v.i,
+                    (cmd->args[1].v.i < 0 ? osd_duration : cmd->args[1].v.i),
+                    "%-.63s",txt);
+        free(txt);
+      }
+    } break;
     case MP_CMD_LOADFILE : {
       play_tree_t* e = play_tree_new();
       play_tree_add_file(e,cmd->args[0].v.s);