diff options
-rw-r--r-- | DOCS/man/input.rst | 8 | ||||
-rw-r--r-- | input/cmd_list.c | 2 | ||||
-rw-r--r-- | input/cmd_list.h | 2 | ||||
-rw-r--r-- | player/command.c | 8 |
4 files changed, 20 insertions, 0 deletions
diff --git a/DOCS/man/input.rst b/DOCS/man/input.rst index 3588d66599..f127882bb3 100644 --- a/DOCS/man/input.rst +++ b/DOCS/man/input.rst @@ -691,6 +691,14 @@ Input Commands that are Possibly Subject to Change ``af-command "<label>" "<cmd>" "<args>"`` Same as ``vf-command``, but for audio filters. +``apply-profile "<name>"`` + Apply the contents of a named profile. This is like using ``profile=name`` + in a config file, except you can map it to a key binding to change it at + runtime. + + There is no such thing as "unapplying" a profile - applying a profile + merely sets all option values listed within the profile. + Undocumented commands: ``tv-last-channel`` (TV/DVB only), ``ao-reload`` (experimental/internal). diff --git a/input/cmd_list.c b/input/cmd_list.c index bc3c622075..f6db9cbba8 100644 --- a/input/cmd_list.c +++ b/input/cmd_list.c @@ -224,6 +224,8 @@ const struct mp_cmd_def mp_cmds[] = { {"reselect", 1})), }}, + { MP_CMD_APPLY_PROFILE, "apply-profile", {ARG_STRING } }, + {0} }; diff --git a/input/cmd_list.h b/input/cmd_list.h index e1018c38aa..e0fd8fa2de 100644 --- a/input/cmd_list.h +++ b/input/cmd_list.h @@ -114,6 +114,8 @@ enum mp_command_type { MP_CMD_RESCAN_EXTERNAL_FILES, + MP_CMD_APPLY_PROFILE, + // Internal MP_CMD_COMMAND_LIST, // list of sub-commands in args[0].v.p }; diff --git a/player/command.c b/player/command.c index d791838ef8..f275fcc489 100644 --- a/player/command.c +++ b/player/command.c @@ -5514,6 +5514,14 @@ int run_command(struct MPContext *mpctx, struct mp_cmd *cmd, struct mpv_node *re break; } + case MP_CMD_APPLY_PROFILE: { + char *profile = cmd->args[0].v.s; + int flags = mpctx->initialized ? M_SETOPT_RUNTIME : 0; + if (m_config_set_profile(mpctx->mconfig, profile, flags) < 0) + return -1; + break; + } + default: MP_VERBOSE(mpctx, "Received unknown cmd %s\n", cmd->name); return -1; |