From 9d03b83a6c26341b2dd7c5e1ffc4592219c79730 Mon Sep 17 00:00:00 2001 From: nanahi <130121847+na-na-hi@users.noreply.github.com> Date: Mon, 26 Feb 2024 18:19:16 -0500 Subject: command: add begin-vo-dragging command This command initializes a vo dragging request for VOs that implement the new VOCTRL_BEGIN_DRAGGING voctrl. This allows scripts to begin vo dragging for any button press event. --- player/command.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'player') diff --git a/player/command.c b/player/command.c index 2690fd4a27..e1de32be25 100644 --- a/player/command.c +++ b/player/command.c @@ -6502,6 +6502,16 @@ static void cmd_dump_cache_ab(void *p) cmd->args[0].v.s); } +static void cmd_begin_vo_dragging(void *p) +{ + struct mp_cmd_ctx *cmd = p; + struct MPContext *mpctx = cmd->mpctx; + struct vo *vo = mpctx->video_out; + + if (vo) + vo_control(vo, VOCTRL_BEGIN_DRAGGING, NULL); +} + /* This array defines all known commands. * The first field the command name used in libmpv and input.conf. * The second field is the handler function (see mp_cmd_def.handler and @@ -6970,6 +6980,8 @@ const struct mp_cmd_def mp_cmds[] = { { "ab-loop-align-cache", cmd_align_cache_ab }, + { "begin-vo-dragging", cmd_begin_vo_dragging }, + {0} }; -- cgit v1.2.3