diff --git a/src/core.c b/src/core.c index 3adebdef..c46e196d 100644 --- a/src/core.c +++ b/src/core.c @@ -1243,7 +1243,7 @@ struct text_object *construct_text_object(const char *s, const char *arg, long obj->callbacks.print = &print_mpd_status; obj->callbacks.free = &free_mpd; END OBJ(mpd_bar, &update_mpd) - scan_bar(obj, arg, 255); + scan_bar(obj, arg, 1); init_mpd(); obj->callbacks.barval = &mpd_barval; obj->callbacks.free = &free_mpd; diff --git a/src/mpd.c b/src/mpd.c index 81802cd4..5a38a53e 100644 --- a/src/mpd.c +++ b/src/mpd.c @@ -378,10 +378,10 @@ uint8_t mpd_percentage(struct text_object *obj) return round_to_int(mpd_info.progress * 100.0f); } -uint8_t mpd_barval(struct text_object *obj) +double mpd_barval(struct text_object *obj) { (void)obj; - return round_to_int(mpd_info.progress * 255.0f); + return mpd_info.progress; } void print_mpd_smart(struct text_object *obj, char *p, int p_max_size) diff --git a/src/mpd.h b/src/mpd.h index e5f17b2c..790dfffd 100644 --- a/src/mpd.h +++ b/src/mpd.h @@ -17,7 +17,7 @@ void update_mpd(void); void print_mpd_elapsed(struct text_object *, char *, int); void print_mpd_length(struct text_object *, char *, int); uint8_t mpd_percentage(struct text_object *); -uint8_t mpd_barval(struct text_object *); +double mpd_barval(struct text_object *); void print_mpd_smart(struct text_object *, char *, int); void print_mpd_title(struct text_object *, char *, int); void print_mpd_artist(struct text_object *, char *, int);