summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-06-23 01:28:28 +0200
committerwm4 <wm4@nowhere>2013-06-29 22:58:13 +0200
commitfc422f5aebbfe6dd2ea12b92fe9b13ba5fd65041 (patch)
treed6aa5720da791117d26feb56bd5bf89f55bfd122 /core
parent776e2893a23c9cd139c406e15c6ec56ebba48b01 (diff)
downloadmpv-fc422f5aebbfe6dd2ea12b92fe9b13ba5fd65041.tar.bz2
mpv-fc422f5aebbfe6dd2ea12b92fe9b13ba5fd65041.tar.xz
command: add commands to enable/disable input sections
For now, it's mostly for testing. It also might allow to create key binding state machines, but this sounds questionable.
Diffstat (limited to 'core')
-rw-r--r--core/command.c9
-rw-r--r--core/input/input.c7
-rw-r--r--core/input/input.h3
3 files changed, 19 insertions, 0 deletions
diff --git a/core/command.c b/core/command.c
index 9e77436a95..9c56b412fd 100644
--- a/core/command.c
+++ b/core/command.c
@@ -2412,6 +2412,15 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
mplayer_put_key(mpctx->key_fifo, cmd->args[0].v.i);
break;
+ case MP_CMD_ENABLE_INPUT_SECTION:
+ mp_input_enable_section(mpctx->input, cmd->args[0].v.s,
+ cmd->args[1].v.i == 1 ? MP_INPUT_EXCLUSIVE : 0);
+ break;
+
+ case MP_CMD_DISABLE_INPUT_SECTION:
+ mp_input_disable_section(mpctx->input, cmd->args[0].v.s);
+ break;
+
case MP_CMD_VO_CMDLINE:
if (mpctx->video_out) {
char *s = cmd->args[0].v.s;
diff --git a/core/input/input.c b/core/input/input.c
index b883974409..5b9a31866c 100644
--- a/core/input/input.c
+++ b/core/input/input.c
@@ -194,6 +194,13 @@ static const mp_cmd_t mp_cmds[] = {
.v.f = 1 },
}},
+ { MP_CMD_ENABLE_INPUT_SECTION, "enable_section", {
+ ARG_STRING,
+ OARG_CHOICE(0, ({"default", 0},
+ {"exclusive", 1})),
+ }},
+ { MP_CMD_DISABLE_INPUT_SECTION, "disable_section", { ARG_STRING } },
+
{ MP_CMD_AF_SWITCH, "af_switch", { ARG_STRING } },
{ MP_CMD_AF_ADD, "af_add", { ARG_STRING } },
{ MP_CMD_AF_DEL, "af_del", { ARG_STRING } },
diff --git a/core/input/input.h b/core/input/input.h
index 26b529bfb9..551ba80db6 100644
--- a/core/input/input.h
+++ b/core/input/input.h
@@ -67,6 +67,9 @@ enum mp_command_type {
MP_CMD_TV_START_SCAN,
MP_CMD_STOP,
+ MP_CMD_ENABLE_INPUT_SECTION,
+ MP_CMD_DISABLE_INPUT_SECTION,
+
/// DVB commands
MP_CMD_DVB_SET_CHANNEL = 5101,