mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-28 05:33:14 +00:00
options: add flag option type
This commit is contained in:
@@ -52,6 +52,7 @@ extern const m_option_type_t m_option_type_keyvalue_list;
|
||||
extern const m_option_type_t m_option_type_time;
|
||||
extern const m_option_type_t m_option_type_rel_time;
|
||||
extern const m_option_type_t m_option_type_choice;
|
||||
extern const m_option_type_t m_option_type_flags;
|
||||
extern const m_option_type_t m_option_type_msglevels;
|
||||
extern const m_option_type_t m_option_type_print_fn;
|
||||
extern const m_option_type_t m_option_type_subconfig;
|
||||
@@ -626,6 +627,9 @@ extern const char m_option_path_separator;
|
||||
#define OPT_CHOICE_(optname, varname, flags, choices, ...) \
|
||||
OPT_GENERAL(int, optname, varname, flags, M_CHOICES(choices), __VA_ARGS__)
|
||||
|
||||
#define OPT_FLAGS(...) \
|
||||
OPT_CHOICE_(__VA_ARGS__, .type = &m_option_type_flags)
|
||||
|
||||
// Union of choices and an int range. The choice values can be included in the
|
||||
// int range, or be completely separate - both works.
|
||||
#define OPT_CHOICE_OR_INT_(optname, varname, flags, minval, maxval, choices, ...) \
|
||||
|
||||
Reference in New Issue
Block a user