Update of /cvsroot/xine/xine-lib/src/xine-engine
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv14035/src/xine-engine

Modified Files:
        configfile.c configfile.h xine.c xine_interface.c 
Log Message:
Mark string-type configuration items according to whether they're plain
strings or names of files, device nodes or directories. This information is
available to front ends (via .num_value) so that they can present
file/dir-open dialogue boxes if they so choose.

Subtitle font selection is split up due to this.


Index: configfile.c
===================================================================
RCS file: /cvsroot/xine/xine-lib/src/xine-engine/configfile.c,v
retrieving revision 1.81
retrieving revision 1.82
diff -u -r1.81 -r1.82
--- configfile.c        26 Sep 2006 21:51:11 -0000      1.81
+++ configfile.c        19 Dec 2006 19:10:52 -0000      1.82
@@ -491,14 +491,15 @@
   return entry;
 }
 
-static char *config_register_string (config_values_t *this,
-                                    const char *key,
-                                    const char *def_value,
-                                    const char *description,
-                                    const char *help,
-                                    int exp_level,
-                                    xine_config_cb_t changed_cb,
-                                    void *cb_data) {
+static cfg_entry_t *config_register_string_internal (config_values_t *this,
+                                                    const char *key,
+                                                    const char *def_value,
+                                                    int num_value,
+                                                    const char *description,
+                                                    const char *help,
+                                                    int exp_level,
+                                                    xine_config_cb_t 
changed_cb,
+                                                    void *cb_data) {
   cfg_entry_t *entry;
 
   _x_assert(this);
@@ -512,7 +513,7 @@
   if (entry->type != XINE_CONFIG_TYPE_UNKNOWN) {
     lprintf("config entry already registered: %s\n", key);
     pthread_mutex_unlock(&this->config_lock);
-    return entry->str_value;
+    return entry;
   }
 
   config_reset_value(entry);
@@ -525,13 +526,40 @@
   else
     entry->str_value = strdup(def_value);
 
+  entry->num_value = num_value;
+
   /* fill out rest of struct */
   entry->str_default    = strdup(def_value);
   entry->description    = (description) ? strdup(description) : NULL;
   entry->help           = (help) ? strdup(help) : NULL;
 
   pthread_mutex_unlock(&this->config_lock);
-  return entry->str_value;
+  return entry;
+}
+
+static char *config_register_string (config_values_t *this,
+                                    const char *key,
+                                    const char *def_value,
+                                    const char *description,
+                                    const char *help,
+                                    int exp_level,
+                                    xine_config_cb_t changed_cb,
+                                    void *cb_data) {
+  return config_register_string_internal (this, key, def_value, 0, description,
+                                         help, exp_level, changed_cb, 
cb_data)->str_value;
+}
+
+static char *config_register_filename (config_values_t *this,
+                                      const char *key,
+                                      const char *def_value,
+                                      int req_type,
+                                      const char *description,
+                                      const char *help,
+                                      int exp_level,
+                                      xine_config_cb_t changed_cb,
+                                      void *cb_data) {
+  return config_register_string_internal (this, key, def_value, req_type, 
description,
+                                         help, exp_level, changed_cb, 
cb_data)->str_value;
 }
 
 static int config_register_num (config_values_t *this,
@@ -1184,6 +1212,7 @@
   pthread_mutex_init(&this->config_lock, &attr);
 
   this->register_string     = config_register_string;
+  this->register_filename   = config_register_filename;
   this->register_range      = config_register_range;
   this->register_enum       = config_register_enum;
   this->register_num        = config_register_num;

Index: configfile.h
===================================================================
RCS file: /cvsroot/xine/xine-lib/src/xine-engine/configfile.h,v
retrieving revision 1.38
retrieving revision 1.39
diff -u -r1.38 -r1.39
--- configfile.h        26 Sep 2006 05:19:48 -0000      1.38
+++ configfile.h        19 Dec 2006 19:10:52 -0000      1.39
@@ -108,6 +108,16 @@
                            xine_config_cb_t changed_cb,
                            void *cb_data);
 
+  char* (*register_filename) (config_values_t *self,
+                             const char *key,
+                             const char *def_value,
+                             int req_type,
+                             const char *description,
+                             const char *help,
+                             int exp_level,
+                             xine_config_cb_t changed_cb,
+                             void *cb_data);
+
   int (*register_range) (config_values_t *self,
                         const char *key,
                         int def_value,

Index: xine.c
===================================================================
RCS file: /cvsroot/xine/xine-lib/src/xine-engine/xine.c,v
retrieving revision 1.338
retrieving revision 1.339
diff -u -r1.338 -r1.339
--- xine.c      19 Dec 2006 14:10:35 -0000      1.338
+++ xine.c      19 Dec 2006 19:10:52 -0000      1.339
@@ -1579,9 +1579,9 @@
   /*
    * save directory
    */
-  this->save_path  = this->config->register_string (
+  this->save_path  = this->config->register_filename (
       this->config, 
-      "media.capture.save_dir", "",
+      "media.capture.save_dir", "", XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
       _("directory for saving streams"),
       _("When using the stream save feature, files will be written only into 
this directory.\n"
        "This setting is security critical, because when changed to a different 
directory, xine "

Index: xine_interface.c
===================================================================
RCS file: /cvsroot/xine/xine-lib/src/xine-engine/xine_interface.c,v
retrieving revision 1.99
retrieving revision 1.100
diff -u -r1.99 -r1.100
--- xine_interface.c    16 Oct 2006 06:29:38 -0000      1.99
+++ xine_interface.c    19 Dec 2006 19:10:52 -0000      1.100
@@ -100,7 +100,23 @@
                                        cb_data);
 
 }
-  
+
+const char* xine_config_register_filename (xine_t *self,
+                                          const char *key,
+                                          const char *def_value,
+                                          int req_type,
+                                          const char *description,
+                                          const char *help,
+                                          int   exp_level,
+                                          xine_config_cb_t changed_cb,
+                                          void *cb_data) {
+  
+  return self->config->register_filename (self->config,
+                                         key, def_value, req_type,
+                                         description, help, exp_level,
+                                         changed_cb, cb_data);
+}
+
 int xine_config_register_range (xine_t *self,
                                const char *key,
                                int def_value,


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Xine-cvslog mailing list
Xine-cvslog@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/xine-cvslog

Reply via email to