diff options
Diffstat (limited to 'cfg-mplayer.h')
-rw-r--r-- | cfg-mplayer.h | 108 |
1 files changed, 49 insertions, 59 deletions
diff --git a/cfg-mplayer.h b/cfg-mplayer.h index 1cb5b5ff59..136296576d 100644 --- a/cfg-mplayer.h +++ b/cfg-mplayer.h @@ -23,12 +23,11 @@ * config for cfgparser */ +#include <stddef.h> + #include "cfg-common.h" -#include "libmpcodecs/vd.h" #include "libvo/vo_zr.h" - -extern int key_fifo_size; -extern unsigned doubleclick_time; +#include "options.h" extern char *fb_mode_cfgfile; extern char *fb_mode_name; @@ -36,7 +35,6 @@ extern char *dfb_params; extern char *lirc_configfile; -extern float vo_panscanrange; /* only used at startup (setting these values from configfile) */ extern char *vo_geometry; @@ -57,14 +55,6 @@ extern char *unrar_executable; extern const m_option_t dxr2_opts[]; -extern char * skinName; -extern int guiWinID; - - -/* from libvo/aspect.c */ -extern float force_monitor_aspect; -extern float monitor_pixel_aspect; - extern int sws_flags; extern char* pp_help; @@ -100,12 +90,12 @@ const m_option_t mplayer_opts[]={ //---------------------- libao/libvo options ------------------------ {"o", "Option -o has been renamed to -vo (video-out), use -vo.\n", 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}, - {"ontop", &vo_ontop, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noontop", &vo_ontop, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + OPT_STRINGLIST("vo", video_driver_list, 0), + OPT_STRINGLIST("ao", audio_driver_list, 0), + OPT_FLAG_ON("fixed-vo", fixed_vo, CONF_GLOBAL), + OPT_FLAG_OFF("nofixed-vo", fixed_vo, CONF_GLOBAL), + OPT_FLAG_ON("ontop", vo_ontop, 0), + OPT_FLAG_OFF("noontop", vo_ontop, 0), {"rootwin", &vo_rootwin, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"border", &vo_border, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"noborder", &vo_border, CONF_TYPE_FLAG, 0, 1, 0, NULL}, @@ -129,9 +119,9 @@ const m_option_t mplayer_opts[]={ {"nowaveheader", "-nowaveheader has been removed. Use -ao pcm:nowaveheader instead.\n", CONF_TYPE_PRINT, 0, 1, 0, NULL}, {"alsa", "-alsa has been removed. Remove it from your config file.\n", - CONF_TYPE_PRINT, 0, 0, 0, NULL}, + CONF_TYPE_PRINT, 0, 0, 0, NULL}, {"noalsa", "-noalsa has been removed. Remove it from your config file.\n", - CONF_TYPE_PRINT, 0, 0, 0, NULL}, + CONF_TYPE_PRINT, 0, 0, 0, NULL}, {"edlout", &edl_output_filename, CONF_TYPE_STRING, 0, 0, 0, NULL}, #ifdef CONFIG_X11 @@ -173,30 +163,32 @@ const m_option_t mplayer_opts[]={ #endif // force window width/height or resolution (with -vm) - {"x", &opt_screen_size_x, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL}, - {"y", &opt_screen_size_y, CONF_TYPE_INT, CONF_RANGE, 0, 4096, NULL}, + OPT_INTRANGE("x", screen_size_x, 0, 0, 4096), + OPT_INTRANGE("y", screen_size_y, 0, 0, 4096), // set screen dimensions (when not detectable or virtual!=visible) - {"screenw", &vo_screenwidth, CONF_TYPE_INT, CONF_RANGE|CONF_OLD, 0, 4096, NULL}, - {"screenh", &vo_screenheight, CONF_TYPE_INT, CONF_RANGE|CONF_OLD, 0, 4096, NULL}, + OPT_INTRANGE("screenw", vo_screenwidth, CONF_OLD, 0, 4096), + OPT_INTRANGE("screenh", vo_screenheight, CONF_OLD, 0, 4096), // Geometry string {"geometry", &vo_geometry, CONF_TYPE_STRING, 0, 0, 0, NULL}, + OPT_FLAG_ON("force-window-position", force_window_position, 0), + OPT_FLAG_OFF("noforce-window-position", force_window_position, 0), // vo name (X classname) and window title strings {"name", &vo_winname, CONF_TYPE_STRING, 0, 0, 0, NULL}, {"title", &vo_wintitle, CONF_TYPE_STRING, 0, 0, 0, NULL}, // set aspect ratio of monitor - useful for 16:9 TV-out - {"monitoraspect", &force_monitor_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.0, 9.0, NULL}, - {"monitorpixelaspect", &monitor_pixel_aspect, CONF_TYPE_FLOAT, CONF_RANGE, 0.2, 9.0, NULL}, + OPT_FLOATRANGE("monitoraspect", force_monitor_aspect, 0, 0.0, 9.0), + OPT_FLOATRANGE("monitorpixelaspect", monitor_pixel_aspect, 0, 0.2, 9.0), // video mode switching: (x11,xv,dga) - {"vm", &vidmode, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"novm", &vidmode, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + OPT_FLAG_ON("vm", vidmode, 0), + OPT_FLAG_OFF("novm", vidmode, 0), // start in fullscreen mode: - {"fs", &fullscreen, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nofs", &fullscreen, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + OPT_FLAG_ON("fs", fullscreen, 0), + OPT_FLAG_OFF("nofs", fullscreen, 0), // set fullscreen switch method (workaround for buggy WMs) {"fsmode", "-fsmode is obsolete, avoid it and use -fstype instead.\nIf you really want it, try -fsmode-dontuse, but don't report bugs!\n", CONF_TYPE_PRINT, CONF_RANGE, 0, 31, NULL}, {"fsmode-dontuse", &vo_fsmode, CONF_TYPE_INT, CONF_RANGE, 0, 31, NULL}, // set bpp (x11+vm, dga, fbdev, vesa, svga?) - {"bpp", &vo_dbpp, CONF_TYPE_INT, CONF_RANGE, 0, 32, NULL}, + OPT_INTRANGE("bpp", vo_dbpp, 0, 0, 32), {"colorkey", &vo_colorkey, CONF_TYPE_INT, 0, 0, 0, NULL}, {"nocolorkey", &vo_colorkey, CONF_TYPE_FLAG, 0, 0, 0x1000000, NULL}, {"double", &vo_doublebuffering, CONF_TYPE_FLAG, 0, 0, 1, NULL}, @@ -205,7 +197,7 @@ const m_option_t mplayer_opts[]={ {"vsync", &vo_vsync, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"novsync", &vo_vsync, CONF_TYPE_FLAG, 0, 1, 0, NULL}, {"panscan", &vo_panscan, CONF_TYPE_FLOAT, CONF_RANGE, -1.0, 1.0, NULL}, - {"panscanrange", &vo_panscanrange, CONF_TYPE_FLOAT, CONF_RANGE, -19.0, 99.0, NULL}, + OPT_FLOATRANGE("panscanrange", vo_panscanrange, 0, -19.0, 99.0), {"grabpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"nograbpointer", &vo_grabpointer, CONF_TYPE_FLAG, 0, 1, 0, NULL}, @@ -227,10 +219,10 @@ const m_option_t mplayer_opts[]={ {"xineramascreen", &xinerama_screen, CONF_TYPE_INT, CONF_RANGE, -2, 32, NULL}, - {"brightness",&vo_gamma_brightness, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, - {"saturation",&vo_gamma_saturation, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, - {"contrast",&vo_gamma_contrast, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, - {"hue",&vo_gamma_hue, CONF_TYPE_INT, CONF_RANGE, -100, 100, NULL}, + OPT_INTRANGE("brightness", vo_gamma_brightness, 0, -100, 100), + OPT_INTRANGE("saturation", vo_gamma_saturation, 0, -100, 100), + OPT_INTRANGE("contrast", vo_gamma_contrast, 0, -100, 100), + OPT_INTRANGE("hue", vo_gamma_hue, 0, -100, 100), {"keepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 0, 1, NULL}, {"nokeepaspect", &vo_keepaspect, CONF_TYPE_FLAG, 0, 1, 0, NULL}, @@ -265,8 +257,8 @@ const m_option_t mplayer_opts[]={ {"crash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"nocrash-debug", &crash_debug, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, #endif - {"osdlevel", &osd_level, CONF_TYPE_INT, CONF_RANGE, 0, 3, NULL}, - {"osd-duration", &osd_duration, CONF_TYPE_INT, CONF_MIN, 0, 0, NULL}, + OPT_INTRANGE("osdlevel", osd_level, 0, 0, 3), + OPT_INTRANGE("osd-duration", osd_duration, 0, 0, 3600000), #ifdef CONFIG_MENU {"menu", &use_menu, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"nomenu", &use_menu, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, @@ -320,23 +312,21 @@ const m_option_t mplayer_opts[]={ {"lircconf", &lirc_configfile, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, #endif - {"gui", "The -gui option will only work as the first command line argument.\n", CONF_TYPE_PRINT, 0, 0, 0, (void *)1}, - {"nogui", "The -nogui option will only work as the first command line argument.\n", CONF_TYPE_PRINT, 0, 0, 0, (void *)1}, + // these should be removed when gmplayer is forgotten + {"gui", "Internal GUI was removed. Use some other frontend instead.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, + {"nogui", "Internal GUI was removed, -nogui is no longer valid.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, -#ifdef CONFIG_GUI - {"skin", &skinName, CONF_TYPE_STRING, CONF_GLOBAL, 0, 0, NULL}, - {"enqueue", &enqueue, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"noenqueue", &enqueue, CONF_TYPE_FLAG, 0, 1, 0, NULL}, - {"guiwid", &guiWinID, CONF_TYPE_INT, 0, 0, 0, NULL}, -#endif - - {"noloop", &mpctx_s.loop_times, CONF_TYPE_FLAG, 0, 0, -1, NULL}, - {"loop", &mpctx_s.loop_times, CONF_TYPE_INT, CONF_RANGE, -1, 10000, NULL}, + OPT_FLAG_CONSTANTS("noloop", loop_times, 0, 0, -1), + OPT_INTRANGE("loop", loop_times, 0, -1, 10000), {"playlist", NULL, CONF_TYPE_STRING, 0, 0, 0, NULL}, + OPT_FLAG_ON("ordered-chapters", ordered_chapters, 0), + OPT_FLAG_OFF("noordered-chapters", ordered_chapters, 0), + // a-v sync stuff: - {"correct-pts", &user_correct_pts, CONF_TYPE_FLAG, 0, 0, 1, NULL}, - {"nocorrect-pts", &user_correct_pts, CONF_TYPE_FLAG, 0, 1, 0, NULL}, + OPT_FLAG_ON("correct-pts", user_correct_pts, 0), + OPT_FLAG_OFF("nocorrect-pts", user_correct_pts, 0), + OPT_INTRANGE("pts-association-mode", user_pts_assoc_mode, 0, 0, 2), {"noautosync", &autosync, CONF_TYPE_FLAG, 0, 0, -1, NULL}, {"autosync", &autosync, CONF_TYPE_INT, CONF_RANGE, 0, 10000, NULL}, @@ -356,14 +346,14 @@ const m_option_t mplayer_opts[]={ {"idle", &player_idle_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 0, 1, NULL}, {"noidle", &player_idle_mode, CONF_TYPE_FLAG,CONF_GLOBAL , 1, 0, NULL}, {"use-stdin", "-use-stdin has been renamed to -noconsolecontrols, use that instead.", CONF_TYPE_PRINT, 0, 0, 0, NULL}, - {"key-fifo-size", &key_fifo_size, CONF_TYPE_INT, CONF_RANGE, 2, 65000, NULL}, + OPT_INTRANGE("key-fifo-size", key_fifo_size, CONF_GLOBAL, 2, 65000), {"noconsolecontrols", &noconsolecontrols, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"consolecontrols", &noconsolecontrols, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, {"mouse-movements", &enable_mouse_movements, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"nomouse-movements", &enable_mouse_movements, CONF_TYPE_FLAG, CONF_GLOBAL, 1, 0, NULL}, - {"doubleclick-time", &doubleclick_time, CONF_TYPE_INT, CONF_RANGE, 0, 1000, NULL}, + OPT_INTRANGE("doubleclick-time", doubleclick_time, 0, 0, 1000), #ifdef CONFIG_TV - {"tvscan", tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + {"tvscan", (void *) tvscan_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, #else {"tvscan", "MPlayer was compiled without TV interface support.\n", CONF_TYPE_PRINT, 0, 0, 0, NULL}, #endif /* CONFIG_TV */ @@ -372,11 +362,11 @@ const m_option_t mplayer_opts[]={ {"list-properties", &list_properties, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL}, {"identify", &mp_msg_levels[MSGT_IDENTIFY], CONF_TYPE_FLAG, CONF_GLOBAL, 0, MSGL_V, NULL}, - {"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, - {"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, - {"h", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, + {"-help", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, + {"help", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, + {"h", (void *) help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL}, - {"vd", vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, + {"vd", (void *) vd_conf, CONF_TYPE_SUBCONFIG, 0, 0, 0, NULL}, {NULL, NULL, 0, 0, 0, 0, NULL} }; |