diff options
author | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-03-31 06:19:29 +0300 |
---|---|---|
committer | Uoti Urpala <uau@symbol.nonexistent.invalid> | 2008-04-23 13:41:05 +0300 |
commit | 9db0c118d3acee07880472e590dc0a25e5b51be6 (patch) | |
tree | f7b1664d28d5300bde7f863c8d32324a427112d2 /cfg-mplayer.h | |
parent | f894294bae1ff9b2c1802a5ae7e73cfdbc26e645 (diff) | |
download | mpv-9db0c118d3acee07880472e590dc0a25e5b51be6.tar.bz2 mpv-9db0c118d3acee07880472e590dc0a25e5b51be6.tar.xz |
Start of new option system
First part of option restructuring. The aim is to move option values
from a huge number of separate globals to a single non-global struct.
This part adds some support for parsing option values into such struct
instances, and moves one example option (fixed-vo) to the struct.
Diffstat (limited to 'cfg-mplayer.h')
-rw-r--r-- | cfg-mplayer.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cfg-mplayer.h b/cfg-mplayer.h index a8a6e25515..462e09f7f1 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -5,7 +5,10 @@ * config for cfgparser */ +#include <stddef.h> + #include "cfg-common.h" +#include "options.h" extern int key_fifo_size; extern unsigned doubleclick_time; @@ -84,6 +87,9 @@ const m_option_t tvscan_conf[]={ * by Folke */ +#define FLAG_ON(optname, varname, flags) {optname, NULL, CONF_TYPE_FLAG, flags, 0, 1, NULL, 1, offsetof(struct MPOpts, varname)} +#define FLAG_OFF(optname, varname, flags) {optname, NULL, CONF_TYPE_FLAG, flags, 1, 0, NULL, 1, offsetof(struct MPOpts, varname)} + const m_option_t mplayer_opts[]={ /* name, pointer, type, flags, min, max */ @@ -92,8 +98,8 @@ const m_option_t mplayer_opts[]={ CONF_TYPE_PRINT, CONF_NOCFG, 0, 0, NULL}, {"vo", &video_driver_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, {"ao", &audio_driver_list, CONF_TYPE_STRING_LIST, 0, 0, 0, NULL}, - {"fixed-vo", &fixed_vo, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL}, - {"nofixed-vo", &fixed_vo, CONF_TYPE_FLAG,CONF_GLOBAL, 1, 0, NULL}, + FLAG_ON("fixed-vo", fixed_vo, CONF_GLOBAL), + FLAG_OFF("nofixed-vo", fixed_vo, CONF_GLOBAL), {"ontop", &vo_ontop, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"noontop", &vo_ontop, CONF_TYPE_FLAG, 0, 1, 0, NULL}, {"rootwin", &vo_rootwin, CONF_TYPE_FLAG, 0, 0, 1, NULL}, |