From a749c614375107a09e5877f6bb654133c7947672 Mon Sep 17 00:00:00 2001 From: wm4 Date: Sat, 15 Sep 2012 02:04:57 +0200 Subject: commands: rename osd_show_[property_]text and osd_show_progression osd_show_[property_]text => show_text osd_show_progression => show_progress show_text, osd_show_property_text and osd_show_text both map to the code for the previous osd_show_property_text. The only special thing about osd_show_text is that you don't need to escape "$". Also, unfortunately osd_show_property_text requires escaping things twice, one time for the command parser, and the other time for the property formatting code, while osd_show_text needed only one level of escaping. --- command.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'command.c') diff --git a/command.c b/command.c index 961a74ee7c..9ee184ed04 100644 --- a/command.c +++ b/command.c @@ -2313,22 +2313,14 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) break; } - case MP_CMD_OSD_SHOW_TEXT: - set_osd_msg(mpctx, OSD_MSG_TEXT, cmd->args[2].v.i, - (cmd->args[1].v.i < - 0 ? osd_duration : cmd->args[1].v.i), - "%s", cmd->args[0].v.s); - break; - - case MP_CMD_OSD_SHOW_PROPERTY_TEXT: { + case MP_CMD_SHOW_TEXT: { char *txt = m_properties_expand_string(mp_properties, cmd->args[0].v.s, mpctx); // if no argument supplied use default osd_duration, else ms. if (txt) { set_osd_msg(mpctx, OSD_MSG_TEXT, cmd->args[2].v.i, - (cmd->args[1].v.i < - 0 ? osd_duration : cmd->args[1].v.i), + (cmd->args[1].v.i < 0 ? osd_duration : cmd->args[1].v.i), "%s", txt); free(txt); } @@ -2392,7 +2384,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd) mpctx->stop_play = PT_STOP; break; - case MP_CMD_OSD_SHOW_PROGRESSION: + case MP_CMD_SHOW_PROGRESS: mp_show_osd_progression(mpctx); break; -- cgit v1.2.3