[MPlayer-cvslog] CVS: main/input joystick.c,1.6,1.7

Reynaldo H. Verdejo CVS syncmail at mplayerhq.hu
Tue Oct 25 20:45:42 CEST 2005


CVS change done by Reynaldo H. Verdejo CVS

Update of /cvsroot/mplayer/main/input
In directory mail:/var2/tmp/cvs-serv14722/input

Modified Files:
	joystick.c 
Log Message:
printf to mp_msg

Index: joystick.c
===================================================================
RCS file: /cvsroot/mplayer/main/input/joystick.c,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- joystick.c	9 Jul 2003 01:30:22 -0000	1.6
+++ joystick.c	25 Oct 2005 18:45:39 -0000	1.7
@@ -15,6 +15,9 @@
 #include <fcntl.h>
 #include <errno.h>
 
+#include "mp_msg.h"
+#include "help_mp.h"
+
 #ifndef JOY_AXIS_DELTA
 #define JOY_AXIS_DELTA 500
 #endif
@@ -35,11 +38,11 @@
   int inited = 0;
   struct js_event ev;
   
-  printf("Opening joystick device %s\n",dev ? dev : JS_DEV);
+  mp_msg(MSGT_INPUT,MSGL_INFO,MSGTR_INPUT_JOYSTICK_Opening,dev ? dev : JS_DEV);
 
   fd = open( dev ? dev : JS_DEV , O_RDONLY | O_NONBLOCK );
   if(fd < 0) {
-    printf("Can't open joystick device %s : %s\n",dev ? dev : JS_DEV,strerror(errno));
+    mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_CantOpen,dev ? dev : JS_DEV,strerror(errno));
     return -1;
   }
   
@@ -54,7 +57,7 @@
 	  inited = 1;
 	  break;
 	}
-	printf("Error while reading joystick device : %s\n",strerror(errno));
+	mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,strerror(errno));
 	close(fd);
 	return -1;
       }	
@@ -62,7 +65,7 @@
     }
     if((unsigned int)l < sizeof(struct js_event)) {
       if(l > 0)
-	printf("Joystick : we loose %d bytes of data\n",l);
+	mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_LoosingBytes,l);	  
       break;
     }
     ev.type &= ~JS_EVENT_INIT;
@@ -87,9 +90,9 @@
       else if(errno == EAGAIN)
 	return MP_INPUT_NOTHING;
       if( r < 0)
-	printf("Joystick error while reading joystick device : %s\n",strerror(errno));
+	mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,strerror(errno));
       else
-	printf("Joystick error while reading joystick device : EOF\n");
+	mp_msg(MSGT_INPUT,MSGL_ERR,MSGTR_INPUT_JOYSTICK_ErrReading,"EOF"); 
       return MP_INPUT_DEAD;
     } 	
     l += r;
@@ -97,12 +100,12 @@
 
   if((unsigned int)l < sizeof(struct js_event)) {
     if(l > 0)
-      printf("Joystick : we loose %d bytes of data\n",l);
+      mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_LoosingBytes,l);
     return MP_INPUT_NOTHING;
   }
 
   if(ev.type & JS_EVENT_INIT) {
-    printf("Joystick : warning init event, we have lost sync with driver\n");
+    mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_WarnLostSync);	
     ev.type &= ~JS_EVENT_INIT;
     if(ev.type == JS_EVENT_BUTTON) {
       int s = (btns >> ev.number) & 1;
@@ -139,7 +142,7 @@
     } else
       return MP_INPUT_NOTHING;
   } else {
-    printf("Joystick warning unknown event type %d\n",ev.type);
+    mp_msg(MSGT_INPUT,MSGL_WARN,MSGTR_INPUT_JOYSTICK_WarnUnknownEvent,ev.type);	
     return MP_INPUT_ERROR;
   }
 




More information about the MPlayer-cvslog mailing list