From e2e7c47c486b8678dcb0bb5b48705cc145c8322d Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Fri, 4 Dec 2009 01:31:21 +0100 Subject: [PATCH] convert xmms2_barval to double --- src/core.c | 2 +- src/xmms2.c | 4 ++-- src/xmms2.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/core.c b/src/core.c index c46e196d..ea68b901 100644 --- a/src/core.c +++ b/src/core.c @@ -1340,7 +1340,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long obj->callbacks.print = &print_xmms2_percent; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_bar, &update_xmms2) - scan_bar(obj, arg, 255); + scan_bar(obj, arg, 1); obj->callbacks.barval = &xmms2_barval; obj->callbacks.free = &free_xmms2; END OBJ(xmms2_smart, &update_xmms2) diff --git a/src/xmms2.c b/src/xmms2.c index 6066023d..d6059a8d 100644 --- a/src/xmms2.c +++ b/src/xmms2.c @@ -359,11 +359,11 @@ void print_xmms2_duration(struct text_object *obj, char *p, int p_max_size) (info.xmms2.duration / 1000) % 60); } -uint8_t xmms2_barval(struct text_object *obj) +double xmms2_barval(struct text_object *obj) { (void)obj; - return round_to_int(info.xmms2.progress * 255.0f); + return info.xmms2.progress; } void print_xmms2_smart(struct text_object *obj, char *p, int p_max_size) diff --git a/src/xmms2.h b/src/xmms2.h index d191ced7..3b81e6bb 100644 --- a/src/xmms2.h +++ b/src/xmms2.h @@ -58,7 +58,7 @@ void update_xmms2(void); void print_xmms2_tracknr(struct text_object *, char *, int); void print_xmms2_elapsed(struct text_object *, char *, int); void print_xmms2_duration(struct text_object *, char *, int); -uint8_t xmms2_barval(struct text_object *); +double xmms2_barval(struct text_object *); void print_xmms2_smart(struct text_object *, char *, int); void print_xmms2_artist(struct text_object *, char *, int); void print_xmms2_album(struct text_object *, char *, int);