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.


git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@18223 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
albeu 2006-04-23 14:31:54 +00:00
parent 84b19e7c4c
commit 116ca0c768
6 changed files with 23 additions and 0 deletions

View File

@ -307,6 +307,8 @@ Move subtitles up/down.
Set EDL mark.
.IPs "s (\-vf screenshot only)"
Take a screenshot.
.IPs "I"
Show filename on the OSD.
.RE
.PD 1
.PP

View File

@ -137,6 +137,12 @@ mute [value]
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.

View File

@ -58,6 +58,8 @@ T vo_ontop
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

View File

@ -66,6 +66,7 @@ static mp_cmd_t mp_cmds[] = {
{ 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 @@ static mp_cmd_bind_t def_cmd_binds[] = {
{ { 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" },

View File

@ -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

View File

@ -4234,6 +4234,16 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
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);