diff options
author | wm4 <wm4@nowhere> | 2013-11-28 19:04:16 +0100 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2013-11-28 19:04:16 +0100 |
commit | 5318a1bea1e477033cd355e19be366f0504222e9 (patch) | |
tree | 23d400653b1bed44eb4901d72f57accbf8d6e5da /mpvcore/input/input.h | |
parent | 5411fbdb2341433dfa3241034390c19c257ce57e (diff) | |
download | mpv-5318a1bea1e477033cd355e19be366f0504222e9.tar.bz2 mpv-5318a1bea1e477033cd355e19be366f0504222e9.tar.xz |
input: use separate type for command definitions
Introduce a mp_cmd_def struct to define commands, instead of using
mp_cmd for this. This way each command parameter can be a m_option,
instead of m_option plus some more stuff.
Define the ARG_ macros directly in terms of the OPT_ macros. Not sure if
this makes it easier to read (maybe not, even if it looks simpler), but
at least it makes it easier to add other option types.
Another idea was adding a name for each parameter (so you could have
named parameters), but not today.
Diffstat (limited to 'mpvcore/input/input.h')
-rw-r--r-- | mpvcore/input/input.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/mpvcore/input/input.h b/mpvcore/input/input.h index f55e151b7d..a7ddaa7db1 100644 --- a/mpvcore/input/input.h +++ b/mpvcore/input/input.h @@ -131,8 +131,7 @@ enum mp_input_section_flags { struct input_ctx; struct mp_cmd_arg { - struct m_option type; - bool optional; + const struct m_option *type; union { int i; float f; @@ -158,7 +157,7 @@ typedef struct mp_cmd { int mouse_x, mouse_y; struct mp_cmd *queue_next; double scale; // for scaling numeric arguments - bool allow_auto_repeat; // used in command specification + const struct mp_cmd_def *def; } mp_cmd_t; |