aboutsummaryrefslogtreecommitdiffstats
path: root/src/conf.c
diff options
context:
space:
mode:
authorKalle Wallin <kaw@linux.se>2006-01-16 10:01:35 +0000
committerKalle Wallin <kaw@linux.se>2006-01-16 10:01:35 +0000
commit1603384f1bf298466183a2bfec343293b5b9ead9 (patch)
tree09eb4628fee2e065e8a75720d14a9cb62a0ac89e /src/conf.c
parent0e1ba218ea357c2ecf9119b8a19017531536229c (diff)
downloadmpd-1603384f1bf298466183a2bfec343293b5b9ead9.tar.gz
mpd-1603384f1bf298466183a2bfec343293b5b9ead9.tar.xz
mpd-1603384f1bf298466183a2bfec343293b5b9ead9.zip
included patch from Jonathan Fors
git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3832 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/conf.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/conf.c b/src/conf.c
index 4b5e49230..f2c21ea05 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -64,6 +64,7 @@
#define CONF_HIDE_CURSOR "hide-cursor"
#define CONF_SEEK_TIME "seek-time"
#define CONF_SCREEN_LIST "screen-list"
+#define CONF_TIMEDISPLAY_TYPE "timedisplay-type"
typedef enum {
KEY_PARSER_UNKNOWN,
@@ -217,6 +218,17 @@ parse_key_definition(char *str)
return assign_keys(cmd, keys);
}
+static char *
+parse_timedisplay_type(char *str)
+{
+ if((!strcmp(str,"elapsed")) || (!strcmp(str,"remaining"))){
+ return str;
+ } else {
+ fprintf(stderr,_("Error: Bad time display type - %s\n"), str);
+ return DEFAULT_TIMEDISPLAY_TYPE;
+ }
+}
+
static int
parse_color(char *str)
{
@@ -243,7 +255,6 @@ parse_color(char *str)
return colors_assign(name, value);
}
-
static int
parse_color_definition(char *str)
{
@@ -460,6 +471,14 @@ read_rc_file(char *filename, options_t *options)
{
options->wide_cursor = str2bool(value);
}
+ /* timer display type */
+ else if( !strcasecmp(CONF_TIMEDISPLAY_TYPE, name) )
+ {
+ g_free(options->timedisplay_type);
+ options->timedisplay_type=g_strdup(parse_timedisplay_type(value));
+ D("deb");
+ D(options->timedisplay_type);
+ }
/* color definition */
else if( !strcasecmp(CONF_COLOR_DEFINITION, name) )
{