[Mplayer-cvslog] CVS: main mp_msg.c,1.19,1.20

Arpi of Ize arpi at mplayerhq.hu
Sat Aug 31 16:54:14 CEST 2002


Update of /cvsroot/mplayer/main
In directory mail:/var/tmp.root/cvs-serv27070

Modified Files:
	mp_msg.c 
Log Message:
- warnings enabled for GUI mode
- color mode (color depends on msg level), disabled by default


Index: mp_msg.c
===================================================================
RCS file: /cvsroot/mplayer/main/mp_msg.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- mp_msg.c	31 Aug 2002 13:44:03 -0000	1.19
+++ mp_msg.c	31 Aug 2002 14:54:00 -0000	1.20
@@ -1,4 +1,6 @@
 
+//#define MSG_USE_COLORS
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <stdarg.h>
@@ -67,18 +69,34 @@
 	    case MSGL_ERR:
 		gtkMessageBox(GTK_MB_ERROR|GTK_MB_SIMPLE, tmp);
 		break;
-//	    case MSGL_WARN:
-//		gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, tmp);
-//		break;
+	    case MSGL_WARN:
+		gtkMessageBox(GTK_MB_WARNING|GTK_MB_SIMPLE, tmp);
+		break;
 	}
     }
 #endif
 
+#ifdef MSG_USE_COLORS
+#if 1
+    { int c;
+      static int flag=1;
+      if(flag)
+      for(c=0;c<16;c++)
+          printf("\033[%d;3%dm***  COLOR TEST %d  ***\n",(c>7),c&7,c);
+      flag=0;
+    }
+#endif    
+    {	unsigned char v_colors[10]={9,9,11,14,15,7,6,5,5,5};
+	int c=v_colors[(x & 255)];
+	fprintf(((x & 255) <= MSGL_WARN)?stderr:stdout, "\033[%d;3%dm",(c>7),c&7);
+    }
+#endif
     if ((x & 255) <= MSGL_WARN){
 	fprintf(stderr, "%s", tmp);fflush(stderr);
     } else {
 	printf("%s", tmp);fflush(stdout);
     }
+
 #else
     va_list va;
     if((x&255)>mp_msg_levels[x>>8]) return; // do not display




More information about the MPlayer-cvslog mailing list