diff options
Diffstat (limited to 'input/joystick.c')
-rw-r--r-- | input/joystick.c | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/input/joystick.c b/input/joystick.c index 4549a1bd9c..40a1b22b7f 100644 --- a/input/joystick.c +++ b/input/joystick.c @@ -31,7 +31,6 @@ #include <errno.h> #include "mp_msg.h" -#include "help_mp.h" #ifndef JOY_AXIS_DELTA #define JOY_AXIS_DELTA 500 @@ -51,11 +50,11 @@ int mp_input_joystick_init(char* dev) { int initialized = 0; struct js_event ev; - mp_msg(MSGT_INPUT,MSGL_V,MSGTR_INPUT_JOYSTICK_Opening,dev ? dev : JS_DEV); + mp_tmsg(MSGT_INPUT,MSGL_V,"Opening joystick device %s\n",dev ? dev : JS_DEV); fd = open( dev ? dev : JS_DEV , O_RDONLY | O_NONBLOCK ); if(fd < 0) { - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_CantOpen,dev ? dev : JS_DEV,strerror(errno)); + mp_tmsg(MSGT_INPUT,MSGL_ERR,"Can't open joystick device %s: %s\n",dev ? dev : JS_DEV,strerror(errno)); return -1; } @@ -70,7 +69,7 @@ int mp_input_joystick_init(char* dev) { initialized = 1; break; } - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,strerror(errno)); + mp_tmsg(MSGT_INPUT,MSGL_ERR,"Error while reading joystick device: %s\n",strerror(errno)); close(fd); return -1; } @@ -78,7 +77,7 @@ int mp_input_joystick_init(char* dev) { } if((unsigned int)l < sizeof(struct js_event)) { if(l > 0) - mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_LoosingBytes,l); + mp_tmsg(MSGT_INPUT,MSGL_WARN,"Joystick: We lose %d bytes of data\n",l); break; } if(ev.type == JS_EVENT_BUTTON) @@ -90,7 +89,7 @@ int mp_input_joystick_init(char* dev) { return fd; } -int mp_input_joystick_read(int fd) { +int mp_input_joystick_read(void *ctx, int fd) { struct js_event ev; int l=0; @@ -102,9 +101,9 @@ int mp_input_joystick_read(int fd) { else if(errno == EAGAIN) return MP_INPUT_NOTHING; if( r < 0) - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,strerror(errno)); + mp_tmsg(MSGT_INPUT,MSGL_ERR,"Error while reading joystick device: %s\n",strerror(errno)); else - mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,"EOF"); + mp_tmsg(MSGT_INPUT,MSGL_ERR,"Error while reading joystick device: %s\n","EOF"); return MP_INPUT_DEAD; } l += r; @@ -112,12 +111,12 @@ int mp_input_joystick_read(int fd) { if((unsigned int)l < sizeof(struct js_event)) { if(l > 0) - mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_LoosingBytes,l); + mp_tmsg(MSGT_INPUT,MSGL_WARN,"Joystick: We lose %d bytes of data\n",l); return MP_INPUT_NOTHING; } if(ev.type & JS_EVENT_INIT) { - mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_WarnLostSync); + mp_tmsg(MSGT_INPUT,MSGL_WARN,"Joystick: warning init event, we have lost sync with driver.\n"); ev.type &= ~JS_EVENT_INIT; if(ev.type == JS_EVENT_BUTTON) { int s = (btns >> ev.number) & 1; @@ -154,7 +153,7 @@ int mp_input_joystick_read(int fd) { } else return MP_INPUT_NOTHING; } else { - mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_WarnUnknownEvent,ev.type); + mp_tmsg(MSGT_INPUT,MSGL_WARN,"Joystick warning unknown event type %d\n",ev.type); return MP_INPUT_ERROR; } |