[MPlayer-dev-eng] feature XInput

Diego Biurrun diego at biurrun.de
Sat Mar 7 19:31:20 CET 2009


On Sat, Mar 07, 2009 at 06:18:55PM +0100, Christoph Fritz wrote:
> cleanup

> --- input/xinput.c	(revision 0)
> +++ input/xinput.c	(revision 0)
> @@ -0,0 +1,216 @@
> +/*
> + * Add support for XInput, so you can use a Spinner to e.g. control

"Add support" sounds weird here, just say "XInput support" or whatever.

> + * the volume. Only axis and buttons are supported.
> + * Added by Christoph Fritz <christoph_fritz at arcor.de>
> + *
> + * MPlayer is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * MPlayer is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with MPlayer; if not, write to the Free Software Foundation, Inc.,
> + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + */

This is not a standard license header.

> +int mp_input_xinput_init(char* dev, int xinput_minus_sens) {

K&R style for new files please, i.e. put the { on a new line.

> --- input/xinput.h	(revision 0)
> +++ input/xinput.h	(revision 0)
> @@ -0,0 +1,62 @@
> +/*
> + * Add support for XInput, so you can use a Spinner to e.g. control
> + * the volume. Only axis and buttons are supported.
> + * Added by Christoph Fritz <christoph_fritz at arcor.de>
> + *
> + * MPlayer is free software; you can redistribute it and/or modify
> + * it under the terms of the GNU General Public License as published by
> + * the Free Software Foundation; either version 2 of the License, or
> + * (at your option) any later version.
> + *
> + * MPlayer is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License along
> + * with MPlayer; if not, write to the Free Software Foundation, Inc.,
> + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
> + */

see above

> --- Makefile	(revision 28853)
> +++ Makefile	(working copy)
> @@ -599,6 +599,7 @@
>  SRCS_MPLAYER-$(IVTV)         += libao2/ao_ivtv.c libvo/vo_ivtv.c
>  SRCS_MPLAYER-$(JACK)         += libao2/ao_jack.c
>  SRCS_MPLAYER-$(JOYSTICK)     += input/joystick.c
> +SRCS_MPLAYER-$(XINPUT)       += input/xinput.c
>  SRCS_MPLAYER-$(JPEG)         += libvo/vo_jpeg.c
>  SRCS_MPLAYER-$(LIBMENU)      += libmenu/menu.c \
>                                  libmenu/menu_chapsel.c \
> --- configure	(revision 28853)
> +++ configure	(working copy)
> @@ -8144,6 +8162,7 @@
>  IVTV = $_ivtv
>  JACK = $_jack
>  JOYSTICK = $_joystick
> +XINPUT = $_xinput
>  JPEG = $_jpeg
>  LADSPA = $_ladspa
>  LIBA52 = $_liba52
> @@ -8578,6 +8597,7 @@
>  $def_ioctl_bt848_h_name
>  $def_ioctl_meteor_h_name
>  $def_joystick
> +$def_xinput
>  $def_lirc
>  $def_lircc
>  $def_pvr

These were previously in alphabetical order.

> --- help/help_mp-en.h	(revision 28853)
> +++ help/help_mp-en.h	(working copy)
> @@ -1343,6 +1343,16 @@
>  
> +// xinput.c
> +#define MSGTR_INPUT_XINPUT_Opening "Opening XInput-Device-Name \"%s\" with a value of minus %u sensitivity\n"
> +#define MSGTR_INPUT_XINPUT_ErrorSensitivityIsSignedInt "Error XInput-minus_sensitivity (%i) is less than zero\n"
> +#define MSGTR_INPUT_XINPUT_SensitivityIs "XInput-minus_sensitivity is set to %u\n"
> +#define MSGTR_INPUT_XINPUT_CantOpenDisplay "XInput error, can't open display\n"
> +#define MSGTR_INPUT_XINPUT_CantOpenDevName "Can't open XInput-Device-Name \"%s\"\n"
> +#define MSGTR_INPUT_XINPUT_CantOpenState "XInput error, cannot open state of device-name \"%s\"\n"
> +#define MSGTR_INPUT_XINPUT_AXIS "XInput-Device-Name \"%s\" with axis[%i]=%i\n"
> +#define MSGTR_INPUT_XINPUT_POSSIBLES "XInput-Device-Name \"%s\" found %i axis of %i possibilities and %i buttons of %i possibilities\n"

Please add periods at the end of sentences.

Diego



More information about the MPlayer-dev-eng mailing list