mirror of https://github.com/mpv-player/mpv
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:
parent
84b19e7c4c
commit
116ca0c768
|
@ -307,6 +307,8 @@ Move subtitles up/down.
|
||||||
Set EDL mark.
|
Set EDL mark.
|
||||||
.IPs "s (\-vf screenshot only)"
|
.IPs "s (\-vf screenshot only)"
|
||||||
Take a screenshot.
|
Take a screenshot.
|
||||||
|
.IPs "I"
|
||||||
|
Show filename on the OSD.
|
||||||
.RE
|
.RE
|
||||||
.PD 1
|
.PD 1
|
||||||
.PP
|
.PP
|
||||||
|
|
|
@ -137,6 +137,12 @@ mute [value]
|
||||||
osd [level]
|
osd [level]
|
||||||
Toggle OSD mode or set it to [level] when [level] >= 0.
|
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>
|
osd_show_text <string>
|
||||||
Show <string> on the OSD.
|
Show <string> on the OSD.
|
||||||
|
|
||||||
|
|
|
@ -58,6 +58,8 @@ T vo_ontop
|
||||||
w panscan -0.1
|
w panscan -0.1
|
||||||
e panscan +0.1
|
e panscan +0.1
|
||||||
|
|
||||||
|
I osd_show_property_text "${filename}"
|
||||||
|
|
||||||
h tv_step_channel 1
|
h tv_step_channel 1
|
||||||
l tv_step_channel -1
|
l tv_step_channel -1
|
||||||
n tv_step_norm
|
n tv_step_norm
|
||||||
|
|
|
@ -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_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, "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_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_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_MIXER_USEMASTER, "use_master", 0, { {-1,{0}} } },
|
||||||
{ MP_CMD_MUTE, "mute", 0, { {MP_CMD_ARG_INT,{-1}}, {-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" },
|
{ { KEY_DEL, 0 }, "alt_src_step -1" },
|
||||||
{ { 'o', 0 }, "osd" },
|
{ { 'o', 0 }, "osd" },
|
||||||
{ { 'O', 0 }, "osd" },
|
{ { 'O', 0 }, "osd" },
|
||||||
|
{ { 'I', 0 }, "osd_show_property_text \"${filename}\"" },
|
||||||
{ { 'z', 0 }, "sub_delay -0.1" },
|
{ { 'z', 0 }, "sub_delay -0.1" },
|
||||||
{ { 'x', 0 }, "sub_delay +0.1" },
|
{ { 'x', 0 }, "sub_delay +0.1" },
|
||||||
{ { 'g', 0 }, "sub_step -1" },
|
{ { 'g', 0 }, "sub_step -1" },
|
||||||
|
|
|
@ -71,6 +71,7 @@
|
||||||
#define MP_CMD_VO_BORDER 67
|
#define MP_CMD_VO_BORDER 67
|
||||||
#define MP_CMD_SET_PROPERTY 68
|
#define MP_CMD_SET_PROPERTY 68
|
||||||
#define MP_CMD_GET_PROPERTY 69
|
#define MP_CMD_GET_PROPERTY 69
|
||||||
|
#define MP_CMD_OSD_SHOW_PROPERTY_TEXT 70
|
||||||
|
|
||||||
#define MP_CMD_GUI_EVENTS 5000
|
#define MP_CMD_GUI_EVENTS 5000
|
||||||
#define MP_CMD_GUI_LOADFILE 5001
|
#define MP_CMD_GUI_LOADFILE 5001
|
||||||
|
|
10
mplayer.c
10
mplayer.c
|
@ -4234,6 +4234,16 @@ if (stream->type==STREAMTYPE_DVDNAV && dvd_nav_still)
|
||||||
case MP_CMD_OSD_SHOW_TEXT : {
|
case MP_CMD_OSD_SHOW_TEXT : {
|
||||||
set_osd_msg(OSD_MSG_TEXT,1,osd_duration,"%-.63s",cmd->args[0].v.s);
|
set_osd_msg(OSD_MSG_TEXT,1,osd_duration,"%-.63s",cmd->args[0].v.s);
|
||||||
} break;
|
} 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 : {
|
case MP_CMD_LOADFILE : {
|
||||||
play_tree_t* e = play_tree_new();
|
play_tree_t* e = play_tree_new();
|
||||||
play_tree_add_file(e,cmd->args[0].v.s);
|
play_tree_add_file(e,cmd->args[0].v.s);
|
||||||
|
|
Loading…
Reference in New Issue