From 1603384f1bf298466183a2bfec343293b5b9ead9 Mon Sep 17 00:00:00 2001 From: Kalle Wallin Date: Mon, 16 Jan 2006 10:01:35 +0000 Subject: included patch from Jonathan Fors git-svn-id: https://svn.musicpd.org/ncmpc/trunk@3832 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/conf.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'src/conf.c') 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) ) { -- cgit v1.2.3