[Mplayerxp-cvslog] SF.net SVN: mplayerxp:[266] mplayerxp
Brought to you by:
olov
From: <nic...@us...> - 2012-10-31 14:00:36
|
Revision: 266 http://mplayerxp.svn.sourceforge.net/mplayerxp/?rev=266&view=rev Author: nickols_k Date: 2012-10-31 14:00:16 +0000 (Wed, 31 Oct 2012) Log Message: ----------- use enums instead of #define where it's possible Modified Paths: -------------- mplayerxp/dump.c mplayerxp/fifo.h mplayerxp/input/in_msg.h mplayerxp/input/input.h mplayerxp/input/joystick.h mplayerxp/input/mouse.h mplayerxp/libao2/ao_msg.h mplayerxp/libao2/ao_null.c mplayerxp/libao2/audio_out.h mplayerxp/libmpcodecs/ad.c mplayerxp/libmpcodecs/ad.h mplayerxp/libmpcodecs/ad_msg.h mplayerxp/libmpcodecs/codecs_ld.c mplayerxp/libmpcodecs/liba52/a52.h mplayerxp/libmpcodecs/liba52/a52_internal.h mplayerxp/libmpcodecs/libdca/dca.h mplayerxp/libmpcodecs/libdca/dca_internal.h mplayerxp/libmpcodecs/libdca/resample.c mplayerxp/libmpcodecs/libnuppelvideo/lzoconf.h mplayerxp/libmpcodecs/vd.h mplayerxp/libmpcodecs/vd_msg.h mplayerxp/libmpconf/cfgparser.c mplayerxp/libmpconf/cfgparser.h mplayerxp/libmpconf/codec-cfg.c mplayerxp/libmpconf/codec-cfg.h mplayerxp/libmpconf/m_option.c mplayerxp/libmpconf/m_option.h mplayerxp/libmpconf/m_property.c mplayerxp/libmpconf/m_property.h mplayerxp/libmpconf/m_struct.c mplayerxp/libmpconf/m_struct.h mplayerxp/libmpconf/subopt-helper.c mplayerxp/libmpconf/subopt-helper.h mplayerxp/libmpdemux/asf.h mplayerxp/libmpdemux/demux_aiff.c mplayerxp/libmpdemux/demux_bmp.c mplayerxp/libmpdemux/demux_mkv.c mplayerxp/libmpdemux/demux_msg.h mplayerxp/libmpdemux/demux_vqf.c mplayerxp/libmpdemux/demuxer.h mplayerxp/libmpdemux/demuxer_r.c mplayerxp/libmpdemux/demuxer_r.h mplayerxp/libmpdemux/freesdp/priv.h mplayerxp/libmpdemux/frequencies.h mplayerxp/libmpdemux/genres.h mplayerxp/libmpdemux/librtsp/rtsp.h mplayerxp/libmpdemux/matroska.h mplayerxp/libmpdemux/mpxpav64.h mplayerxp/libmpdemux/mrl.h mplayerxp/libmpdemux/muxer.h mplayerxp/libmpdemux/parse_es.h mplayerxp/libmpdemux/parse_mp4.h mplayerxp/libmpdemux/pnm.h mplayerxp/libmpdemux/realrtsp/rmff.h mplayerxp/libmpdemux/s_cdd.c mplayerxp/libmpdemux/s_oss.c mplayerxp/libmpdemux/stream.h mplayerxp/libmpdemux/tcp.h mplayerxp/libmpdemux/tv.h mplayerxp/libmpdemux/yuv4mpeg.h mplayerxp/libmpsub/find_sub.c mplayerxp/libmpsub/spudec.c mplayerxp/libmpsub/subreader.c mplayerxp/libmpsub/subreader.h mplayerxp/libmpsub/vobsub.c mplayerxp/libplaytree/asxparser.c mplayerxp/libplaytree/asxparser.h mplayerxp/libplaytree/playtree.c mplayerxp/libplaytree/playtree.h mplayerxp/libplaytree/playtreeparser.c mplayerxp/libvo/aspect.h mplayerxp/libvo/dri_vo.h mplayerxp/libvo/img_format.h mplayerxp/libvo/sub.c mplayerxp/libvo/sub.h mplayerxp/libvo/video_out.h mplayerxp/libvo/videodev_mjpeg.h mplayerxp/libvo/vo_dga.c mplayerxp/libvo/vo_fbdev.c mplayerxp/libvo/vo_msg.h mplayerxp/libvo/vo_sdl.c mplayerxp/libvo/vo_vesa.c mplayerxp/libvo/vo_x11.c mplayerxp/libvo/vo_xv.c mplayerxp/libvo/wskeys.h mplayerxp/mixer.h mplayerxp/mp_image.c mplayerxp/mp_image.h mplayerxp/mp_msg.c mplayerxp/mp_msg.h mplayerxp/mplayer.c mplayerxp/nls/help_mp-en.h mplayerxp/nls/help_mp-ru.h mplayerxp/nls/nls_msg.h mplayerxp/osdep/aclib.c mplayerxp/osdep/bswap.h mplayerxp/osdep/cpudetect.c mplayerxp/osdep/cpudetect.h mplayerxp/osdep/cputable.h mplayerxp/osdep/keycodes.h mplayerxp/osdep/mm_accel.h mplayerxp/osdep/mp_malloc.c mplayerxp/osdep/mplib.h mplayerxp/osdep/osdep_msg.h mplayerxp/osdep/vbelib.h mplayerxp/postproc/af.c mplayerxp/postproc/af.h mplayerxp/postproc/af_ao2.c mplayerxp/postproc/af_center.c mplayerxp/postproc/af_channels.c mplayerxp/postproc/af_control.h mplayerxp/postproc/af_delay.c mplayerxp/postproc/af_dummy.c mplayerxp/postproc/af_equalizer.c mplayerxp/postproc/af_export.c mplayerxp/postproc/af_extrastereo.c mplayerxp/postproc/af_ffenc.c mplayerxp/postproc/af_format.c mplayerxp/postproc/af_format.h mplayerxp/postproc/af_hrtf.c mplayerxp/postproc/af_hrtf.h mplayerxp/postproc/af_lp.c mplayerxp/postproc/af_mp.c mplayerxp/postproc/af_mp.h mplayerxp/postproc/af_pan.c mplayerxp/postproc/af_raw.c mplayerxp/postproc/af_resample.c mplayerxp/postproc/af_resample.h mplayerxp/postproc/af_scaletempo.c mplayerxp/postproc/af_sinesuppress.c mplayerxp/postproc/af_sub.c mplayerxp/postproc/af_surround.c mplayerxp/postproc/af_volnorm.c mplayerxp/postproc/af_volume.c mplayerxp/postproc/dsp.h mplayerxp/postproc/libmenu/menu.h mplayerxp/postproc/libmenu/menu_list.h mplayerxp/postproc/mpc_info.h mplayerxp/postproc/postprocess.c mplayerxp/postproc/pp_msg.h mplayerxp/postproc/swscale.c mplayerxp/postproc/swscale.h mplayerxp/postproc/vf.h mplayerxp/postproc/vfcap.h mplayerxp/sig_hand.c mplayerxp/sig_hand.h mplayerxp/xmp_core.c mplayerxp/xmp_core.h Added Paths: ----------- mplayerxp/xmp_enums.h Removed Paths: ------------- mplayerxp/__mp_msg.h Deleted: mplayerxp/__mp_msg.h =================================================================== --- mplayerxp/__mp_msg.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/__mp_msg.h 2012-10-31 14:00:16 UTC (rev 266) @@ -1,29 +0,0 @@ -#ifndef __MP_MSG_H -#define __MP_MSG_H -#include "./mp_msg.h" -#undef MSG_INFO -#undef MSG_FATAL -#undef MSG_WARN -#undef MSG_ERR -#undef MSG_V -#undef MSG_OK -#undef MSG_DBG2 -#undef MSG_DBG3 -#undef MSG_HINT -#undef MSG_STATUS -#define MSG_INFO(args...) mp_msg(MSGT_CLASS,MSGL_INFO,__FILE__,__LINE__,##args ) -#define MSG_FATAL(args...) mp_msg(MSGT_CLASS,MSGL_FATAL,__FILE__,__LINE__,##args ) -#define MSG_WARN(args...) mp_msg(MSGT_CLASS,MSGL_WARN,__FILE__,__LINE__,##args ) -#define MSG_ERR(args...) mp_msg(MSGT_CLASS,MSGL_ERR,__FILE__,__LINE__,##args ) -#define MSG_V(args...) mp_msg(MSGT_CLASS,MSGL_V,__FILE__,__LINE__,##args ) -#define MSG_OK(args...) mp_msg(MSGT_CLASS,MSGL_OK,__FILE__,__LINE__,##args ) -#define MSG_HINT(args...) mp_msg(MSGT_CLASS,MSGL_HINT,__FILE__,__LINE__,##args ) -#define MSG_STATUS(args...) mp_msg(MSGT_CLASS,MSGL_STATUS,__FILE__,__LINE__,##args ) -#ifdef MP_DEBUG -#define MSG_DBG2(args...) mp_msg(MSGT_CLASS,MSGL_DBG2,__FILE__,__LINE__,##args ) -#define MSG_DBG3(args...) mp_msg(MSGT_CLASS,MSGL_DBG3,__FILE__,__LINE__,##args ) -#else -#define MSG_DBG2(args...) -#define MSG_DBG3(args...) -#endif -#endif Modified: mplayerxp/dump.c =================================================================== --- mplayerxp/dump.c 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/dump.c 2012-10-31 14:00:16 UTC (rev 266) @@ -18,7 +18,7 @@ #include "libmpdemux/mrl.h" #include "osdep/mplib.h" #define MSGT_CLASS MSGT_GLOBAL -#include "__mp_msg.h" +#include "mp_msg.h" static char *media=NULL,*port=NULL; Modified: mplayerxp/fifo.h =================================================================== --- mplayerxp/fifo.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/fifo.h 2012-10-31 14:00:16 UTC (rev 266) @@ -6,7 +6,7 @@ #ifndef MSGT_CLASS #define MSGT_CLASS MSGT_GLOBAL #endif -#include "__mp_msg.h" +#include "mp_msg.h" #include <stdint.h> #include <stddef.h> Modified: mplayerxp/input/in_msg.h =================================================================== --- mplayerxp/input/in_msg.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/input/in_msg.h 2012-10-31 14:00:16 UTC (rev 266) @@ -1,28 +1,7 @@ #ifndef IN_MSG_H #define IN_MSG_H -#include "../mp_msg.h" -#undef MSG_INFO -#undef MSG_FATAL -#undef MSG_WARN -#undef MSG_ERR -#undef MSG_V -#undef MSG_OK -#undef MSG_DBG2 -#undef MSG_DBG3 -#undef MSG_HINT -#define MSG_INFO(args...) mp_msg(MSGT_INPUT,MSGL_INFO,__FILE__,__LINE__, ##args ) -#define MSG_FATAL(args...) mp_msg(MSGT_INPUT,MSGL_FATAL,__FILE__,__LINE__, ##args ) -#define MSG_WARN(args...) mp_msg(MSGT_INPUT,MSGL_WARN,__FILE__,__LINE__, ##args ) -#define MSG_ERR(args...) mp_msg(MSGT_INPUT,MSGL_ERR,__FILE__,__LINE__, ##args ) -#define MSG_V(args...) mp_msg(MSGT_INPUT,MSGL_V,__FILE__,__LINE__, ##args ) -#define MSG_OK(args...) mp_msg(MSGT_INPUT,MSGL_OK,__FILE__,__LINE__, ##args ) -#define MSG_HINT(args...) mp_msg(MSGT_INPUT,MSGL_HINT,__FILE__,__LINE__, ##args ) -#ifdef MP_DEBUG -#define MSG_DBG2(args...) mp_msg(MSGT_INPUT,MSGL_DBG2,__FILE__,__LINE__, ##args ) -#define MSG_DBG3(args...) mp_msg(MSGT_INPUT,MSGL_DBG3,__FILE__,__LINE__, ##args ) -#else -#define MSG_DBG2(args...) -#define MSG_DBG3(args...) +#define MSGT_CLASS MSGT_INPUT +#include "mp_msg.h" + #endif -#endif Modified: mplayerxp/input/input.h =================================================================== --- mplayerxp/input/input.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/input/input.h 2012-10-31 14:00:16 UTC (rev 266) @@ -1,106 +1,108 @@ +#ifndef INPUT_H_INCLUDED +#define INPUT_H_ICLUDED 1 + // All commands id -#define MP_CMD_SEEK 0 -#define MP_CMD_RESERVED_0 1 -#define MP_CMD_QUIT 2 -#define MP_CMD_PAUSE 3 -#define MP_CMD_SOFT_QUIT 4 -#define MP_CMD_PLAY_TREE_STEP 5 -#define MP_CMD_PLAY_TREE_UP_STEP 6 -#define MP_CMD_PLAY_ALT_SRC_STEP 7 -#define MP_CMD_RESERVED_1 8 -#define MP_CMD_OSD 9 -#define MP_CMD_VOLUME 10 -#define MP_CMD_RESERVED_2 11 -#define MP_CMD_CONTRAST 12 -#define MP_CMD_BRIGHTNESS 13 -#define MP_CMD_HUE 14 -#define MP_CMD_SATURATION 15 -#define MP_CMD_FRAMEDROPPING 16 -#define MP_CMD_TV_STEP_CHANNEL 17 -#define MP_CMD_TV_STEP_NORM 18 -#define MP_CMD_TV_STEP_CHANNEL_LIST 19 -#define MP_CMD_VO_FULLSCREEN 20 -#define MP_CMD_SUB_POS 21 -#define MP_CMD_DVDNAV 22 -#define MP_CMD_VO_SCREENSHOT 23 -#define MP_CMD_PANSCAN 24 -#define MP_CMD_MUTE 25 -#define MP_CMD_LOADFILE 26 -#define MP_CMD_LOADLIST 27 -#define MP_CMD_VF_CHANGE_RECTANGLE 28 -#define MP_CMD_GAMMA 29 -#define MP_CMD_SUB_VISIBILITY 30 -#define MP_CMD_VOBSUB_LANG 31 -#define MP_CMD_MENU 32 -#define MP_CMD_SET_MENU 33 -#define MP_CMD_GET_TIME_LENGTH 34 -#define MP_CMD_GET_PERCENT_POS 35 -#define MP_CMD_SUB_STEP 36 -#define MP_CMD_TV_SET_CHANNEL 37 +enum { + MP_CMD_SEEK =0, + MP_CMD_RESERVED_0 =1, + MP_CMD_QUIT =2, + MP_CMD_PAUSE =3, + MP_CMD_SOFT_QUIT =4, + MP_CMD_PLAY_TREE_STEP =5, + MP_CMD_PLAY_TREE_UP_STEP =6, + MP_CMD_PLAY_ALT_SRC_STEP =7, + MP_CMD_RESERVED_1 =8, + MP_CMD_OSD =9, + MP_CMD_VOLUME =10, + MP_CMD_RESERVED_2 =11, + MP_CMD_CONTRAST =12, + MP_CMD_BRIGHTNESS =13, + MP_CMD_HUE =14, + MP_CMD_SATURATION =15, + MP_CMD_FRAMEDROPPING =16, + MP_CMD_TV_STEP_CHANNEL =17, + MP_CMD_TV_STEP_NORM =18, + MP_CMD_TV_STEP_CHANNEL_LIST =19, + MP_CMD_VO_FULLSCREEN =20, + MP_CMD_SUB_POS =21, + MP_CMD_DVDNAV =22, + MP_CMD_VO_SCREENSHOT =23, + MP_CMD_PANSCAN =24, + MP_CMD_MUTE =25, + MP_CMD_LOADFILE =26, + MP_CMD_LOADLIST =27, + MP_CMD_VF_CHANGE_RECTANGLE =28, + MP_CMD_GAMMA =29, + MP_CMD_SUB_VISIBILITY =30, + MP_CMD_VOBSUB_LANG =31, + MP_CMD_MENU =32, + MP_CMD_SET_MENU =33, + MP_CMD_GET_TIME_LENGTH =34, + MP_CMD_GET_PERCENT_POS =35, + MP_CMD_SUB_STEP =36, + MP_CMD_TV_SET_CHANNEL =37, #ifdef USE_EDL -#define MP_CMD_EDL_MARK 38 + MP_CMD_EDL_MARK =38, #endif -#define MP_CMD_SUB_ALIGNMENT 39 -#define MP_CMD_TV_LAST_CHANNEL 40 -#define MP_CMD_OSD_SHOW_TEXT 41 -#define MP_CMD_TV_STEP_CHANNEL_UP 42 -#define MP_CMD_TV_STEP_CHANNEL_DOWN 43 + MP_CMD_SUB_ALIGNMENT =39, + MP_CMD_TV_LAST_CHANNEL =40, + MP_CMD_OSD_SHOW_TEXT =41, + MP_CMD_TV_STEP_CHANNEL_UP =42, + MP_CMD_TV_STEP_CHANNEL_DOWN =43, -#define MP_CMD_SPEED_INCR 44 -#define MP_CMD_SPEED_MULT 45 -#define MP_CMD_SPEED_SET 46 + MP_CMD_SPEED_INCR =44, + MP_CMD_SPEED_MULT =45, + MP_CMD_SPEED_SET =46, -#define MP_CMD_SWITCH_AUDIO 47 -#define MP_CMD_SWITCH_VIDEO 48 -#define MP_CMD_SWITCH_SUB 49 + MP_CMD_SWITCH_AUDIO =47, + MP_CMD_SWITCH_VIDEO =48, + MP_CMD_SWITCH_SUB =49, -#define MP_CMD_FRAME_STEP 56 + MP_CMD_FRAME_STEP =56, -#define MP_CMD_DVDNAV_EVENT 6000 - -#define MP_CMD_DVDNAV_UP 1 -#define MP_CMD_DVDNAV_DOWN 2 -#define MP_CMD_DVDNAV_LEFT 3 -#define MP_CMD_DVDNAV_RIGHT 4 -#define MP_CMD_DVDNAV_MENU 5 -#define MP_CMD_DVDNAV_SELECT 6 - + MP_CMD_DVDNAV_EVENT =6000, /// Console command -#define MP_CMD_CHELP 7000 -#define MP_CMD_CEXIT 7001 -#define MP_CMD_CHIDE 7002 -#define MP_CMD_CRUN 7003 + MP_CMD_CHELP =7000, + MP_CMD_CEXIT =7001, + MP_CMD_CHIDE =7002, + MP_CMD_CRUN =7003 +}; +enum { + MP_CMD_DVDNAV_UP =1, + MP_CMD_DVDNAV_DOWN =2, + MP_CMD_DVDNAV_LEFT =3, + MP_CMD_DVDNAV_RIGHT =4, + MP_CMD_DVDNAV_MENU =5, + MP_CMD_DVDNAV_SELECT=6, +}; +enum { // The args types -#define MP_CMD_ARG_INT 0 -#define MP_CMD_ARG_FLOAT 1 -#define MP_CMD_ARG_STRING 2 -#define MP_CMD_ARG_VOID 3 + MP_CMD_ARG_INT =0, + MP_CMD_ARG_FLOAT =1, + MP_CMD_ARG_STRING =2, + MP_CMD_ARG_VOID =3, #ifndef MP_CMD_MAX_ARGS -#define MP_CMD_MAX_ARGS 10 + MP_CMD_MAX_ARGS =10 #endif - +}; // Error codes for the drivers -// An error occured but we can continue -#define MP_INPUT_ERROR -1 -// A fatal error occured, this driver should be removed -#define MP_INPUT_DEAD -2 -// No input were avaible -#define MP_INPUT_NOTHING -3 - +enum { + MP_INPUT_ERROR =-1,// An error occured but we can continue + MP_INPUT_DEAD =-2,// A fatal error occured, this driver should be removed + MP_INPUT_NOTHING =-3 // No input were avaible +}; // For the keys drivers, if possible you can send key up and key down // events. Key up is the default, to send a key down you must or the key // code with MP_KEY_DOWN -#define MP_KEY_DOWN (1<<29) -// Use this when the key shouldn't be auto-repeated (like mouse buttons) -#define MP_NO_REPEAT_KEY (1<<28) +enum { + MP_KEY_DOWN =(1<<29), + MP_NO_REPEAT_KEY =(1<<28), // Use this when the key shouldn't be auto-repeated (like mouse buttons) + MP_MAX_KEY_DOWN =32 +}; -#ifndef MP_MAX_KEY_DOWN -#define MP_MAX_KEY_DOWN 32 -#endif - typedef union mp_cmd_arg_value { int i; float f; @@ -211,3 +213,4 @@ void mp_input_print_keys(void); void mp_input_print_cmds(void); void mp_input_print_binds(void); +#endif Modified: mplayerxp/input/joystick.h =================================================================== --- mplayerxp/input/joystick.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/input/joystick.h 2012-10-31 14:00:16 UTC (rev 266) @@ -1,39 +1,43 @@ +#ifndef JOYSTICK_H_INCLUDED +#define JOYSTICK_H_INCLUDED 1 -#define JOY_BASE (0x100+128) -#define JOY_AXIS0_PLUS (JOY_BASE+0) -#define JOY_AXIS0_MINUS (JOY_BASE+1) -#define JOY_AXIS1_PLUS (JOY_BASE+2) -#define JOY_AXIS1_MINUS (JOY_BASE+3) -#define JOY_AXIS2_PLUS (JOY_BASE+4) -#define JOY_AXIS2_MINUS (JOY_BASE+5) -#define JOY_AXIS3_PLUS (JOY_BASE+6) -#define JOY_AXIS3_MINUS (JOY_BASE+7) -#define JOY_AXIS4_PLUS (JOY_BASE+8) -#define JOY_AXIS4_MINUS (JOY_BASE+9) -#define JOY_AXIS5_PLUS (JOY_BASE+10) -#define JOY_AXIS5_MINUS (JOY_BASE+11) -#define JOY_AXIS6_PLUS (JOY_BASE+12) -#define JOY_AXIS6_MINUS (JOY_BASE+13) -#define JOY_AXIS7_PLUS (JOY_BASE+14) -#define JOY_AXIS7_MINUS (JOY_BASE+15) -#define JOY_AXIS8_PLUS (JOY_BASE+16) -#define JOY_AXIS8_MINUS (JOY_BASE+17) -#define JOY_AXIS9_PLUS (JOY_BASE+18) -#define JOY_AXIS9_MINUS (JOY_BASE+19) +enum { + JOY_BASE =(0x100+128), + JOY_AXIS0_PLUS =(JOY_BASE+0), + JOY_AXIS0_MINUS =(JOY_BASE+1), + JOY_AXIS1_PLUS =(JOY_BASE+2), + JOY_AXIS1_MINUS =(JOY_BASE+3), + JOY_AXIS2_PLUS =(JOY_BASE+4), + JOY_AXIS2_MINUS =(JOY_BASE+5), + JOY_AXIS3_PLUS =(JOY_BASE+6), + JOY_AXIS3_MINUS =(JOY_BASE+7), + JOY_AXIS4_PLUS =(JOY_BASE+8), + JOY_AXIS4_MINUS =(JOY_BASE+9), + JOY_AXIS5_PLUS =(JOY_BASE+10), + JOY_AXIS5_MINUS =(JOY_BASE+11), + JOY_AXIS6_PLUS =(JOY_BASE+12), + JOY_AXIS6_MINUS =(JOY_BASE+13), + JOY_AXIS7_PLUS =(JOY_BASE+14), + JOY_AXIS7_MINUS =(JOY_BASE+15), + JOY_AXIS8_PLUS =(JOY_BASE+16), + JOY_AXIS8_MINUS =(JOY_BASE+17), + JOY_AXIS9_PLUS =(JOY_BASE+18), + JOY_AXIS9_MINUS =(JOY_BASE+19) +}; +enum { + JOY_BTN_BASE=((0x100+148)|(1<<28)), + JOY_BTN0 =(JOY_BTN_BASE+0), + JOY_BTN1 =(JOY_BTN_BASE+1), + JOY_BTN2 =(JOY_BTN_BASE+2), + JOY_BTN3 =(JOY_BTN_BASE+3), + JOY_BTN4 =(JOY_BTN_BASE+4), + JOY_BTN5 =(JOY_BTN_BASE+5), + JOY_BTN6 =(JOY_BTN_BASE+6), + JOY_BTN7 =(JOY_BTN_BASE+7), + JOY_BTN8 =(JOY_BTN_BASE+8), + JOY_BTN9 =(JOY_BTN_BASE+9) +}; -#define JOY_BTN_BASE ((0x100+148)|MP_NO_REPEAT_KEY) -#define JOY_BTN0 (JOY_BTN_BASE+0) -#define JOY_BTN1 (JOY_BTN_BASE+1) -#define JOY_BTN2 (JOY_BTN_BASE+2) -#define JOY_BTN3 (JOY_BTN_BASE+3) -#define JOY_BTN4 (JOY_BTN_BASE+4) -#define JOY_BTN5 (JOY_BTN_BASE+5) -#define JOY_BTN6 (JOY_BTN_BASE+6) -#define JOY_BTN7 (JOY_BTN_BASE+7) -#define JOY_BTN8 (JOY_BTN_BASE+8) -#define JOY_BTN9 (JOY_BTN_BASE+9) - int mp_input_joystick_init(const char* dev); - int mp_input_joystick_read(int fd); - +#endif Modified: mplayerxp/input/mouse.h =================================================================== --- mplayerxp/input/mouse.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/input/mouse.h 2012-10-31 14:00:16 UTC (rev 266) @@ -1,25 +1,30 @@ +#ifndef MOUSE_H_INCLUDED +#define MOUSE_H_INCLUDED 1 - -#define MOUSE_BASE ((0x100+256)|MP_NO_REPEAT_KEY) -#define MOUSE_BTN0 (MOUSE_BASE+0) -#define MOUSE_BTN1 (MOUSE_BASE+1) -#define MOUSE_BTN2 (MOUSE_BASE+2) -#define MOUSE_BTN3 (MOUSE_BASE+3) -#define MOUSE_BTN4 (MOUSE_BASE+4) -#define MOUSE_BTN5 (MOUSE_BASE+5) -#define MOUSE_BTN6 (MOUSE_BASE+6) -#define MOUSE_BTN7 (MOUSE_BASE+7) -#define MOUSE_BTN8 (MOUSE_BASE+8) -#define MOUSE_BTN9 (MOUSE_BASE+9) - -#define MOUSE_BASE_DBL (0x300|MP_NO_REPEAT_KEY) -#define MOUSE_BTN0_DBL (MOUSE_BASE_DBL+0) -#define MOUSE_BTN1_DBL (MOUSE_BASE_DBL+1) -#define MOUSE_BTN2_DBL (MOUSE_BASE_DBL+2) -#define MOUSE_BTN3_DBL (MOUSE_BASE_DBL+3) -#define MOUSE_BTN4_DBL (MOUSE_BASE_DBL+4) -#define MOUSE_BTN5_DBL (MOUSE_BASE_DBL+5) -#define MOUSE_BTN6_DBL (MOUSE_BASE_DBL+6) -#define MOUSE_BTN7_DBL (MOUSE_BASE_DBL+7) -#define MOUSE_BTN8_DBL (MOUSE_BASE_DBL+8) -#define MOUSE_BTN9_DBL (MOUSE_BASE_DBL+9) +enum { + MOUSE_BASE=((0x100+256)|MP_NO_REPEAT_KEY), + MOUSE_BTN0=(MOUSE_BASE+0), + MOUSE_BTN1=(MOUSE_BASE+1), + MOUSE_BTN2=(MOUSE_BASE+2), + MOUSE_BTN3=(MOUSE_BASE+3), + MOUSE_BTN4=(MOUSE_BASE+4), + MOUSE_BTN5=(MOUSE_BASE+5), + MOUSE_BTN6=(MOUSE_BASE+6), + MOUSE_BTN7=(MOUSE_BASE+7), + MOUSE_BTN8=(MOUSE_BASE+8), + MOUSE_BTN9=(MOUSE_BASE+9) +}; +enum { + MOUSE_BASE_DBL=(0x300|MP_NO_REPEAT_KEY), + MOUSE_BTN0_DBL=(MOUSE_BASE_DBL+0), + MOUSE_BTN1_DBL=(MOUSE_BASE_DBL+1), + MOUSE_BTN2_DBL=(MOUSE_BASE_DBL+2), + MOUSE_BTN3_DBL=(MOUSE_BASE_DBL+3), + MOUSE_BTN4_DBL=(MOUSE_BASE_DBL+4), + MOUSE_BTN5_DBL=(MOUSE_BASE_DBL+5), + MOUSE_BTN6_DBL=(MOUSE_BASE_DBL+6), + MOUSE_BTN7_DBL=(MOUSE_BASE_DBL+7), + MOUSE_BTN8_DBL=(MOUSE_BASE_DBL+8), + MOUSE_BTN9_DBL=(MOUSE_BASE_DBL+9) +}; +#endif \ No newline at end of file Modified: mplayerxp/libao2/ao_msg.h =================================================================== --- mplayerxp/libao2/ao_msg.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libao2/ao_msg.h 2012-10-31 14:00:16 UTC (rev 266) @@ -1,28 +1,7 @@ #ifndef AO_MSG_H #define AO_MSG_H -#include "../mp_msg.h" -#undef MSG_INFO -#undef MSG_FATAL -#undef MSG_WARN -#undef MSG_ERR -#undef MSG_V -#undef MSG_OK -#undef MSG_DBG2 -#undef MSG_DBG3 -#undef MSG_HINT -#define MSG_INFO(args...) mp_msg(MSGT_AO,MSGL_INFO,__FILE__,__LINE__, ##args ) -#define MSG_FATAL(args...) mp_msg(MSGT_AO,MSGL_FATAL,__FILE__,__LINE__, ##args ) -#define MSG_WARN(args...) mp_msg(MSGT_AO,MSGL_WARN,__FILE__,__LINE__, ##args ) -#define MSG_ERR(args...) mp_msg(MSGT_AO,MSGL_ERR,__FILE__,__LINE__, ##args ) -#define MSG_V(args...) mp_msg(MSGT_AO,MSGL_V,__FILE__,__LINE__, ##args ) -#define MSG_OK(args...) mp_msg(MSGT_AO,MSGL_OK,__FILE__,__LINE__, ##args ) -#define MSG_HINT(args...) mp_msg(MSGT_AO,MSGL_HINT,__FILE__,__LINE__, ##args ) -#ifdef MP_DEBUG -#define MSG_DBG2(args...) mp_msg(MSGT_AO,MSGL_DBG2,__FILE__,__LINE__, ##args ) -#define MSG_DBG3(args...) mp_msg(MSGT_AO,MSGL_DBG3,__FILE__,__LINE__, ##args ) -#else -#define MSG_DBG2(args...) -#define MSG_DBG3(args...) +#define MSGT_CLASS MSGT_AO +#include "mp_msg.h" + #endif -#endif Modified: mplayerxp/libao2/ao_null.c =================================================================== --- mplayerxp/libao2/ao_null.c 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libao2/ao_null.c 2012-10-31 14:00:16 UTC (rev 266) @@ -34,11 +34,11 @@ int wav_mode; }priv_t; -#define WAV_ID_RIFF MAKE_FOURCC(0x46,0x46,0x49,0x52) /* "RIFF" */ -#define WAV_ID_WAVE MAKE_FOURCC(0x45,0x56,0x41,0x57) /* "WAVE" */ -#define WAV_ID_FMT MAKE_FOURCC(0x20,0x74,0x6d,0x66) /* "fmt " */ -#define WAV_ID_DATA MAKE_FOURCC(0x61,0x74,0x61,0x64) /* "data" */ -#define WAV_ID_PCM MAKE_TWOCC(0x00,0x01) +#define WAV_ID_RIFF FOURCC_TAG(0x46,0x46,0x49,0x52) /* "RIFF" */ +#define WAV_ID_WAVE FOURCC_TAG(0x45,0x56,0x41,0x57) /* "WAVE" */ +#define WAV_ID_FMT FOURCC_TAG(0x20,0x74,0x6d,0x66) /* "fmt " */ +#define WAV_ID_DATA FOURCC_TAG(0x61,0x74,0x61,0x64) /* "data" */ +#define WAV_ID_PCM TWOCC_TAG (0x00,0x01) struct WaveHeader { Modified: mplayerxp/libao2/audio_out.h =================================================================== --- mplayerxp/libao2/audio_out.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libao2/audio_out.h 2012-10-31 14:00:16 UTC (rev 266) @@ -1,6 +1,7 @@ #ifndef __AUDIO_OUT_H #define __AUDIO_OUT_H 1 -#include "../mp_config.h" +#include "mp_config.h" +#include "xmp_enums.h" /** Text description of AO-driver */ typedef struct ao_info_s { @@ -34,7 +35,7 @@ * @param arg argument associated with command * @return CONTROL_OK if success CONTROL_FALSE CONTROL_ERROR CONTROL_NA otherwise **/ - int (* __FASTCALL__ control)(ao_data_t*,int cmd,long arg); + ControlCodes (* __FASTCALL__ control)(ao_data_t*,int cmd,long arg); /** Preinitializes driver * @param flag currently unused @@ -80,21 +81,15 @@ extern const ao_functions_t* audio_out_drivers[]; /**< NULL terminated array of all drivers */ -#define CONTROL_OK 1 -#define CONTROL_TRUE 1 -#define CONTROL_FALSE 0 -#define CONTROL_UNKNOWN -1 -#define CONTROL_ERROR -2 -#define CONTROL_NA -3 - -#define AOCONTROL_SET_DEVICE 1 /**< Sets new audio device (example: /dev/dsp2) */ -#define AOCONTROL_GET_DEVICE 2 /**< Query current audio device (example: /dev/dsp) */ -#define AOCONTROL_QUERY_FORMAT 3 /**< Test for support of given format */ -#define AOCONTROL_QUERY_CHANNELS 4 /**< Test for support of a given number of channels */ -#define AOCONTROL_QUERY_RATE 5 /**< Test for support of given rate */ -#define AOCONTROL_GET_VOLUME 6 /**< Query volume level */ -#define AOCONTROL_SET_VOLUME 7 /**< Sets new volume level */ - +enum { + AOCONTROL_SET_DEVICE =1, /**< Sets new audio device (example: /dev/dsp2) */ + AOCONTROL_GET_DEVICE =2, /**< Query current audio device (example: /dev/dsp) */ + AOCONTROL_QUERY_FORMAT =3, /**< Test for support of given format */ + AOCONTROL_QUERY_CHANNELS =4, /**< Test for support of a given number of channels */ + AOCONTROL_QUERY_RATE =5, /**< Test for support of given rate */ + AOCONTROL_GET_VOLUME =6, /**< Query volume level */ + AOCONTROL_SET_VOLUME =7 /**< Sets new volume level */ +}; typedef struct ao_control_vol_s { float left; float right; Modified: mplayerxp/libmpcodecs/ad.c =================================================================== --- mplayerxp/libmpcodecs/ad.c 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/ad.c 2012-10-31 14:00:16 UTC (rev 266) @@ -12,6 +12,7 @@ #include "libmpdemux/demuxer.h" #include "libmpdemux/stheader.h" #include "ad.h" +#include "ad_msg.h" /* Missed vorbis, mad, dshow */ Modified: mplayerxp/libmpcodecs/ad.h =================================================================== --- mplayerxp/libmpcodecs/ad.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/ad.h 2012-10-31 14:00:16 UTC (rev 266) @@ -5,39 +5,31 @@ #define AD_H_INCLUDED 1 #include "libmpconf/cfgparser.h" +#include "xmp_enums.h" typedef struct ad_info_s { - /* driver description ("Autodesk FLI/FLC Animation decoder" */ - const char *descr; - /* driver name ("dshow") */ - const char *driver_name; - /* interface author/maintainer */ - const char *author; - /* URL of homepage */ - const char *url; + const char *descr; /* driver description ("Autodesk FLI/FLC Animation decoder" */ + const char *driver_name; /* driver name ("dshow") */ + const char *author; /* interface author/maintainer */ + const char *url; /* URL of homepage */ } ad_info_t; -#define CONTROL_OK 1 -#define CONTROL_TRUE 1 -#define CONTROL_FALSE 0 -#define CONTROL_UNKNOWN -1 -#define CONTROL_ERROR -2 -#define CONTROL_NA -3 +enum { + ADCTRL_RESYNC_STREAM=0, + ADCTRL_SKIP_FRAME =1 +}; -#define ADCTRL_RESYNC_STREAM 0 -#define ADCTRL_SKIP_FRAME 1 - /* interface of video decoder drivers */ typedef struct ad_functions_s { - const ad_info_t *info; - const config_t* options;/**< Optional: MPlayerXP's option related */ - int (*preinit)(sh_audio_t *); - int (*init)(sh_audio_t *sh); - void (*uninit)(sh_audio_t *sh); - int (*control)(sh_audio_t *sh,int cmd,any_t* arg, ...); - unsigned (*decode)(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts); + const ad_info_t *info; + const config_t* options;/**< Optional: MPlayerXP's option related */ + int (*preinit)(sh_audio_t *); + int (*init)(sh_audio_t *sh); + void (*uninit)(sh_audio_t *sh); + ControlCodes (*control)(sh_audio_t *sh,int cmd,any_t* arg, ...); + unsigned (*decode)(sh_audio_t *sh_audio,unsigned char *buf,unsigned minlen,unsigned maxlen,float *pts); } ad_functions_t; // NULL terminated array of all drivers Modified: mplayerxp/libmpcodecs/ad_msg.h =================================================================== --- mplayerxp/libmpcodecs/ad_msg.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/ad_msg.h 2012-10-31 14:00:16 UTC (rev 266) @@ -1,26 +1,7 @@ #ifndef AD_MSG_H #define AD_MSG_H 1 -#undef MSG_WARN -#undef MSG_HINT -#undef MSG_V -#undef MSG_INFO -#undef MSG_ERR -#undef MSG_FATAL -#undef MSG_DBG2 -#undef MSG_DBG3 -#undef MSG_OK -#define MSG_INFO(args...) mp_msg(MSGT_DECAUDIO,MSGL_INFO,__FILE__,__LINE__, ##args ) -#define MSG_FATAL(args...) mp_msg(MSGT_DECAUDIO,MSGL_FATAL,__FILE__,__LINE__, ##args ) -#define MSG_WARN(args...) mp_msg(MSGT_DECAUDIO,MSGL_WARN,__FILE__,__LINE__, ##args ) -#define MSG_ERR(args...) mp_msg(MSGT_DECAUDIO,MSGL_ERR,__FILE__,__LINE__, ##args ) -#define MSG_V(args...) mp_msg(MSGT_DECAUDIO,MSGL_V,__FILE__,__LINE__, ##args ) -#define MSG_OK(args...) mp_msg(MSGT_DECAUDIO,MSGL_OK,__FILE__,__LINE__, ##args ) -#define MSG_HINT(args...) mp_msg(MSGT_DECAUDIO,MSGL_HINT,__FILE__,__LINE__, ##args ) -#ifdef MP_DEBUG -#define MSG_DBG2(args...) mp_msg(MSGT_DECAUDIO,MSGL_DBG2,__FILE__,__LINE__, ##args ) -#define MSG_DBG3(args...) mp_msg(MSGT_DECAUDIO,MSGL_DBG3,__FILE__,__LINE__, ##args ) -#else -#define MSG_DBG2(args...) -#define MSG_DBG3(args...) + +#define MSGT_CLASS MSGT_DECAUDIO +#include "mp_msg.h" + #endif -#endif Modified: mplayerxp/libmpcodecs/codecs_ld.c =================================================================== --- mplayerxp/libmpcodecs/codecs_ld.c 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/codecs_ld.c 2012-10-31 14:00:16 UTC (rev 266) @@ -7,10 +7,10 @@ #include <string.h> #include <stdarg.h> #include "codecs_ld.h" -#include "../mp_config.h" -#include "../help_mp.h" +#include "mp_config.h" +#include "help_mp.h" #define MSGT_CLASS MSGT_GLOBAL -#include "../__mp_msg.h" +#include "mp_msg.h" any_t* ld_codec(const char *name,const char *url_hint) { Modified: mplayerxp/libmpcodecs/liba52/a52.h =================================================================== --- mplayerxp/libmpcodecs/liba52/a52.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/liba52/a52.h 2012-10-31 14:00:16 UTC (rev 266) @@ -34,22 +34,23 @@ typedef struct a52_state_s a52_state_t; -#define A52_CHANNEL 0 -#define A52_MONO 1 -#define A52_STEREO 2 -#define A52_3F 3 -#define A52_2F1R 4 -#define A52_3F1R 5 -#define A52_2F2R 6 -#define A52_3F2R 7 -#define A52_CHANNEL1 8 -#define A52_CHANNEL2 9 -#define A52_DOLBY 10 -#define A52_CHANNEL_MASK 15 +enum { + A52_CHANNEL =0, + A52_MONO =1, + A52_STEREO =2, + A52_3F =3, + A52_2F1R =4, + A52_3F1R =5, + A52_2F2R =6, + A52_3F2R =7, + A52_CHANNEL1=8, + A52_CHANNEL2=9, + A52_DOLBY =10, + A52_CHANNEL_MASK=15, + A52_LFE =16, + A52_ADJUST_LEVEL=32 +}; -#define A52_LFE 16 -#define A52_ADJUST_LEVEL 32 - a52_state_t * a52_init (uint32_t mm_accel); sample_t * a52_samples (a52_state_t * state); extern int a52_syncinfo (uint8_t * buf, int * flags, @@ -66,5 +67,4 @@ extern int (* a52_resample) (float * _f, int16_t * s16); extern int (* a52_resample32) (float * _f, float * s16); - #endif /* A52_H */ Modified: mplayerxp/libmpcodecs/liba52/a52_internal.h =================================================================== --- mplayerxp/libmpcodecs/liba52/a52_internal.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/liba52/a52_internal.h 2012-10-31 14:00:16 UTC (rev 266) @@ -93,16 +93,18 @@ #define LEVEL_45DB 0.5946035575013605 #define LEVEL_6DB 0.5 -#define EXP_REUSE (0) -#define EXP_D15 (1) -#define EXP_D25 (2) -#define EXP_D45 (3) - -#define DELTA_BIT_REUSE (0) -#define DELTA_BIT_NEW (1) -#define DELTA_BIT_NONE (2) -#define DELTA_BIT_RESERVED (3) - +enum { + EXP_REUSE =0, + EXP_D15 =1, + EXP_D25 =2, + EXP_D45 =3 +}; +enum { + DELTA_BIT_REUSE =0, + DELTA_BIT_NEW =1, + DELTA_BIT_NONE =2, + DELTA_BIT_RESERVED =3 +}; void a52_bit_allocate (a52_state_t * state, ba_t * ba, int bndstart, int start, int end, int fastleak, int slowleak, expbap_t * expbap); Modified: mplayerxp/libmpcodecs/libdca/dca.h =================================================================== --- mplayerxp/libmpcodecs/libdca/dca.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/libdca/dca.h 2012-10-31 14:00:16 UTC (rev 266) @@ -24,14 +24,8 @@ #define DCA_H #include "mp_config.h" +#include "osdep/mm_accel.h" -/* x86 accelerations */ -#define MM_ACCEL_X86_MMX 0x80000000 -#define MM_ACCEL_X86_3DNOW 0x40000000 -#define MM_ACCEL_X86_MMXEXT 0x20000000 - -uint32_t mm_accel (void); - #if defined(LIBDTS_FIXED) typedef int32_t sample_t; typedef int32_t level_t; @@ -45,26 +39,28 @@ typedef struct dca_state_s dca_state_t; -#define DCA_MONO 0 -#define DCA_CHANNEL 1 -#define DCA_STEREO 2 -#define DCA_STEREO_SUMDIFF 3 -#define DCA_STEREO_TOTAL 4 -#define DCA_3F 5 -#define DCA_2F1R 6 -#define DCA_3F1R 7 -#define DCA_2F2R 8 -#define DCA_3F2R 9 -#define DCA_4F2R 10 +enum { + DCA_MONO =0, + DCA_CHANNEL =1, + DCA_STEREO =2, + DCA_STEREO_SUMDIFF=3, + DCA_STEREO_TOTAL=4, + DCA_3F =5, + DCA_2F1R =6, + DCA_3F1R =7, + DCA_2F2R =8, + DCA_3F2R =9, + DCA_4F2R =10, -#define DCA_DOLBY 101 /* FIXME */ + DCA_DOLBY =101, /* FIXME */ -#define DCA_CHANNEL_MAX DCA_3F2R /* We don't handle anything above that */ -#define DCA_CHANNEL_BITS 6 -#define DCA_CHANNEL_MASK 0x3F + DCA_CHANNEL_MAX=DCA_3F2R, /* We don't handle anything above that */ + DCA_CHANNEL_BITS=6, + DCA_CHANNEL_MASK=0x3F, -#define DCA_LFE 0x80 -#define DCA_ADJUST_LEVEL 0x100 + DCA_LFE =0x80, + DCA_ADJUST_LEVEL=0x100 +}; extern dca_state_t * dca_init (uint32_t mm_accel); extern int dca_syncinfo (dca_state_t *state, uint8_t * buf, int * flags, Modified: mplayerxp/libmpcodecs/libdca/dca_internal.h =================================================================== --- mplayerxp/libmpcodecs/libdca/dca_internal.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/libdca/dca_internal.h 2012-10-31 14:00:16 UTC (rev 266) @@ -24,13 +24,14 @@ extern uint32_t dca_accel; -#define DCA_SUBFRAMES_MAX (16) -#define DCA_PRIM_CHANNELS_MAX (5) -#define DCA_SUBBANDS (32) -#define DCA_ABITS_MAX (32) /* Should be 28 */ -#define DCA_SUBSUBFAMES_MAX (4) -#define DCA_LFE_MAX (3) - +enum { + DCA_SUBFRAMES_MAX =16, + DCA_PRIM_CHANNELS_MAX=5, + DCA_SUBBANDS =32, + DCA_ABITS_MAX =32, /* Should be 28 */ + DCA_SUBSUBFAMES_MAX =4, + DCA_LFE_MAX =3 +}; struct dca_state_s { /* Frame header */ Modified: mplayerxp/libmpcodecs/libdca/resample.c =================================================================== --- mplayerxp/libmpcodecs/libdca/resample.c 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/libdca/resample.c 2012-10-31 14:00:16 UTC (rev 266) @@ -22,11 +22,11 @@ #include "resample_mmx.c" #endif -any_t* dca_resample_init(dca_state_t * state,uint32_t mm_accel,int flags,int chans){ +any_t* dca_resample_init(dca_state_t * state,uint32_t _mm_accel,int flags,int chans){ any_t* tmp; #ifdef CAN_COMPILE_MMX - if(mm_accel&MM_ACCEL_X86_MMX){ + if(_mm_accel&MM_ACCEL_X86_MMX){ tmp=dca_resample_MMX(state,flags,chans); if(tmp){ if(dca_resample==NULL) fprintf(stderr, "Using MMX optimized resampler\n"); @@ -42,16 +42,16 @@ dca_resample=tmp; return tmp; } - + fprintf(stderr, "Unimplemented resampler for mode 0x%X -> %d channels conversion - Contact MPlayer developers!\n", flags, chans); return NULL; } -any_t* dca_resample_init_float(dca_state_t * state,uint32_t mm_accel,int flags,int chans){ +any_t* dca_resample_init_float(dca_state_t * state,uint32_t _mm_accel,int flags,int chans){ any_t* tmp; #if 0 //#if defined( ARCH_X86 ) || defined(ARCH_X86_64) - if(mm_accel&MM_ACCEL_X86_MMX){ + if(_mm_accel&MM_ACCEL_X86_MMX){ tmp=dca_resample_MMX(state,flags,chans); if(tmp){ if(dca_resample==NULL) fprintf(stderr, "Using MMX optimized resampler\n"); Modified: mplayerxp/libmpcodecs/libnuppelvideo/lzoconf.h =================================================================== --- mplayerxp/libmpcodecs/libnuppelvideo/lzoconf.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/libnuppelvideo/lzoconf.h 2012-10-31 14:00:16 UTC (rev 266) @@ -306,17 +306,18 @@ * values are errors, positive values will be used for special but * normal events. */ -#define LZO_E_OK 0 -#define LZO_E_ERROR (-1) -#define LZO_E_OUT_OF_MEMORY (-2) /* not used right now */ -#define LZO_E_NOT_COMPRESSIBLE (-3) /* not used right now */ -#define LZO_E_INPUT_OVERRUN (-4) -#define LZO_E_OUTPUT_OVERRUN (-5) -#define LZO_E_LOOKBEHIND_OVERRUN (-6) -#define LZO_E_EOF_NOT_FOUND (-7) -#define LZO_E_INPUT_NOT_CONSUMED (-8) +enum { + LZO_E_OK =0, + LZO_E_ERROR =-1, + LZO_E_OUT_OF_MEMORY =-2, /* not used right now */ + LZO_E_NOT_COMPRESSIBLE =-3, /* not used right now */ + LZO_E_INPUT_OVERRUN =-4, + LZO_E_OUTPUT_OVERRUN =-5, + LZO_E_LOOKBEHIND_OVERRUN =-6, + LZO_E_EOF_NOT_FOUND =-7, + LZO_E_INPUT_NOT_CONSUMED =-8 +}; - /* lzo_init() should be the first function you call. * Check the return code ! * Modified: mplayerxp/libmpcodecs/vd.h =================================================================== --- mplayerxp/libmpcodecs/vd.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/vd.h 2012-10-31 14:00:16 UTC (rev 266) @@ -2,46 +2,37 @@ #define VD_H_INCLUDED 1 #include "libmpconf/cfgparser.h" +#include "xmp_enums.h" typedef struct vd_info_s { - /* driver description ("Autodesk FLI/FLC Animation decoder" */ - const char *descr; - /* driver name ("dshow") */ - const char *driver_name; - /* interface author/maintainer */ - const char *author; - /* URL of homepage */ - const char *url; + const char *descr; /* driver description ("Autodesk FLI/FLC Animation decoder" */ + const char *driver_name; /* driver name ("dshow") */ + const char *author; /* interface author/maintainer */ + const char *url; /* URL of homepage */ } vd_info_t; /* interface of video decoder drivers */ typedef struct vd_functions_s { - const vd_info_t *info; - const config_t* options;/**< Optional: MPlayerXP's option related */ - int (*init)(sh_video_t *sh); - void (*uninit)(sh_video_t *sh); - int (*control)(sh_video_t *sh,int cmd,any_t* arg, ...); - mp_image_t* (*decode)(sh_video_t *sh,any_t* data,int len,int flags); + const vd_info_t *info; + const config_t* options;/**< Optional: MPlayerXP's option related */ + int (*init)(sh_video_t *sh); + void (*uninit)(sh_video_t *sh); + ControlCodes (*control)(sh_video_t *sh,int cmd,any_t* arg, ...); + mp_image_t* (*decode)(sh_video_t *sh,any_t* data,int len,int flags); } vd_functions_t; // NULL terminated array of all drivers extern const vd_functions_t* mpcodecs_vd_drivers[]; -#define CONTROL_OK 1 -#define CONTROL_TRUE 1 -#define CONTROL_FALSE 0 -#define CONTROL_UNKNOWN -1 -#define CONTROL_ERROR -2 -#define CONTROL_NA -3 - -#define VDCTRL_QUERY_FORMAT 3 /* test for availabilty of a format */ -#define VDCTRL_QUERY_MAX_PP_LEVEL 4 /* test for postprocessing support (max level) */ -#define VDCTRL_SET_PP_LEVEL 5 /* set postprocessing level */ -#define VDCTRL_SET_EQUALIZER 6 /* set color options (brightness,contrast etc) */ -#define VDCTRL_RESYNC_STREAM 7 /* resync video stream if needed */ - +enum { + VDCTRL_QUERY_FORMAT =3, /* test for availabilty of a format */ + VDCTRL_QUERY_MAX_PP_LEVEL =4, /* test for postprocessing support (max level) */ + VDCTRL_SET_PP_LEVEL =5, /* set postprocessing level */ + VDCTRL_SET_EQUALIZER =6, /* set color options (brightness,contrast etc) */ + VDCTRL_RESYNC_STREAM =7 /* resync video stream if needed */ +}; // callbacks: int mpcodecs_config_vo(sh_video_t *sh, int w, int h, any_t*tune); mp_image_t* mpcodecs_get_image(sh_video_t *sh, int mp_imgtype, int mp_imgflag,int w, int h); Modified: mplayerxp/libmpcodecs/vd_msg.h =================================================================== --- mplayerxp/libmpcodecs/vd_msg.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpcodecs/vd_msg.h 2012-10-31 14:00:16 UTC (rev 266) @@ -1,26 +1,7 @@ #ifndef VD_MSG_H #define VD_MSG_H 1 -#undef MSG_WARN -#undef MSG_HINT -#undef MSG_V -#undef MSG_INFO -#undef MSG_ERR -#undef MSG_FATAL -#undef MSG_DBG2 -#undef MSG_DBG3 -#undef MSG_OK -#define MSG_INFO(args...) mp_msg(MSGT_DECVIDEO,MSGL_INFO,__FILE__,__LINE__, ##args ) -#define MSG_FATAL(args...) mp_msg(MSGT_DECVIDEO,MSGL_FATAL,__FILE__,__LINE__, ##args ) -#define MSG_WARN(args...) mp_msg(MSGT_DECVIDEO,MSGL_WARN,__FILE__,__LINE__, ##args ) -#define MSG_ERR(args...) mp_msg(MSGT_DECVIDEO,MSGL_ERR,__FILE__,__LINE__, ##args ) -#define MSG_V(args...) mp_msg(MSGT_DECVIDEO,MSGL_V,__FILE__,__LINE__, ##args ) -#define MSG_OK(args...) mp_msg(MSGT_DECVIDEO,MSGL_OK,__FILE__,__LINE__, ##args ) -#define MSG_HINT(args...) mp_msg(MSGT_DECVIDEO,MSGL_HINT,__FILE__,__LINE__, ##args ) -#ifdef MP_DEBUG -#define MSG_DBG2(args...) mp_msg(MSGT_DECVIDEO,MSGL_DBG2,__FILE__,__LINE__, ##args ) -#define MSG_DBG3(args...) mp_msg(MSGT_DECVIDEO,MSGL_DBG3,__FILE__,__LINE__, ##args ) -#else -#define MSG_DBG2(args...) -#define MSG_DBG3(args...) + +#define MSGT_CLASS MSGT_DECVIDEO +#include "mp_msg.h" + #endif -#endif Modified: mplayerxp/libmpconf/cfgparser.c =================================================================== --- mplayerxp/libmpconf/cfgparser.c 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpconf/cfgparser.c 2012-10-31 14:00:16 UTC (rev 266) @@ -39,7 +39,7 @@ #include "cfgparser.h" #include "osdep/mplib.h" #define MSGT_CLASS MSGT_CFGPARSER -#include "__mp_msg.h" +#include "mp_msg.h" typedef int (*cfg_func_arg_param_t)(const config_t *,const char *,const char *); typedef int (*cfg_func_param_t)(const config_t *,const char *); Modified: mplayerxp/libmpconf/cfgparser.h =================================================================== --- mplayerxp/libmpconf/cfgparser.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpconf/cfgparser.h 2012-10-31 14:00:16 UTC (rev 266) @@ -6,32 +6,34 @@ #define __CONFIG_H /* config types */ -#define CONF_TYPE_FLAG 0 -#define CONF_TYPE_INT 1 -#define CONF_TYPE_FLOAT 2 -#define CONF_TYPE_STRING 3 -#define CONF_TYPE_PRINT 4 -#define CONF_TYPE_FUNC 5 -#define CONF_TYPE_FUNC_PARAM 6 -#define CONF_TYPE_FUNC_FULL 7 -#define CONF_TYPE_SUBCONFIG 8 - - -#define ERR_NOT_AN_OPTION -1 -#define ERR_MISSING_PARAM -2 -#define ERR_OUT_OF_RANGE -3 -#define ERR_FUNC_ERR -4 -#define ERR_NO_SUBCONF -5 - +enum { + CONF_TYPE_FLAG =0, + CONF_TYPE_INT =1, + CONF_TYPE_FLOAT =2, + CONF_TYPE_STRING =3, + CONF_TYPE_PRINT =4, + CONF_TYPE_FUNC =5, + CONF_TYPE_FUNC_PARAM=6, + CONF_TYPE_FUNC_FULL =7, + CONF_TYPE_SUBCONFIG =8 +}; +enum { + ERR_NOT_AN_OPTION =-1, + ERR_MISSING_PARAM =-2, + ERR_OUT_OF_RANGE =-3, + ERR_FUNC_ERR =-4, + ERR_NO_SUBCONF =-5 +}; /* config flags */ -#define CONF_MIN (1<<0) -#define CONF_MAX (1<<1) -#define CONF_RANGE (CONF_MIN|CONF_MAX) -#define CONF_NOCFG (1<<2) -#define CONF_NOCMD (1<<3) -#define CONF_GLOBAL (1<<4) -#define CONF_NOSAVE (1<<5) - +enum { + CONF_MIN =(1<<0), + CONF_MAX =(1<<1), + CONF_RANGE =(CONF_MIN|CONF_MAX), + CONF_NOCFG =(1<<2), + CONF_NOCMD =(1<<3), + CONF_GLOBAL =(1<<4), + CONF_NOSAVE =(1<<5) +}; typedef struct config config_t; typedef struct m_config m_config_t; typedef struct config_save config_save_t; @@ -41,37 +43,37 @@ typedef void (*cfg_default_func_t)(config_t *,const char*); struct config { - const char *name; - any_t* const p; - unsigned int type; - unsigned int flags; - float min,max; - const char *help; + const char *name; + any_t* const p; + unsigned int type; + unsigned int flags; + float min,max; + const char *help; }; struct m_config { - const config_t** opt_list; - config_save_t** config_stack; - any_t**dynamics; - unsigned dynasize; - int cs_level; - int parser_mode; /* COMMAND_LINE or CONFIG_FILE */ - int flags; - const char* sub_conf; // When we save a subconfig - play_tree_t* pt; // play tree we use for playlist option, etc - play_tree_t* last_entry; // last added entry - play_tree_t* last_parent; // if last_entry is NULL we must create child of this - int recursion_depth; + const config_t** opt_list; + config_save_t** config_stack; + any_t**dynamics; + unsigned dynasize; + int cs_level; + int parser_mode; /* COMMAND_LINE or CONFIG_FILE */ + int flags; + const char* sub_conf; // When we save a subconfig + play_tree_t* pt; // play tree we use for playlist option, etc + play_tree_t* last_entry; // last added entry + play_tree_t* last_parent; // if last_entry is NULL we must create child of this + int recursion_depth; }; struct config_save { - const config_t* opt; - union { - int as_int; - float as_float; - any_t* as_pointer; - } param; - char* opt_name; + const config_t* opt; + union { + int as_int; + float as_float; + any_t* as_pointer; + } param; + char* opt_name; }; /* parse_config_file returns: Modified: mplayerxp/libmpconf/codec-cfg.c =================================================================== --- mplayerxp/libmpconf/codec-cfg.c 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpconf/codec-cfg.c 2012-10-31 14:00:16 UTC (rev 266) @@ -24,9 +24,8 @@ #include "codec-cfg.h" #include "osdep/mplib.h" #define MSGT_CLASS MSGT_CODECCFG -#include "__mp_msg.h" +#include "mp_msg.h" - #define MAX_NR_TOKEN 16 #define MAX_LINE_LEN 1000 Modified: mplayerxp/libmpconf/codec-cfg.h =================================================================== --- mplayerxp/libmpconf/codec-cfg.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpconf/codec-cfg.h 2012-10-31 14:00:16 UTC (rev 266) @@ -3,26 +3,28 @@ #include <stdint.h> -#define CODECS_MAX_FOURCC 128 -#define CODECS_MAX_OUTFMT 16 -#define CODECS_MAX_INFMT 16 - +enum { + CODECS_MAX_FOURCC =128, + CODECS_MAX_OUTFMT =16, + CODECS_MAX_INFMT =16 +}; +enum { // Global flags: -#define CODECS_FLAG_SEEKABLE (1<<0) -#define CODECS_FLAG_SELECTED (1<<15) /* for internal use */ + CODECS_FLAG_SEEKABLE =(1<<0), + CODECS_FLAG_SELECTED =(1<<15), /* for internal use */ // Outfmt flags: -#define CODECS_FLAG_FLIP (1<<0) -#define CODECS_FLAG_NOFLIP (1<<1) -#define CODECS_FLAG_YUVHACK (1<<2) + CODECS_FLAG_FLIP =(1<<0), + CODECS_FLAG_NOFLIP =(1<<1), + CODECS_FLAG_YUVHACK =(1<<2), -#define CODECS_STATUS__MIN 0 -#define CODECS_STATUS_NOT_WORKING 0 -#define CODECS_STATUS_UNTESTED -1 -#define CODECS_STATUS_PROBLEMS 1 -#define CODECS_STATUS_WORKING 2 -#define CODECS_STATUS__MAX 2 - + CODECS_STATUS__MIN =0, + CODECS_STATUS_NOT_WORKING =0, + CODECS_STATUS_UNTESTED =-1, + CODECS_STATUS_PROBLEMS =1, + CODECS_STATUS_WORKING =2, + CODECS_STATUS__MAX =2 +}; #ifndef GUID_TYPE #define GUID_TYPE typedef struct { Modified: mplayerxp/libmpconf/m_option.c =================================================================== --- mplayerxp/libmpconf/m_option.c 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpconf/m_option.c 2012-10-31 14:00:16 UTC (rev 266) @@ -18,7 +18,7 @@ #include "libmpdemux/url.h" #include "osdep/mplib.h" #define MSGT_CLASS MSGT_CPLAYER -#include "__mp_msg.h" +#include "mp_msg.h" // Don't mp_free for 'production' atm #ifndef MP_DEBUG Modified: mplayerxp/libmpconf/m_option.h =================================================================== --- mplayerxp/libmpconf/m_option.h 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpconf/m_option.h 2012-10-31 14:00:16 UTC (rev 266) @@ -55,33 +55,28 @@ /// Callback used by m_option_type_func options. typedef int (*m_opt_func_t)(const m_option_t *); -#define END_AT_NONE 0 -#define END_AT_TIME 1 -#define END_AT_SIZE 2 +enum { + END_AT_NONE=0, + END_AT_TIME=1, + END_AT_SIZE=2 +}; typedef struct { - double pos; - int type; + double pos; + int type; } m_time_size_t; /// Extra definition needed for \ref m_option_type_obj_settings_list options. typedef struct { - /// Pointer to an array of pointer to some object type description struct. - any_t** list; - /// Offset of the object type name (char*) in the description struct. - any_t* name_off; - /// Offset of the object type info string (char*) in the description struct. - any_t* info_off; - /// \brief Offset of the object type parameter description (\ref m_struct_st) - /// in the description struct. - any_t* desc_off; + any_t** list; /// Pointer to an array of pointer to some object type description struct. + any_t* name_off; /// Offset of the object type name (char*) in the description struct. + any_t* info_off; /// Offset of the object type info string (char*) in the description struct. + any_t* desc_off; /// \brief Offset of the object type parameter description (\ref m_struct_st) in the description struct. } m_obj_list_t; /// The data type used by \ref m_option_type_obj_settings_list. typedef struct m_obj_settings { - /// Type of the object. - char* name; - /// NULL terminated array of parameter/value pairs. - char** attribs; + char* name; /// Type of the object. + char** attribs; /// NULL terminated array of parameter/value pairs. } m_obj_settings_t; /// A parser to set up a list of objects. @@ -93,14 +88,10 @@ /// Extra definition needed for \ref m_option_type_obj_presets options. typedef struct { - /// Description of the struct holding the presets. - struct m_struct_st* in_desc; - /// Description of the struct that should be set by the presets. - struct m_struct_st* out_desc; - /// Pointer to an array of structs defining the various presets. - any_t* presets; - /// Offset of the preset's name inside the in_struct. - any_t* name_off; + struct m_struct_st* in_desc; /// Description of the struct holding the presets. + struct m_struct_st* out_desc; /// Description of the struct that should be set by the presets. + any_t* presets; /// Pointer to an array of structs defining the various presets. + any_t* name_off; /// Offset of the preset's name inside the in_struct. } m_obj_presets_t; /// Set several fields in a struct at once. @@ -120,10 +111,8 @@ /// Extra definition needed for \ref m_option_type_obj_params options. typedef struct { - /// Field descriptions. - const struct m_struct_st* desc; - /// Field separator to use. - char separator; + const struct m_struct_st* desc; /// Field descriptions. + char separator; /// Field separator to use. } m_obj_params_t; /// Parse a set of parameters. @@ -134,8 +123,8 @@ extern const m_option_type_t m_option_type_obj_params; typedef struct { - int start; - int end; + int start; + int end; } m_span_t; /// Ready made settings to parse a \ref m_span_t with a start-end syntax. extern const m_obj_params_t m_span_params_def; @@ -169,17 +158,14 @@ /// Option type description struct m_option_type { - char* name; - /// Syntax description, etc - char* comments; - /// Size needed for the data. - unsigned int size; - /// See \ref OptionTypeFlags. - unsigned int flags; - + char* name; + char* comments; /// Syntax description, etc + unsigned int size; /// Size needed for the data. + unsigned int flags; /// See \ref OptionTypeFlags. + /// Parse the data from a string. /** It is the only required function, all others can be NULL. - * + * * \param opt The option that is parsed. * \param name The full option name. * \param param The parameter to parse. @@ -189,15 +175,15 @@ * \return On error a negative value is returned, on success the number of arguments * consumed. For details see \ref OptionParserReturn. */ - int (*parse)(const m_option_t* opt,const char *name, char *param, any_t* dst, int src); - + int (*parse)(const m_option_t* opt,const char *name, char *param, any_t* dst, int src); + /// Print back a value in string form. /** \param opt The option to print. * \param val Pointer to the memory holding the data to be printed. * \return An allocated string containing the text value or (any_t*)-1 * on error. */ - char* (*print)(const m_option_t* opt, any_t* val); + char* (*print)(const m_option_t* opt, any_t* val); /** \name * These functions are called to save/set/restore the status of the @@ -212,21 +198,21 @@ * \param dst Pointer to the destination memory. * \param src Pointer to the source memory. */ - void (*save)(const m_option_t* opt,any_t* dst, any_t* src); - + void (*save)(const m_option_t* opt,any_t* dst, any_t* src); + /// Set the value in the program (dst) from a save slot. /** \param opt The option to copy. * \param dst Pointer to the destination memory. * \param src Pointer to the source memory. */ - void (*set)(const m_option_t* opt,any_t* dst, any_t* src); + void (*set)(const m_option_t* opt,any_t* dst, any_t* src); /// Copy the data between two save slots. If NULL and size is > 0 a memcpy will be used. /** \param opt The option to copy. * \param dst Pointer to the destination memory. * \param src Pointer to the source memory. */ - void (*copy)(const m_option_t* opt,any_t* dst, any_t* src); + void (*copy)(const m_option_t* opt,any_t* dst, any_t* src); //@} /// Free the data allocated for a save slot. @@ -234,7 +220,7 @@ * \param dst Pointer to the data, usually a pointer that should be freed and * set to NULL. */ - void (*mp_free)(any_t* dst); + void (*mp_free)(any_t* dst); }; ///@} @@ -243,93 +229,49 @@ /** \ingroup Options */ struct m_option { - /// Option name. - const char *name; - - /// Reserved for higher level APIs, it shouldn't be used by parsers. + const char *name; /// Option name. /** The suboption parser and func types do use it. They should instead * use the priv field but this was inherited from older versions of the * config code. */ - any_t*p; - - /// Option type. - const m_option_type_t* type; - - /// See \ref OptionFlags. - unsigned int flags; - - /// \brief Mostly useful for numeric types, the \ref M_OPT_MIN flags must - /// also be set. - double min; - - /// \brief Mostly useful for numeric types, the \ref M_OPT_MAX flags must - /// also be set. - double max; - - /// Type dependent data (for all kinds of extended settings). + any_t*p; /// Reserved for higher level APIs, it shouldn't be used by parsers. + const m_option_type_t* type; /// Option type. + unsigned int flags; /// See \ref OptionFlags. + double min; /// \brief Mostly useful for numeric types, the \ref M_OPT_MIN flags must also be set. + double max; /// \brief Mostly useful for numeric types, the \ref M_OPT_MAX flags must also be set. /** This used to be a function pointer to hold a 'reverse to defaults' func. * Now it can be used to pass any type of extra args needed by the parser. * Passing a 'default func' is still valid for all func based option types. */ - any_t* priv; + any_t* priv; /// Type dependent data (for all kinds of extended settings). }; /// \defgroup OptionFlags Option flags ///@{ - -/// The option has a minimum set in \ref m_option::min. -#define M_OPT_MIN (1<<0) - -/// The option has a maximum set in \ref m_option::max. -#define M_OPT_MAX (1<<1) - -/// The option has a minimum and maximum in \ref m_option::min and \ref m_option::max. -#define M_OPT_RANGE (M_OPT_MIN|M_OPT_MAX) - -/// The option is forbidden in config files. -#define M_OPT_NOCFG (1<<2) - -/// The option is forbidden on the command line. -#define M_OPT_NOCMD (1<<3) - +enum { + M_OPT_MIN =(1<<0), /// The option has a minimum set in \ref m_option::min. + M_OPT_MAX =(1<<1), /// The option has a maximum set in \ref m_option::max. + M_OPT_RANGE =(M_OPT_MIN|M_OPT_MAX), /// The option has a minimum and maximum in \ref m_option::min and \ref m_option::max. + M_OPT_NOCFG =(1<<2), /// The option is forbidden in config files. + M_OPT_NOCMD =(1<<3), /// The option is forbidden on the command line. /// The option is global in the \ref Config. /** It won't be saved on push and the command line parser will set it when * it's parsed (i.e. it won't be set later) * e.g options : -v, -quiet */ -#define M_OPT_GLOBAL (1<<4) - + M_OPT_GLOBAL =(1<<4), /// The \ref Config won't save this option on push. /** It won't be saved on push but the command line parser will add it with * its entry (i.e. it may be set later) * e.g options : -include */ -#define M_OPT_NOSAVE (1<<5) + M_OPT_NOSAVE =(1<<5), + M_OPT_OLD =(1<<6) /// \brief The \ref Config will emulate the old behavior by pushing the option only if it was set by the user. -/// \brief The \ref Config will emulate the old behavior by pushing the -/// option only if it was set by the user. -#define M_OPT_OLD (1<<6) - -/// \defgroup OldOptionFlags Backward compatibility -/// -/// These are kept for compatibility with older code. -/// @{ -#if 0 -#define CONF_MIN M_OPT_MIN -#define CONF_MAX M_OPT_MAX -#define CONF_RANGE M_OPT_RANGE -#define CONF_NOCFG M_OPT_NOCFG -#define CONF_NOCMD M_OPT_NOCMD -#define CONF_GLOBAL M_OPT_GLOBAL -#define CONF_NOSAVE M_OPT_NOSAVE -#define CONF_OLD M_OPT_OLD -#endif +}; ///@} -///@} - /// \defgroup OptionTypeFlags Option type flags /// \ingroup OptionTypes /// @@ -337,6 +279,7 @@ /// ///@{ +enum { /// Suboption parser flag. /** When this flag is set, m_option::p should point to another m_option * array. Only the parse function will be called. If dst is set, it should @@ -345,13 +288,13 @@ * Also note that suboptions may be directly accessed by using * -option:subopt blah. */ -#define M_OPT_TYPE_HAS_CHILD (1<<0) + M_OPT_TYPE_HAS_CHILD =(1<<0), /// Wildcard matching flag. /** If set the option type has a use for option names ending with a * * (used for -aa*), this only affects the option name matching. */ -#define M_OPT_TYPE_ALLOW_WILDCARD (1<<1) + M_OPT_TYPE_ALLOW_WILDCARD =(1<<1), /// Dynamic data type. /** This flag indicates that the data is dynamically allocated (m_option::p @@ -359,7 +302,7 @@ * replaces the initial value of such variables with a dynamic copy in case * the initial value is statically allocated (pretty common with strings). */ -#define M_OPT_TYPE_DYNAMIC (1<<2) + M_OPT_TYPE_DYNAMIC =(1<<2), /// Indirect option type. /** If this is set the parse function doesn't directly return @@ -370,8 +313,8 @@ * target var. It's used by the callback-based options as the callback call * may append later on. */ -#define M_OPT_TYPE_INDIRECT (1<<3) - + M_OPT_TYPE_INDIRECT =(1<<3) +}; ///@} ///////////////////////////// Parser flags //////////////////////////////////////// @@ -384,11 +327,10 @@ /// an argument when parsing from the command line. ///@{ -/// Set when parsing from a config file. -#define M_CONFIG_FILE 0 -/// Set when parsing command line arguments. -#define M_COMMAND_LINE 1 - +enum { + M_CONFIG_FILE=0, /// Set when parsing from a config file. + M_COMMAND_LINE=1 /// Set when parsing command line arguments. +}; ///@} /// \defgroup OptionParserReturn Option parser return code @@ -403,47 +345,21 @@ /// On error one of the following (negative) error codes is returned: ///@{ -/// For use by higher level APIs when the option name is invalid. -#define M_OPT_UNKNOWN -1 - -/// Returned when a parameter is needed but wasn't provided. -#define M_OPT_MISSING_PARAM -2 - -/// Returned when the given parameter couldn't be parsed. -#define M_OPT_INVALID -3 - -/// \brief Returned if the value is "out of range". The exact meaning may -/// vary from type to type. -#define M_OPT_OUT_OF_RANGE -4 - -/// Returned if the parser failed for any other reason than a bad parameter. -#define M_OPT_PARSER_ERR -5 - -/// Returned when MPlayer should exit. Used by various help stuff. -/** M_OPT_EXIT must be the lowest number on this list. - */ -#define M_OPT_EXIT -6 - -/// \defgroup OldOptionParserReturn Backward compatibility -/// -/// These are kept for compatibility with older code. -/// -///@{ -#if 0 -#define ERR_NOT_AN_OPTION M_OPT_UNKNOWN -#define ERR_MISSING_PARAM M_OPT_MISSING_PARAM -#define ERR_OUT_OF_RANGE M_OPT_OUT_OF_RANGE -#define ERR_FUNC_ERR M_OPT_PARSER_ERR -#endif +enum { + M_OPT_UNKNOWN =-1, /// For use by higher level APIs when the option name is invalid. + M_OPT_MISSING_PARAM =-2, /// Returned when a parameter is needed but wasn't provided. + M_OPT_INVALID =-3, /// Returned when the given parameter couldn't be parsed. + M_OPT_OUT_OF_RANGE =-4, /// \brief Returned if the value is "out of range". The exact meaning may vary from type to type. + M_OPT_PARSER_ERR =-5, /// Returned if the parser failed for any other reason than a bad parameter. + M_OPT_EXIT =-6 /// Returned when MPlayer should exit. Used by various help stuff. M_OPT_EXIT must be the lowest number on this list. +}; ///@} -///@} - /// Find the option matching the given name in the list. /** \ingroup Options * This function takes the possible wildcards into account (see * \ref M_OPT_TYPE_ALLOW_WILDCARD). - * + * * \param list Pointer to an array of \ref m_option. * \param name Name of the option. * \return The matching option or NULL. Modified: mplayerxp/libmpconf/m_property.c =================================================================== --- mplayerxp/libmpconf/m_property.c 2012-10-30 17:46:02 UTC (rev 265) +++ mplayerxp/libmpconf/m_property.c 2012-10-31 14:00:16 UTC (rev 266) @@ -15,7 +15,7 @@ #include "help_mp.h" #include "osdep/mplib.h" #define MSGT_CLASS MSGT_CPLAYER -#include "__mp_msg.h" +#include "mp_msg.h" #define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5)) @@ -217,14 +217,14 @@ switch(action) { case M_PROPERTY_SET: if(!arg) return 0; - M_PROPERTY_CLAMP(prop,*(int*)arg); + *(int*)arg=M_PROPERTY_CLAMP(prop,*(int*)arg); *var = *(int*)arg; return 1; case M_PROPERTY_STEP_UP: case M_PROPERTY_STEP_DOWN: *var += (arg ? *(int*)arg : 1) * (action == M_... [truncated message content] |