changeset 1518:e0ceb814471d

vo_aa: configurable now
author folke
date Tue, 14 Aug 2001 19:00:00 +0000
parents 0e9c29538a86
children 7474bb046ed5
files cfg-mplayer.h libvo/vo_aa.c
diffstat 2 files changed, 49 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/cfg-mplayer.h	Tue Aug 14 18:28:56 2001 +0000
+++ b/cfg-mplayer.h	Tue Aug 14 19:00:00 2001 +0000
@@ -49,6 +49,13 @@
 extern char *mDisplayName;
 #endif
 
+#ifdef HAVE_AA
+extern int  aaopt_osdcolor;
+extern int  aaopt_extended;
+extern int  aaopt_eight;
+extern char aaopt_driver;
+#endif
+
 struct config conf[]={
 	/* name, pointer, type, flags, min, max */
 	{"include", cfg_include, CONF_TYPE_FUNC_PARAM, 0, 0, 0}, /* this must be the first!!! */
@@ -194,7 +201,15 @@
 #ifdef HAVE_LIRC
 	{"lircconf", &lirc_configfile, CONF_TYPE_STRING, 0, 0, 0}, 
 #endif
-	
+
+#ifdef HAVE_AA
+	{"aaosdfont", &aaopt_osdcolor, CONF_TYPE_INT, CONF_RANGE, 0, 5 }, 
+	{"aaextended", &aaopt_extended, CONF_TYPE_FLAG, 0, 0, 1 },
+	{"aaeight", &aaopt_eight, CONF_TYPE_FLAG, 0, 0, 1 },
+	{"aadriver", &aaopt_driver, CONF_TYPE_STRING, 0, 0, 0 },
+#endif
+
+      
 	{"noidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 0},
 	{"idx", &index_mode, CONF_TYPE_FLAG, 0, -1, 1},
 	{"forceidx", &index_mode, CONF_TYPE_FLAG, 0, -1, 2},
--- a/libvo/vo_aa.c	Tue Aug 14 18:28:56 2001 +0000
+++ b/libvo/vo_aa.c	Tue Aug 14 19:00:00 2001 +0000
@@ -75,10 +75,18 @@
 double accum;
 
 /* our version of the playmodes :) */
-static char * osdmodes[] ={ ">", "\"", "#", "-" , "+" };
+static char * osdmodes[] ={ "|>", "||", ">>", "[]" , ">>" };
 
 extern void mplayer_put_key(int code);
 
+/* to disable stdout outputs when curses/linux mode */
+extern int quiet;
+
+/* config options */
+int aaopt_extended = 0;
+int aaopt_eight = 0;
+int aaopt_osdcolor = AA_SPECIAL;
+char *aaopt_driver = NULL;
 
 void
 resize(void){
@@ -199,8 +207,15 @@
     aa_recommendhidisplay("curses");
     aa_recommendhidisplay("X11");
     aa_recommendlowdisplay("linux");
+    
+    /* options ? */
+    if (aaopt_eight) aa_defparams.supported|=AA_EIGHT;
+    if (aaopt_extended && !aaopt_eight) aa_defparams.supported|=AA_EXTENDED;
+    if (aaopt_driver!=NULL){
+	aa_recommendhidisplay(aaopt_driver);
+    }
 
-
+    
     c = aa_autoinit(&aa_defparams);
     aa_resizehandler(c, (void *)resize);
 
@@ -223,8 +238,10 @@
     aa_hidecursor(c);
     p = aa_getrenderparams();
 
-    if ((strstr(c->driver->name,"curses")) || (strstr(c->driver->name,"libux"))) 
+    if ((strstr(c->driver->name,"curses")) || (strstr(c->driver->name,"linux"))){
 	freopen("/dev/null", "w", stderr);
+	quiet=1; /* disable mplayer outputs */
+    }
     
     image_height = height;
     image_width = width;
@@ -246,7 +263,12 @@
 
     printf(
 		"\n"
-		"\tAA-MPlayer Keys:\n"
+		"Options\n"
+		"\t-aaosdfont   0=normal, 1=dark, 2=bold, 3-boldfont, 4=reverse, 5=special\n"
+		"\t-aaextended  use use all 256 characters\n"
+		"\t-aaeight     use eight bit ascii\n"
+		"\n"
+		"AA-MPlayer Keys:\n"
 		"\t1 : fast rendering\n"
 		"\t2 : dithering\n"
 		"\t3 : invert image\n"
@@ -329,10 +351,10 @@
      */
     if (vo_osd_text){
 	if (vo_osd_text[0]-1<=5)
-	  aa_puts(c, 0,0, AA_BOLDFONT, osdmodes[vo_osd_text[0]-1]);
-	else aa_puts(c, 0,0, AA_BOLDFONT, "?");
-	aa_puts(c,1,0, AA_BOLDFONT, vo_osd_text+1);
-	aa_puts(c,strlen(vo_osd_text),0, AA_BOLDFONT, " ");
+	  aa_puts(c, 0,0, aaopt_osdcolor, osdmodes[vo_osd_text[0]-1]);
+	else aa_puts(c, 0,0, aaopt_osdcolor, "?");
+	aa_puts(c,2,0, aaopt_osdcolor, vo_osd_text+1);
+	aa_puts(c,strlen(vo_osd_text)+1,0, aaopt_osdcolor, " ");
     }
 }
 
@@ -505,8 +527,10 @@
     free(stx);
     free(sty);
     if (convertbuf!=NULL) free(convertbuf);
-    if (strstr(c->driver->name,"curses") || strstr(c->driver->name,"libux")) 
+    if (strstr(c->driver->name,"curses") || strstr(c->driver->name,"libux")){
 	freopen("/dev/tty", "w", stderr);
+	quiet=0; /* enable mplayer outputs */
+    }
 }
 
 static void