summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--src/audio_out/audio_sun_out.c5
-rw-r--r--src/input/input_cdda.c10
-rw-r--r--src/input/input_dvd.c13
-rw-r--r--src/input/input_file.c6
-rw-r--r--src/input/input_pvr.c6
-rw-r--r--src/input/input_v4l.c8
-rw-r--r--src/input/input_vcd.c4
-rw-r--r--src/input/vcd/xineplug_inp_vcd.c6
-rw-r--r--src/libreal/audio_decoder.c5
-rw-r--r--src/libreal/xine_decoder.c5
-rw-r--r--src/libsputext/xine_decoder.c68
-rw-r--r--src/libw32dll/common.c2
-rw-r--r--src/video_out/video_out_fb.c4
-rw-r--r--src/video_out/video_out_syncfb.c5
-rw-r--r--src/video_out/video_out_vidix.c4
-rw-r--r--src/xine-engine/configfile.c51
-rw-r--r--src/xine-engine/configfile.h12
-rw-r--r--src/xine-engine/xine.c6
-rw-r--r--src/xine-engine/xine_interface.c18
20 files changed, 179 insertions, 65 deletions
diff --git a/ChangeLog b/ChangeLog
index 45f655334..3b1cdc948 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
xine-lib (1.1.4)
- (write here)
+ * 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.
xine-lib (1.1.3)
* Security fixes:
diff --git a/src/audio_out/audio_sun_out.c b/src/audio_out/audio_sun_out.c
index 95e38d811..15bd3b72d 100644
--- a/src/audio_out/audio_sun_out.c
+++ b/src/audio_out/audio_sun_out.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_sun_out.c,v 1.45 2006/07/16 16:18:09 dsalt Exp $
+ * $Id: audio_sun_out.c,v 1.46 2006/12/19 19:10:51 dsalt Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -888,9 +888,10 @@ static ao_driver_t *ao_sun_open_plugin (audio_driver_class_t *class_gen, const v
audiodev = getenv("AUDIODEV");
/* This config entry is security critical, is it really necessary? */
- devname = config->register_string(config,
+ devname = config->register_filename(config,
"audio.device.sun_audio_device",
audiodev && *audiodev ? audiodev : "/dev/audio",
+ XINE_CONFIG_STRING_IS_DEVICE_NAME,
_("Sun audio device name"),
_("Specifies the file name for the Sun audio device "
"to be used.\nThis setting is security critical, "
diff --git a/src/input/input_cdda.c b/src/input/input_cdda.c
index f51ffc646..7ee2e7899 100644
--- a/src/input/input_cdda.c
+++ b/src/input/input_cdda.c
@@ -20,7 +20,7 @@
* Compact Disc Digital Audio (CDDA) Input Plugin
* by Mike Melanson (melanson@pcisys.net)
*
- * $Id: input_cdda.c,v 1.90 2006/08/11 21:40:02 dsalt Exp $
+ * $Id: input_cdda.c,v 1.91 2006/12/19 19:10:51 dsalt Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -2675,8 +2675,8 @@ static void *init_plugin (xine_t *xine, void *data) {
this->mrls_allocated_entries = 0;
this->ip = NULL;
- this->cdda_device = config->register_string(config, "media.audio_cd.device",
- DEFAULT_CDDA_DEVICE,
+ this->cdda_device = config->register_filename(config, "media.audio_cd.device",
+ DEFAULT_CDDA_DEVICE, XINE_CONFIG_STRING_IS_DEVICE_NAME,
_("device used for CD audio"),
_("The path to the device, usually a "
"CD or DVD drive, which you intend to use "
@@ -2704,8 +2704,8 @@ static void *init_plugin (xine_t *xine, void *data) {
"title and track information from."), XINE_CONFIG_SECURITY,
port_changed_cb, (void *) this);
- config->register_string(config, "media.audio_cd.cddb_cachedir",
- (_cdda_cddb_get_default_location()),
+ config->register_filename(config, "media.audio_cd.cddb_cachedir",
+ (_cdda_cddb_get_default_location()), XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
_("CDDB cache directory"), _("The replies from the CDDB server will be "
"cached in this directory.\nThis setting is security critical, because files "
"with uncontrollable names will be created in this directory. Be sure to use "
diff --git a/src/input/input_dvd.c b/src/input/input_dvd.c
index 26eb67e24..ddc3fe964 100644
--- a/src/input/input_dvd.c
+++ b/src/input/input_dvd.c
@@ -18,7 +18,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_dvd.c,v 1.211 2006/10/29 19:39:39 hadess Exp $
+ * $Id: input_dvd.c,v 1.212 2006/12/19 19:10:51 dsalt Exp $
*
*/
@@ -1779,9 +1779,9 @@ static void *init_class (xine_t *xine, void *data) {
this->ip = NULL;
- this->dvd_device = config->register_string(config,
+ this->dvd_device = config->register_filename(config,
"media.dvd.device",
- DVD_PATH,
+ DVD_PATH, XINE_CONFIG_STRING_IS_DEVICE_NAME,
_("device used for DVD playback"),
_("The path to the device, usually a "
"DVD drive, which you intend to use for playing DVDs."),
@@ -1799,8 +1799,9 @@ static void *init_class (xine_t *xine, void *data) {
char *css_cache_default, *css_cache;
int mode;
- raw_device = config->register_string(config, "media.dvd.raw_device",
- RDVD_PATH, _("raw device set up for DVD access"),
+ raw_device = config->register_filename(config, "media.dvd.raw_device",
+ RDVD_PATH, XINE_CONFIG_STRING_IS_DEVICE_NAME,
+ _("raw device set up for DVD access"),
_("If this points to a raw device connected to your "
"DVD device, xine will use the raw device for playback. "
"This has the advantage of being slightly faster and "
@@ -1822,7 +1823,7 @@ static void *init_class (xine_t *xine, void *data) {
css_cache_default = (char *)malloc(strlen(xine_get_homedir()) + 10);
sprintf(css_cache_default, "%s/.dvdcss/", xine_get_homedir());
- css_cache = config->register_string(config, "media.dvd.css_cache_path", css_cache_default,
+ css_cache = config->register_filename(config, "media.dvd.css_cache_path", css_cache_default, XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
_("path to the title key cache"),
_("Since cracking the copy protection of scrambled DVDs can "
"be quite time consuming, libdvdcss will cache the cracked "
diff --git a/src/input/input_file.c b/src/input/input_file.c
index 93d208c4e..db7937956 100644
--- a/src/input/input_file.c
+++ b/src/input/input_file.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_file.c,v 1.117 2006/10/01 20:14:43 dgp85 Exp $
+ * $Id: input_file.c,v 1.118 2006/12/19 19:10:51 dsalt Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -1027,8 +1027,8 @@ static void *init_plugin (xine_t *xine, void *data) {
if(getcwd(current_dir, sizeof(current_dir)) == NULL)
strcpy(current_dir, ".");
- this->origin_path = config->register_string(config, "media.files.origin_path",
- current_dir,
+ this->origin_path = config->register_filename(config, "media.files.origin_path",
+ current_dir, XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
_("file browsing start location"),
_("The browser to select the file to play will "
"start at this location."),
diff --git a/src/input/input_pvr.c b/src/input/input_pvr.c
index 1461d0f9e..f47bfe890 100644
--- a/src/input/input_pvr.c
+++ b/src/input/input_pvr.c
@@ -38,7 +38,7 @@
* usage:
* xine pvr:/<prefix_to_tmp_files>\!<prefix_to_saved_files>\!<max_page_age>
*
- * $Id: input_pvr.c,v 1.62 2006/07/10 22:08:15 dgp85 Exp $
+ * $Id: input_pvr.c,v 1.63 2006/12/19 19:10:51 dsalt Exp $
*/
/**************************************************************************
@@ -1548,9 +1548,9 @@ static void *init_plugin (xine_t *xine, void *data) {
this->xine = xine;
this->config = xine->config;
- this->devname = this->config->register_string(this->config,
+ this->devname = this->config->register_filename(this->config,
"media.wintv_pvr.device",
- PVR_DEVICE,
+ PVR_DEVICE, XINE_CONFIG_STRING_IS_DEVICE_NAME,
_("device used for WinTV-PVR 250/350 (pvr plugin)"),
_("The path to the device of your WinTV card."),
10, NULL,
diff --git a/src/input/input_v4l.c b/src/input/input_v4l.c
index 1dfde167f..8143c6b13 100644
--- a/src/input/input_v4l.c
+++ b/src/input/input_v4l.c
@@ -1907,8 +1907,8 @@ static void *init_video_class (xine_t *xine, void *data)
this->input_class.dispose = v4l_class_dispose;
this->input_class.eject_media = NULL;
- config->register_string (config, "media.video4linux.video_device",
- VIDEO_DEV,
+ config->register_filename (config, "media.video4linux.video_device",
+ VIDEO_DEV, XINE_CONFIG_STRING_IS_DEVICE_NAME,
_("v4l video device"),
_("The path to your Video4Linux video device."),
10, NULL, NULL);
@@ -1933,8 +1933,8 @@ static void *init_radio_class (xine_t *xine, void *data)
this->input_class.dispose = v4l_class_dispose;
this->input_class.eject_media = NULL;
- config->register_string (config, "media.video4linux.radio_device",
- RADIO_DEV,
+ config->register_filename (config, "media.video4linux.radio_device",
+ RADIO_DEV, XINE_CONFIG_STRING_IS_DEVICE_NAME,
_("v4l radio device"),
_("The path to your Video4Linux radio device."),
10, NULL, NULL);
diff --git a/src/input/input_vcd.c b/src/input/input_vcd.c
index 0103027bf..ab0715e96 100644
--- a/src/input/input_vcd.c
+++ b/src/input/input_vcd.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: input_vcd.c,v 1.85 2006/07/10 22:08:16 dgp85 Exp $
+ * $Id: input_vcd.c,v 1.86 2006/12/19 19:10:51 dsalt Exp $
*
*/
@@ -1094,7 +1094,7 @@ static void *init_class (xine_t *xine, void *data) {
this->input_class.dispose = vcd_class_dispose;
this->input_class.eject_media = vcd_class_eject_media;
- this->device = config->register_string (config, "media.vcd.device", CDROM,
+ this->device = config->register_filename (config, "media.vcd.device", CDROM, XINE_CONFIG_STRING_IS_DEVICE_NAME,
_("device used for VCD playback"),
_("The path to the device, usually a CD or DVD drive, "
"you intend to play your VideoCDs with."),
diff --git a/src/input/vcd/xineplug_inp_vcd.c b/src/input/vcd/xineplug_inp_vcd.c
index c5cd7c031..87b442acd 100644
--- a/src/input/vcd/xineplug_inp_vcd.c
+++ b/src/input/vcd/xineplug_inp_vcd.c
@@ -1,5 +1,5 @@
/*
- $Id: xineplug_inp_vcd.c,v 1.51 2006/12/13 19:21:10 dsalt Exp $
+ $Id: xineplug_inp_vcd.c,v 1.52 2006/12/19 19:10:51 dsalt Exp $
Copyright (C) 2002, 2003, 2004, 2005 Rocky Bernstein <rocky@panix.com>
@@ -1829,9 +1829,9 @@ _("The VCD play unit to use when none is specified in an MRL, e.g. "
class->vcd_device =
- strdup (config->register_string(config,
+ strdup (config->register_filename(config,
"media.vcd.device",
- "",
+ "", XINE_CONFIG_STRING_IS_DEVICE_NAME,
_("CD-ROM drive used for VCD when none given"),
_("What to use if no drive specified. If the setting is empty, xine will scan for CD drives."),
20,
diff --git a/src/libreal/audio_decoder.c b/src/libreal/audio_decoder.c
index d5b2b2d26..105c91fe3 100644
--- a/src/libreal/audio_decoder.c
+++ b/src/libreal/audio_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: audio_decoder.c,v 1.49 2006/07/10 22:08:30 dgp85 Exp $
+ * $Id: audio_decoder.c,v 1.50 2006/12/19 19:10:51 dsalt Exp $
*
* thin layer to use real binary-only codecs in xine
*
@@ -740,8 +740,9 @@ static void *init_class (xine_t *xine, void *data) {
if (!stat ("/usr/lib/win32/drv3.so.6.0", &s))
default_real_codec_path = "/usr/lib/win32";
- real_codec_path = config->register_string (config, "decoder.external.real_codecs_path",
+ real_codec_path = config->register_filename (config, "decoder.external.real_codecs_path",
default_real_codec_path,
+ XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
_("path to RealPlayer codecs"),
_("If you have RealPlayer installed, specify the path "
"to its codec directory here. You can easily find "
diff --git a/src/libreal/xine_decoder.c b/src/libreal/xine_decoder.c
index 0ed7f12d8..d1f5ce1c0 100644
--- a/src/libreal/xine_decoder.c
+++ b/src/libreal/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.83 2006/07/10 22:08:30 dgp85 Exp $
+ * $Id: xine_decoder.c,v 1.84 2006/12/19 19:10:51 dsalt Exp $
*
* thin layer to use real binary-only codecs in xine
*
@@ -633,8 +633,9 @@ static void *init_class (xine_t *xine, void *data) {
if (!stat ("/usr/lib/win32/drv3.so.6.0", &s))
default_real_codec_path = "/usr/lib/win32";
- real_codec_path = config->register_string (config, "decoder.external.real_codecs_path",
+ real_codec_path = config->register_filename (config, "decoder.external.real_codecs_path",
default_real_codec_path,
+ XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
_("path to RealPlayer codecs"),
_("If you have RealPlayer installed, specify the path "
"to its codec directory here. You can easily find "
diff --git a/src/libsputext/xine_decoder.c b/src/libsputext/xine_decoder.c
index 851a9af93..8c976671f 100644
--- a/src/libsputext/xine_decoder.c
+++ b/src/libsputext/xine_decoder.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_decoder.c,v 1.96 2006/09/26 02:36:55 dgp85 Exp $
+ * $Id: xine_decoder.c,v 1.97 2006/12/19 19:10:51 dsalt Exp $
*
*/
@@ -64,6 +64,10 @@ typedef struct sputext_class_s {
subtitle_size subtitle_size; /* size of subtitles */
int vertical_offset;
char font[FONTNAME_SIZE]; /* subtitle font */
+#ifdef HAVE_FT2
+ char font_ft[FILENAME_MAX]; /* subtitle font */
+ int use_font_ft; /* use Freetype */
+#endif
char *src_encoding; /* encoding of subtitle file */
int use_unscaled; /* use unscaled OSD if possible */
@@ -87,7 +91,7 @@ typedef struct sputext_decoder_s {
*/
subtitle_size subtitle_size; /* size of subtitles */
int vertical_offset;
- char font[FONTNAME_SIZE]; /* subtitle font */
+ char font[FILENAME_MAX]; /* subtitle font */
char *buf_encoding; /* encoding of subtitle buffer */
int width; /* frame width */
@@ -107,6 +111,14 @@ typedef struct sputext_decoder_s {
int last_lines; /* number of lines of the previous subtitle */
} sputext_decoder_t;
+static inline char *get_font (sputext_class_t *class)
+{
+#ifdef HAVE_FT2
+ return class->use_font_ft ? class->font_ft : class->font;
+#else
+ return class->font;
+#endif
+}
static void update_font_size (sputext_decoder_t *this, int force_update) {
static int sizes[SUBTITLE_SIZE_NUM] = { 16, 20, 24, 32, 48, 64 };
@@ -138,7 +150,7 @@ static void update_font_size (sputext_decoder_t *this, int force_update) {
this->width,
SUB_MAX_TEXT * this->line_height);
- this->renderer->set_font (this->osd, this->class->font, this->font_size);
+ this->renderer->set_font (this->osd, get_font (this->class), this->font_size);
this->renderer->set_position (this->osd, 0, y);
}
}
@@ -338,6 +350,7 @@ static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t su
int line, y;
int font_size;
+ char *font;
_x_assert(this->renderer != NULL);
if ( ! this->renderer )
@@ -345,10 +358,11 @@ static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t su
update_font_size(this, 0);
- if( strcmp(this->font, this->class->font) ) {
- strncpy(this->font, this->class->font, FONTNAME_SIZE);
- this->font[FONTNAME_SIZE - 1] = '\0';
- this->renderer->set_font (this->osd, this->class->font, this->font_size);
+ font = get_font (this->class);
+ if( strcmp(this->font, font) ) {
+ strncpy(this->font, font, FILENAME_MAX);
+ this->font[FILENAME_MAX - 1] = '\0';
+ this->renderer->set_font (this->osd, font, this->font_size);
}
font_size = this->font_size;
@@ -546,7 +560,7 @@ static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t su
if( w > this->width && font_size > 16 ) {
font_size -= 4;
- this->renderer->set_font (this->osd, this->class->font, font_size);
+ this->renderer->set_font (this->osd, get_font (this->class), font_size);
} else {
break;
}
@@ -561,7 +575,7 @@ static void draw_subtitle(sputext_decoder_t *this, int64_t sub_start, int64_t su
}
if( font_size != this->font_size )
- this->renderer->set_font (this->osd, this->class->font, this->font_size);
+ this->renderer->set_font (this->osd, get_font (this->class), this->font_size);
if( this->last_subtitle_end && sub_start < this->last_subtitle_end ) {
sub_start = this->last_subtitle_end;
@@ -824,6 +838,27 @@ static void update_osd_font(void *class_gen, xine_cfg_entry_t *entry)
xprintf(class->xine, XINE_VERBOSITY_DEBUG, "libsputext: spu_font = %s\n", class->font );
}
+#ifdef HAVE_FT2
+static void update_osd_font_ft(void *class_gen, xine_cfg_entry_t *entry)
+{
+ sputext_class_t *class = (sputext_class_t *)class_gen;
+
+ strncpy(class->font_ft, entry->str_value, FILENAME_MAX);
+ class->font_ft[FILENAME_MAX - 1] = '\0';
+
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, "libsputext: spu_font_ft = %s\n", class->font_ft);
+}
+
+static void update_osd_use_font_ft(void *class_gen, xine_cfg_entry_t *entry)
+{
+ sputext_class_t *class = (sputext_class_t *)class_gen;
+
+ class->use_font_ft = entry->num_value;
+
+ xprintf(class->xine, XINE_VERBOSITY_DEBUG, "libsputext: spu_use_font_ft = %d\n", class->use_font_ft);
+}
+#endif
+
static void update_subtitle_size(void *class_gen, xine_cfg_entry_t *entry)
{
sputext_class_t *class = (sputext_class_t *)class_gen;
@@ -929,6 +964,21 @@ static void *init_spu_decoder_plugin (xine_t *xine, void *data) {
"subtitle text."),
10, update_osd_font, this), FONTNAME_SIZE);
this->font[FONTNAME_SIZE - 1] = '\0';
+#ifdef HAVE_FT2
+ strncpy(this->font_ft, xine->config->register_filename(xine->config,
+ "subtitles.separate.font_freetype",
+ "", XINE_CONFIG_STRING_IS_FILENAME,
+ _("font for subtitles"),
+ _("An outline font file (e.g. a .ttf) to be used for the subtitle text."),
+ 10, update_osd_font_ft, this), FILENAME_MAX);
+ this->font_ft[FILENAME_MAX - 1] = '\0';
+ this->use_font_ft = xine->config->register_bool(xine->config,
+ "subtitles.separate.font_use_freetype",
+ 0,
+ _("whether to use a freetype font"),
+ NULL,
+ 10, update_osd_use_font_ft, this);
+#endif
this->src_encoding = xine->config->register_string(xine->config,
"subtitles.separate.src_encoding",
xine_guess_spu_encoding(),
diff --git a/src/libw32dll/common.c b/src/libw32dll/common.c
index 1f42288c2..35fe41941 100644
--- a/src/libw32dll/common.c
+++ b/src/libw32dll/common.c
@@ -13,7 +13,7 @@ static char *get_win32_codecs_path(config_values_t *cfg) {
NULL };
int i = 0;
- cfgpath = cfg->register_string (cfg, "decoder.external.win32_codecs_path", WIN32_PATH,
+ cfgpath = cfg->register_filename (cfg, "decoder.external.win32_codecs_path", WIN32_PATH, XINE_CONFIG_STRING_IS_DIRECTORY_NAME,
_("path to Win32 codecs"),
_("If you have the Windows or Apple Quicktime codec packs "
"installed, specify the path the codec directory here. "
diff --git a/src/video_out/video_out_fb.c b/src/video_out/video_out_fb.c
index 808092a03..e88def112 100644
--- a/src/video_out/video_out_fb.c
+++ b/src/video_out/video_out_fb.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_fb.c,v 1.48 2006/07/10 22:08:44 dgp85 Exp $
+ * $Id: video_out_fb.c,v 1.49 2006/12/19 19:10:51 dsalt Exp $
*
* video_out_fb.c, frame buffer xine driver by Miguel Freitas
*
@@ -848,7 +848,7 @@ static int open_fb_device(config_values_t *config, xine_t *xine)
/* This config entry is security critical, is it really necessary
* or is a number enough? */
- device_name = config->register_string(config, devkey, "",
+ device_name = config->register_filename(config, devkey, "", XINE_CONFIG_STRING_IS_DEVICE_NAME,
_("framebuffer device name"),
_("Specifies the file name for the framebuffer device "
"to be used.\nThis setting is security critical, "
diff --git a/src/video_out/video_out_syncfb.c b/src/video_out/video_out_syncfb.c
index 9760105c2..f03d0ea97 100644
--- a/src/video_out/video_out_syncfb.c
+++ b/src/video_out/video_out_syncfb.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_syncfb.c,v 1.107 2006/09/02 01:10:46 dgp85 Exp $
+ * $Id: video_out_syncfb.c,v 1.108 2006/12/19 19:10:51 dsalt Exp $
*
* video_out_syncfb.c, SyncFB (for Matrox G200/G400 cards) interface for xine
*
@@ -1073,7 +1073,8 @@ static void *init_class (xine_t *xine, void *visual_gen) {
char* device_name;
int fd;
- device_name = xine->config->register_string(xine->config, "video.device.syncfb_device", "/dev/syncfb",
+ device_name = xine->config->register_filename(xine->config, "video.device.syncfb_device", "/dev/syncfb",
+ XINE_CONFIG_STRING_IS_DEVICE_NAME,
_("SyncFB device name"),
_("Specifies the file name for the SyncFB (TeleTux) device "
"to be used.\nThis setting is security critical, "
diff --git a/src/video_out/video_out_vidix.c b/src/video_out/video_out_vidix.c
index 188b5271a..b90a162ca 100644
--- a/src/video_out/video_out_vidix.c
+++ b/src/video_out/video_out_vidix.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: video_out_vidix.c,v 1.74 2006/07/10 22:08:44 dgp85 Exp $
+ * $Id: video_out_vidix.c,v 1.75 2006/12/19 19:10:51 dsalt Exp $
*
* video_out_vidix.c
*
@@ -1235,7 +1235,7 @@ static vo_driver_t *vidixfb_open_plugin (video_driver_class_t *class_gen, const
this->visual_type = XINE_VISUAL_TYPE_FB;
/* Register config option for fb device */
- device = config->register_string(config, "video.device.vidixfb_device", "/dev/fb0",
+ device = config->register_filename(config, "video.device.vidixfb_device", "/dev/fb0", XINE_CONFIG_STRING_IS_DEVICE_NAME,
_("framebuffer device name"),
_("Specifies the file name for the framebuffer device to be used.\n"
"This setting is security critical, because when changed to a different file, xine "
diff --git a/src/xine-engine/configfile.c b/src/xine-engine/configfile.c
index 21ebfd5be..5d552f8f1 100644
--- a/src/xine-engine/configfile.c
+++ b/src/xine-engine/configfile.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: configfile.c,v 1.81 2006/09/26 21:51:11 dgp85 Exp $
+ * $Id: configfile.c,v 1.82 2006/12/19 19:10:52 dsalt Exp $
*
* config object (was: file) management - implementation
*
@@ -491,14 +491,15 @@ static cfg_entry_t *config_register_key (config_values_t *this,
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 @@ static char *config_register_string (config_values_t *this,
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 @@ static char *config_register_string (config_values_t *this,
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 @@ config_values_t *_x_config_init (void) {
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;
diff --git a/src/xine-engine/configfile.h b/src/xine-engine/configfile.h
index 2a98be9f1..29413610c 100644
--- a/src/xine-engine/configfile.h
+++ b/src/xine-engine/configfile.h
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: configfile.h,v 1.38 2006/09/26 05:19:48 dgp85 Exp $
+ * $Id: configfile.h,v 1.39 2006/12/19 19:10:52 dsalt Exp $
*
* config file management
*
@@ -108,6 +108,16 @@ struct config_values_s {
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,
diff --git a/src/xine-engine/xine.c b/src/xine-engine/xine.c
index 07d9455e1..63afc86d3 100644
--- a/src/xine-engine/xine.c
+++ b/src/xine-engine/xine.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine.c,v 1.338 2006/12/19 14:10:35 klan Exp $
+ * $Id: xine.c,v 1.339 2006/12/19 19:10:52 dsalt Exp $
*/
/*
@@ -1579,9 +1579,9 @@ void xine_init (xine_t *this) {
/*
* 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 "
diff --git a/src/xine-engine/xine_interface.c b/src/xine-engine/xine_interface.c
index d0dc0e4a5..7e7527de7 100644
--- a/src/xine-engine/xine_interface.c
+++ b/src/xine-engine/xine_interface.c
@@ -17,7 +17,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
*
- * $Id: xine_interface.c,v 1.99 2006/10/16 06:29:38 dgp85 Exp $
+ * $Id: xine_interface.c,v 1.100 2006/12/19 19:10:52 dsalt Exp $
*
* convenience/abstraction layer, functions to implement
* libxine's public interface
@@ -100,7 +100,23 @@ const char* xine_config_register_string (xine_t *self,
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,