summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-09-19 05:10:46 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-09-19 05:30:20 +0300
commita0854c197893e4e05090d223a88fbb7e180f3c83 (patch)
treecbc07916611126bbdb66c549de0eb0a30831ebca /command.c
parent606d6fa65be92a1a4207f9e8e985848159ee8ea8 (diff)
downloadmpv-a0854c197893e4e05090d223a88fbb7e180f3c83.tar.bz2
mpv-a0854c197893e4e05090d223a88fbb7e180f3c83.tar.xz
commands: Add set_property_osd and step_property_osd
Diffstat (limited to 'command.c')
-rw-r--r--command.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/command.c b/command.c
index 798492c47b..3b35ae5d80 100644
--- a/command.c
+++ b/command.c
@@ -2443,6 +2443,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
sh_audio_t * const sh_audio = mpctx->sh_audio;
sh_video_t * const sh_video = mpctx->sh_video;
int osd_duration = opts->osd_duration;
+ int case_fallthrough_hack = 0;
if (!set_property_command(mpctx, cmd))
switch (cmd->id) {
case MP_CMD_SEEK:{
@@ -2469,6 +2470,9 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
}
break;
+ case MP_CMD_SET_PROPERTY_OSD:
+ case_fallthrough_hack = 1;
+
case MP_CMD_SET_PROPERTY:{
int r = mp_property_do(cmd->args[0].v.s, M_PROPERTY_PARSE,
cmd->args[1].v.s, mpctx);
@@ -2479,9 +2483,14 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
mp_msg(MSGT_CPLAYER, MSGL_WARN,
"Failed to set property '%s' to '%s'.\n",
cmd->args[0].v.s, cmd->args[1].v.s);
+ else if (case_fallthrough_hack)
+ show_property_osd(mpctx, cmd->args[0].v.s);
}
break;
+ case MP_CMD_STEP_PROPERTY_OSD:
+ case_fallthrough_hack = 1;
+
case MP_CMD_STEP_PROPERTY:{
void* arg = NULL;
int r,i;
@@ -2520,6 +2529,8 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
mp_msg(MSGT_CPLAYER, MSGL_WARN,
"Failed to increment property '%s' by %f.\n",
cmd->args[0].v.s, cmd->args[1].v.f);
+ else if (case_fallthrough_hack)
+ show_property_osd(mpctx, cmd->args[0].v.s);
}
break;