[Mplayer-cvslog] CVS: main mp_msg.c,1.10,1.11
Alex Beregszaszi
alex at mplayer.dev.hu
Fri Mar 15 22:08:18 CET 2002
Update of /cvsroot/mplayer/main
In directory mplayer:/var/tmp.root/cvs-serv7018
Modified Files:
mp_msg.c
Log Message:
added i18n support
Index: mp_msg.c
===================================================================
RCS file: /cvsroot/mplayer/main/mp_msg.c,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- mp_msg.c 28 Feb 2002 08:26:20 -0000 1.10
+++ mp_msg.c 15 Mar 2002 21:08:14 -0000 1.11
@@ -10,7 +10,6 @@
extern void gtkMessageBox( int type,char * str );
extern int use_gui;
#endif
-
#include "mp_msg.h"
static int mp_msg_levels[MSGT_MAX]; // verbose level of this module
@@ -25,6 +24,41 @@
}
void mp_msg_c( int x, const char *format, ... ){
+#if 1
+ va_list va;
+ char tmp[2048];
+
+ if((x&255)>mp_msg_levels[x>>8]) return; // do not display
+ va_start(va, mp_gettext(format));
+ vsnprintf(tmp, 2048, mp_gettext(format), va);
+ tmp[2047] = 0;
+
+#if defined(HAVE_NEW_GUI) && !defined(HAVE_MENCODER)
+ if(use_gui)
+ {
+ switch(x & 255)
+ {
+ case MSGL_FATAL:
+ gtkMessageBox(GTK_MB_FATAL|GTK_MB_SIMPLE, tmp);
+ break;
+ case MSGL_ERR:
+ gtkMessageBox(GTK_MB_ERROR|GTK_MB_SIMPLE, tmp);
+ break;
+ case MSGL_WARN:
+ gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, tmp);
+ break;
+ }
+ }
+#endif
+
+ fprintf(stderr, "%s", tmp);
+ if ((x & 255) <= MSGL_ERR)
+ fflush(stderr);
+ else
+ fflush(stdout);
+
+ va_end(va);
+#else
va_list va;
if((x&255)>mp_msg_levels[x>>8]) return; // do not display
va_start(va, format);
@@ -64,6 +98,7 @@
fflush(stdout);
}
va_end(va);
+#endif
}
#else
More information about the MPlayer-cvslog
mailing list