[vlc-commits] Add integer config item type for RGB values

Rémi Denis-Courmont git at videolan.org
Wed Jun 29 22:39:44 CEST 2011


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Jun 29 23:35:58 2011 +0300| [4fc0e980e79086242230178a9aa82f3994b0a0aa] | committer: Rémi Denis-Courmont

Add integer config item type for RGB values

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4fc0e980e79086242230178a9aa82f3994b0a0aa
---

 include/vlc_configuration.h |    1 +
 include/vlc_plugin.h        |    4 ++++
 src/config/cmdline.c        |    1 +
 src/libvlc.c                |    1 +
 4 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/include/vlc_configuration.h b/include/vlc_configuration.h
index 2284f1c..7a40485 100644
--- a/include/vlc_configuration.h
+++ b/include/vlc_configuration.h
@@ -53,6 +53,7 @@ extern "C" {
 /* Configuration item types */
 #define CONFIG_ITEM_FLOAT                   0x20  /* Float option */
 #define CONFIG_ITEM_INTEGER                 0x40  /* Integer option */
+#define CONFIG_ITEM_RGB                     0x41  /* RGB color option */
 #define CONFIG_ITEM_BOOL                    0x60  /* Bool option */
 #define CONFIG_ITEM_STRING                  0x80  /* String option */
 #define CONFIG_ITEM_PASSWORD                0x81  /* Password option (*) */
diff --git a/include/vlc_plugin.h b/include/vlc_plugin.h
index 1f03e62..a99d2e1 100644
--- a/include/vlc_plugin.h
+++ b/include/vlc_plugin.h
@@ -345,6 +345,10 @@ enum vlc_module_properties
 #define add_integer( name, value, text, longtext, advc ) \
     add_int_inner( CONFIG_ITEM_INTEGER, name, text, longtext, advc, value )
 
+#define add_rgb( name, value, text, longtext, advc ) \
+    add_int_inner( CONFIG_ITEM_RGB, name, text, longtext, advc, value ) \
+    change_integer_range( 0, 0xFFFFFF )
+
 #define add_key( name, value, text, longtext, advc ) \
     add_string_inner( CONFIG_ITEM_KEY, "global-" name, text, longtext, advc, \
                    KEY_UNSET ) \
diff --git a/src/config/cmdline.c b/src/config/cmdline.c
index ecdc5ff..266705f 100644
--- a/src/config/cmdline.c
+++ b/src/config/cmdline.c
@@ -258,6 +258,7 @@ int config_LoadCmdLine( vlc_object_t *p_this, int i_argc,
                         var_SetString( p_this, psz_name, state.arg );
                         break;
                     case CONFIG_ITEM_INTEGER:
+                    case CONFIG_ITEM_RGB:
                         var_Create( p_this, psz_name, VLC_VAR_INTEGER );
                         var_SetInteger( p_this, psz_name,
                                         strtoll(state.arg, NULL, 0));
diff --git a/src/libvlc.c b/src/libvlc.c
index 2a950fd..2b272f1 100644
--- a/src/libvlc.c
+++ b/src/libvlc.c
@@ -1545,6 +1545,7 @@ static void Usage( libvlc_int_t *p_this, char const *psz_search )
                 }
                 break;
             case CONFIG_ITEM_INTEGER:
+            case CONFIG_ITEM_RGB:
                 print_help_section( p_parser, p_section, b_color,
                                     b_description );
                 p_section = NULL;



More information about the vlc-commits mailing list