[MPlayer-cvslog] CVS: main cfg-mplayer.h, 1.258, 1.259 m_property.c, 1.1, 1.2 m_property.h, 1.1, 1.2 mplayer.c, 1.916, 1.917

Alban Bedel CVS syncmail at mplayerhq.hu
Wed Mar 22 17:35:19 CET 2006


CVS change done by Alban Bedel CVS

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

Modified Files:
	cfg-mplayer.h m_property.c m_property.h mplayer.c 
Log Message:
Add an option to list the properties: -list-properties


Index: cfg-mplayer.h
===================================================================
RCS file: /cvsroot/mplayer/main/cfg-mplayer.h,v
retrieving revision 1.258
retrieving revision 1.259
diff -u -r1.258 -r1.259
--- cfg-mplayer.h	22 Mar 2006 00:19:00 -0000	1.258
+++ cfg-mplayer.h	22 Mar 2006 16:35:16 -0000	1.259
@@ -397,6 +397,7 @@
 #include "cfg-common.h"
 #undef MAIN_CONF
         
+	{"list-properties", &list_properties, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
 	{"identify", &identify, CONF_TYPE_FLAG, CONF_GLOBAL, 0, 1, NULL},
 	{"-help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},
 	{"help", help_text, CONF_TYPE_PRINT, CONF_NOCFG|CONF_GLOBAL, 0, 0, NULL},

Index: m_property.c
===================================================================
RCS file: /cvsroot/mplayer/main/m_property.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- m_property.c	22 Mar 2006 00:19:01 -0000	1.1
+++ m_property.c	22 Mar 2006 16:35:16 -0000	1.2
@@ -9,6 +9,7 @@
 
 #include "m_option.h"
 #include "m_property.h"
+#include "mp_msg.h"
 #include "help_mp.h"
 
 #define ROUND(x) ((int)((x)<0 ? (x)-0.5 : (x)+0.5))
@@ -142,6 +143,34 @@
     return ret;
 }
 
+void m_properties_print_help_list(m_option_t* list) {
+    char min[50],max[50];
+    int i,count = 0;
+    
+    mp_msg(MSGT_CFGPARSER, MSGL_INFO, MSGTR_PropertyListHeader);
+    for(i = 0 ; list[i].name ; i++) {
+        m_option_t* opt = &list[i];
+        if(opt->flags & M_OPT_MIN)
+            sprintf(min,"%-8.0f",opt->min);
+        else
+            strcpy(min,"No");
+        if(opt->flags & M_OPT_MAX)
+            sprintf(max,"%-8.0f",opt->max);
+        else
+            strcpy(max,"No");
+        mp_msg(MSGT_CFGPARSER, MSGL_INFO, " %-20.20s %-15.15s %-10.10s %-10.10s\n",
+               opt->name,
+               opt->type->name,
+               min,
+               max,
+               opt->flags & CONF_GLOBAL ? "Yes" : "No",
+               opt->flags & CONF_NOCMD ? "No" : "Yes",
+               opt->flags & CONF_NOCFG ? "No" : "Yes");
+        count++;
+    }
+    mp_msg(MSGT_CFGPARSER, MSGL_INFO, MSGTR_TotalProperties, count);
+}
+
 // Some generic property implementations
 
 int m_property_int_ro(m_option_t* prop,int action,

Index: m_property.h
===================================================================
RCS file: /cvsroot/mplayer/main/m_property.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- m_property.h	22 Mar 2006 00:19:01 -0000	1.1
+++ m_property.h	22 Mar 2006 16:35:16 -0000	1.2
@@ -33,6 +33,8 @@
 
 int m_property_parse(m_option_t* prop, char* txt);
 
+void m_properties_print_help_list(m_option_t* list);
+
 char* m_properties_expand_string(m_option_t* prop_list,char* str);
 
 #define M_PROPERTY_CLAMP(prop,val) do {                                 \

Index: mplayer.c
===================================================================
RCS file: /cvsroot/mplayer/main/mplayer.c,v
retrieving revision 1.916
retrieving revision 1.917
diff -u -r1.916 -r1.917
--- mplayer.c	22 Mar 2006 00:19:01 -0000	1.916
+++ mplayer.c	22 Mar 2006 16:35:16 -0000	1.917
@@ -227,6 +227,8 @@
 int enqueue=0;
 #endif
 
+static int list_properties = 0;
+
 #define MAX_OSD_LEVEL 3
 #define MAX_TERM_OSD_LEVEL 1
 
@@ -1815,6 +1817,10 @@
       mp_msg(MSGT_CPLAYER, MSGL_INFO, "\n");
       opt_exit = 1;
     }
+    if(list_properties) {
+      m_properties_print_help_list(mp_properties);
+      opt_exit = 1;
+    }
 
     if(opt_exit)
       exit_player(NULL);




More information about the MPlayer-cvslog mailing list